Write an NS2 script to build 2-node point to point network. Implement three nodes point
– to – point network with duplex links between them. Set the queue size, vary the
bandwidth and find the number of packets dropped.
Write an NS2 script to build 2-node point to point network. Implement three nodes point
– to – point network with duplex links between them. Set the queue size, vary the
bandwidth and find the number of packets dropped.
Answer:
NS-is one of the types simulation (Network Simulation in full) which is used to simulate the networks. It provide simulation for routing both wired and wireless networks.
Script:
Node-link-agent-traffic source
#create 3 nodes
Set n0{$ns node}
Set n1{$ns node}
Set n2{$ns node}
Source label “TCP source”
#create Link between nodes
$ns duplex-link $n0 $ n1 1mb 10ms drop
$ns duplex-link $n1 $n2 1mb 10ms drop
#set queue size
$ns queue-limit $ n0 $n1 10
$ns queue –limit $n1 $n2 10
#Show the number of packets dropped
Exec “The number of packets drops
Exit 0;
Comments
Leave a comment