Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that Time Constrained federates receive messages in timestamped order #323

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martinffi
Copy link
Contributor

@martinffi martinffi commented Aug 23, 2021

Page 21 of the HLA standard defines timestamp order (TSO) as the guarantee that if two messages M1 and M2 have timestamps T1 and T2, then message M1 will always be delivered to a time-constrained federate before message M2 if T1<T2.

At the moment, timestamped messages can be polled from the LRC Message Queue as long as their timestamp is lower than the time the federate has currently requested to advance to. However, there is no guarantee that the federate might not receive a message with a lower timestamp than this later on, since the federate might request to advance to an arbitrary timestamp, and other federates might have a smaller lower bound on timestamp than this.

The CRC currently maintains a federation wide lower bound on timestamp. If the LRCs were aware of this, they could make sure to only return messages with a lower timestamp than this, meaning no new messages with a lower timestamp could be added later. This would guarantee that all messages are delivered in timestamp order.

This pull request adds a message class to broadcast the federation LBTS to all LRCs whenever it changes. The federation LBTS is recalculated each time a federate requests to advance, so some code was added to broadcast this message whenever the LBTS changes. The LRCs receive the broadcast message and store the current federation LBTS in their LRCState, and can then check against this whenever deciding to return a message from the TSO queue.

Possible bug: There are other places in the code where the federation wide LBTS is recalculated. These do not currently trigger an LBTS broadcast message.

…ge is broadcast to all LRCs whenever the federation wide lower bound on timestamp changes. This LBTS can then be used by the LRCs to ensure that federates receive timestamped messages in timestamped order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant