Re: [ns] Problem with MANET simulation
Hi all, I found on the Web some files to run a simulation on ns-2. The simulation represents a MANET with nodes broadcasting information. I attach the files. I followed the steps in the README (unfortunately it's in italian) and tryed to run the .tcl file with this result. [EMAIL PROTECTED]:~/Desktop/eserc$ ns script.tcl num_nodes is set 100 warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl INITIALIZE THE LIST xListHead Loading connection pattern... Starting Simulation... channel.cc:sendUp - Calc highestAntennaZ_ and distCST_ highestAntennaZ_ = 1.5, distCST_ = 550.0 SORTING LISTS ...DONE! Nodo 0: spedisco broadcast perch� ho 10 tokens *** stack smashing detected ***: ns terminated === Backtrace: = /lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb7c52138] /lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x0)[0xb7c520f0] ns(_ZN8CMUTrace10nam_formatEP6Packeti+0xcc4)[0x82a3df0] ns(_ZN8CMUTrace6formatEP6PacketPKc+0x6b)[0x82a4a67] ns(_ZN8CMUTrace4recvEP6PacketP7Handler+0x73)[0x82a4d3f] ns(_ZN5Agent4sendEP6PacketP7Handler+0x2c)[0x81b913a] ns(_ZN18BroadcastbaseAgent16sendbroadcastmsgEiP10BBCastData+0xe7)[0x837ba91] ns(_ZN16BroadcastbaseApp18send_broadcast_pktEv+0xb0)[0x837c1c2] ns(_ZN16BroadcastbaseApp5startEv+0x11)[0x837c23b] ns(_ZN11Application7commandEiPKPKc+0x110)[0x81ba97a] ns(_ZN16BroadcastbaseApp7commandEiPKPKc+0xbf)[0x837c2fd] ns(_ZN8TclClass12dispatch_cmdEPvP10Tcl_InterpiPPKc+0x32)[0x83cd3be] ns[0x83d212c] ns(TclInvokeStringCommand+0x6e)[0x83d8efe] ns(TclEvalObjvInternal+0x326)[0x83daa56] ns[0x8405191] ns(TclCompEvalObj+0x9c)[0x84099cc] ns[0x8405032] ns(TclCompEvalObj+0x9c)[0x84099cc] ns(TclObjInterpProc+0x2e8)[0x8432608] ns(TclProcInterpProc+0x82)[0x8432a62] ns[0x83d22b6] ns(TclInvokeStringCommand+0x6e)[0x83d8efe] ns(TclEvalObjvInternal+0x326)[0x83daa56] ns(Tcl_EvalEx+0x435)[0x83daff5] ns(Tcl_Eval+0x3c)[0x83db30c] ns(Tcl_GlobalEval+0x36)[0x83db3a6] ns(_ZN3Tcl4evalEPc+0x1b)[0x83cfec1] ns(_ZN9AtHandler6handleEP5Event+0x24)[0x81a8782] ns(_ZN9Scheduler8dispatchEP5Eventd+0x92)[0x81a8444] ns(_ZN9Scheduler3runEv+0x2c)[0x81a8696] ns(_ZN9Scheduler7commandEiPKPKc+0x6b)[0x81a8955] ns(_ZN8TclClass12dispatch_cmdEPvP10Tcl_InterpiPPKc+0x32)[0x83cd3be] ns[0x83d212c] ns(TclInvokeStringCommand+0x6e)[0x83d8efe] ns(TclEvalObjvInternal+0x326)[0x83daa56] ns[0x8405191] ns(TclCompEvalObj+0x9c)[0x84099cc] ns[0x8405032] ns(TclCompEvalObj+0x9c)[0x84099cc] ns(TclObjInterpProc+0x2e8)[0x8432608] ns(TclProcInterpProc+0x82)[0x8432a62] ns[0x83d22b6] ns(TclInvokeStringCommand+0x6e)[0x83d8efe] ns(TclEvalObjvInternal+0x326)[0x83daa56] ns[0x8405191] ns(TclCompEvalObj+0x9c)[0x84099cc] ns(TclObjInterpProc+0x2e8)[0x8432608] ns(TclProcInterpProc+0x82)[0x8432a62] ns[0x83d212c] ns(TclInvokeStringCommand+0x6e)[0x83d8efe] ns(TclEvalObjvInternal+0x326)[0x83daa56] ns(Tcl_EvalEx+0x435)[0x83daff5] ns(Tcl_FSEvalFile+0x21b)[0x8421eab] ns(Tcl_Main+0x337)[0x8425567] ns(nslibmain+0x20)[0x83cd0b6] ns(main+0x22)[0x83cd112] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0)[0xb7b7b450] ns(__gxx_personality_v0+0x335)[0x81a00b1] === Memory map: 08048000-08535000 r-xp 08:01 4759687 /home/maurizio/.ns/ns-allinone-2.33/ns-2.33/ns 08535000-085d1000 rw-p 004ec000 08:01 4759687 /home/maurizio/.ns/ns-allinone-2.33/ns-2.33/ns 085d1000-09a3d000 rw-p 085d1000 00:00 0 [heap] b7b01000-b7b4 r--p 08:01 1524604 /usr/lib/locale/en_US.utf8/LC_CTYPE b7b4-b7b42000 rw-p b7b4 00:00 0 b7b42000-b7b46000 r-xp 08:01 1500491/usr/lib/libXdmcp.so.6.0.0 b7b46000-b7b47000 rw-p 3000 08:01 1500491/usr/lib/libXdmcp.so.6.0.0 b7b47000-b7b5e000 r-xp 08:01 1501321/usr/lib/libxcb.so.1.0.0 b7b5e000-b7b5f000 rw-p 00016000 08:01 1501321/usr/lib/libxcb.so.1.0.0 b7b5f000-b7b6 r-xp 08:01 1501319 /usr/lib/libxcb-xlib.so.0.0.0 b7b6-b7b61000 rw-p 08:01 1501319 /usr/lib/libxcb-xlib.so.0.0.0 b7b61000-b7b63000 r-xp 08:01 1500480/usr/lib/libXau.so.6.0.0 b7b63000-b7b64000 rw-p 1000 08:01 1500480/usr/lib/libXau.so.6.0.0 b7b64000-b7b65000 rw-p b7b64000 00:00 0 b7b65000-b7cae000 r-xp 08:01 1492322/lib/tls/i686/cmov/ libc-2.7.so b7cae000-b7caf000 r--p 00149000 08:01 1492322/lib/tls/i686/cmov/ libc-2.7.so b7caf000-b7cb1000 rw-p 0014a000 08:01 1492322/lib/tls/i686/cmov/ libc-2.7.so b7cb1000-b7cb4000 rw-p b7cb1000 00:00 0 b7cb4000-b7cbe000 r-xp 08:01 1474624/lib/libgcc_s.so.1 b7cbe000-b7cbf000 rw-p a000 08:01 1474624/lib/libgcc_s.so.1 b7cbf000-b7da7000 r-xp 08:01 1501258 /usr/lib/libstdc++.so.6.0.9 b7da7000-b7daa000 r--p 000e8000 08:01 1501258 /usr/lib/libstdc++.so.6.0.9 b7daa000-b7dac000 rw-p 000eb000 08:01 1501258 /usr/lib/libstdc++.so.6.0.9 b7dac000-b7db2000 rw-p b7dac000 00:00 0 b7db2000-b7dd5000 r-xp 08:01 1492330/lib/tls/i686/cmov/ libm-2.7.so b7dd5000-b7dd7000 rw-p
[ns] Simulation error
Hi, does anyone know why i get this error simulating? ns: _o2021 sendData IP_BROADCAST: (_o2021 cmd line 1) invoked from within _o2021 cmd sendData IP_BROADCAST invoked from within catch $self cmd $args ret invoked from within if [catch $self cmd $args ret] { set cls [$self info class] global errorInfo set savedInfo $errorInfo error error when calling class $cls: $args $... (procedure _o2021 line 2) (SplitObject unknown line 2) invoked from within _o2021 sendData IP_BROADCAST Thank you Maurizio
[ns] How to test a new protocol? [nsrt-howto]
*Hola* *Javier, he mirado tu post sobre el articulo de Francisco. Quería usar tu file para simular el protocolo Protoname. Al final solucionaste el problema y, si es así, me puedes enviar el tcl. corregido? Gracias Maurizio *
[ns] Implementing a New Manet Unicast Routing Protocol in NS2
Hi, I have implemented the code and it works, but the problem is when i try to realize a real broadcast, I got an error * check_pktCTRL:Invalid MAC Control subtype* I simply add the code to rebroadcast the packet. I modified only one function. void Protoname::recv_protoname_pkt(Packet* p) { // processing of protoname packet struct hdr_cmn* ch= HDR_CMN(p); struct hdr_ip* ih = HDR_IP(p); struct hdr_protoname_pkt* ph = HDR_PROTONAME_PKT(p); // All routing messages are sent from and to port RT_PORT, so we check it assert(ih-sport() == RT_PORT); assert(ih-dport() == RT_PORT); //ph-pkt_src() = ra_addr(); //ph-pkt_len() = 7; //ph-pkt_seq_num() = seq_num_++; //ch-ptype() = PT_PROTONAME; ch-direction() = hdr_cmn::DOWN; //ch-size() = IP_HDR_LEN + ph-pkt_len(); //ch-error() = 0; //ch-next_hop() = IP_BROADCAST; //ch-addr_type() = NS_AF_INET; ih-saddr() = ra_addr(); ih-daddr() = IP_BROADCAST; ih-sport() = RT_PORT; ih-dport() = RT_PORT; ih-ttl() = ih-ttl()-1; // Pay attention to TTL Scheduler::instance().schedule(target_, p, JITTER); // Release resources Packet::free(p); } Probably the problem is that target_ is null, but i don't know. Plz help me Thanks Maurizio
[ns] Routing Table
Hi, I'm writing a piece of code to create a routing table with the use of std map. Does anyone know how I can implement lifetime?? I need to create a timer which, at the expiration, causes the removal of the entry in the table. Any suggestions? Thank you very much Maurizio
Re: [ns] Routing Table
Thank you Mubashir and Ahmad. If you are not very busy i would have another question. I'm trying to simulate an efficient flooding and i need the data about transmission power. I'll try to be clear. I have a MANET with all the nodes moving around and, supposing a constant signal strength, i want to know it to determine the distance between the node. If a packet reaches the destination with a low power i will suppose the node is farthest than another which packet arrives with a greater power. How can i take this data? Thank you very much Maurizio 2008/9/17 Mubashir Rehmani [EMAIL PROTECTED] Hi Mauriwio Bellemo Here is the example of simple timer *Declare this timer in the header fil***e** class MyTimer : public TimerHandler { public: MyTimer(AODV* ms) : TimerHandler() {ms_=ms;}; protected: virtual void expire(Event* e); AODV* ms_; }; MyTimer MS_*timer*_; *Declare in the .cc file * void MyTimer::expire(Event*) { ms_-MS_*timer*_.resched(10); //delay of 10 seconds couttime is : Scheduler::instance().clock()endl; //call any function which you want to schedule } Now what you have to do is simply in the expire function, just write the logic for purging the entries (removal of entries) from the table. For instance, you can look at AODV.cc file in which they have clearly defined the logic of purging the routes from the routing table. I hope it helps. Mubashir Husain Rehmani Regards 2008/9/17 Maurizio Bellemo [EMAIL PROTECTED] Hi, I'm writing a piece of code to create a routing table with the use of std map. Does anyone know how I can implement lifetime?? I need to create a timer which, at the expiration, causes the removal of the entry in the table. Any suggestions? Thank you very much Maurizio -- Mubashir Husain Rehmani Mobile : 00 33 (0)6 32 00 89 35
[ns] Problem with Scheduler
Hi all, I have a little problem with the Scheduler. I schedule some packets in my program Scheduler::instance().schedule(target_, p, (100/tcf_time)); but when i try to cancel some of them from the queue not to be sent Scheduler::instance().cancel(p); drop(p); It doesn't work. I read the trace and saw that, even if the node drops the packet, it send it anyway r 0.772681927 _1_ RTR --- 2 protoname 27 [0 2 800] --- [2:255 -1:255 32 0] D 0.772681927 _1_ RTR --- 2 protoname 27 [0 2 800] --- [2:255 -1:255 32 0] s 1.320665076 _1_ RTR --- 1 protoname 27 [0 0 0 0] --- [1:255 -1:255 32 0] Does anyone know why? How can i cancel a packet from the scheduler queue? Thks Maurizio
Re: [ns] Problem with Scheduler
Hi all, I have a little problem with the Scheduler. I schedule some packets in my program Scheduler::instance().schedule(target_, p, (100/tcf_time)); but when i try to cancel some of them from the queue not to be sent Scheduler::instance().cancel(p); drop(p); It doesn't work. I read the trace and saw that, even if the node drops the packet, it send it anyway r 0.772681927 _1_ RTR --- 2 protoname 27 [0 2 800] --- [2:255 -1:255 32 0] D 0.772681927 _1_ RTR --- 2 protoname 27 [0 2 800] --- [2:255 -1:255 32 0] s 1.320665076 _1_ RTR --- 1 protoname 27 [0 0 0 0] --- [1:255 -1:255 32 0] Does anyone know why? How can i cancel a packet from the scheduler queue? Thks Maurizio
[ns] Help with scheduler
Hi all, I have a little problem with the Scheduler. I schedule some packets in my program Scheduler::instance().schedule(target_, p, (100/tcf_time)); And then I registers all the scheduled packets with packet source and packet uid map nsaddr_t, scheduler_uid_t scedPackets; Then i wait to receive some packet and if happens i have to cancel the packet from the Scheduler pos = scedPackets.find(ph-pkt_src_); Event* e = Scheduler::instance().lookup(pos-second); if(e!=NULL) { Scheduler::instance().cancel(e); fprintf(stdout, Cancelling event \n, e-uid_); } It doesn't work. I read the trace and saw that, even if the node sends the packet, it send it anyway r 0.772681927 _1_ RTR --- 2 protoname 27 [0 2 800] --- [2:255 -1:255 32 0] D 0.772681927 _1_ RTR --- 2 protoname 27 [0 2 800] --- [2:255 -1:255 32 0] s 1.320665076 _1_ RTR --- 1 protoname 27 [0 0 0 0] --- [1:255 -1:255 32 0] Does anyone know why? How can i cancel a packet from the scheduler queue? Plz any suggestion could be useful... i am really stuck Thks Maurizio
[ns] ANSim movement generator
Hi, I'm trying to get some movement files from the ANSim Web site http://www.ansim.info/index.php?title=SceneGenerator. The problem is that I need different scenarios with the same characteristics. I thought as it was random generator it can generate every time a different random movement simulation. But it always generates the same file, it's not so random. How can i have different movement files with same input data? Thks Maurizio
[ns] Problem with xgraph
Hi guys, I have problems plotting in Xgraph. I have some files to be plotted and the values are high (but not too high, the x is almost 100 and the y is 4000). The problem is when i try to plot it, it doesn't work. The program says the drawing area is too small. I have tryied to change the y axis with xgraph -ly 0,4000 namefile and with xgraph -scale 0.2 namefile but no result.. Any suggestions??? Thks Maurizio
[ns] Problem with awk
Hi i am doing a script with awk, but i faces a few problem maybe you can help me... BEGIN { i = 0; p = 0; cont = 0; } { while(getline0) { if($1 == r) p+=1; } close(FILENAME); for(cont = 0; cont nnodes; cont++) { while((getlineFILENAME)0) { split($0,pkt); if(pkt[1] == r pkt[3] == _$cont_) { print nnodes,pkt[3],pkt[18],pkt[19],pkt[20]; if(pkt[18] in rcvdPackets) { if(rcvdPackets[pkt[19]] = pkt[20]) i+=1; else rcvdPackets[pkt[19]] = pkt[20]; } else rcvdPackets[pkt[19]] = pkt[20]; } } close(FILENAME); } } END { print nnodes i/nnodes 100*i/p p cont; } The script analyze a NS trace file. It opens the same trace as many times as the number of nodes in the simulation. The problem is with the second getline. I seems with the getline it copies all in $0 (that is the normal behavior), but also the variable cont, which should be a simple counter, contains the same data of $0. A little bit strange... Any suggestions?? Thks Maurizio
[ns] Accuracy between MobileNodes
Hi all, i have a question about 802.11 and ns-2 MobileNode. Which is the accuracy of the distance between two mobile nodes in 802.11?? Thks Maurizio
[ns] Accuracy in 802.11
Hi all, i have a question about 802.11 and ns-2 MobileNode. Which is the accuracy of the distance between two mobile nodes in 802.11?? That is, having three nodes in a mobile ad hoc networks (A, B, C) and be A the one from which the distance is calculated. Which is the minimum distance between B and C that let them be perceived at different distances from A point of view??? I'm sorry if my question is bad, any suggestion will be welcomed Thks Maurizio