riebl / artery

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

CaService: indicate() might not be activated #287

Closed HuyTyskland closed 1 year ago

HuyTyskland commented 1 year ago

Hello everyone,

Currently, I am using CaService as a service for my artery.inet.car. As far as I understand (based on chapter 12 of the book "Recent Advances in Network Simulation"), the indicate() method is activated when a message is received. However, it seems like that method is not activated in my case or I understand it incorrectly.

Situation: I want to count the number of sent and received message. So I declared NumSent and NumReceived variable to record those data. I, then, registered two signals corresponding to the "sent" and "received" counter. The "sent" signal is emitted in CaService::sendCam() with the 'NumSentand the "received" signal is emitted in theCaService::indicated()with theNumReceived`.

Problem: while the NumSent is displayed in the statistics of Omnet++, the NumReceived is not.

Approach: I used gdb to set 2 breakpoints at the place where I emitted the two signals but only the one at CaService::sendCam() worked. I doubt that the indicated() was not executed when my simulation was running.

Question: Do I understand indicated() incorrectly or something caused this issue?

Kind regards, Huy Nguyen.

HuyTyskland commented 1 year ago

A little update: it seems like the problem is about my scenario, not the CaService. I run the debug_example which also uses CaService. I set three breakpoints at sendCam(), indicate(), and the one at indicate() did show up. So I think it's more about my scenario.

Is there any configuration that enables/disables message processing?

awillecke commented 1 year ago

Hey,

can you share the relevant parts of your scenario configuration? The *.node[*].middleware.services parameter and the corresponding XML file would be of interest here.

Also: is there more than one vehicle in your scenario that is equipped with the CaService by the mapper? The sender won't receive its own message.

Best regards Alex

HuyTyskland commented 1 year ago

Hello @awillecke

My omnetpp.ini is here. The middleware service of each node is using CaService as regulated here. I used artery.inet.car in my vehicles.xml.

Yes, I know the sender cannot receive its message. Currently, there are only 6 vehicles in my simulation as described here. However, other vehicles also do not receive any CAM. I filtered the result in General.anf with "middleware" and in all 6 vehicles, only the # of sent messages are displayed.

best regards, Huy Nguyen.

awillecke commented 1 year ago

I think you need to change the listener port to 2001 since CAMs are sent to this BTP port.

HuyTyskland commented 1 year ago

hello @awillecke that indeed true. that fixed the issue.

Thank you very much.