Re: [ns] Traffic generation in a proc
Hi Nabila, looks like you only declared ns as a global variable inside your procedure. Is this sufficient? I am not sure, but maybe reading up on local variables and their scope in tcl is a starter... Please add any insight you gained into the ns2 wiki (http://nsnam.isi.edu/nsnam/index.php/Main_Page) so that others can learn about and from your work. Claus Nabila khedimi wrote: > > Hi, > I am still wondering about the no generation of a trafic when it is done by a > procedure although the same code made outside works, but when I put it in a > procedure it does not!!! anyone has an idea > nabila > > > Date: Mon, 19 Nov 2007 10:46:30 -0800From: [EMAIL PROTECTED]: Re: [ns] > Traffic generation in a procTo: [EMAIL PROTECTED]: ns-users@isi.edu > > > > > Hi ns user, > Try to wirte the cbr traffic without procedure to show it is correct or not. > Like > > # Traffic Source 1: Mobile node1->node3, flowid=1set udp1 [new Agent/UDP]$ns_ > attach-agent $node_(1) $udp1$udp1 set class_ 1$udp1 set fid_ 1set cbr1 [new > Application/Traffic/CBR]$cbr1 attach-agent $udp1$cbr1 set rate_ 20kb$cbr1 set > packetSize_ 512#$cbr1 set interval_ 0.2 > # Set loss monitor (to count bytes) at node 3set null1 [new Agent/Null]$ns_ > attach-agent $node_(8) $null1 > # Connect the CBR generator to the loss monitor$ns_ connect $udp1 $null1 > > > Cheers, > Mohammed AbuHajar > - Original Message From: Nabila khedimi <[EMAIL PROTECTED]>To: [EMAIL > PROTECTED]: Monday, November 19, 2007 7:27:35 PMSubject: [ns] Traffic > generation in a procHi every one,I wrote a tcl proc for the generation of a > cbr trafic :proc generate_cbr_traffic {agent_src size rate start_time > end_time} { global ns puts "In generate cbr: $agent_src $size $rate > $start_time $end_time" set cbr_ [new Application/Traffic/CBR] $cbr_ set type_ > CBR $cbr_ set packetsize_ $size $cbr_ set rate_ $rate $cbr_ attach-agent > $agent_src $ns at $start_time "$cbr_ start" $ns at $end_time "$cbr_ stop"}I > made the connection of the udp agents outside the procedure , when I call the > procedure, in the NAM environment no traffic was generated , Thanks for your > helpnabila_Your > smile counts. The more smiles you share, the more we donate. Join > in.www.windowslive.com/smile?ocid=TXT_TAGLM_Wave2_oprsmilewlhmtagline > > > Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. > _ > Have fun while connecting on Messenger! Click here to learn more. > http://entertainment.sympatico.msn.ca/WindowsLiveMessenger -- Claus Christmann Graduate Research Assistant Georgia Institute of Technology 270 Ferst Drive Atlanta, GA 30332-0150 http://uav.ae.gatech.edu
Re: [ns] Traffic generation in a proc
Hi, I am still wondering about the no generation of a trafic when it is done by a procedure although the same code made outside works, but when I put it in a procedure it does not!!! anyone has an idea nabila Date: Mon, 19 Nov 2007 10:46:30 -0800From: [EMAIL PROTECTED]: Re: [ns] Traffic generation in a procTo: [EMAIL PROTECTED]: ns-users@isi.edu Hi ns user, Try to wirte the cbr traffic without procedure to show it is correct or not. Like # Traffic Source 1: Mobile node1->node3, flowid=1set udp1 [new Agent/UDP]$ns_ attach-agent $node_(1) $udp1$udp1 set class_ 1$udp1 set fid_ 1set cbr1 [new Application/Traffic/CBR]$cbr1 attach-agent $udp1$cbr1 set rate_ 20kb$cbr1 set packetSize_ 512#$cbr1 set interval_ 0.2 # Set loss monitor (to count bytes) at node 3set null1 [new Agent/Null]$ns_ attach-agent $node_(8) $null1 # Connect the CBR generator to the loss monitor$ns_ connect $udp1 $null1 Cheers, Mohammed AbuHajar - Original Message From: Nabila khedimi <[EMAIL PROTECTED]>To: [EMAIL PROTECTED]: Monday, November 19, 2007 7:27:35 PMSubject: [ns] Traffic generation in a procHi every one,I wrote a tcl proc for the generation of a cbr trafic :proc generate_cbr_traffic {agent_src size rate start_time end_time} { global ns puts "In generate cbr: $agent_src $size $rate $start_time $end_time" set cbr_ [new Application/Traffic/CBR] $cbr_ set type_ CBR $cbr_ set packetsize_ $size $cbr_ set rate_ $rate $cbr_ attach-agent $agent_src $ns at $start_time "$cbr_ start" $ns at $end_time "$cbr_ stop"}I made the connection of the udp agents outside the procedure , when I call the procedure, in the NAM environment no traffic was generated , Thanks for your helpnabila_Your smile counts. The more smiles you share, the more we donate. Join in.www.windowslive.com/smile?ocid=TXT_TAGLM_Wave2_oprsmilewlhmtagline Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. _ Have fun while connecting on Messenger! Click here to learn more. http://entertainment.sympatico.msn.ca/WindowsLiveMessenger
Re: [ns] Traffic generation in a proc
it works without procedure but as I want the code to be in a procedure in order to call it several times so I don't have to repeat writing it in different parts of the program thanks for help nabila Date: Mon, 19 Nov 2007 10:46:30 -0800From: [EMAIL PROTECTED]: Re: [ns] Traffic generation in a procTo: [EMAIL PROTECTED]: ns-users@isi.edu Hi ns user, Try to wirte the cbr traffic without procedure to show it is correct or not. Like # Traffic Source 1: Mobile node1->node3, flowid=1set udp1 [new Agent/UDP]$ns_ attach-agent $node_(1) $udp1$udp1 set class_ 1$udp1 set fid_ 1set cbr1 [new Application/Traffic/CBR]$cbr1 attach-agent $udp1$cbr1 set rate_ 20kb$cbr1 set packetSize_ 512#$cbr1 set interval_ 0.2 # Set loss monitor (to count bytes) at node 3set null1 [new Agent/Null]$ns_ attach-agent $node_(8) $null1 # Connect the CBR generator to the loss monitor$ns_ connect $udp1 $null1 Cheers, Mohammed AbuHajar - Original Message From: Nabila khedimi <[EMAIL PROTECTED]>To: [EMAIL PROTECTED]: Monday, November 19, 2007 7:27:35 PMSubject: [ns] Traffic generation in a procHi every one,I wrote a tcl proc for the generation of a cbr trafic :proc generate_cbr_traffic {agent_src size rate start_time end_time} { global ns puts "In generate cbr: $agent_src $size $rate $start_time $end_time" set cbr_ [new Application/Traffic/CBR] $cbr_ set type_ CBR $cbr_ set packetsize_ $size $cbr_ set rate_ $rate $cbr_ attach-agent $agent_src $ns at $start_time "$cbr_ start" $ns at $end_time "$cbr_ stop"}I made the connection of the udp agents outside the procedure , when I call the procedure, in the NAM environment no traffic was generated , Thanks for your helpnabila_Your smile counts. The more smiles you share, the more we donate. Join in.www.windowslive.com/smile?ocid=TXT_TAGLM_Wave2_oprsmilewlhmtagline Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. _ Connect and share in new ways with Windows Live. http://www.windowslive.com/connect.html?ocid=TXT_TAGLM_Wave2_newways_112007
Re: [ns] Traffic generation in a proc
Hi ns user, Try to wirte the cbr traffic without procedure to show it is correct or not. Like # Traffic Source 1: Mobile node1->node3, flowid=1 set udp1 [new Agent/UDP] $ns_ attach-agent $node_(1) $udp1 $udp1 set class_ 1 $udp1 set fid_ 1 set cbr1 [new Application/Traffic/CBR] $cbr1 attach-agent $udp1 $cbr1 set rate_ 20kb $cbr1 set packetSize_ 512 #$cbr1 set interval_ 0.2 # Set loss monitor (to count bytes) at node 3 set null1 [new Agent/Null] $ns_ attach-agent $node_(8) $null1 # Connect the CBR generator to the loss monitor $ns_ connect $udp1 $null1 Cheers, Mohammed AbuHajar - Original Message From: Nabila khedimi <[EMAIL PROTECTED]> To: ns-users@ISI.EDU Sent: Monday, November 19, 2007 7:27:35 PM Subject: [ns] Traffic generation in a proc Hi every one, I wrote a tcl proc for the generation of a cbr trafic : proc generate_cbr_traffic {agent_src size rate start_time end_time} { global ns puts "In generate cbr: $agent_src $size $rate $start_time $end_time" set cbr_ [new Application/Traffic/CBR] $cbr_ set type_ CBR $cbr_ set packetsize_ $size $cbr_ set rate_ $rate $cbr_ attach-agent $agent_src $ns at $start_time "$cbr_ start" $ns at $end_time "$cbr_ stop"} I made the connection of the udp agents outside the procedure , when I call the procedure, in the NAM environment no traffic was generated , Thanks for your help nabila _ Your smile counts. The more smiles you share, the more we donate. Join in. www.windowslive.com/smile?ocid=TXT_TAGLM_Wave2_oprsmilewlhmtagline Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs