set ns [new Simulator] set n0 [$ns node] set n1 [$ns node] set f [open out.tr w] $ns trace-all $f # install a duplex link with WFQ queues at both ends $ns duplex-link $n0 $n1 5Mb 2ms WFQ 10 # create an instance of the classifier suited for flow aggregation set cl [new WFQAggregClassifier] # install the classifier on the WFQ server at node $n0 heading at nt $n1 $ns wfqclassifier-install $n0 $n1 $cl # in this example we have a flow for each queue but # more than one flow can be assigned to the same WFQ server queue(PGPS session) $cl setqueue 0 3; # fid 0 -> WFQ server queue 3 $cl setqueue 1 4; # fid 1 -> WFQ server queue 4 #we set WFQ server queue weights $cl setweight 3 .5; # WFQ server queue 3 has weight .5 $cl setlength 3 13; # WFQ server queue 3 has length 13 packets $cl setweight 4 .2; # WFQ server queue 5 has weight .2 $cl setlength 4 20; # WFQ server queue 5 has length 20 packets set udp0 [new Agent/UDP] $ns attach-agent $n0 $udp0 $udp0 set fid_ 0; # this is the info used by WFQ classifier set cbr0 [new Application/Traffic/CBR] $cbr0 attach-agent $udp0 set udp1 [new Agent/UDP] $ns attach-agent $n0 $udp1 $udp1 set fid_ 1; # this is the info used by WFQ classifier set cbr1 [new Application/Traffic/CBR] $cbr1 attach-agent $udp1 set null0 [new Agent/Null] $ns attach-agent $n1 $null0 set null1 [new Agent/Null] $ns attach-agent $n1 $null1 $ns connect $udp0 $null0 $ns connect $udp1 $null1 $ns at 1.0 "$cbr0 start" $ns at 1.1 "$cbr1 start" $ns at 3.0 "finish" proc finish {} { global ns f $ns flush-trace close $f exit 0 } $ns run