[ns] Routing to a base station through intermediate nodes.
Hi, Thanks again for the advice. Your suggestion certainly took care of the error message, but unfortunately nothing is being written to the output file. Do you have an example of dump-routes that I could use? I was able to route traffic from base stations to wireless nodes within range. I also performed successful routing between wireless nodes using intermediate nodes. However, the problem resides in sending packets from a base station to a wireless node that requires an additional hop (in my diagram below, it would be W(0)-->MH(1) ). Maybe the wireless nodes are not forwarding the information regarding MH(1) to the base stations, or else the base stations are not propagating that information to the rest of the wired nodes. Does anyone know if there is a bug in the simulator implementation or a way to check for this either by looking at the trace file or by any other function in tcl? Has anyone been able to try this experiment before? Thank you. Best regards, Eric 2009/8/17 zhujian > I think that the line $dr dump-routes $fh should modified to $node > dump-routes $fh > > > > *发件人:* Eric Miedzowicz [mailto:emie...@gmail.com] > *发送时间:* 2009年8月17日 11:53 > *收件人:* zhujian > *主题:* Re: 答复: [ns] Routing to a base station through intermediate nodes. > > > > Zhujian, > Thank you for your prompt response. I am trying to verify the > routing table. I used an example posted in the mailing list as follows: > > set fh [open dyn.trc w] > > proc rtdump {node fh} { > global ns_ > set now [$ns_ now] > puts "Routing table of node $node at time $now" > set dr [$node rtObject?] > $dr dump-routes $fh > } > > $ns_ at 99.5 "rtdump $MH(1) $fh" > > However, when I run the script I get the following error: > > INITIALIZE THE LIST xListHead > *** NOTE: no connection pattern specified. > *** NOTE: no scenario file specified. > Starting Simulation... > channel.cc:sendUp - Calc highestAntennaZ_ and distCST_ > highestAntennaZ_ = 1.5, distCST_ = 550.0 > SORTING LISTS ...DONE! > Routing table of node _o133 at time 99.5 > ns: rtdump _o133 file5: invalid command name "" > while executing > "$dr dump-routes $fh" > (procedure "rtdump" line 8) > invoked from within > "rtdump _o133 file5" > > Do you know a way to show the routing table for a wireless node? Is it > possible to deduce it from the output traces? Thank you. > > Best regards, > Eric > > 2009/8/16 zhujian > > Maybe you can checking the routing. > > -邮件原件- > 发件人: ns-users-boun...@isi.edu [mailto:ns-users-boun...@isi.edu] 代表 Eric > Miedzowicz > 发送时间: 2009年8月17日 7:14 > 收件人: ns-users@ISI.EDU > 主题: [ns] Routing to a base station through intermediate nodes. > > > > Hi! > >I am new to ns-2 and I need to simulate a wired-wireless network. I am > using the wireless3.tcl script as a model and I need to be able to use both > base stations to route traffic to different wireless nodes, depending on > their location. In my example, I use 3 wireless nodes (MH) and 2 base > stations (HA and FA, as shown below). > > W(0) > | > W(1) > /\ > HAFA > >MH(0)MH(2) > MH(1) > > In my script I was able to send traffic from MH(2) to W(0) (through FA), > from MH(0) to W(0) (through HA) and even from MH(0) to MH(2), using MH(1) > as > an intermediate node. When MH(1) is within range from FA, it sends packets > normally. However, when move it out of range from the base station, in > order > to use an intermediate node, it is not able to find its way. Below you will > find the code I am using. > > You will notice that I am not using the base station definitions shown in > wireless3.tcl and wired-cum-wireless-sim.tcl. I did try them at first, but > the results were the same. Could somebody please help me? Has anyone tried > this experiment before in order to send me a sample script? I am using > ns-2.34. > > set opt(chan) Channel/WirelessChannel;# channel type > set opt(prop) Propagation/TwoRayGround ;# radio-propagation model > set opt(netif) Phy/WirelessPhy;# network interface type > set opt(mac)Mac/802_11 ;# MAC type > set opt(ifq)Queue/DropTail/PriQueue;# interface queue type > set opt(ll) LL ;# link layer type > set opt(ant)Antenna/OmniAntenna;# antenna model > set opt(ifqlen) 50 ;# max packet in ifq > set opt(nn) 3 ;# number of mobilenodes > set opt(adhocRouting) DSDV ;# routing protocol > > set opt(cp) "" ;# cp file not used > set opt(sc) "" ;# node movement file. > > set opt(x) 670;# x coordinate of topology > set opt(y) 670;# y coordinate of topol
Re: [ns] Segmentation fault with wireless simulation
in your script you have to change ifq value Queue/DropTail/PriQueue by CMUPriQueue #Define wirleess scenario parameters set val(chan) Channel/WirelessChannel; set val(prop) Propagation/TwoRayGround1; set val(netif) Phy/WirelessPhy; set val(mac) Mac/802_11; set val(ifq) CMUPriQueue ; set val(ll) LL; set val(ant) Antenna/OmniAntenna; set val(ifqlen) 50; set val(nn) 5; set val(rp) DSR; set val(x) 500; set val(y) 400; set val(stop) 150; set ns [new Simulator] set tracefd [open problem1Trace.tr w] set windowVsTime2 [open problem1Win.tr w] set namfd [open problem1Namtrace.nam w] $ns trace-all $tracefd $ns namtrace-all-wireless $namfd $val(x) $val(y) set topo [new Topography] $topo load_flatgrid $val(x) $val(y) create-god $val(nn) $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 ON\ -macTrace OFF \ -movementTrace ON for {set i 0} {$i < $val(nn) } {incr i} { set node_($i) [$ns node] } $node_(0) set X_ 5.0 $node_(0) set Y_ 5.0 $node_(0) set Z_ 0.0 $node_(1) set X_ 490.0 $node_(1) set Y_ 285.0 $node_(1) set Z_ 0.0 $node_(2) set X_ 150.0 $node_(2) set Y_ 240.0 $node_(2) set Z_ 0.0 $node_(3) set X_ 495.0 $node_(3) set Y_ 100 $node_(3) set Z_ 0.0 $node_(4) set X_ 495 $node_(4) set Y_ 395 $node_(4) set Z_ 0.0 $ns at 10.0 "$node_(0) setdest 250.0 250.0 3.0" $ns at 15.0 "$node_(1) setdest 45.0 285.0 5.0" $ns at 20.0 "$node_(2) setdest 480.0 300.0 5.0" $ns at 25.0 "$node_(3) setdest 50.0 150.0 5.0" $ns at 15.0 "$node_(4) setdest 50.0 50.0 3.0" #set TCP Connection between node_(0) and node_(1) set tcp0 [new Agent/TCP/Newreno] $tcp0 set class_ 2 set sink0 [new Agent/TCPSink] $ns attach-agent $node_(0) $tcp0 $ns attach-agent $node_(1) $sink0 $ns connect $tcp0 $sink0 set ftp [new Application/FTP] $ftp attach-agent $tcp0 $ns at 10.0 "$ftp start" #set TCP Connection between node_(0) and node_(4) set tcp1 [new Agent/TCP/Newreno] $tcp1 set class_ 2 set sink1 [new Agent/TCPSink] $ns attach-agent $node_(0) $tcp1 $ns attach-agent $node_(4) $sink1 $ns connect $tcp1 $sink1 set ftp1 [new Application/FTP] $ftp1 attach-agent $tcp1 $ns at 12.0 "$ftp1 start" #set TCP Connection between node_(3) and node_(2) set tcp2 [new Agent/TCP/Newreno] $tcp2 set class_ 2 set sink2 [new Agent/TCPSink] $ns attach-agent $node_(3) $tcp2 $ns attach-agent $node_(2) $sink2 $ns connect $tcp2 $sink2 set ftp2 [new Application/FTP] $ftp2 attach-agent $tcp2 $ns at 15.0 "$ftp2 start" proc plotWindow {tcpSource file} { global ns set time 0.01 set now [$ns now] set cwnd [$tcpSource set cwnd_] puts $file "$now $cwnd" $ns at [expr $now+$time] "plotWindow $tcpSource $file" } $ns at 10.1 "plotWindow $tcp0 $windowVsTime2" #define node position in NAM for {set i 0} {$i < $val(nn)} {incr i} { $ns initial_node_pos $node_($i) 30 } for {set i 0} {$i < $val(nn) } {incr i} { $ns at $val(stop) "$node_($i) reset"; } $ns at $val(stop) "$ns nam-end-wireless $val(stop)" $ns at $val(stop) "stop" $ns at 150.01 "puts \"end simulation\" ; $ns halt" proc stop {} { global ns tracefd namfd $ns flush-trace close $tracefd close $namfd } $ns run #Good Luck -- View this message in context: http://www.nabble.com/Segmentation-fault-with-wireless-simulation-tp14679409p25017741.html Sent from the ns-users mailing list archive at Nabble.com.
[ns] linking tcl with c++
hi friends.. i have a cpp file of RTRAgent of odmrp protocol. when i implement it ,an error occurs as "invalid command name", how should i link c++ with tcl wit regards sangeetha.k
Re: [ns] awk script for calculating end to end delay in a wired-wireless scenario
hi, Because of inconsistencies in the trace format, sometimes the node id is given in a hierarchical way (eg, 0.0.1) and other times in a decimal way (hierarchical addresses normally allocate bits as 10.11.11, so 1.0.1 becomes 4194305). It's generally simplest to have a look through your trace file and figure out which id is being given to which node under which circumstances. (eg., sending from a wired node to a wired node seems to result in hierarchical addresses, but receiving at a wireless node seems to result in the confusing decimal format). Here's what I use for calculating loss, it should get you started and make calculating throughput and delay easier. # #Hierarchical routing is used with bits allocated as 10.11.11, # #addresses must be converted# #0.0.0 = 0 (our server node) # #1.0.0 = 4194304(our Access point node) # #1.0.1 = 4194305(our destination node) # # BEGIN{totaltime=input;} /^+/ && /0.0.0.0/ && /1.0.1.0/ && /Multimedia/{ wtimefield=2 wpacketidfield=12 loss[int($wtimefield)]++; packet[$wpacketidfield]=1; } /^r/ && / -Is 0.0/ && / -Id 4194305.0/ && /AGT/ && /Multimedia/ { if(timefield==0 ||packetidfield==0) { for(i=1; i<=NF; i++) { if($i=="-t") timefield=i+1; if($i=="-Ii") packetidfield=i+1; } } loss[int($timefield)]--; packet[$packetidfield] = 0; } END{ for(i=0;i: > > hello, > > does anyone have the awk script to calculate delay,throughput,packet loss in > a mixed scenario i.e. wired-wireless scenario? > i will really appreciate it. > regards. > > > > >
Re: [ns] UMTS on NS-2
Hi! Did you remember to recompile ns-2, as the instructions imply? Best wishes, -- Mats Folke, M.Sc., Lic.Eng. Research Engineer Ericsson AB Office: +46 10 7171385 Ericsson Research Fax: +46 920 99621 P.O. Box 920Mobile: +46 76 1271385 SE-971 28 Luleå Sweden -Original Message- From: dka...@gmail.com [mailto:dka...@gmail.com] Sent: den 15 augusti 2009 22:48 To: Mats Folke Subject: Re: UMTS on NS-2 I recently installed ns-2.30 and added the required eurane patch to run UMTS on it, however when i try to run the test_tcp.tcl file or any other file i get the following error: any suggestions as to why this is happening? d...@dk-laptop:~$ ns test1.tcl (_o3 cmd line 1) invoked from within "_o3 cmd create-Umtsnode" 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 "_o3" line 2) (SplitObject unknown line 2) invoked from within "$ns create-Umtsnode" invoked from within "set rnc [$ns create-Umtsnode]" (file "test1.tcl" line 28) d...@dk-laptop:~$ Mats Folke-2 wrote: > > > Hi! > > First of all, please post your questions to the mailing list. It adds > value to the list. > > Yes, you can have multiple versions of ns running in parallel, but you > need to be very careful how you set up your paths. Please search the web > for setting up paths in the shell. That will search your other problems > you wrote about. > > Best regards, > Mats > > Syed Faraz Hasan wrote: >> Dear Mats, >> >> Please advise me, can I have both NS-2.33 and NS-2.30 at the same >> time? Will they both ok if they coexist or do I need to get rid of >> one for th other? >> >> Thanks a lot in anticipation >> >> Faraz >> >> >> From: ns-users-boun...@isi.edu [ns-users-boun...@isi.edu] On Behalf >> Of Mats Folke [mats.fo...@ericsson.com] >> Sent: Tuesday, March 24, 2009 12:47 AM >> To: ns-users@isi.edu >> Subject: Re: [ns] UMTS on NS-2 >> >> Hi! >> >> Syed Faraz Hasan wrote: >>> Hello! >>> >>> Reference to my previous email about UMTS implementation on NS-2. Can >>> some one tell me if I need a separate patch for UMTS while working on >>> NS-2.33? If so, where can I download it from? I have seen >>> http://eurane.ti-wmc.nl/eurane/, patch available there is in diff.gz >>> format. I am a newbie to open suse linux, I think I should be after >>> something .tar.gz? >> >> There is currently no patch for ns-2.33 and since Eurane is not >> supported anymore, there probably never will be. You have two >> options. 1) Download ns-2.30 and patch with existing eurane patch. If >> you need something introduced in later versions of ns-2, you cannot >> use it. 2) Patch an existing ns-2.33 with the eurane patch for >> ns-2.30. This could result in difficulties which you must manually >> resolve. >> >> The patching procedure is documented in the manual, section 2.3. >> >> A patch is distributed in something called a diff-file, hence the >> file extension .diff. Gzip then adds the extension .gz. Before >> pathing the .diff.gz file needs to be uncompressed using gunzip. The >> result will be the diff-file. >> >>> Anyway, when I download and open eurane1.12.diff.gz, it gives an >>> error "associated help application does not exist"! This patch is >>> available for NS-2.30, I am using 2.33. >> >> What gives an error? A patch file should not be "opened", see the >> eurane manual for correct usage, or the patch man page, or google for >> "unix command patch" or similar. >> >>> Also, what is CLEAN NS-2.3 >> >> A clean version is a version not messed up by changes, builds etc. A >> fresh downloaded version is a clean version. >> >>> I downloaded test_tcp.tcl (UMTS implementation on NS-2 test run), >>> without installing any patch on my existing NS-2.33. When I execute >>> it, it says >>> >>> (_o3 cmd line 1) >>> invoked from within >>> "_o3 cmd create-Umtsnode" >>> . >>> . >>> . >>> "$ns create-Umtsnode" >>> invoked from within >>> "set rnc [$ns create-Umtsnode]" >>> file "umtstcp.tcl line 42 >> >> This is because ns-2 (without the patch) does not understand the >> instructions in those tcl files. You need the patch to be able to run >> the tcl files. >> >> Regards, > > > > -- > Mats Folke, M.Sc., Lic.Eng. > Research Engineer > > Ericsson AB Office: +46 10 7171385 > Ericsson Research Fax: +46 920 99621 > P.O. Box 920Mobile: +46 76 1271385 > SE-971 28 Luleå > Sweden > > > Quoted from: http://www.nabble.com/UMTS-on-NS-2-tp22659223p22703758.html