riebl / artery

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

DCC Flow Control #189

Closed OverwatchGirl closed 1 year ago

OverwatchGirl commented 3 years ago

Hello @riebl !

I have some questions concerning DCC Flow Control. Can u please explain the logic behind the FlowControl::enqueue() method ??

I am actually trying to use Token Bucket as a logic for enqueuing messages, but i can't even understand how is FlowControl::enqueue() working ?

Thank you in advance.

riebl commented 3 years ago

FlowControl implements a part of DCC_ACC, i.e. DCC operating at the access layer. If a packet cannot be transmitted immediately because this would violate the allowed packet rate, FlowControl buffers such a packet until the next transmission opportunity. The enqueue method adds a packet to one of the four waiting queues, one for each access category. If such a queue runs full, older packets will get dropped to make space for the arriving packet.

OverwatchGirl commented 3 years ago

Hello @riebl !

Thank you for your answer !

In flow_control.cpp , in the method enqueue(), there's this loop :

while (m_queue_length > 0 && m_queues[ac].size() >= m_queue_length) {
        m_queues[ac].pop_front(); //pops the oldest pending transmission
        m_packet_drop_hook(ac, packet.get());
    }

Can you please explain to me the role of the highlighted line : m_packet_drop_hook(ac, packet.get());

I have another problem, i created two files TokenB.hpp and TokenB.cpp, that i added to vanetza/dcc , i included in them some libraries from both outside and inside vanetza and dcc, but when i compile these two files, i get an error that the files cited in the includes are not existent, knowing that i added TokenB.cpp to the CMakeFile.txt in vanetza/dcc.

Thank you in advance.

riebl commented 3 years ago

You can register custom callback functions at those hooks, which are called if the corresponding code path is executed. In this particular case, you can register a callback to get notified about packets dropped by DCC_ACC. This mechanism is handy to add some data logging, for example.

Can you give some more details about your TokenB problem? In particular, what is the exact error message and which modifications have you precisely done? You can open a new issue ticket for this purpose, as it seems unrelated to the original question of this ticket.

OverwatchGirl commented 3 years ago

Thank you so much !