[Paper Review] A Tutorial on the Implementation of Ad-hoc On Demand Distance Vector (AODV) Protocol in Network Simulator (NS-2)
This tutorial provides a comprehensive guide to implementing the AODV routing protocol in NS-2, targeting novice users and researchers. It details the protocol's flow, trace format, and core implementation files, including timers, routing table management, neighbor discovery, and packet handling, enabling users to extend or customize AODV for ad hoc networks.
The Network Simulator (NS-2) is a most widely used network simulator. It has the capabilities to simulate a range of networks including wired and wireless networks. In this tutorial, we present the implementation of Ad Hoc On-Demand Distance Vector (AODV) Protocol in NS-2. This tutorial is targeted to the novice user who wants to understand the implementation of AODV Protocol in NS-2.
Motivation & Objective
- To provide a step-by-step guide for implementing the AODV protocol in NS-2 for researchers and students.
- To explain the internal flow and event handling of AODV, including routing table, neighbor, and broadcast ID management.
- To enable users to extend or customize AODV by understanding key implementation files and functions.
- To clarify the trace format used in NS-2 for debugging and analyzing AODV behavior.
- To demonstrate how to enable Hello packets and configure timers for reliable neighbor discovery.
Proposed method
- The tutorial uses NS-2 version 2.32 and 2.33 to explain AODV's implementation through core files: aodv.cc, aodv.h, and supporting files like aodv_rtable.h and aodv_rqueue.cc.
- It explains the use of timers such as the Hello Timer and Broadcast Timer to manage periodic Hello packet transmission and route purging.
- The protocol flow is traced from node configuration via the Command function to packet reception and processing through recvAODV, which classifies incoming packets by type.
- Key functions include rt_update for route updates, rt_down for route invalidation, and rt_purge for removing expired routes and forwarding buffered packets.
- Neighbor management is handled via nb_insert, nb_lookup, and nb_delete, with nb_purge running every 1.5×HELLO_INTERVAL to remove stale entries.
- Packet transmission and reception are managed through sendRequest, sendReply, sendError, and recv functions that handle RREQ, RREP, RERR, and HELLO packets.
Experimental results
Research questions
- RQ1How is the AODV protocol implemented in NS-2, and what are the key components of its code structure?
- RQ2What is the role of timers such as the Hello Timer and Broadcast Timer in maintaining route and neighbor information?
- RQ3How does AODV handle route discovery, maintenance, and failure recovery through its core functions?
- RQ4What is the trace format used in NS-2 to monitor AODV packet events and network behavior?
- RQ5How can users enable and configure Hello packets for neighbor detection in AODV?
Key findings
- The AODV protocol in NS-2 uses a Hello Timer to broadcast Hello packets every 1.5×HELLO_INTERVAL seconds, with a random interval between MinHelloInterval and MaxHelloInterval to avoid synchronization.
- When a node receives a HELLO packet, it updates the neighbor's expiry time to CURRENT_TIME + (1.5 × ALLOWED_HELLO_LOSS × HELLO_INTERVAL), where ALLOWED_HELLO_LOSS is set to 3 packets.
- The rt_purge function removes expired routes, drops packets in the send buffer, and triggers a new RREQ if a route is down and packets are queued.
- The sendRequest function is invoked when a node lacks a route to a destination, initiating a new route discovery process by flooding RREQ packets.
- The recvAODV function classifies incoming AODV packets and dispatches them to specific handlers like recvRequest, recvReply, recvError, and recvHello based on packet type.
- The protocol supports local route repair by buffering packets and re-initiating route discovery when a link failure is detected, improving robustness in dynamic networks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.