[ns] Runtime Error: glibc detected, ns: realloc(): invalid next size:0x09150380

2010-09-02 Thread Lee

Hi all,
I have recently implemented a new protocol in NS2.
The new protocol is based on the OLSR routing protocol, which runs correctly
in NS2 before any modification.
The compilation was successful, but when I tried to run NS2, I got the
following error messages:

*** glibc detected *** ns: realloc(): invalid next size: 0x09150380 ***
=== Backtrace: =
/lib/libc.so.6[0x696efd]
/lib/libc.so.6(realloc+0x19d)[0x698ebd]
ns(TclpRealloc+0x24)[0x8496b64]
ns(Tcl_Realloc+0x2c)[0x8421fbc]
ns(Tcl_SetObjLength+0x7a)[0x8477f5a]
ns(TclpNativeJoinPath+0xa8)[0x844d828]
ns(Tcl_FSJoinPath+0x368)[0x845ffa8]
ns(Tcl_JoinPath+0x68)[0x844d5d8]
ns(TclpInitLibraryPath+0x5d7)[0x848b7a7]
ns[0x843eaf0]
ns(Tcl_FindExecutable+0x91)[0x843ec41]
ns(Tcl_Main+0x2b)[0x84663fb]
ns(nslibmain+0x20)[0x840f6d2]
ns(main+0x22)[0x840f72e]
/lib/libc.so.6(__libc_start_main+0xdc)[0x641e8c]
ns(__gxx_personality_v0+0x331)[0x81abb41]
=== Memory map: 
00497000-004a2000 r-xp  fd:00 1967695
/lib/libgcc_s-4.1.2-20080825.so.1
004a2000-004a3000 rwxp a000 fd:00 1967695
/lib/libgcc_s-4.1.2-20080825.so.1
005e9000-005ea000 r-xp 005e9000 00:00 0  [vdso]
0060e000-00628000 r-xp  fd:00 1967671/lib/ld-2.5.so
00628000-00629000 r-xp 00019000 fd:00 1967671/lib/ld-2.5.so
00629000-0062a000 rwxp 0001a000 fd:00 1967671/lib/ld-2.5.so
0062c000-0076a000 r-xp  fd:00 1967672/lib/libc-2.5.so
0076a000-0076c000 r-xp 0013e000 fd:00 1967672/lib/libc-2.5.so
0076c000-0076d000 rwxp 0014 fd:00 1967672/lib/libc-2.5.so
0076d000-0077 rwxp 0076d000 00:00 0
00772000-00797000 r-xp  fd:00 1967679/lib/libm-2.5.so
..
..
..
//
//
//
// I have googled the problem, it seems to be a matter of memory management.

However, I did not use the realloc() function when programming.
Except that I implemented some containers like vector, map, and map of maps,
map of vectors.

Could this caused by these containers? Like when one tries to allocate new
container, or delete elements from containers.

I am trying to find any possible logical bugs in my program, but this is
really urgent.
Any help will be appreciated.
Edward.


[ns] Problem sending a MAC layer broadcast

2010-09-02 Thread O S

hi,

I am trying to send a MAC broadcast message in response to having overheard
something. So I create and send a packet as follows (inside recvDATA before
address filtering):

   Packet* report_pkt =
Packet::alloc();

hdr_ip* iph_report =
hdr_ip::access(report_pkt);
hdr_cmn* ch_report =
hdr_cmn::access(report_pkt);
hdr_wd* wd_report =
hdr_wd::access(report_pkt);


ch_report-direction() =
hdr_cmn::DOWN;
ch_report-next_hop() =
IP_BROADCAST;
ch_report-addr_type() =
NS_AF_INET;
ch_report-ptype() = PT_MAC;
//method to set address
iph_report-saddr() =
Address::instance().create_ipaddr(NodeId,RT_PORT);
iph_report-daddr() =
IP_BROADCAST;
iph_report-sport() =
RT_PORT;
iph_report-dport() =
RT_PORT;
iph_report-ttl() =
IP_DEF_TTL;
hdr_mac *mh_report =
HDR_MAC(report_pkt);
wd_report-is_bad_ = 1;
wd_report-watchdog_id_ =
NodeId;
wd_report-watched_id_ =
sorc;
send(report_pkt,0);


