Wireless Simulation in OMNeT++

Wireless networking is defined as communication of two or more different computers without using any wires.A wireless network is very similar to the wired network in that all the same pieces are still required a wireless NIC, Access Point (similar to a wired network Ethernet Switch) and a wireless router. The only thing that’s missing is the cables. We develop academic projects in wireless simulation in OMNeT++.

Characteristics of wireless links:

  • Decreased signal strength.
  • Multipath propagation.
  • Interference from other sources.
Architecture of Wireless Networks
Architecture of Wireless Networks

Terms involved in wireless network simulations are:

  • Access point.
  • Hot spot.
  • Encryption techniques.
  • 11a, 802.11b, 802.11g.
  • Wi-Fi.
  • ISM band.

Sample code for wireless network:

WirelessRoutingBase::~WirelessRoutingBase()
{
    delete interfaceVector;
    if (timerMessagePtr)
    {
        cancelAndDelete(timerMessagePtr);
        timerMessagePtr = NULL;
    }
    if (timerMultiMapPtr)
    {
        while (timerMultiMapPtr->size()>0)
        {
            ManetTimer * timer = timerMultiMapPtr->begin()->second;
            timerMultiMapPtr->erase(timerMultiMapPtr->begin());
            delete timer;
        }
        delete timerMultiMapPtr;
        timerMultiMapPtr = NULL;
    }
    if (routesVector)
    {
        delete routesVector;
        routesVector = NULL;
    }
    proxyAddress.clear();
    addressGroupVector.clear();
    inAddressGroup.clear();

    if (globalRouteMap)
    {
        GlobalRouteMap::iterator it = globalRouteMap->find(getAddress());
        if (it != globalRouteMap->end())
            globalRouteMap->erase(it);
        if (globalRouteMap->empty())
        {
            delete globalRouteMap;
            globalRouteMap = NULL;
        }
    }
}

bool WirelessRoutingBase::isIpLocalAddress(const IPv4Address& dest) const
{
    if (!isRegistered)
        opp_error("Manet routing protocol is not register");
    return inet_rt->isLocalAddress(dest);
}

bool WirelessRoutingBase::isLocalAddress(const ManetAddress& dest) const
{
    if (!isRegistered)
        opp_error("Manet routing protocol is not register");
    if (dest.getType() == ManetAddress::IPv4_ADDRESS)
        return inet_rt->isLocalAddress(dest.getIPv4());
    InterfaceEntry *ie;
    for (int i = 0; i < inet_ift->getNumInterfaces(); i++)
    {
        ie = inet_ift->getInterface(i);
        ManetAddress add(ie->getMacAddress());
        if (add==dest) return true;
    }
    return false;
}