[ns] graph in ns2
Hello everybody, I found that u need to install tracegraph if u want to plot graphs in ns2. But www.tracegraph.com is not working..can somebody forward me tracegraph installation files and procedure to install it?? Hoping for a quick reply Thanking you, parul
[ns] 802.11b rates in 802_11Ext model
Hi I try to run simple test with two nodes using 802.11Ext. I set parameters according to 802.11b specification. When I run at 1Mbps everything is ok. But I don't know how to set another rates: 2Mbps, 5.5Mbps and 11Mbps. How should I specify following parameters Mac/802_11Ext basicRate_ Mac/802_11Ext dataRate_ Phy/WirelessPhyExt BasicModulationScheme_ Phy/WirelessPhy bandwidth_ to obtain 802.11b network with for example 5.5Mbps rate? Thanks in advance. -- View this message in context: http://old.nabble.com/802.11b-rates-in-802_11Ext-model-tp28215251p28215251.html Sent from the ns-users mailing list archive at Nabble.com.
[ns] wireless tcl script true but the trace file hasn't the same format as for wireless script
I am trying to construt a wireless tcl script that generates voice traffic "voip", i use this tcl script but the trace file hasn't the same contents as the trace file for "simple-wireless.tcl". I explain more: I use this tcl script -tcl script-- set ns [new Simulator] # choix des couleurs: $ns color 0 blue $ns color 1 red $ns color 2 green $ns color 3 red $ns color 4 orange $ns color 5 blue $ns color 6 green $ns color 7 black $ns color 8 orange $ns color 9 blue # les dix noeuds: set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] set n4 [$ns node] set n5 [$ns node] set n6 [$ns node] set n7 [$ns node] set n8 [$ns node] set n9 [$ns node] # création des outputs trace et nam: set f [open emna.tr w] $ns trace-all $f set nf [open emna.nam w] $ns namtrace-all $nf # == # Define options # == set val(chan) Channel/WirelessChannel ;# channel type set val(prop) Propagation/TwoRayGround ;# radio-propagation model set val(netif) Phy/WirelessPhy ;# network interface type set val(mac) Mac/802_11 ;# MAC type set val(ifq) Queue/DropTail/PriQueue ;# interface queue type set val(ll) LL ;# link layer type set val(ant) Antenna/OmniAntenna ;# antenna model set val(rp) DumbAgent ;# routing protocol set val(start) 0.0 set val(ifqlen) 50 ;# max packet in ifq set val(nn) 10 set val(tr) "trace" set val(X) 500 set val(Y) 500 set val(CWmin) 16 set val(CWmax) 1024 set val(SlotTime) 0.09 set val(SIFS) 0.16 set val(basicRate) 2Mb set val(dataRate) 54Mb # # Codec: G.711 # #set val(ON) 1500ms #set val(OFF) 1500ms #set val(AppRate) 96Kb set val(pktsize) 160 set val(pktinterval) 0.020 set val(run) 50.0 # # MAC MIB # Mac/802_11 set basicRate $val(basicRate)Mb Mac/802_11 set dataRate $val(dataRate)Mb Mac/802_11 set CWMin $val(CWmin) Mac/802_11 set CWMax $val(CWmax) Mac/802_11 set SlotTime $val(SlotTime) Mac/802_11 set SIFS $val(SIFS) # set up topography object set topo [new Topography] #$topo load_flatgrid $val(X) $val(Y) # Create God create-god $val(nn) # configure node $ns node-config -adhocRouting $val(rp) \ -llType $val(ll) \ -macType $val(mac) \ -ifqType $val(ifq) \ -ifqLen $val(ifqlen) \ -antType $val(ant) \ -propType $val(prop) \ -phyType $val(netif) \ -channelType $val(chan) \ -topoInstance $topo \ -agentTrace ON \ -routerTrace OFF \ -macTrace OFF \ -movementTrace OFF for {set i 0} {$i < $val(nn) } {incr i} { set node_($i) [$ns node] $node_($i) random-motion 0 ;# disable random motion } # connection des noeuds entre eux: # $ns simple-link (duplex-link) $n0 $n1 $ns duplex-link $n0 $n1 2Mb 2ms DropTail $ns duplex-link $n0 $n2 2Mb 2ms DropTail $ns duplex-link $n0 $n3 2Mb 2ms DropTail $ns duplex-link $n0 $n4 2Mb 2ms DropTail $ns duplex-link $n0 $n5 2Mb 2ms DropTail $ns duplex-link $n0 $n6 2Mb 2ms DropTail $ns duplex-link $n0 $n7 2Mb 2ms DropTail $ns duplex-link $n0 $n8 2Mb 2ms DropTail $ns duplex-link $n0 $n9 2Mb 2ms DropTail # la création de l'"agent" / set ... [new Agent/type] set rtp0 [new Agent/RTP] # communication agent-network ($ns attach-agent $node $agent) $ns attach-agent $n0 $rtp0 # la création de l'application / set ... [new Application/type] set cbr0 [new Application/Traffic/CBR] $cbr0 attach-agent $rtp0 set rtp1 [new Agent/RTP] $ns attach-agent $n1 $rtp1 $rtp1 set class_ 1 set cbr1 [new Application/Traffic/CBR] $cbr1 attach-agent $rtp1 set rtp2 [new Agent/RTP] $ns attach-agent $n2 $rtp2 $rtp1 set class_ 2 set cbr2 [new Application/Traffic/CBR] $cbr2 attach-agent $rtp2 set rtp3 [new Agent/RTP] $ns attach-agent $n3 $rtp3 $rtp3 set class_ 3 set cbr3 [new Application/Traffic/CBR] $cbr3 attach-agent $rtp3 set rtp4 [new Agent/RTP] $ns attach-agent $n4 $rtp4 $rtp4 set class_ 4 set cbr4 [new Application/Traffic/CBR] $cbr4 atta
[ns] ns2 installation problem....
hello... i want to install ns2.1b9 or ns2.1b8a. pls help me. which os will support these versions i tried ns2.2b9 on redhat 9... its giving error. ns2 make failed [trace/ trace.o] error is coming. so pls help me Thanks Sushma
[ns] Example TCL Script for "Adding Multiple Interface Support in NS-2" patch
Hello, Example tcl scripts along with awk scripts for "Adding Multiple Interface Support in NS-2" patch are available on the following link: http://mohittahiliani.blogspot.com/2010/04/revised-adding-multiple-interface.html Also the previous patch has been modified so as to work correctly. Hope it helps. Regards,Mohit P. Tahiliani
Re: [ns] ns2 installation problem....
Hi, ns-2 is not directly dependent on the OS. It depends more on the version of the packages and the libraries . Regards Mike
[ns] Create a video from NAM
Hi all, Nothing else to add ! Thanks
[ns] Segmentation Fault while Modifying AODV
Dear NS2 Users I am facing a very serious problem regarding modification to AODV protocol. I have customized AODV Protocol to work as VANET Beaconing Protocol according to DSRC Standard. I also having implemented the duplicity mechansim where each node on receiving a beacon, stores it for certain time to check for duplicity, because i want the beacons to travel for multihops. i have divided the road into regions and there is a linked list for every region which stores the hashes of certain values taken from every beacon. i have implemented all this, and when i run my tcl script, it gives segmentation fault. basically i get the segmentation fault after adding the following code (This whole code is included in aodv.cc and aodv is no more a routing protocol. it is just a VANET Beaconing protocol now which i optimized for my simulations). aodv/aodv.cc recev_beacon() { ... ... . receive the beacon and calculate the hash from some values // Now Save the Beacons if (xx<=x && x<(xx+200)) { bool flag=obj.search(hash2); if (flag==TRUE) { cout<<"Already exists in the linked list"<=xx && (xx<=x && x<(xx+400))) { obj.add(hash2, 2); ofstream list2;//for saving hash values list2.open("linkedlist2.dat", ios::app); list2<=xx && (xx<=x && x<(xx+600))) { obj.add(hash2, 3); } else if (x>=xx && (xx<=x && x<(xx+1000))) { obj.add(hash2, 4); } the linked list implemented is given below // // Defining Linked Lists // struct list1{ unsigned int bid;list1 *link; }; struct list2{ unsigned int bid;list2 *link; }; struct list3{ unsigned int bid;list3 *link; }; struct list4{ unsigned int bid;list4 *link; }; class list{ private: int i; list1 *cur1,*temp1,*start1; list2 *cur2,*temp2,*start2; list3 *cur3,*temp3,*start3; list4 *cur4,*temp4,*start4; public: list() { start1=NULL; start2=NULL; start3=NULL; start4=NULL; } void add(unsigned int hashval, int listno) { //cout<<"Enter the list number to add element to";cin>>i; // check for list no. if (listno==1) { if(start1==NULL) { start1=new list1; cur1=start1; cur1->bid=hashval; cur1->link=NULL; } else { cur1->link=new list1; cur1=cur1->link; cur1->bid=hashval; cur1->link=NULL; } } else if (listno==2) { if(start2==NULL) { start2=new list2; cur2=start2; cur2->bid=hashval; cur2->link=NULL; } else { cur2->link=new list2; cur2=cur2->link; cur2->bid=hashval; cur2->link=NULL; } } else if (listno==3) { if(start3==NULL) { start3=new list3; cur3=start3; cur3->bid=hashval; cur3->link=NULL; } else { cur3->link=new list3; cur3=cur3->link; cur3->bid=hashval; cur3->link=NULL; } } else if (listno==4) { if(start4==NULL) { start4=new list4; cur4=start4; cur4->bid=hashval; cur4->link=NULL; } else { cur4->link=new list4; cur4=cur4->link; cur4->bid=hashval; cur4->link=NULL; } } } // searching method bool search(unsigned int hashval) { bool b; cur1=start1; while (cur1->link!=NULL) { if(cur1->bid==hashval) b=TRUE; else b=FALSE; cur1=cur1->link; } return b; } I will be looking for some help as soon as possible. THanks to all concerned in advance!! Rasheed
[ns] Specifying nodes in mobility trace generation
Hi All, Please how can I specify nodes in scenario generation to start from a different number instead of 0? I mean having the scenario generation start from say node_(10) instead of node_(0). Any help is appreciated please. Eze
[ns] Changing TCL file and script while running
Dear all, I run (Ubuntu 2.6.27-7-server) a script with several simulation scenarios. Here are the first lines of my script which uses another script and the several simulations are very similar: ** #!/bin/bash sim_name=35p3tcps1a ns IGoXFAN.tcl 1.1429 3 1 0.25 ./exe.sh 3 10.0 rm cpt_elastic_all.tr rm temps*.txt cp cpt_elastic_backup.tr cpt_elastic_all.tr rm cpt_elastic_backup.tr mkdir $sim_name cp *.txt $sim_name cp *.tr $sim_name sim_name=70p3tcps1a ns IGoXFAN.tcl 0.5714 3 1 0.25 ./exe.sh 3 10.0 rm cpt_elastic_all.tr rm temps*.txt cp cpt_elastic_backup.tr cpt_elastic_all.tr rm cpt_elastic_backup.tr mkdir $sim_name cp *.txt $sim_name cp *.tr $sim_name etc ** I just discover my TCL file and my script has a non trascendent error for the previous results but for future simulations. I do not have time to re-run my simulations from the beginning but I want to correct the future ones. Two questions. a) Can I change the value of some parameters (not the event generation) in my TCL so the new values are taken into account? b) Can I change the script (showed above) and the new simulations will take into account such changes? I would appreciate any comment on that, please accept my best regards, César
[ns] i use link-duplex mode in tcl sript, but when i learned the trace file i haven't find the full duplex use.
i use link-duplex mode in tcl sript, but when i learned the trace file i haven't find the full duplex use. for example i tried with 10 nodes : $ns duplex-link $n0 $n1 1Mb 20ms DropTail $ns duplex-link $n0 $n2 1Mb 20ms DropTail $ns duplex-link $n0 $n3 1Mb 20ms DropTail $ns duplex-link $n0 $n4 1Mb 20ms DropTail $ns duplex-link $n0 $n5 1Mb 20ms DropTail $ns duplex-link $n0 $n6 1Mb 20ms DropTail $ns duplex-link $n0 $n7 1Mb 20ms DropTail $ns duplex-link $n0 $n8 1Mb 20ms DropTail $ns duplex-link $n0 $n9 1Mb 20ms DropTail $ns duplex-link $n0 $n10 1Mb 20ms DropTail where i want the node 0 be the Acess point of the scenario I wanted that the communication between nodes ans node 0 has a full duplex direction But when reading the trace file , i found: + 0.1 0 10 cbr 210 --- 0 0.0 10.1 1 5 + 0.1 0 10 cbr 210 --- 0 0.0 10.1 1 6 + 0.1 1 0 cbr 210 --- 2 1.0 10.1 1 7 - 0.1 1 0 cbr 210 --- 2 1.0 10.1 1 7 + 0.1 1 0 cbr 210 --- 2 1.0 10.1 1 8 + 0.1 1 0 cbr 210 --- 2 1.0 10.1 1 9 + 0.1 1 0 cbr 210 --- 2 1.0 10.1 1 10 + 0.1 1 0 cbr 210 --- 2 1.0 10.1 1 11 + 0.1 1 0 cbr 210 --- 2 1.0 10.1 1 12 + 0.1 1 0 cbr 210 --- 2 1.0 10.1 1 13 + 0.1 2 0 cbr 210 --- 0 2.0 10.1 1 14 - 0.1 2 0 cbr 210 --- 0 2.0 10.1 1 14 + 0.1 2 0 cbr 210 --- 0 2.0 10.1 1 15 + 0.1 2 0 cbr 210 --- 0 2.0 10.1 1 16 + 0.1 2 0 cbr 210 --- 0 2.0 10.1 1 17 + 0.1 2 0 cbr 210 --- 0 2.0 10.1 1 18 + 0.1 2 0 cbr 210 --- 0 2.0 10.1 1 19 + 0.1 2 0 cbr 210 --- 0 2.0 10.1 1 20 + 0.1 3 0 cbr 210 --- 3 3.0 10.1 1 21 - 0.1 3 0 cbr 210 --- 3 3.0 10.1 1 21 + 0.1 3 0 cbr 210 --- 3 3.0 10.1 1 22 + 0.1 3 0 cbr 210 --- 3 3.0 10.1 1 23 + 0.1 3 0 cbr 210 --- 3 3.0 10.1 1 24 + 0.1 3 0 cbr 210 --- 3 3.0 10.1 1 25 + 0.1 3 0 cbr 210 --- 3 3.0 10.1 1 26 + 0.1 3 0 cbr 210 --- 3 3.0 10.1 1 27 + 0.1 4 0 cbr 210 --- 5 4.0 10.1 1 28 - 0.1 4 0 cbr 210 --- 5 4.0 10.1 1 28 + 0.1 4 0 cbr 210 --- 5 4.0 10.1 1 29 + 0.1 4 0 cbr 210 --- 5 4.0 10.1 1 30 + 0.1 4 0 cbr 210 --- 5 4.0 10.1 1 31 + 0.1 4 0 cbr 210 --- 5 4.0 10.1 1 32 + 0.1 4 0 cbr 210 --- 5 4.0 10.1 1 33 + 0.1 4 0 cbr 210 --- 5 4.0 10.1 1 34 + 0.1 5 0 cbr 210 --- 0 5.0 10.1 1 35 - 0.1 5 0 cbr 210 --- 0 5.0 10.1 1 35 + 0.1 5 0 cbr 210 --- 0 5.0 10.1 1 36 + 0.1 5 0 cbr 210 --- 0 5.0 10.1 1 37 + 0.1 5 0 cbr 210 --- 0 5.0 10.1 1 38 + 0.1 5 0 cbr 210 --- 0 5.0 10.1 1 39 + 0.1 5 0 cbr 210 --- 0 5.0 10.1 1 40 + 0.1 5 0 cbr 210 --- 0 5.0 10.1 1 41 + 0.1 6 0 cbr 210 --- 8 6.0 10.1 1 42 - 0.1 6 0 cbr 210 --- 8 6.0 10.1 1 42 + 0.1 6 0 cbr 210 --- 8 6.0 10.1 1 43 + 0.1 6 0 cbr 210 --- 8 6.0 10.1 1 44 + 0.1 6 0 cbr 210 --- 8 6.0 10.1 1 45 + 0.1 6 0 cbr 210 --- 8 6.0 10.1 1 46 + 0.1 6 0 cbr 210 --- 8 6.0 10.1 1 47 + 0.1 6 0 cbr 210 --- 8 6.0 10.1 1 48 + 0.1 7 0 cbr 210 --- 0 7.0 10.1 1 49 - 0.1 7 0 cbr 210 --- 0 7.0 10.1 1 49 + 0.1 7 0 cbr 210 --- 0 7.0 10.1 1 50 + 0.1 7 0 cbr 210 --- 0 7.0 10.1 1 51 + 0.1 7 0 cbr 210 --- 0 7.0 10.1 1 52 + 0.1 7 0 cbr 210 --- 0 7.0 10.1 1 53 + 0.1 7 0 cbr 210 --- 0 7.0 10.1 1 54 + 0.1 7 0 cbr 210 --- 0 7.0 10.1 1 55 + 0.1 8 0 cbr 210 --- 0 8.0 10.1 1 56 - 0.1 8 0 cbr 210 --- 0 8.0 10.1 1 56 + 0.1 8 0 cbr 210 --- 0 8.0 10.1 1 57 + 0.1 8 0 cbr 210 --- 0 8.0 10.1 1 58 + 0.1 8 0 cbr 210 --- 0 8.0 10.1 1 59 + 0.1 8 0 cbr 210 --- 0 8.0 10.1 1 60 + 0.1 8 0 cbr 210 --- 0 8.0 10.1 1 61 + 0.1 8 0 cbr 210 --- 0 8.0 10.1 1 62 + 0.1 9 0 cbr 210 --- 9 9.0 10.1 1 63 - 0.1 9 0 cbr 210 --- 9 9.0 10.1 1 63 + 0.1 9 0 cbr 210 --- 9 9.0 10.1 1 64 + 0.1 9 0 cbr 210 --- 9 9.0 10.1 1 65 + 0.1 9 0 cbr 210 --- 9 9.0 10.1 1 66 + 0.1 9 0 cbr 210 --- 9 9.0 10.1 1 67 + 0.1 9 0 cbr 210 --- 9 9.0 10.1 1 68 + 0.1 9 0 cbr 210 --- 9 9.0 10.1 1 69 - 0.10168 0 10 cbr 210 --- 0 0.0 10.1 1 1 - 0.10168 1 0 cbr 210 --- 2 1.0 10.1 1 8 - 0.10168 2 0 cbr 210 --- 0 2.0 10.1 1 15 - 0.10168 3 0 cbr 210 --- 3 3.0 10.1 1 22 - 0.10168 4 0 cbr 210 --- 5 4.0 10.1 1 29 as if i have node 0 send packets to node 10, and others nodes sends to node0 without that node0 resend to them. where is the effect of the use of link-duplex???
Re: [ns] wireless tcl script true but the trace file hasn't the same format as for wireless script
Hi Emma, You are using a new trace format. Please refer to http://nsnam.isi.edu/nsnam/index.php/NS-2_Trace_Formats for more information. Best Regards, Teerawat Issariyakul http://www.ns2ultimate.com/ http://www.facebook.com/pages/Teerawat-Issariyakul/358240861417 http://twitter.com/T_Bear http://www.t-issariyakul.blogspot.com http://www.ece.ubc.ca/~teerawat On 4/12/2010, "Emma Ch" wrote: > >I >am trying to construt a wireless tcl script that generates voice >traffic "voip", i use this tcl script but the trace file hasn't the >same contents as the trace file for "simple-wireless.tcl". >I explain more: >I use this tcl script > >-tcl >script-- >set ns [new Simulator] ># choix des couleurs: >$ns color 0 blue >$ns color 1 red >$ns color 2 green >$ns color 3 red >$ns color 4 orange >$ns color 5 blue >$ns color 6 green >$ns color 7 black >$ns color 8 orange >$ns color 9 blue > > ># les dix noeuds: >set n0 [$ns node] >set n1 [$ns node] >set n2 [$ns node] >set n3 [$ns node] >set n4 [$ns node] >set n5 [$ns node] >set n6 [$ns node] >set n7 [$ns node] >set n8 [$ns node] >set n9 [$ns node] > > > ># création des outputs > trace et nam: >set f [open emna.tr w] >$ns trace-all $f >set nf [open emna.nam w] >$ns namtrace-all $nf ># == ># Define options ># == >set val(chan) Channel/WirelessChannel ;# channel type >set val(prop) Propagation/TwoRayGround ;# radio-propagation >model >set val(netif) Phy/WirelessPhy ;# network interface >type >set val(mac) > Mac/802_11 ;# MAC type >set val(ifq) Queue/DropTail/PriQueue ;# interface queue >type >set val(ll) LL ;# link layer type >set val(ant) Antenna/OmniAntenna ;# antenna model >set val(rp) DumbAgent > ;# routing protocol >set val(start) 0.0 >set val(ifqlen) 50 ;# max packet in ifq >set val(nn) 10 >set val(tr) "trace" >set val(X) 500 >set val(Y) 500 >set val(CWmin) 16 >set val(CWmax) 1024 >set val(SlotTime) 0.09 >set > val(SIFS) 0.16 >set val(basicRate) 2Mb >set val(dataRate) 54Mb ># ># Codec: G.711 ># >#set val(ON) 1500ms >#set val(OFF) 1500ms >#set val(AppRate) 96Kb >set val(pktsize) 160 >set val(pktinterval) 0.020 >set val(run) 50.0 > ># ># MAC > MIB ># >Mac/802_11 set basicRate $val(basicRate)Mb >Mac/802_11 set dataRate $val(dataRate)Mb >Mac/802_11 set CWMin $val(CWmin) >Mac/802_11 set CWMax $val(CWmax) >Mac/802_11 set SlotTime $val(SlotTime) >Mac/802_11 set SIFS $val(SIFS) ># set up topography object >set > topo [new Topography] >#$topo load_flatgrid $val(X) $val(Y) > ># Create God >create-god $val(nn) > ># configure node > > > $ns node-config -adhocRouting $val(rp) \ > > -llType $val(ll) \ > > -macType $val(mac) \ > > -ifqType $val(ifq) \ > > -ifqLen $val(ifqlen) \ > > -antType $val(ant) \ > > -propType $val(prop) \ > > -phyType $val(netif) \ > > -channelType > $val(chan) \ > > -topoInstance $topo \ > > -agentTrace ON \ > > -routerTrace OFF \ > > -macTrace OFF \ > > -movementTrace OFF > > > for {set i 0} {$i < $val(nn) } {incr i} { > > set node_($i) [$ns node] > $node_($i) random-motion 0 ;# disable random motion > > } > ># connection des noeuds entre eux: ># $ns simple-link (duplex-link) $n0 > $n1 >$ns duplex-link $n0 $n1 2Mb 2ms DropTail >$ns duplex-link $n0 $n2 2Mb 2ms DropTail >$ns duplex-link $n0 $n3 2Mb 2ms DropTail >$ns duplex-link $n0 $n4 2Mb 2ms DropTail >$ns duplex-link $n0 $n5 2Mb 2ms DropTail >$ns duplex-link $n0 $n6 2Mb 2ms DropTail >$ns duplex-link $n0 $n7 2Mb 2ms DropTail >$ns duplex-link $n0 $n8 2Mb 2ms DropTail >$ns duplex-link $n0 $n9 2Mb 2ms DropTail > ># la création de l'"agent" / set ... [new Agent/type] >set rtp0 [new Agent/RTP] ># communication agent-network ($ns attach-agent $node $agent) >$ns attach-agent $n0 $rtp0 ># la création de l'application / set ... [new Application/type] >set cbr0 [new Application/T
Re: [ns] ns2 installation problem....
Hi Sushma, I did some test on NS2 installation few weeks ago. Here is the result http://www.ns2ultimate.com/post/439346614/working-combination-ns-2-34-ubuntu-8-04-and-perhaps There is a problem with the current linux-like distribution. Here is the solution http://www.ns2ultimate.com/post/441093095/ns-2-35-works-on-cygwin I hope this will help. Best Wishes, Teerawat Issariyakul http://www.ns2ultimate.com/ http://www.ece.ubc.ca/~teerawat http://www.t-issariyakul.blogspot.com http://www.facebook.com/pages/Teerawat-Issariyakul/358240861417 http://twitter.com/T_Bear On 4/12/2010, "Sushma M" wrote: > >hello... > > > i want to install ns2.1b9 or ns2.1b8a. pls help me. which os will >support these versions >i tried ns2.2b9 on redhat 9... its giving error. ns2 make failed [trace/ >trace.o] error is coming. >so pls help me > > > >Thanks >Sushma >
Re: [ns] Segmentation Fault while Modifying AODV
Hi Rasheed, Segmentation fault is usually due to memory access violation. A common example is as follows. int x[10]; x[20] = 0; where you create an array x with 10 slots, but try to access 20th slot of x. Hope this will help. Best Regards, Teerawat Issariyakul http://www.ns2ultimate.com/ http://www.facebook.com/pages/Teerawat-Issariyakul/358240861417 http://twitter.com/T_Bear http://www.t-issariyakul.blogspot.com http://www.ece.ubc.ca/~teerawat On 4/12/2010, "Èļ¼ÀÎ ¶ó½¬µå[RASHEED HUSSAIN] rasheed1...@gmail.com" <=?EUC-KR?B?yMS8vMDOICC2872steVbUkFTSEVFRCBIVVNTQUlOXQ==?= rasheed1...@gmail.com> wrote: > >Dear NS2 Users >I am facing a very serious problem regarding modification to AODV protocol. >I have customized AODV Protocol to work as VANET Beaconing Protocol >according to DSRC Standard. >I also having implemented the duplicity mechansim where each node on >receiving a beacon, stores it for certain time to check for duplicity, >because i want the beacons to travel for multihops. >i have divided the road into regions and there is a linked list for every >region which stores the hashes of certain values taken from every beacon. >i have implemented all this, and when i run my tcl script, it gives >segmentation fault. > >basically i get the segmentation fault after adding the following code (This >whole code is included in aodv.cc and aodv is no more a routing protocol. it >is just a VANET Beaconing protocol now which i optimized for my >simulations). > >aodv/aodv.cc >recev_beacon() >{ >... >... >. >receive the beacon and calculate the hash from some values >// Now Save the Beacons > > if (xx<=x && x<(xx+200)) > { > bool flag=obj.search(hash2); > if (flag==TRUE) > { > cout<<"Already exists in the linked list"< } > else > { > obj.add(hash2, 1); > //ofstream list1;//for saving hash values > //list1.open("linkedlist1.dat", ios::app); > //list1< } >} // end of if > else if (x>=xx && (xx<=x && x<(xx+400))) > { > obj.add(hash2, 2); >ofstream list2;//for saving hash values > list2.open("linkedlist2.dat", ios::app); > list2< } > else if (x>=xx && (xx<=x && x<(xx+600))) > { > obj.add(hash2, 3); > } > else if (x>=xx && (xx<=x && x<(xx+1000))) > { > obj.add(hash2, 4); > } > >the linked list implemented is given below >// >// Defining Linked Lists >// >struct list1{ >unsigned int bid;list1 *link; >}; > >struct list2{ >unsigned int bid;list2 *link; >}; > > >struct list3{ >unsigned int bid;list3 *link; >}; > >struct list4{ >unsigned int bid;list4 *link; >}; > >class list{ >private: >int i; > list1 *cur1,*temp1,*start1; > list2 *cur2,*temp2,*start2; > list3 *cur3,*temp3,*start3; > list4 *cur4,*temp4,*start4; > >public: > >list() >{ >start1=NULL; >start2=NULL; >start3=NULL; >start4=NULL; >} > >void add(unsigned int hashval, int listno) >{ >//cout<<"Enter the list number to add element to";cin>>i; >// check for list no. > if (listno==1) > { > > if(start1==NULL) > { > start1=new list1; > cur1=start1; > cur1->bid=hashval; > cur1->link=NULL; > } > else > { >cur1->link=new list1; >cur1=cur1->link; >cur1->bid=hashval; >cur1->link=NULL; > } > > } > else if (listno==2) > { >if(start2==NULL) > { > start2=new list2; > cur2=start2; > cur2->bid=hashval; > cur2->link=NULL; > } > else >{ >cur2->link=new list2; >cur2=cur2->link; >cur2->bid=hashval; >cur2->link=NULL; >} > } >else if (listno==3) > { >if(start3==NULL) > { > start3=new list3; > cur3=start3; > cur3->bid=hashval; > cur3->link=NULL; > } > else >{ >cur3->link=new list3; >cur3=cur3->link; >cur3->bid=hashval; >cur3->link=NULL; >} > } >else if (listno==4) > { >if(start4==NULL) > { > start4=new list4; > cur4=start4; > cur4->bid=hashval; > cur4->link=NULL; > } > else >{ >cur4->link=new list4; >cur4=cur4->link; >cur4->bid=hashval; >cur4->link=NULL; >} > } >} > // searching method > bool search(unsigned int hashval) > { >bool b; > cur1=start1; > while (cur1->link!=NULL) > { > if(cur1->bid==hashval) > b=TRUE; > else > b=FALSE; > cur1=cur1->link; >} > return b; > } > >I will be looking for some help as soon as possible. >THanks to all concerned in advance!! > > >Rasheed >
[ns] Value of the Routing protocol [val(rp) ??? ]
Hi all, In the tcl script while setting the options of the node, where should the value of the routing protocol, val(rp), be defined? Is it in the ns-packet.tcl, inside the foreach prot { ... }? I have two different agents in my protocol, and the name I have provided in the ns-packet.tcl file does not match with any of the agents' names. The name I've provided inside the foreach prot { ... MSProto ...} is the name of the Directory inside the ns-2.34 directory wherein all the files of my protocol reside. I want to know if this is correct or the name of the protocol should match with any agent? Thanks and Regards, The Learner -- View this message in context: http://old.nabble.com/Value-of-the-Routing-protocol--val%28rp%29---tp28219215p28219215.html Sent from the ns-users mailing list archive at Nabble.com.
[ns] Error while running the tcl script while implementing a new protocol in ns2
When I run my tcl script, I get the following error- (_o14 cmd line 1) invoked from within "_o14 cmd addr" 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 "_o14" line 2) (SplitObject unknown line 2) invoked from within "_o14 addr" ("eval" body line 1) invoked from within "eval $node addr $args" ("default" arm line 2) invoked from within "switch -exact $routingAgent_ { MSClusterHead { set ragent [$self create-msprotoch-agent $node] } MSDataDiscovery { set ragent [$self create-msprotodd..." (procedure "_o3" line 14) (Simulator create-wireless-node line 14) invoked from within "_o3 create-wireless-node" ("eval" body line 1) invoked from within "eval $self create-wireless-node $args" (procedure "_o3" line 23) (Simulator node line 23) invoked from within "$ns node" ("for" body line 2) invoked from within "for {set i 0} {$i < $val(nn) } {incr i} { set node_($i) [$ns node] $node_($i) random-motion 0 ;# disable random motion }" (file "simulation.tcl" line 60) What does this error mean? And how can I rectify this? Thanks and Regards, The Learner -- View this message in context: http://old.nabble.com/Error-while-running-the-tcl-script-while-implementing-a-new-protocol-in-ns2-tp28219216p28219216.html Sent from the ns-users mailing list archive at Nabble.com.
[ns] Regarding capacity(Bottleneck) bandwidth estimation
Hi All, If any one worked or working with estimating bottleneck bandwidth of path pls help me regarding this... I need tcl code of this.. Thankin you -- With regards Navi
[ns] how to change the freq of broadcasting the PBC packet
I donot know how to change the freq of broadcasting period in tcl &&c++,who can tell me ? thank you