In the end I found this way of simulating the M/D/1 queue:
set lambda 16.0
set mu 20.0
set link [$ns simplex-link $n0 $n1 1Mb 0ms DropTail]
set InterArrivalTime [new RandomVariable/Exponential]
$InterArrivalTime set avg_ [expr 1/$lambda]
set pktSize [new RandomVariable/Constant]
$pktSize set val_ [expr 1500.0/$mu]
set src [new Agent/UDP]
$src set packetSize_ 1500
$ns attach-agent $n0 $src
set sink [new Agent/Null]
$ns attach-agent $n1 $sink
$ns connect $src $sink
proc sendpacket {} {
global ns src InterArrivalTime pktSize
set time [$ns now]
$ns at [expr $time + [$InterArrivalTime value]] "sendpacket"
set bytes [$pktSize value]
$src send $bytes
}
The problem I have concerns the constant variable pktSize. I found the simulation of an M/m/1 queue in a tutorial
http://www-sop.inria.fr/maestro/pers....Altman/ns.htm It used this value for pktSize:
set pktSize [new RandomVariable/Exponential]
$pktSize set avg_ [expr round (100000.0/(8*$mu))]
In the tutorial it was implied that in order to simulate
an M/D/1 queue one has only to replace the exponential pktSize with its average.
Because I want the packet size to be 1500 bytes and the packet processing rate to be deterministic, I tried:
$pktSize set val_ 1500
$pktSize set val_ [expr 1500.0/$mu]
Both times the queue is empty and the number of packets received by the sink is 16.028. In the first case the size of the packets is 1 according to the trace file, while in the second case it is 7. And that even though I have specified that the packet size ought to be 1500bytes. Does anyone know the rate at which a null agent processes the packets it receives? Obviously I am doing something wrong with specifying the service rate and the packet size. Any help would be very welcome. Thanks.