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

About FQ



Hi, folks
This message is about how to use queueing management type FQ. I posted
the similiar question before, but got no response. I have no some
experiments, still could not figure out it.

The code fragment is 

#create topology
NodeTopology/1node instproc init ns {
    $self next

    $self instvar node_
    set node_(r1) [$ns node]
    set node_(k1) [$ns node]
}

Class Topology/nets -superclass NodeTopology/1node
Topology/nets instproc init ns {
    $self next $ns
    $self instvar node_
    $ns simplex-link $node_(r1) $node_(k1) 0.1Mb 0ms FQ
#FQ type is used
    $ns queue-limit $node_(r1) $node_(k1) 10
    if {[$class info instprocs config] != ""} {
	$self config $ns
    }
}

Class Test/1switch -superclass TestSuite
Test/1switch instproc init topo {
	$self instvar net_ defNet_ test_
	set net_	$topo
	set defNet_	nets
	set test_	1switch
	$self next
}
#set up three flows udp1, cbr1, cbr 2 to test FQ
Test/1switch instproc run {} {
	$self instvar ns_ node_ testName_
	
	#create a udp source with fid 0
	set udp1 [new Agent/CBR/UDP]
	$udp1 set fid_ 0

	set expo1 [new Traffic/Expoo]
	$expo1 set packet-size 200
	$expo1 set burst-time 500ms
	$expo1 set idle-time 500ms
	$expo1 set rate 100k
	$udp1 attach-traffic $expo1

	#create two CBR source with fid 1 and 2
	set cbr1 [new Agent/CBR]
	$cbr1 set fid_ 1
	set cbr2 [new Agent/CBR]
	$cbr2 set fid_ 2
	$cbr1 set packetSize_ 200
	$cbr1 set interval_ 50ms
	$cbr2 set packetSize_ 200
	$cbr2 set interval_ 10ms

	$ns_ attach-agent $node_(r1) $udp1
	$ns_ attach-agent $node_(r1) $cbr1
	$ns_ attach-agent $node_(r1) $cbr2

	set recv1 [new Agent/Null]
	$ns_ attach-agent $node_(k1) $recv1

	$ns_ connect $udp1 $recv1
	$ns_ connect $cbr1 $recv1
	$ns_ connect $cbr2 $recv1
	$ns_ at 0.0 "$cbr1 start; $cbr2 start; $udp1 start"


	$self traceQueues $node_(r1) [$self dummpyopenTrace 5.0 $testName_]
	$ns_ run
}

Then, I run my code for 5 minutes. The output from create-trace is

v testName 1switch
+ 0 0 1 cbr 200 ------ 1 0.1 1.0 0 0
+ 0 0 1 cbr 200 ------ 2 0.2 1.0 0 1
+ 0.01 0 1 cbr 200 ------ 2 0.2 1.0 1 2

For me, the result is not right. At least, there are more than
three queue operations in 5 minutes.

Any suggestion, especially from ns developer or FQ user,  is welcome.

--Shaogang 
============================================================================
Web: http://yake.ecn.purdue.edu/~shaogang          Purdue University
Office:  MSEE 292  Phone: (765) 494-0434           W. Lafayette, IN 47907
============================================================================