TY B.Tech Computer Engineering 2018 Course Wireless Network Sensor Lab
TY B.Tech Computer Engineering 2018 Course Wireless Network Sensor Lab
SUBMITTED TO:
PROF. NITIN SAKHARE
BY:
Aim: Simulate the transmission of ping messages over a network topology consisting of 6
nodes.
Methodology:
1)Open ns2g2.jar by right clicking on the jar file and choosing open with java. Ns2g2.jar file
is java dependent.
3)The node tab is to be selected next to place the nodes on the grid. This program requires the
user to have 6 nodes in the network. Draw 6 nodes on the network.
4)The link tab provides the user to link the nodes in the grid. Connect all the nodes.
Select Link type as duplex(bi-directional link), Queue type as Droptail(indication stating the
packets are to be dropped at destination only), capacity as 1Mbps, propagation
delay as 10ms and queue size as desirable(i.e 5, 10, etc.)
5)After finishing the topology, click on TCL tab. It generates the code and save it where
required as a .tcl file.
6)After saving, open the file in a text editor.(like nano, gedit, vi etc)
7)Now enter the following code under the agent definition header:
CODE:
proc sendPingPacket {} {
//global objects
//when the current simulation time($now) + time($time = 0.01) occurs a ping is sent to
the destination
//pingPacket is sent
}
//In the Tcl code, a procedure 'Agent/Ping recv {from rtt}' has to be defined which allows
the user to react to the ping result.
global seq
11)In nam, click on the play button and simulation will be run.
12)Once the simulation ends, in the terminal, type cat out.tr | grep ^d | wc -l to know
the number of packets dropped.
Snapshots:
Output: