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

Why?



Hello,
     In my current simulation, I define the following topology.

node 0--+                       +--node 10
node 1--+                       +--node 11
node 2--+--node 5 ------node 9--+--node 12
node 3--+                       +--node 13
node 4--+                       +--node 14


I defined each link between node(0-4) to node with the bandwidth 0.85Mb
and the link between node 5 to node 9 with the bandwidth 4.126MB

I defined the agents below:
...

for {set i 0} {$i<5} {incr i} {
	set cbr($i) [new Agent/CBR]
	$ns attach-agent $n($i) $cbr($i)
	$cbr($i) set packetSize_ 500
	$cbr($i) set interval_ 0.008
	$cbr($i) set random_ 1
	$cbr($i) set fid_ 1
}

for {set i 5} {$i<10} {incr i} {
        set udp($i) [new Agent/UDP]
        $ns attach-agent $n([expr $i - 5]) $udp($i)
	set cbr($i) [new Application/Traffic/CBR]
	$cbr($i) attach-agent $udp($i)
	$cbr($i) set packetSize_ 500
	$cbr($i) set interval_ 0.008
	$cbr($i) set random_ 1
	$cbr($i) set fid_ 2
       set null($i) [new Agent/Null]
        $ns attach-agent $n([expr $i + 5]) $null($i)
        $ns connect $udp($i) $null($i)
        $ns at 1.0 "$cbr($i) start"
	$ns at 200 "$cbr($i) stop"
}

for {set i 10} {$i<15} {incr i} {
	set sink($i) [new Agent/LossMonitor]
	$ns attach-agent $n($i) $sink($i)
	$ns connect $cbr([expr $i-10]) $sink($i)
}

for {set i 0} {$i<5} {incr i} {
	$ns at 130.0 "$cbr($i) start"
	$ns at 200.0 "$cbr($i) stop"
}

...


The strange thing is, in my simulation process, there is no packets 
lost.
There should be some packets lost because:
each cbr agent should send at least  (1/0.008)*500*8 = 500000 bits per 
second.
And each node(0-4) has two cbr agents, so each node should send at 
least 1Mb per second 130s after the simulation begin.
So, it is respectively above the bandwidths of the links between 
node(0-4) and node 5. At the same time, they together should be at 
least 5Mb, and it also bigger than the bandwidth of the link between 
node5 and node9. So, there should be packet loss at node0, node1, 
node2, node3, node4 and node5. 
Here, I did not define big buffer in each link.

So, why there is no packet loss in the real simulation?

Many thanks,
       Sun Kai