Table Of Contents
Table Of Contents

Multiple Wireless Interfaces

Goals

Wireless devices often have multiple network interfaces so they can communicate on multiple wireless networks simultaneously. This can be useful for devices such as mobile phones, which often have cellular, WiFi, and Bluetooth interfaces, or dual-band wireless routers.

This showcase demonstrates how to simulate such devices and how they can be used to communicate on multiple wireless networks simultaneously.

INET version: 4.0
Source files location: inet/showcases/wireless/multiradio

The model

In this showcase, we will simulate a dual-band wireless router. Our dual-band wireless router will have two 802.11 interfaces, one operating on the 2.4 GHz band, and the other on 5 GHz. Both interfaces operate in infrastructure mode and implement two different wireless LANs. The router will provide L2 connectivity (bridging) between the two LANs.

We will use INET’s AccessPoint type for the wireless router, and configure it to have two 802.11 interfaces. This is as simple as setting the numWlanInterfaces parameter to 2. The same would work to configure a StandardHost, its derivatives like WirelessHost and AdhocHost, or a Router to have multiple wireless interfaces.

To test the router, we’ll use two hosts, one on each wireless LAN. The network will look like the following:

../../../../_images/network9.png

The network contains the wireless router named accessPoint, and two WirelessHost’s named host1 and host2. The model also contains the usual support components, a medium model, a configurator, and a visualizer.

The important part of the configuration is shown below:

# access point
*.accessPoint.numWlanInterfaces = 2
*.accessPoint.wlan[0].mgmt.ssid = "wlan2.4"
*.accessPoint.wlan[1].mgmt.ssid = "wlan5"
*.accessPoint.wlan[1].radio.bandName = "5 GHz"

# host1 is associated with wlan2.4, host2 is associated with wlan5
*.host1.wlan[*].agent.defaultSsid = "wlan2.4"
*.host2.wlan[*].agent.defaultSsid = "wlan5"
*.host2.wlan[0].radio.bandName = "5 GHz"

The wireless networks advertised by the two interfaces of accessPoint are configured to have the names wlan2.4 and wlan5, and the second interface is configured to operate on 5 GHz using the bandName parameter. Of the hosts, host1 is configured to connect to the wlan2.4 network and host2 to wlan5. host2’s wireless interface is also configured to use the 5 GHz band so that it finds the access point.

The rest of the configuration (omitted) configures traffic (host1 pings host2) and configures visualization.

Results

The following video has been captured from the simulation. Note how host1 is pinging host2 through accessPoint. The radio signals are visualized as disks, and successful transmissions between nodes’ data link layers are visualized by arrows. The transmissions for the two different networks (both disks and arrows) are colored differently (red for wlan2.4 and blue for wlan5.)

Sources: omnetpp.ini, MultiRadioShowcase.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/wireless/multiradio 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.0 --init -w inet-workspace --install --chdir \
   -c 'cd inet-4.0.*/showcases/wireless/multiradio && 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 inet-4.0
$ 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.