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

Update group member status basing on packet type #1448

Merged

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented Aug 6, 2020

This provides two fixes:

  1. When a data packet is coming in, the link turns IDLE -> RUNNING. Even if the packet is going to be effectively rejected. This is important because RUNNING links will not get updated the reception sequence when the buffer is empty. Updating this sequence while data packets were received was causing the "runaway train" effect, that is, while every incoming packet would come with increasing sequence, the synchronization was pushing the sequence forward in the meantime, which caused that incoming packets were seen as belated virtually forever.

  2. Turning link to IDLE on sender state in case when keepalive has come and the link is outside the "temporary activation" state. The second condition prevents the link from being treated as IDLE in case when it was just activated and still tries to transmit old packets that are not surely acknowledged, but have been actually received over a broken link. This "initial burst" that happens after the link switch might effectively delay the ACK report and make the receiver side generate a KEEPALIVE message.

@ethouris ethouris requested a review from maxsharabayko August 6, 2020 16:50
@ethouris ethouris self-assigned this Aug 6, 2020
@ethouris ethouris added [core] Area: Changes in SRT library core Impact: High Priority: High Type: Bug Indicates an unexpected problem or unintended behavior labels Aug 6, 2020
@ethouris ethouris added this to the v1.5.0 - Sprint 20 milestone Aug 6, 2020
@maxsharabayko maxsharabayko merged commit f204c2c into Haivision:master Aug 6, 2020
@mbakholdina mbakholdina modified the milestones: v1.5.0 - Sprint 20, v1.4.2 Oct 14, 2020
@gou4shi1
Copy link
Contributor

Hi @ethouris , can you help to explain that why need_notify_loss would be introduced here?

@ethouris
Copy link
Collaborator Author

@gou4shi1 This is to prevent checking for loss for a freshly turned-to-running link. If this isn't done then the sequence distance between the last reception - which in this case, as a group member, is artificially updated to be in synch with other links in the group - and the current packet reception would be treated as loss and loss-reported. This actually isn't a loss because the "previous" sequence is not really a received packet sequence. After turning to RUNNING state though since this moment this range should be treated as a loss.

@gou4shi1
Copy link
Contributor

@ethouris Thanks for you explanation, but it may introduce unrecoverable packet loss (#2236), which is unacceptable for message mode.
I found that sender would just ignore loss-report behind m_iSndLastAck and send a corresponding drop-request, maybe it's harmless to send a possible-fake-loss-report?

@ethouris
Copy link
Collaborator Author

You mean, if there are initial packets lost before the one that has been sent?

Likely I may have missed something, that was a long time ago. Not sure how the synchronization works with the statement of the ACK-ed packets. Maybe an additional check should be made within this loop and the range between the last ACK-ed, maybe shifted by the last received within the group, should be treated as loss. If it's not empty.

@gou4shi1
Copy link
Contributor

gou4shi1 commented Feb 28, 2022

You mean, if there are initial packets lost before the one that has been sent?

I mean there are initial packets lost before the first one that has been received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Priority: High Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants