Search code examples
omnet++veinssumo

Facing warning: "Nic is not connected to any gates!" in VEINS simulation


I'm using Veins 5.0, OMNet++ 5.5.1, SUMO 1.2.0

I'm getting the following warning in my simulation:

WARN (PhyLayer80211p)mpsScenario.node[0].nic.phy80211p: Nic is not connected to any gates!

This is how my mpsScenario.ned file looks:

import org.car2x.veins.base.connectionManager.ConnectionManager;
import org.car2x.veins.base.modules.BaseWorldUtility;
import org.car2x.veins.modules.mobility.traci.TraCIScenarioManager*;
import org.car2x.veins.modules.obstacle.ObstacleControl;
import org.car2x.veins.modules.world.annotations.AnnotationManager;
import org.car2x.veins.nodes.Car;

import org.car2x.veins.mps.traffic.BaseTrafficManager;


network mpsScenario {
    parameters:
        double playgroundSizeX @unit(m); // x size of the area the nodes are in (in meters)
        double playgroundSizeY @unit(m); // y size of the area the nodes are in (in meters)
        double playgroundSizeZ @unit(m); // z size of the area the nodes are in (in meters)
        string trafficType;
        @display("bgb=$playgroundSizeX,$playgroundSizeY");
        @figure[description](type=text; pos=700,30; font=,,bold; 
                text="Aerolink(TM) Misbehavior Protection System Simulation");
    submodules:
        obstacles: ObstacleControl {
            @display("p=240,50");
        }
        annotations: AnnotationManager {
            @display("p=260,50");
        }
        connectionManager: ConnectionManager {
            parameters:
                @display("p=150,0;i=abstract/multicast");
        }
        world: BaseWorldUtility {
            parameters:
                playgroundSizeX = playgroundSizeX;
                playgroundSizeY = playgroundSizeY;
                playgroundSizeZ = playgroundSizeZ;
                @display("p=30,0;i=misc/globe");
        }
        manager: TraCIScenarioManagerForker {
            parameters:
                @display("p=115,60");
        }
        trafficManager: <trafficType> like BaseTrafficManager {
            @display("p=115,0");
        }
        node[0]: Car {
        }
    connections allowunconnected:
}

which is basically the default file with one custom trafficManager module. Also, the manager points to TraCIScenarioManagerForker.

The Car.ned module is same as default that is provided by VEINS 5.0.

Since mostly everything is default, I don't understand why I am getting the aforementioned warning. Due to this warning I am getting a std::bad_alloc error as soon as a new BSM is received by a vehicle.

Edit 1: Add MWE which is in github repo

My issue can be recreated using the following steps:

  1. Clone my branch v5 from my fork of veins:
git clone --branch v5 https://github.com/raash1d/veins
  1. Start OMNeT++
  2. Run the simulation from scenarios/mps/omnetpp.ini; choose "Gui" Config name.
  3. Click "RUN" and observe the log messages in OMNeT++ Qtenv window. As soon as a vehicle is created, a warning is generated for the Nic module.

This eventually causes the std::bad_alloc error.


Solution

  • Your OMNeT++ simulation playground is configured (in omnetpp.ini) to go from (0,0) to (10000,10000).

    Your SUMO road network (in .net.xml) goes from 0.00,0.00 to 5527.41,7491.84 (this is okay), but your SUMO buildings (in .poly.xml) go from -3255.66,-3540.81 to 5794.35,8029.21.

    This means that your simulation will try to use buildings that are outside the playground, which crashes it. You will need to increase the size of the simulation playground.