Multiple nodes can't communicate using one eNB - omnet++

The simulation configuration I want is for the vehicle and the RSU to communicate with each other through IEEE 802.11p and LTE through one eNB(eNodeB).
Refer to the veins_hetvnet repository and the paper Simulating cellular communications in vehicular networks: making SimuLTE interoperable with Veins to configure the .ned of each node and write the source code.
The error seems to occur in the code below among omnetpp.ini codes.
# car
**.car[*].masterId = 1
**.car[*].macCellId = 1
# RSU
**.fRSU[*].masterId = 1
**.fRSU[*].macCellId = 1
# Cell (eNodeB)
**.Cell.macCellId = 1
**.Cell.macNodeId = 1
**.dynamicCellAssociation = true
When I run the simulation, the following error occurs.
check_and_cast(): Cannot cast (LteMacEnbRealistic*)MyScenario.Cell.lteNic.mac to type 'LteMacEnbRealisticD2D*' -- in module (LteMacUeRealisticD2D) MyScenario.fRSU[0].lteNic.mac (id=184), during network initialization ..
The paper stated that it was the difference between automatic and manual coupling, but I don't know if that is true.
How can I modify the D2D communication with one eNB?

Related

Error while accessing Mobility module at the MAC layer of Veins

In VEINS 4.4, one can access the current location of the vehicles at the application layer (e.g. TraCIDemo11p) via "Mobility" module which is defined through TraCIMobility.
I followed the same approach to access the Mobility module at the lower layer (MAC1609_4.cc), where I added following statement at the stage 0 of the initialize function:
TraCIMobility* mobility = TraCIMobilityAccess().get(getParentModule());
However, I am not getting any compilation error, but when OMNET throws errors when the simulation starts and it gives following error.
Error in Module (MAC1609_4)
RSUExampleScenario.node[0].nic.mac1609_4(id=12) at event # 2, t = 0.1:
Assert: condition traci false in function get,
\veins/modules/mobility/traci/TraCIMobility.h line 193
I have searched around for different possible solutions, but, I am still unable to solve this problem.
Related posts are:
How to access TraCI command interface from TraCIDemoRSU11p in Veins Car2X simulator?
Transmission of vehicular status in Veins
RoadId() from the BaseWaveApplLayer.cc (VEINS, OMNET++)
How to get Coordinates of each vehicle in VEINS?
You are trying to access a TraCIMobility sub-module in the parent module of the Mac1609_4. This, however, is not the Car but the Nic80211p, which has no such sub-module, hence, the failing assertion.
It should work when you go up one additional layer in the hierarchy, as you then use the Car module as root to find the corresponding sub-module:
TraCIMobility* mobility = TraCIMobilityAccess().get(getParentModule()->getParentModule());
See the Car module and the Nic80211p module for reference:
https://github.com/sommer/veins/blob/veins-4.4/src/veins/nodes/Car.ned
https://github.com/sommer/veins/blob/veins-4.4/src/veins/modules/nic/Nic80211p.ned

Create traffic light in SUMO and OMNeT++

How I can create traffic light in OMNeT++ and SUMO, i have to create the traffic light and configure in XML file from which file using veins example.
The OMNeT++ proxy modules for SUMO traffic lights are available since Veins 4.7.
If you have a network including a traffic light, you need to add the following lines to your omnetpp.ini file:
*.manager.trafficLightModuleType = "org.car2x.veins.nodes.TrafficLight"
*.manager.trafficLightModuleName = "trafficLight"
*.manager.trafficLightModuleDisplayString = default
*.manager.trafficLightFilter = "MYTRAFFICLIGHTID"
*.trafficLight[*].mobility.x = 0
*.trafficLight[*].mobility.y = 0
*.trafficLight[*].mobility.z = 3
*.trafficLight[*].applType = "YOURAPPLAYERTYPE"
*.trafficLight[*].logicType = "YORUTRAFFICLIGHTLOGIC"
The term MYTRAFFICLIGHTID needs to be replaced with the ID you're using in your SUMO network. If you have multiple traffic lights to control, you can list SUMO IDs separated by spaces.
A traffic light consists of an application (YOURAPPLAYERTYPE) and a logic (YORUTRAFFICLIGHTLOGIC). Both properties are mandatory and need to be specified in your omnetpp.ini.
In the current Veins master branch, the YOURAPPLAYERTYPE is an OMNeT++ module, that uses the DemoBaseApplLayer as a the base module.
class YOURAPPLAYERTYPE: public DemoBaseApplLayer {
....
}
The YORUTRAFFICLIGHTLOGIC is an OMNeT++ module, that uses the TraCITrafficLightAbstractLogic as a the base module.
class YORUTRAFFICLIGHTLOGIC: public TraCITrafficLightAbstractLogic{
....
}

