[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Changing the packet type from tcl...






Hi:

	I am stuck with a silly problem that I do not know how to solve. I have a CBR 
Traffic generator over a UDP transport agent and I want to be able to change 
the packet type from PT_CBR to another one that I have defined in 'packet.h'. 
The question is that I want to do it only for some CBR sources in a particular 
simulation, but I do not find the way to do it in the tcl script. I gues that 
it has to do with Otcl, calling the function ptype of the Agent class, but I 
am not able to do it... could anyone help me out with it? Here I send the 
pertinent piece of code...

----------------
set udp1 [new Agent/UDP]
$ns attach-agent $n2 $udp1
$udp1 set fid_ 0

set null1 [new Agent/UDP]
$ns attach-agent $n7 $null1

set cbr1 [new Application/Traffic/CBR]
$cbr1 attach-agent $udp1
$cbr1 set packetsize_ 100
$cbr1 set rate_ 40Kb
$cbr1 set random_ 1

----

And I want to change the packet type of cbr1...

Thanks in advance!!

/Nacho

-- 
Department of Microelectronics and Information Technology
Royal Institute of Technology
http://www.it.kth.se/~nacho/    Tf:+46 706 428596




PGP signature