You are on page 1of 5

Princess Sumaya University for Technology

Communication Network lab

Exp. 3
Simulation of stochastic fairness Queuing and Droptail Queuing

Amjad Khalil Hamad 20080204 Idris Ali Sober

wen . 7/3/2012

1)write the otcl script to construct the network . set $ns $ns set $ns set $ns ns [new Simulator] color 1 Blue color 2 Red nf [open out.nam w] namtrace-all $nf tf [open trace.tr w] trace-all $tf

proc finish {} { global ns nf tf $ns flush-trace close $nf close $tf exec nam out.nam & exit 0 } set set set set $ns $ns $ns n0 [$ns node] n1 [$ns node] n2 [$ns node] n3 [$ns node] duplex-link $n0 $n2 1Mb 10ms SFQ duplex-link $n1 $n2 1Mb 10ms SFQ duplex-link $n2 $n3 1Mb 10ms SFQ

$ns duplex-link-op $n0 $n2 orient right-down $ns duplex-link-op $n1 $n2 orient right-up $ns duplex-link-op $n2 $n3 orient right $ns duplex-link-op $n2 $n3 queuePos 0.5 set udp0 [new Agent/UDP] $ns attach-agent $n0 $udp0 set cbr0 [new Application/Traffic/CBR] $cbr0 set packetSize_ 500 $cbr0 set interval_ 0.005 $cbr0 attach-agent $udp0 $udp0 set class_ 1 set udp1 [new Agent/UDP] $ns attach-agent $n1 $udp1 set cbr1 [new Application/Traffic/CBR] $cbr1 set packetSize_ 500 $cbr1 set interval_ 0.005 $cbr1 attach-agent $udp1 $udp1 set class_ 2 set null0 [new Agent/Null]

$ns attach-agent $n3 $null0 $ns connect $udp0 $null0 $ns connect $udp1 $null0 $ns $ns $ns $ns $ns $ns at 0.5 at 1.0 at 4.0 at 4.5 at 5.0 run "$cbr0 start" "$cbr1 start" "$cbr1 stop" "$cbr0 stop" "finish"

a ) The simulation result ,using droptail queuing :

b) The simulation result ,using SF queuing (SFQ):

2 )for the droptail queue . a- when did the path from n0 to n3 start ? at .5 sec b- when did the path from n1 to n3 start ? at 1 sec c-on which link did dropping occur? n2 n3 link d-which traffic is being dropped? blue

3) a- notice what changes occurred when SFQ was used instead of DropTail? SFQ dropped red and blue , droptail gave priority to the late comer "dropped blue" b- for both Droptail and sfq dropping occurred , explain mathematically? the capacity for n1 n3 link is 1Mbps . same as n2 n3 link . when you add them together they will be 2Mbps and the capacity for so drop will be occurred . link n3 n4 is 1Mbps .

4)Based on the results from the trace file where SfQ is used : a- when did n3 receive the first packet? @ .528 sec

b- which node transmitted this packet? node 0 c- how long does it take to travel the whole distance from the source to destination ? .028 sec d- find Tdrop? 1.144 sec e- what was the duration of dropping ? 1.114 to 4.089 4.089-1.114 = 2.975 sec f- how long did the network work without dropping ? (5-4.089)+(1.114-.5)=1.525 sec g- trace the packer which has the ID number 219 , when was it recived by n3? By whom it was transmitted? n0 to n3 and it received at 1.4 sec .

You might also like