Simulation 1
Simulation 1
Set
the queue size, vary the bandwidth and find the number of packets dropped.
#Create Simulator
set ns [new Simulator]
#Open Trace file and NAM file
set ntrace [open prog1.trw]
$ns trace-all $ntrace
set namfile [open prog1.nam w]
$ns namtrace-all $namfile
AWK File:
BEGIN {
count=0;
}
{
if ($1==” d”)
count++;
}
END {
printf(“no. of packets dropped is %d\n”,count);
}
Command:
awk -f lab1.awk prog1.tr