Hi,
I'm new at ns. I want to analyze mm1 queue and confirm E[N].
I got all the output files. But when i run the nam, i saw that there is not any
packet which goes from node 0 to node 1. How can this happen?
I made the link bandwidth small (set link [$ns simplex-link $n1 $n2 1kb 0ms
DropTail]) and i saw that the packet dropped from node 0 before they go to1.
Shouldn't they would drop near node 1. I think the packets are at the buffer of
npde 1. Why couldn't i see the packets which goes from node 0 to 1?
The tcl code is below:
set ns [new Simulator]
set nf [open out1.nam w]
$ns namtrace-all $nf
set tf [open out.tr w]
$ns trace-all $tf
set lambda 30.0
set mu 33.0
set n0 [$ns node]
set n1 [$ns node]
set link [$ns simplex-link $n0 $n1 100kb 0ms DropTail]
$ns queue-limit $n0 $n1 100000
set InterArrivalTime [new RandomVariable/Exponential]
$InterArrivalTime set avg_ [expr 1/$lambda]
set pktSize [new RandomVariable/Exponential]
$pktSize set avg_ [expr 1000000.0/(8*$mu)]
set src [new Agent/UDP]
$ns attach-agent $n0 $src
set qmon [$ns monitor-queue $n0 $n1 [open qm.out w] 0.1]
$link queue-sample-timeout
proc finish {} {
global ns tf nf
$ns flush-trace
close $tf
close $nf
exit 0
}
proc sendpacket {} {
global ns src InterArrivalTime pktSize
set time [$ns now]
$ns at [expr $time + [$InterArrivalTime value]] "sendpacket"
set bytes [expr round ([$pktSize value])]
$src send $bytes
}
set sink [new Agent/Null]
$ns attach-agent $n1 $sink
$ns connect $src $sink
$ns at 0.0001 "sendpacket"
$ns at 1000.0 "finish"
$ns run
Thanks,
DJ
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com