Wireless Networking Lab 109: Ad Hoc Routing Basics and DSDV


This assignment aims at making the students familiar with routing protocols used in ad hoc networks and see the performance of DSDV protocol.

Wireless networks can be classified as follows-

1. Infrastructured Networks
This mode bridges a wireless network to a wired Ethernet network. A wireless access point is required for infrastructure mode wireless networking, which serves as the central WLAN communication station to which the mobile clients attach.
The mobile client can move geographically out of range of one base station to the range of another while it is communicating. When it goes, it connects with new base station and starts communicating through it. This results in handoff.

2. Ad Hoc (Infrastructureless) Networks
This mode is a method for wireless devices to directly communicate with each other. Operating in ad-hoc mode allows wireless devices within range of each other to discover and communicate in peer-to-peer fashion without involving central access points.
This is typically used by two PCs to connect to one another as well as for wireless mesh networks.

Ad hoc routing presents challenges due to high mobility and lack of topology information at each client. We have two categories of ad hoc routing-

1. Pro-active (Table-driven) Protocols
These algorithms maintain fresh list of destinations and their routes at each node. eg. Destination-Sequenced Distance-Vector (DSDV)

2. Reactive (On-demand) Protocols
These protocol find a route when needed. eg. Dynamic Source Routing (DSR), Ad Hoc On-Demand Distance Vector Routing (AODV), Temporally Ordered Routing Algorithm (TORA)


DSDV is table-driven routing scheme for ad hoc mobile wireless networks based on the Bellman-Ford algorithm (does that remind you of RIP in fixed networks?). It uses sequence numbers to mark each node to improve upon the loop problem. Routing information is distributed between nodes via sending "full dumps" and incremental updates. "Settling time" metric is used to determine update interval. It is assumed that you know the protocol well before working on this assignment. It is a good idea to read about it before continuing.

Performance Metrics used

We will try to evaluate the routing protocols in terms of two metrics-

1. Packet delivery fraction : It is the ratio of packets delivered to that generated by the traffic generator.
2. Routing load : It is the number of routing packets required to be sent per data packet delivered.

ns2 Instructions

1. Get the tcl script from here.
2. A script "simple-dsdv.tcl" is provided. Script usage is : ns simple-dsdv.tcl
3. The topology consists of 3 nodes spread over 500x400 sq m area. The mobility model is defined to achieve some pre-defined movement between the nodes. Now the packets are routed using DSDV protocol.
4. Determine the performance metrics. For this you need to do calculations using the trace file generated by the name : simple-dsdv.tr
5. Use following command to get the number of packets sent by the traffic source.
grep "^s.*\-Nl AGT.*\-It tcp.*" simple-dsdv.tr | wc -l
Now, use following command to get the actual number of packets received at the destination.
grep "^r.*\-Nl AGT.*\-It tcp.*" simple-dsdv.tr | wc -l
6. Calculate Packet Delivery Fraction using (received packets/sent packets)
7. Use following command to get the total number of routing packets sent.
grep "^\(s\|f\).*\-Nl RTR.*\-It message.*" simple-dsdv.tr | wc -l
8. Calculate Routing Load using (routing packets/received packets)


1. Now that we have simulated first routing protocol, let's analyse the scenario. Wireless routing is much more challenging than wired networks due to the mobility involved. Hence, it is important to understand the performance of routing protocols with variation in mobility. The metrics we have used here are the basic ones and you can think of others too. What do pdf and routing load signify? Try to think what should be the ideal value of these metrics.
2. One other metric used to evaluate routing protocols is Average End to End packet delivery time. How will you find it? Try calculating it for the trace file you have obtained.
3. Try to jot down some points of difference between wired and wireless routing.
4. You will need to use the trace files calculation in many ns2 simulations. Hence, it is good to get familiar with the trace file formats. Go through the sections 16.1.6 and 16.1.7 of the ns2 manual. Can you now make out the use of grep commands provided in this assignment?


1. A guide for new ns2 trace formats specific to DSDV.
2. Performance evaluation of routing protocols for ad hoc wireless networks