Documente Academic
Documente Profesional
Documente Cultură
Aim: Simulate a three node point to point network with duplex links between them. Set queue size and
vary the bandwidth and find number of packets droppe.
Program:
$ns trace-all $f
proc finish {} {
global f nf ns
$ns flush-trace
close $f
close $nf
exit 0
$ns run
OUTPUT
Experiment No: 2 TRANSMISSION OF PING MESSAGE
Aim:Simulate the transmission of ping messages over a network topology consisting of 6 nodes and find
the number of packets dropped due to congestion.
Program:
$ns trace-all $f
proc finish {} {
global ns f nf
$ns flush-trace
close $f
close $nf
exit 0
global seq
puts "The node [$node_ id] received an ACK from the node $from
$ns run
OUTPUT
Aim: Simulate an Ethernet LAN using „n‟ nodes and set multiple traffic nodes and plot congestion
window for different source / destination.
Program:
proc finish {} {
$ns flush-trace
close $f
close $nf
exit 0
$ns make-lan "$n0 $n1 $n2 $n3 $n4 $n5 $n6 $n7" 10Mb 30ms LL
Queue/DropTail Mac/802_3
global ns
$ns run
OUTPUT
Aim:Simulate simple ESS and with transmitting nodes in wireless LAN by simulation and determine the
performance with respect to transmission of packets.
Program:
create-god $val(nn)
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channelType $val(chan) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace ON
# Node Creation
$node1 set Z_ 0
$node2 set Z_ 0
proc stop {} {
$ns flush-trace
close $namfile
close $tracefile
#Starting scheduler
$ns run
OUTPUT
Experiment 5 & 6:
Implement and study the performance of GSM & CDMA on NS3 (Using MAC
layer) or equivalent Environment
Program
# General Parameters
set opt(ecn) 0 ;
set opt(window) 30 ;
# Topology
set opt(type) gsm ; #type of link:
# AQM parameters
set opt(minth) 5 ;
set opt(maxth) 10 ;
set opt(adaptive) 1 ; # 1 for Adaptive RED, 0 for plain RED
#default downlink bandwidth in bps
set bwDL(gsm) 9600
#default uplink bandwidth in bps
set bwUL(gsm) 9600
#default downlink propagation delay in seconds
set propDL(gsm) .500
#default uplink propagation delay in seconds
set propUL(gsm) .500
#default buffer size in packets
set buf(gsm) 10
BEGIN {
PacketRcvd=0;
Throughput=0.0;
}
{
if(($1=="r") && ($5=="tcp") && ($10=4.0))
{
PacketRcvd++;
}
}
END {
Throughput=((PacketRcvd*1000*8)/(95.0*1000000));
printf("packet received:%f\n", PacketRcvd);
printf( "the throughput is:%f\n",Throughput);
}
OUTPUT