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

[ns] Packets lost



Hello everybody,

I am using TCP agent, and FTP application to do simulation.
node n0, n1 and n2.

n0 ---------------- n1 -----------n2
       10Mb		  1Mb

I set the queue limit is 10:
$ns queue-limit $n1 $n2 10

I send data from node n0:
$cbr0 set packetSize 500
$cbr0 set interval_ 0.0001

but according to the trace file, there are only 3 packets lost. I can not
understand this? does anybody explain or give me some advice?

Thank you very much.

Appending my simple script:

set ns [new Simulator]
# initialise the simulation
# Predefine tracing
set f [open out.tr w]
$ns namtrace-all $f

set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
$ns duplex-link $n0 $n1 10Mb 10ms DropTail
$ns duplex-link $n1 $n2 1Mb 20ms DropTail
$ns queue-limit $n1 $n2 10

# A FTP over TCP from $n1 to $n2
set tcp [new Agent/TCP]
$ns attach-agent $n0 $tcp
set sink [new Agent/TCPSink]
$ns attach-agent $n2 $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $tcp
$cbr0 set packetSize 500
$cbr0 set interval_ 0.0001
$ns connect $tcp $sink

$ns at 0.1 "$cbr0 start"
$ns at 1.35 "$ns detach-agent $n0 $tcp ; $ns detach-agent $n2 $sink"
$ns at 3.0 "finish"
proc finish {} {
global ns f
$ns flush-trace
close $f
#close $nf
puts  "running nam..."
exec nam out.nam &
exit 0 }
$ns run