[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] CBQ and TCP
Dear ns-users,
I have no problem using CBQ with UDP agents but when I try to use TCP agents
instead, I get following message:
ns: _o70 unknown-flow 3 0 2:
(_o70 cmd line 1)
invoked from within
"_o70 cmd unknown-flow 3 0 2"
invoked from within
"catch "$self cmd $args" ret"
(procedure "_o70" line 2)
(SplitObject unknown line 2)
invoked from within
"_o70 unknown-flow 3 0 2"
Here is my tcl-script:
#Create a simulator object
set ns [new Simulator]
# Colors!
$ns color 1 Blue
$ns color 2 Red
#Open the nam trace file
set nf [open totoout.nam w]
$ns namtrace-all $nf
#Create 4 nodes
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
#Connect the nodes
$ns duplex-link $n1 $n3 10Mb 100ms SFQ
$ns duplex-link $n2 $n3 10Mb 100ms SFQ
$ns duplex-link $n3 $n4 1Mb 100ms CBQ
set cbqlink [$ns link $n3 $n4]
$ns duplex-link-op $n1 $n3 orient right-up
$ns duplex-link-op $n2 $n3 orient right
$ns duplex-link-op $n3 $n4 orient right
#Set two leaf classes: lowerClass1 and lowerClass2
set topClass [new CBQClass]
set lowerClass1 [new CBQClass]
set lowerClass2 [new CBQClass]
$topClass setparams none 0 0.80 auto 0 2 0
$lowerClass1 setparams $topClass true 0.35 auto 1 1 0ms
$lowerClass2 setparams $topClass true 0.35 auto 2 1 0ms
set q1 [new Queue/SFQ]
$q1 set limit_ 20
set q2 [new Queue/SFQ]
$q2 set limit_ 30
$lowerClass1 install-queue $q1
$lowerClass2 install-queue $q2
$cbqlink insert $topClass
$cbqlink insert $lowerClass1
$cbqlink insert $lowerClass2
$cbqlink bind $lowerClass1 1
$cbqlink bind $lowerClass2 2
#generate traffic from n1 , n2 to n4 via n3
set null1 [new Agent/Null]
$ns attach-agent $n4 $null1
set s1 [new Agent/UDP]
$s1 set fid_ 1
$ns attach-agent $n1 $s1
$ns connect $s1 $null1
set cbrvoice0 [new Application/Traffic/CBR]
$cbrvoice0 set packetSize_ 50
$cbrvoice0 set interval_ 0.05
$cbrvoice0 attach-agent $s1
set sink1 [new Agent/TCPSink]
$ns attach-agent $n4 $sink1
set tcp0 [new Agent/TCP]
$tcp0 set packetSize_ 500
$tcp0 set interval_ 0.005
$tcp0 set fid_ 2
$ns attach-agent $n1 $tcp0
$ns connect $tcp0 $sink1
set cbrdata0 [new Application/Traffic/CBR]
$cbrdata0 attach-agent $tcp0
#Define a 'finish' procedure
proc finish {} {
global ns nf
$ns flush-trace
#Close the trace file
close $nf
#Execute nam on the trace file
exec nam totoout.nam &
exit 0
}
$ns at 1.0 "$cbrdata0 start"
$ns at 1.0 "$cbrdata0 stop"
$ns at 5.0 "$cbrvoice0 start"
$ns at 5.0 "$cbrvoice0 stop"
$ns at 10.0 "finish"
#Run the simulation
$ns run
Can somemone tell me why it doesn't make???
Thanks,
Gerald