[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
About Ping agent & CBQ
Hi, All,
I run Marc Greis's Ping Agent well, but when I put CBQ link into the Ping
agent, something is wrong...
Now, I attach the error data and TCL script code as follow,
Hope get any helps...
Thx.
zm.
--------------------------
ns: _o25 unknown-flow 256 0 2 2:
(_o25 cmd line 1)
invoked from within
"_o25 cmd unknown-flow 256 0 2 2"
invoked from within
"catch "$self cmd $args" ret"
(procedure "_o25" line 2)
(SplitObject unknown line 2)
invoked from within
"_o25 unknown-flow 256 0 2 2"
-----------------------------------------
#Create a simulator object
set ns [new Simulator]
#Open a trace file
set nf [open out.nam w]
$ns namtrace-all $nf
#Define a 'finish' procedure
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam out.nam &
exit 0
}
#Create three nodes
set n0 [$ns node]
set n1 [$ns node]
#set n2 [$ns node]
#Connect the nodes with two links
$ns duplex-link $n0 $n1 1Mb 10ms CBQ
#Define a 'recv' function for the class 'Agent/Ping'
Agent/Ping instproc recv {from rtt} {
$self instvar node_
puts "node [$node_ id] received ping answer from \
$from with round-trip-time $rtt ms."
}
#Create two ping agents and attach them to the nodes n0 and n2
set p0 [new Agent/Ping]
$ns attach-agent $n0 $p0
set p1 [new Agent/Ping]
$ns attach-agent $n1 $p1
#Connect the two agents
$ns connect $p0 $p1
$p0 set fid_ 1
$p1 set fid_ 2
####################
set qlim 20
set cbq_qtype_ DropTail
set topclass_ [new CBQClass]
$topclass_ setparams none 0 1.0 auto 8 2 0
### audio class
set audioclass_ [new CBQClass]
set q1 [new Queue/$cbq_qtype_]
$q1 set limit_ $qlim
$audioclass_ install-queue $q1
$audioclass_ setparams $topclass_ true 0.1 auto 1 1 0
### data class
set dataclass_ [new CBQClass]
set q2 [new Queue/$cbq_qtype_]
$q2 set limit_ $qlim
$dataclass_ install-queue $q2
$dataclass_ setparams $topclass_ true 0.9 auto 2 1 0
####
set cbqlink [$ns link $n0 $n1]
$cbqlink insert $topclass_
$cbqlink insert $audioclass_
$cbqlink insert $dataclass_
$cbqlink bind $audioclass_ 1
$cbqlink bind $dataclass_ 2
#Schedule events
$ns at 0.2 "$p0 send"
$ns at 0.4 "$p1 send"
$ns at 0.6 "$p0 send"
$ns at 0.6 "$p1 send"
$ns at 1.0 "finish"
#Run the simulation
$ns run