To implement the wireless LAN (WLANs) in OMNeT++ has needs to embrace designing and emulating a network that customs the wireless communication protocols, like IEEE 802.11, to connect devices and then OMNeT++ with the INET framework offers the complete support for mimic the WLANs. The given below are the procedures on implementing Wireless LANs in OMNeT++ using the INET framework:
Step-by-Step Implementation
Make sure that OMNeT++ and the INET Framework installed.
Generate a novel NED file to describe the network topology that contains access points and wireless hosts.
Example: WLAN Network Topology (WLANNetwork.ned)
package wlan;
import inet.node.inet.AccessPoint;
import inet.node.inet.WirelessHost;
network WLANNetwork
{
parameters:
@display(“bgb=800,400”);
submodules:
accessPoint: AccessPoint {
@display(“p=400,200”);
}
host1: WirelessHost {
@display(“p=200,200”);
}
host2: WirelessHost {
@display(“p=600,200”);
}
connections allowunconnected:
}
Create an OMNeT++ initialization file to configure the parameters of the simulation.
Example: Configuration File (omnetpp.ini)
network = wlan.WLANNetwork
sim-time-limit = 100s
# Visualization
*.visualizer.canvasVisualizer.displayBackground = true
*.visualizer.canvasVisualizer.displayGrid = true
# Access Point Configuration
*.accessPoint.wlan[0].typename = “Ieee80211Interface”
*.accessPoint.wlan[0].mac.typename = “Ieee80211MgmtAp”
*.accessPoint.wlan[0].mac.ssid = “MyNetwork”
*.accessPoint.wlan[0].radio.typename = “Ieee80211Radio”
*.accessPoint.wlan[0].radio.bandName = “2.4 GHz”
# Host Configuration
*.host*.wlan[0].typename = “Ieee80211Interface”
*.host*.wlan[0].mac.typename = “Ieee80211MgmtSta”
*.host*.wlan[0].mac.ssid = “MyNetwork”
*.host*.wlan[0].radio.typename = “Ieee80211Radio”
*.host*.wlan[0].radio.bandName = “2.4 GHz”
# IP Address Configuration
*.accessPoint.ipv4.config = xmldoc(“accessPoint.xml”)
*.host1.ipv4.config = xmldoc(“host1.xml”)
*.host2.ipv4.config = xmldoc(“host2.xml”)
# Application Configuration
*.host*.numApps = 1
*.host*.app[0].typename = “UdpBasicApp”
*.host*.app[0].destAddresses = “accessPoint”
*.host*.app[0].destPort = 5000
*.host*.app[0].messageLength = 1024B
*.host*.app[0].sendInterval = 1s
Create XML files to define the IP address configuration for each node.
Example: IP Configuration File for accessPoint (accessPoint.xml)
<config>
<interface>
<name>wlan0</name>
<address>192.168.0.1</address>
<netmask>255.255.255.0</netmask>
</interface>
</config>
Example: IP Configuration File for host1 (host1.xml)
<config>
<interface>
<name>wlan0</name>
<address>192.168.0.2</address>
<netmask>255.255.255.0</netmask>
</interface>
</config>
Example: IP Configuration File for host2 (host2.xml)
<config>
<interface>
<name>wlan0</name>
<address>192.168.0.3</address>
<netmask>255.255.255.0</netmask>
</interface>
</config>
To simulate the features of applications running on the hosts and we need to use pre-defined application modules in the INET framework or execute its own.
Example: UDP Basic Application (Pseudo-Code)
#include <omnetpp.h>
#include <inet/applications/udpapp/UdpBasicApp.h>
using namespace omnetpp;
using namespace inet;
class CustomUdpApp : public UdpBasicApp
{
protected:
virtual void initialize(int stage) override;
virtual void handleMessageWhenUp(cMessage *msg) override;
};
Define_Module(CustomUdpApp);
void CustomUdpApp::initialize(int stage) {
UdpBasicApp::initialize(stage);
if (stage == INITSTAGE_APPLICATION_LAYER) {
// Custom initialization code
}
}
void CustomUdpApp::handleMessageWhenUp(cMessage *msg) {
UdpBasicApp::handleMessageWhenUp(msg);
// Custom message handling code
}
In the end, we provide the comprehensive procedure to complete the implementation process for wireless LAN that can used to communicate wirelessly that were implemented in OMNet++ using INET framework. Further details regarding the implementation of the wireless LAN in different simulations will be provided.
For conducting comparative analysis on Wireless LANs in OMNeT++, you can count on our expertise. Share your details with us for further assistance with simulations.