AODV External Gateway Routing¶
Goals¶
In typical Mobile Ad Hoc Networks (MANETs), all nodes participate in the same routing protocol. However, in real-world scenarios, it’s often necessary to route traffic between a MANET and an external network that uses different routing mechanisms. This showcase demonstrates AODV routing with external gateway support, where AODV-enabled wireless nodes can communicate with hosts on a conventional wired network through a designated gateway router.
The goal of this showcase is to demonstrate how AODV’s external gateway feature enables seamless routing between an ad hoc wireless network and a traditional Ethernet-based network infrastructure.
4.6The Model¶
The Network¶
This showcase uses the AODVNetwork network, defined in
AODVNetwork.ned.
The network contains:
20 mobile wireless hosts of type AodvRouter, equipped with AODV routing protocol and wireless interfaces
A gateway router (also of type AodvRouter) that has both wireless and Ethernet interfaces, connecting the wireless and wired segments
An Ethernet switch for the wired network
An Ethernet host representing a destination on the wired network
All wireless hosts are mobile nodes that form an ad hoc network using AODV routing. The gateway router participates in the AODV network via its wireless interface and forwards traffic to the wired network via its Ethernet interface.
AODV External Gateway Configuration¶
The key feature demonstrated in this showcase is AODV’s external gateway
support. In INET’s AODV implementation, the Aodv module provides a
gatewayAddress parameter that designates which node should act as the
gateway for routing traffic to external (non-AODV) destinations.
All AODV nodes are configured with the router as the gateway:
**.aodv.gatewayAddress = "router"
This configuration tells all AODV nodes that when they need to send packets to
destinations outside the AODV network, they should route them towards the
router, which serves as the gateway.
The gateway router has both a wireless interface (for AODV communication) and an Ethernet interface (for connection to the wired network).
Network Addressing¶
The network uses two separate address ranges:
Wireless AODV network:
10.0.x.xwith netmask255.255.0.0Wired Ethernet network:
192.168.x.xwith netmask255.255.255.0
This separation clearly delineates the two network segments. The gateway router has interfaces in both address ranges, enabling it to forward traffic between them.
For all AODV hosts, the routing table configuration is disabled because AODV manages routes dynamically:
*.host[*].ipv4.configurator.configureRoutingTable = false
Configuration¶
The simulation is configured in omnetpp.ini. Key
configuration parameters include:
The Application¶
In the simulation, host[0] acts as the source and sends ping packets to
ethernetHost, which is on the wired network. The traffic must traverse the
wireless AODV network, pass through the gateway router, and then reach the
destination via the Ethernet segment.
*.host[0].numApps = 1
*.host[0].app[0].typename = "PingApp"
*.host[0].app[0].startTime = 2s
*.host[0].app[0].printPing = true
*.host[0].app[0].destAddr = "ethernetHost"
Gateway Configuration¶
As mentioned earlier, the gatewayAddress parameter on all AODV nodes points
to router:
**.aodv.gatewayAddress = "router"
Network Configuration¶
The Ipv4NetworkConfigurator is configured with XML to set up the address ranges and routing:
*.configurator.config = xml(
"<config>\
<interface hosts='host[*] or router' names='wlan*' address='10.0.x.x' netmask='255.255.0.0'/>\
<route hosts='router' destination='*' interface='eth0' />\
<interface hosts='*' names='eth*' address='192.168.x.x' netmask='255.255.255.0'/>\
</config>")
This configuration:
Assigns
10.0.x.xaddresses to all wireless interfaces on AODV hosts and the routerCreates a default route on the router directing traffic to its Ethernet interface
Assigns
192.168.x.xaddresses to all Ethernet interfaces
Results¶
Simulation Behavior¶
When the simulation runs:
Initial Route Discovery: When
host[0]wants to send a ping toethernetHost, AODV performs route discovery. SinceethernetHostis not part of the AODV network, all AODV nodes recognize it as an external destination and route towards the configured gateway (router).Route Establishment: AODV establishes routes from
host[0]to the router using the standard AODV route request/reply mechanism. The route dynamically adapts to the mobile topology as nodes move.Traffic Flow: Once the route is established, ping packets flow from
host[0]through intermediate AODV nodes to the router. The gateway forwards the packets via its Ethernet interface to the switch, which then delivers them toethernetHost.Topology Changes: As the mobile nodes move, AODV adapts the routes in the wireless segment. If the path to the gateway breaks due to mobility, AODV discovers a new route.
Sources: omnetpp.ini, AODVNetwork.ned
Try It Yourself¶
If you already have INET and OMNeT++ installed, start the IDE by typing
omnetpp, import the INET project into the IDE, then navigate to the
inet/showcases/routing/aodvexternal folder in the Project Explorer. There, you can view
and edit the showcase files, run simulations, and analyze results.
Otherwise, there is an easy way to install INET and OMNeT++ using opp_env, and run the simulation interactively.
Ensure that opp_env is installed on your system, then execute:
$ opp_env run inet-4.6 --init -w inet-workspace --install --build-modes=release --chdir \
-c 'cd inet-4.6.*/showcases/routing/aodvexternal && inet'
This command creates an inet-workspace directory, installs the appropriate
versions of INET and OMNeT++ within it, and launches the inet command in the
showcase directory for interactive simulation.
Alternatively, for a more hands-on experience, you can first set up the workspace and then open an interactive shell:
$ opp_env install --init -w inet-workspace --build-modes=release inet-4.6
$ cd inet-workspace
$ opp_env shell
Inside the shell, start the IDE by typing omnetpp, import the INET project,
then start exploring.
Discussion¶
Use this page in the GitHub issue tracker for commenting on this showcase.