Wireless and Networking Lab EC7712 Ns2 Lab Module: Submitted by R.Nishanth 2016504562
Wireless and Networking Lab EC7712 Ns2 Lab Module: Submitted by R.Nishanth 2016504562
EC7712
NS2 LAB MODULE
Submitted by
R.NISHANTH
2016504562
Distance Vector Routing Protocol
AIM:
To simulate and study the Distance Vector routing algorithm using simulation.
SOFTWARE REQUIRED:
NS-2 simulator
Network Animator
THEORY:
Distance Vector Routing is one of the routing algorithm in a Wide Area Network for computing
shortest path between source and destination. The Router is one main devices used in a wide area
network. The main task of the router is Routing. It forms the routing table and delivers the packets
depending upon the routes in the table either directly or via an intermediate devices.Each router
initially has information about its all neighbors. Then this information will be shared among nodes.
ALGORITHM:
1. Create a simulator object
3. Open a nam trace file and define finish procedure then close the trace file, and execute nam on
trace
file.
PROGRAM:
set ns [new Simulator]
proc finish { } {
global ns nr nf
$ns flush-trace
close $nf
close $nr
exit 0
$ns rtproto DV
$ns at 45 "finish"
$ns run
Throughput File:
BEGIN {
thput=0
sTime=0
}
{
event=$1
time=$2
intSrc=$3
intDest=$4
src=$9
dest=$10
size=$6
if (event=="r" && intDest==dest) {
thput+=size
sTime=time
}
}
END {
thput=(thput*8)/(1000*sTime)
printf("Throughput = %g Kbps \n",thput)
}
TOPOLOGY:
Trace File:
Throughput Analysis:
End to end delay Analysis:
RESULT:
Thus the Distance vector Routing Algorithm was Simulated and studied.