[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Question on CBQ
> Hi:
>
> I am new to ns and I am trying to setup a priority queue in my node.
> I saw your question regarding CBQ on the ns mailing archive and we
got the same error with what you got and I don't know what's wrong with it
> too. It complains about the unknown flow. Here is my script and the
> error message. Would you please give me some suggestion on this
problem? How did you solve your problem last time? Thank you very much
>
-------------------------------------------------------------------------
> #Create a simulator object
> set ns [new Simulator]
>
> #Define different colors for data flows
> #Green for High Priority Traffic
> $ns color 1 Green
>
> #Black for Normal Priority Traffic
> $ns color 2 Blue
>
> #Red for Low Priority Traffic
> $ns color 3 Red
>
> #Open a file for writing that is going to be used for the nam trace data
> set nf [open out.nam w]
> $ns namtrace-all $nf
>
> proc finish {} {
>
> global ns nf
>
> $ns flush-trace
>
> close $nf
>
> exec /usr/home/e497vl/ns/ns-allinone-2.1b5/nam-1.0a7/nam out.nam &
>
> exit 0
>
> }
>
>
> $ns at 5.0 "finish"
>
>
>
> #Create six nodes, 5 links
>
> set HPTS [$ns node]
> set NPTS [$ns node]
> set LPTS [$ns node]
> set GGSN [$ns node]
> set SGSN [$ns node]
> set BSS [$ns node]
>
> $ns duplex-link $HPTS $GGSN 1Mb 10ms DropTail
> $ns duplex-link $NPTS $GGSN 1Mb 10ms DropTail
> $ns duplex-link $LPTS $GGSN 1Mb 10ms DropTail
> $ns duplex-link $GGSN $SGSN 500Kb 10ms DropTail
> $ns duplex-link $SGSN $BSS 500Kb 10ms CBQ
>
> $ns duplex-link-op $HPTS $GGSN orient right-down
> $ns duplex-link-op $NPTS $GGSN orient right
> $ns duplex-link-op $LPTS $GGSN orient right-up
> $ns duplex-link-op $GGSN $SGSN orient right
> $ns duplex-link-op $SGSN $BSS orient right
>
>
>
> #Priority Queue
> set cbqlink [$ns link $SGSN $BSS]
>
> set highPrio [new CBQClass]
> set normalPrio [new CBQClass]
> set lowPrio [new CBQClass]
>
>
> #classname setparams parent borrow_unused_bandwidth bandwidth ? priority
> delay
> $highPrio setparams none 0 0.3 auto 3 1 0
> $normalPrio setparams $highPrio true 0.35 auto 2 1 0
> $lowPrio setparams $normalPrio true 0.35 auto 1 1 0
>
> set q1 [new Queue/DropTail]
> $q1 set limit_ 20
> set q2 [new Queue/DropTail]
> $q2 set limit_ 30
> set q3 [new Queue/DropTail]
> $q3 set limit_ 30
>
> $highPrio install-queue $q1
> $normalPrio install-queue $q2
> $lowPrio install-queue $q3
>
> $cbqlink insert $highPrio
> $cbqlink insert $normalPrio
> $cbqlink insert $lowPrio
>
> $cbqlink bind $highPrio 1
> $cbqlink bind $normalPrio 2
> $cbqlink bind $lowPrio 3
>
> #Monitor the queue for the link between node 2 and node 3
> $ns duplex-link-op $GGSN $SGSN queuePos 0.5
>
>
>
> #TCP connection between HPTS to BSS
>
> set tcp0 [new Agent/TCP]
> $ns attach-agent $HPTS $tcp0
> $tcp0 set fid_ 1
> $tcp0 set packetSize_ 114
> $tcp0 set interval_ 0.005
>
>
>
> #TCP connection between NPTS to BSS
>
> set tcp1 [new Agent/TCP]
> $ns attach-agent $NPTS $tcp1
> $tcp1 set fid_ 2
> $tcp1 set packetSize_ 114
> $tcp1 set interval_ 0.005
>
>
>
> #TCP connection between LPTS to BSS
>
> set tcp2 [new Agent/TCP]
> $ns attach-agent $LPTS $tcp2
>
> $tcp2 set fid_ 3
> $tcp2 set packetSize_ 114
> $tcp2 set interval_ 0.005
>
> $cbqlink bind $highPrio 1
> $cbqlink bind $normalPrio 2
> $cbqlink bind $lowPrio 3
>
> #Sink
> set sink0 [new Agent/TCPSink]
> $ns attach-agent $BSS $sink0
> set sink1 [new Agent/TCPSink]
> $ns attach-agent $BSS $sink1
> set sink2 [new Agent/TCPSink]
> $ns attach-agent $BSS $sink2
>
>
>
> #FTP Traffic from High Priority Traffic Source
>
> set ftp0 [new Application/FTP]
> $ftp0 attach-agent $tcp0
> $ns at 1.5 "$ftp0 start"
> $ns connect $tcp0 $sink0
>
> #FTP Traffic from Normal Priority Traffic Source
>
> set ftp1 [new Application/FTP]
> $ftp1 attach-agent $tcp1
> $ns at 1.0 "$ftp1 start"
> $ns connect $tcp1 $sink1
> #FTP Traffic from Low Priority Traffic Source
>
> set ftp2 [new Application/FTP]
> $ftp2 attach-agent $tcp2
> $ns at 0.5 "$ftp2 start"
> $ns connect $tcp2 $sink2
>
>
> #End Traffic
>
> $ns at 3.5 "$ns detach-agent $HPTS $tcp0 ; $ns detach-agent $BSS $sink0"
> $ns at 4.0 "$ns detach-agent $NPTS $tcp1 ; $ns detach-agent $BSS $sink1"
> $ns at 4.5 "$ns detach-agent $LPTS $tcp2 ; $ns detach-agent $BSS $sink2"
>
> #Start the simulation
>
> $ns run
>
> ----------------------------------------------------------------------
> And the error code is:
>
> ns: _o114 unknown-flow 1282 512 3 3:
> (_o114 cmd line 1)
> invoked from within
> "_o114 cmd unknown-flow 1282 512 3 3"
> invoked from within
> "catch "$self cmd $args" ret"
> (procedure "_o114" line 2)
> (SplitObject unknown line 2)
> invoked from within
> "_o114 unknown-flow 1282 512 3 3"
>
>
> Thank you very much.
>
> Bing-Leung Patrick Cheung
> 4th year computer engineering student
> University of British Columbia
> E-mail: [email protected]