GMLC-TDC / helics-ns3

ns-3 module for integrating with a HELICS co-simulation
GNU General Public License v2.0
3 stars 8 forks source link

Schedule ns-3 packets for incoming messages at time specified #46

Open nightlark opened 2 years ago

nightlark commented 2 years ago

Currently there seems to be a bug affecting the Static Source/Sink and Filter applications due to the callbacks for incoming messages from HELICS scheduling the ns-3 packets to be sent at the current ns-3 time instead of the time specified by HELICS for the message in the callback. The issue is that the callbacks are called before the HELICS request time function has given the granted time to ns-3 to advance its own simulation time.

The fix should be making the Send functions take the time given by the endpoint callback functions for messages, and schedule the ns-3 packet to be sent at time <incoming HELICS message time> - <ns3 simulation time>.

laurmarinovici commented 2 years ago

@nightlark Thanks for reporting this. Not sure if you were planning on looking into it soon. I've started to look at the code last week, and I think I have identified where the change needs to be done. However, I am not sure how fast I can tackle it as I am taking this week off. Let me know how you'd prefer so we do not duplicate effort.