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

Re: Problem with CBQ and TCP Traffic



Oscar,

Are you by any chance using the daily snapshot?  If so, then I suggest
that you download the snapshot tomorrow and see if the problem still
exists.  

Nader

>>> "Oscar" == Oscar Rodriguez <[email protected]> writes:

Oscar> Hi, I'm trying to use a CBQ queue with TCP traffic, but I get
Oscar> the following error:

Oscar> ns: _o34 unknown-flow 1280 768 3 3: (_o34 cmd line 1) invoked
Oscar> from within "_o34 cmd unknown-flow 1280 768 3 3" invoked from
Oscar> within "catch "$self cmd $args" ret" (procedure "_o34" line 2)
Oscar> (SplitObject unknown line 2) invoked from within "_o34
Oscar> unknown-flow 1280 768 3 3"

Oscar> The code that I'm using is the following:

Oscar> proc finish {} { global ns nf sender receiver $ns flush-trace
Oscar> close $nf close $sender close $receiver exit 0 }

Oscar> proc attach-expoo-traffic { node sink size burst idle rate
Oscar> type} { #Get an instance of the simulator set ns [Simulator
Oscar> instance] #Create a UDP agent and attach it to the node set
Oscar> source [new $type] $ns attach-agent $node $source #Create an
Oscar> Expoo traffic agent and set its configuration parameters set
Oscar> traffic [new Traffic/Expoo] $traffic set packet-size $size
Oscar> $traffic set burst-time $burst $traffic set idle-time $idle
Oscar> $traffic set rate $rate #Attach the traffic agent to the
Oscar> traffic source $source attach-traffic $traffic #Connect the
Oscar> source and the sink $ns connect $source $sink return $source }


Oscar> #Create link between n1 and n2 ##############################
Oscar> proc setupLink {n1 n2 bw delay qtype} { global ns

Oscar> $ns duplex-link $n1 $n2 $bw $delay $qtype

Oscar> #if queue type is CBq, then setup CBQ queue
Oscar> ########################################### if { "$qtype" ==
Oscar> "CBQ" } { setupCBQ $n1 $n2 } }


Oscar> #Setup a CBQ Queue. Create two queues: # audioClass: audio
Oscar> queue. Priority 0 (highest) # dataClass : data queue. Priority
Oscar> 1 ############################################### proc setupCBQ
Oscar> {n1 n2} { global ns

Oscar> #Get link ######### set cbqlink [$ns link $n1 $n2]
	
Oscar> #Create classes for the queue ############################# set
Oscar> topClass [new CBQClass] set audioClass [new CBQClass] set
Oscar> dataClass [new CBQClass]

Oscar> #Install DropTail queue in audioClass and dataClass
Oscar> ################################################### $audioClass
Oscar> install-queue [new Queue/DropTail] $dataClass install-queue
Oscar> [new Queue/DropTail]

Oscar> #set parameters for audioClass and dataClass
Oscar> ############################################ # parent borrow?
Oscar> bw all. delay prty type extra delay # ------ ------- -------
Oscar> ----- ----- ---- ----------- $topClass setparams none 0 0.50
Oscar> auto 8 2 0 $audioClass setparams $topClass true 0.11 auto 1 1 0
Oscar> $dataClass setparams $topClass true 0.40 auto 2 1 0

Oscar> #Insert new classes into the link
Oscar> ################################# $cbqlink insert $topClass
Oscar> $cbqlink insert $audioClass $cbqlink insert $dataClass
	
Oscar> #Attach flow ids to each queue ##############################
Oscar> $cbqlink bind $audioClass 0 2 $cbqlink bind $dataClass 3 10 }

Oscar> ################ # MAIN PROGRAM # ################

Oscar> #Some important variables ########################

Oscar> #Start environment ################## set ns [new Simulator]
Oscar> $ns color 1 Red $ns color 2 Yellow $ns color 3 Blue $ns color 4
Oscar> Green

Oscar> #Trace files ############ set nf [open out.nam w] $ns
Oscar> namtrace-all $nf set sender [open out.log w] set receiver [open
Oscar> in.log w]

Oscar> #Create nodes ############# set C0 [$ns node] set C1 [$ns node]
Oscar> set t1 [$ns node] set t2 [$ns node] set c1 [$ns node] set c2
Oscar> [$ns node]


Oscar> #Set up links between nodes ########################### #Hop
Oscar> links ########## setupLink $C0 $C1 1.5Mb 5ms CBQ #Transmision
Oscar> link ################# setupLink $t1 $C0 64Kb 5ms DropTail
Oscar> setupLink $t2 $C0 64Kb 5ms DropTail #Recepcion link
Oscar> ############### setupLink $C1 $c1 64Kb 5ms DropTail setupLink
Oscar> $C1 $c2 1.5Mb 5ms DropTail

Oscar> #TEST TEST TEST set tcp_src1 [new Agent/TCP] set tcp_src2 [new
Oscar> Agent/TCP] set tcp_snk1 [new Agent/TCPSink] set tcp_snk2 [new
Oscar> Agent/TCPSink] $ns attach-agent $t2 $tcp_src1 $ns attach-agent
Oscar> $c2 $tcp_snk1 $ns attach-agent $c2 $tcp_src2 $ns attach-agent
Oscar> $t2 $tcp_snk2 $tcp_src1 set fid_ 3 $tcp_src2 set fid_ 4 $ns
Oscar> connect $tcp_src1 $tcp_snk1 $ns connect $tcp_src2 $tcp_snk2 set
Oscar> ftp1 [$tcp_src1 attach-source FTP] set ftp2 [$tcp_src2
Oscar> attach-source FTP] #TEST TEST TEST

Oscar> #Create sinks ############# set null1 [new Agent/LossMonitor]
Oscar> $ns attach-agent $c1 $null1

Oscar> #Create agents ############## set cbr1 [attach-expoo-traffic
Oscar> $t1 $null1 200 2s 1s 64k Agent/CBR/UDP] $cbr1 set fid_ 1

Oscar> #Connect agents ############### $ns connect $cbr1 $null1

Oscar> #Set trace files ################ #$ns trace-queue $t1 $C0
Oscar> $sender #$ns trace-queue $C2 $c1 $receiver

Oscar> #Start the simulation ##################### #$ns at 0.0
Oscar> "result" $ns duplex-link-op $C0 $C1 queuePos 0.5 $ns at 0.5
Oscar> "$cbr1 start" $ns at 1.0 "$ftp1 start" $ns at 2.0 "$ftp2 start"
Oscar> $ns at 90.6 "$cbr1 stop" $ns at 100.0 "finish"

Oscar> Everything works OK except for the part that is between the
Oscar> TEST comments. If I change the queue between C0 and C1 to a
Oscar> DropTail queue, the simulation works. If I change the queue
Oscar> back again to a CBQ queue, I get the previous error message.

Oscar> I'm new to ns and it is very probably that I'm doing something
Oscar> wrong.  Any clue?

Oscar> Thanks,

Oscar> Oscar.