riebl / artery

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

Question about how to get the packet received signal strength #264

Closed YichaoXu closed 1 year ago

YichaoXu commented 1 year ago

Dear developers,

I was wondering whether the artery provides any APIs to get the RSSI value while receiving each packet, or whether we can detect the RSSI value at a specific time. I notice that Inet provides such a function but we do not find the matching file in both src/inet and extern/inet. Besides, I notice that we use the getPower method in the PowerRx class, but it seems like the function is not accessible directly in the application layer (I mean the CaService or DemService).

I was wondering whether you can provide us with any suggestions about how to implement such a function.

Best, Yichao

riebl commented 1 year ago

Dear Yichao,

RSSI is usually a device-dependent metric, which is hard to compare between manufacturers. Hence I recommend going for the received signal strength expressed in dBm instead. As you have already discovered, the received power is calculated by INET but not passed up to the application layer. Extending every layer to pass-through this information might be a little bit too much effort. I would try this way:

I admit this approach is a little bit hacky, as it violates the OSI layer isolation. In my opinion, this hack is acceptable for some experiments, though.

Ambica2022 commented 1 year ago

Dear Yichao,

RSSI is usually a device-dependent metric, which is hard to compare between manufacturers. Hence I recommend going for the received signal strength expressed in dBm instead. As you have already discovered, the received power is calculated by INET but not passed up to the application layer. Extending every layer to pass-through this information might be a little bit too much effort. I would try this way:

* extend `PowerLevelRx` (could be a sub-class) by a getter which allows access to the power level of the last received packet

* the application module looks up your customized `PowerLevelRx` module during initialization, which should be located at _.wlan[0].max.rx_

* cast the looked-up `cSimpleModule` to the `PowerLevelRx` class type and store it in a member attribute of the application module

* the application can then retrieve the last received power level at data indication: Since there is no delay while passing up a packet from the radio to the application layer, the getter gives you the power level of the just received packet.

I admit this approach is a little bit hacky, as it violates the OSI layer isolation. In my opinion, this hack is acceptable for some experiments, though.

@riebl , will this https://inet.omnetpp.org/docs/showcases/wireless/pathloss/doc/index.html help in finding received signal strength? If so, how to use it in Artery?Thank you.