riebl / artery

OMNeT++ V2X simulation framework for ETSI ITS-G5
GNU General Public License v2.0
203 stars 129 forks source link

Data observation: Channel load at different vehicles #283

Closed HuyTyskland closed 1 year ago

HuyTyskland commented 1 year ago

Hello everyone,

Currently, I have a scenario in which the vehicle type is the Car module in Artery/inet. I want to observe the Channel Load of each vehicle during the simulation (Adding Statistics Collection). However, I am having a bit of an issue when implementing that. So far, I see that there are ChannelLoadRx.ned module and PowerLevelRx.ned module allowing me to extract the ChannelLoad statistic. However, I am unable to deploying those modules as submodule for Car.ned module. As for ChannelLoadRx.ned module, the error in Omnet++ is:

getContainingNicModule(): nic module not found (it should have a property named nic) for module 'World.node[0].channelloadrx' -- in module (artery::ChannelLoadRx) World.node[0].channelloadrx (id=23)

So:

  1. Am I going in the right way based on what I want? if so, what did I miss when including ChannelLoadRx.ned module (for example) as a submodule of Car.ned module?
  2. Is there any better way to do this?

Best regards, Huy Nguyen.

HuyTyskland commented 1 year ago

I figured it out: In the submodule radioDriver (instance of RadioDriver), there is a signal of ChannelLoad. In order to record this signal, in the Car.ned, in the submodule radioDriver, insert @statistic[channel_load](source="ChannelLoad"; record=vector,stats; interpolationmode=none); (detail in this link. The Channel load can be recorded as timeavg, which has been done in src/artery/inet/ChannelLoadRx.ned.

HuyTyskland commented 1 year ago

After implementing as the comment above, there is something I cannot understand and I am not sure what causes that issue (that is why I reopen this issue - sorry for inconvenience). The number of vehicles (Car.ned) does not affect the channel_load/ChannelLoad: when I use @statistic[channel_load](source="ChannelLoad"; record=vector,stats; interpolationmode=none);, no matter how many vehicles in the simulation (200 or 600 vehicles), the channel_load maximum is still 0.01472. To make sure, I even changed this line to ...(record=timeavg,vector); (no need, I believe), and the ChannelLoad is still the same. Based on this reply, I am pretty sure that ChannelLoad is what I want. Besides changing the number of vehicles, I also changed the *.node[*].middleware.updateInternal from 0.1s to 0.05s but nothing changed. About my scenario, the vehicles is Car.ned module and the message request ( I do not use CAM or DEMN in asn1 of Vanetza) is as below with my 40-byte custom message:

    btp::DataRequestB req;
    req.destination_port = host_cast<LLService::port_type>(getPortNumber());
    req.gn.transport_type = geonet::TransportType::SHB;
    req.gn.traffic_class.tc_id(static_cast<unsigned>(dcc::Profile::DP2));
    req.gn.communication_profile = geonet::CommunicationProfile::ITS_G5;
    request(req, msg);

What might be the cause of this situation?

HuyTyskland commented 1 year ago

*A little update: I also changed the service from my service (shown in the previous comment) to CaService but the same thing also happened. The channel load is at 0.015 for 40-100-300-600 vehicles.

HuyTyskland commented 1 year ago

@riebl @awillecke I still haven't been able to address this issue. Would you mind suggesting me some hints?

riebl commented 1 year ago

I don't know what you are doing exactly. The updateInterval will not increase the number of transmitted messages per second, just how often the middleware triggers a service. I have just checked the "car2car-grid" scenario: Even with just about 100 vehicles, I see channel loads up to 10%. Thus, I assume the channel load calculation itself is still working as expected.

How many messages are you generating per vehicle? Do you send them with the default bitrate? Given the message rate, message length and the number of vehicles, you can easily estimate the maximum channel load with ideal (unrealistic) radio propagation.

HuyTyskland commented 1 year ago

Hello @riebl thank you for your response and your hint on the matter. I will dig into that. A little update:

awillecke commented 1 year ago

The channel load only depends indirectly on the number of vehicles sending CAMs but more on the vehicle density (number of vehicles in communication range). From your description, I assume you provide the number of vehicles in your traffic flows. Maybe try vehsPerHour to create flows with a higher density of vehicles.

riebl commented 1 year ago

Also note @HuyTyskland, that the reactive DCC approach is quite restrictive: It allows at most 10 messages per second on DP2 even if the channel load is low.

HuyTyskland commented 1 year ago

@awillecke Thank you very much for your suggestion on using the vehsPerHour. I can control the density of vehicles as I want. Combining with the FundamentalDiagram I can get a dense/medium/sparse traffic. @riebl thank you for your information about the reactive DCC approach. I do notice that CAM messages are currently generated with mGenCamMax which is 1 message per second. I had around 18% Channel Load with that Message rate with around 400 vehicles in 1km.

Just a small question: where can I find the default message size and the default data rate?

awillecke commented 1 year ago

Just a small question: where can I find the default message size and the default data rate?

Unfortunately, the answer is not as straight forward.

The message size depends on the communication layer you are looking at. For example, the size of a CAM emitted by the CaService, leaving the Facilities Layer, depends on several factors described in EN 302 637-2. For example, it can vary over time (see path history) and for different values due to the ASN.1 UPER encoding. In the Networking and Transport Layer, the messages from the Facilities are encapsulated in BTP and GeoNetworking protocol, increasing the size of the message that might be transmitted by a variable amount (signature and certificate). When going down the communication stack further, more header (and trailers) are added and the message grows.

For the data rate, you need to be more specific, as there are multiple definitions/concepts described by this term. If you refer to the actual bit rate used for transmitting data on the physical layer, you can find some information on possible configurations here. However, in your case, it depends on the transceiver configuration in your scenario. The INET based radio, for example, uses a bit rate of 6Mbit/s by default.

HuyTyskland commented 1 year ago

I understand now. Thank you @awillecke