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

question on CBQ



Dear all,
I just begin using the ns to simulate the CBQ and can't find the reason of errors in my script.Please give me some suggestions.
Thanks in advance.
 
My script is as follows:
 

#Create a simulator object

set ns [new Simulator]

#Open the nam trace file

set nf [open out.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 DropTail

$ns duplex-link $n2 $n3 10Mb 100ms DropTail

$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

 

#Monitor the queue for the link between node 3 and node 4

$ns duplex-link-op $n3 $n4 queuePos 0.5

 

#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 100ms

$lowerClass2 setparams $topClass true 0.35 auto 2 1 150ms

 

set q1 [new Queue/DropTail]

$q1 set limit_ 20

set q2 [new Queue/DropTail]

$q2 set limit_ 30

 

$lowerClass1 install-queue $q1

$lowerClass2 install-queue $q2

$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]

$ns attach-agent $n1 $s1

$ns connect $s1 $null1

set exp1 [new Application/Traffic/Exponential]

$exp1 set packet_size_ 210

$exp1 set burst_time_ 500ms

$exp1 set idle_time_ 500ms

$exp1 set rate_ 100k

$exp1 set fid_ 1

$exp1 attach-agent $s1

 

set s2 [new Agent/UDP]

$ns attach-agent $n2 $s2

$ns connect $s2 $null1

set exp2 [new Application/Traffic/Exponential]

$exp2 set packet_size_ 210

$exp2 set burst_time_ 500ms

$exp2 set idle_time_ 500ms

$exp2 set rate_ 100k

$exp2 set fid_ 2

$exp2 attach-agent $s2

#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 out.nam &

exit 0

}

 

$ns at 1.0 "$exp1 start"

$ns at 1.0 "$exp2 start"

$ns at 5.0 "$exp1 stop"

$ns at 5.0 "$exp2 stop"

#Run the simulation

$ns run

The error message is:

 
ns: _o59 unknown-flow 256 768 0 0:
    (_o59 cmd line 1)
    invoked from within
"_o59 cmd unknown-flow 256 768 0 0"
    invoked from within
"catch "$self cmd $args" ret"
    (procedure "_o59" line 2)
    (SplitObject unknown line 2)
    invoked from within
"_o59 unknown-flow 256 768 0 0"