Then I put the following check in recvDATA:

if(dst == MAC_BROADCAST) {
if(ch-direction()==hdr_cmn::UP)
  if ( wd-BadCheck()==1 )
printf(In broadcast I am
node %d and I heard a badness report for %d from ip src%d %d bad report %d
dst is %d \n, netif_-node()-nodeid(), wd-WatchedID(), ssriph-saddr(),
wd-WDID(), wd-BadCheck(), ssriph-daddr());
}

The problem is, only node 0 is receiving these messages. No other node
receives this message. Can anyone please give any suggestions, I have been
stuck here for a week now. Should I put this functionality somewhere  else
maybe?

thanks


[ns] Is it possible to set a specific response delay for a node?

2010-09-02 Thread Mobin Yazarlou

Dear NS users,
 I am new to Network Simulator and don't know much about it's
capabilities, so as the first question i wanted to ask if this
software can help me with my project or not.I have to simulate a
communication between 2 computers that use TCP as the communication
protocol.one of these computers is very fast in processing network
packets but the other one is so slow and can not keep up with the
first one, for example can not send ACK packets in response to packets
that it receives from the first computer in a time that the first
computer expects to receive an ACK for each of its corresponding
packet.
 Actually I want to set a specific delay for the second computer to
answer the first computer packets.

 Would I be able to simulate such a scenario in NS? if yes, which
version of NS is better to use?

 Thanks in advance,
 Mobin



[ns] calculate bandwidth!!!!!!!

2010-09-02 Thread Hosseini Nezhad

Dear all

I am new in Ns-2 and I have a little question.

I this page http://www.isi.edu/nsnam/ns/tutorial/index.html, are written:

 When you start the script now with 'ns example2.tcl', you will
notice that there is more traffic on the links from n0 to n2 and n1 to
n2 than the link from n2 to n3 can carry. A simple calculation
confirms this: We are sending 200 packets per second on each of the
first two links and the packet size is 500 bytes. This results in a
bandwidth of 0.8 megabits per second for the links from n0 to n2 and
from n1 to n2



How you calculate the 0.8 megabits??? why .08?
could you help me please??


-- 
Regards;
Hosseini Nazhad.



[ns] Little question about SIFS_Waiting state in 802.11Etx in ns2.34

2010-09-02 Thread vitacai shun

Hi, all

 I  encountered  a little question about SIFS_Waiting  state  in802.11
   DCF ,  while attemting to  learn   and extending  the
   802.11Ext implementation  for NS2.34.

   When a node(A) receives  a RTS frame,  it will  responds an CTS_1
   after aSIFStime if these no NAV,  which means  it is going to receive
   DATA . Is it possible that the node (A) transmit  another   frame
   during the SIFS?
   During  SIFS,   the Backoff,  channel state and NAC may all report
   OK to transmit. If another frame(F2) is transmit  by MAC after its
   SIFS, the PHY is  very likely still in Transmittin state for the first
   CTS_1,  which seems like  an  error for PHY.
   The reason I notice this question is,  that I am  desining an reliable
multicast_MAC extention for 802.11, which demands  the intended
   receivers to respends  CTS sequentially . So some receivers will wait
   longger time before transmitting  CTS,  and during this waiting time,
   any other transmission is not allowed logically. I use NAV to acheive
   this purpose, i.e. set NAV  =  wait_time.
   Any help will be appriciated.

   Regards,

   -Kara-



[ns] Average Path Length code for AODV and node used from source to destination

2010-09-02 Thread saaidal

Hi,

If anyone has a code on how to calculate the average path length for
AODV protocl, will be greatful if you can provide it here.

My second question is how to know what hops the route taken from
source to destination...

Tq in advance