OMNeT++ - Veins - Create a scenario of 2 vehicules with a starting position defined

I'm working on Veins | OMNeT++ | SUMO.
Is it possible to select the starting position of our cars and the destination?
I only see spawn of vehicules at the exact same position and don't know how to adapt them. I've already read some topics explaining that we have cars that are created automatically by the TraCI module, but how can we control it?
Cars are initially created by SuMO and then inserted in Veins by the TraCIScenarioManager. In the demo example from Veins, multiple vehicles are driving from the same origin to the same destination:
194 Cars leaving the Computer Science Building and campus of the University of Erlangen-Nuremberg
In order to have different traffic, you have to adjust the network description files of SuMO - in particular the *.rou.xml. See the SuMO wiki for how to configure vehicles and routes.
I think you can following method in TraCICommandInterface.h.
bool addVehicle(std::string vehicleId, std::string vehicleTypeId, std::string routeId, simtime_t emitTime_st = -DEPART_NOW, double emitPosition = -DEPART_POS_BASE, double emitSpeed = -DEPART_SPEED_MAX, int8_t emitLane = -DEPART_LANE_BEST_FREE);

omnet++ disconnect or turn off the sensor node

We have a network topology. There is a base station, 36 LCN and 1500 sensor nodes. While simulating, I want to turn off / disconnect randomly selected the sensor nodes.I mean ,I dont want to sense any value from this nodes.To do this I used:
cModuleType *moduleType = cModuleType::get("SensorNode");
cModule *snIO = modtype->createScheduleInit("snIO", this);
snIO->gate("inout")->disconnect();
sensor numbers are set in the network.ned file
(" Error in module (SensorNode) Network.sn[20] (id=22) at event #5, t=0: NED module type "SensorNode" not found (fully qualified type name expected)").So how can I solve this problem ?

ASSERT condition for driving vehicles in Veins failed

I generated plenty of routes (~90.000+) using SUMO's ACTIVITYGEN/DUAROUTER with a configuration file and different durations (--duration-d 1, --duration-d 7, ...).
The resulting .rou.xml is successfully executed by SUMO without serious errors. Just some warnings about invalid departPos.
But when using Veins, I receive the following error message:
<!> Error in module (Veins::TraCIScenarioManagerLaunchd)
Scenario.manager (id=6) at event #2327172, t=25619.2: Model error:
ASSERT: condition count == drivingVehicleCount false in function
processVehicleSubscription,
veins/modules/mobility/traci/TraCIScenarioManager.cc line 640.
I removed the ASSERT condition and displayed both values. count is always higher than drivingVehicleCount.
The included "veins" example is running without any problems.
I am using:
SUMO 0.22.0
OMNeT++ 4.6
Veins 4 alpha 2.
In addition, I tested Veins 3.0 and receive the same error message.
Did somebody encounter the same problem?
Commenting out the ASSERT is totally fine.
In SUMO any vehicle can have one of five states (according to statesvehicleStates_sm.uxf): first, it is loaded, transitions to running when it starts driving, then transitions to arrived when it arrived at its destination. In addition, running vehicles can temporarily become teleporting or parking.
Veins subscribes to these state changes to keep track of the number of driving vehicles. To make sure that the bookkeeping is correct, it compares its own count against SUMO's reported number of active vehicles.
I do not know why the numbers do not match sometimes. It only seems to occur in large congested networks.

Resources