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

[core] Fixed RCV TL drop of packets dropped by SND #2214

Merged
merged 3 commits into from
Dec 24, 2021

Conversation

maxsharabayko
Copy link
Collaborator

@maxsharabayko maxsharabayko commented Dec 23, 2021

The receiver buffer may have packets dropped by sender (marked as EntryState_Drop).
In that case, the ACK position is likely ahead of the current reading position. This has to be taken into account in the TSBPD thread.
It can result in the receiver hanging up for a couple of seconds, making the sender break the connection.

  1. At some point, the receiver hangs up (for about 12 seconds in total) due to the issue fixed above.
  2. Three seconds later the sender detects there is no response from the receiver, and breaks the connection.
  3. About ten seconds later receiver wakes up and continues processing incoming packets, that were accumulated in the system buffer of the UDP socket.
  4. Because of that stall it receives heavily delayed ACKACK packets. Based on the ACK - ACKACK pair of packets receiver estimates RTT, in this case, extra 10+ seconds are added to the estimation, significantly raising SRTT and RTTVar values.
  5. The overestimated SRTT and RTTVar values then impact the connection expiration timeout of SRTT + 4 x RTTVar: it now results in tens of seconds. Therefore, the receiver waits for tens of seconds before concluding the connection with the sender is broken. The SHUTDOWN control packet from the sender is probably lost in that case.

This PR Changes

  • CRcvBufferNew::dropUpTo(..) now returns the number of packets actually dropped. This value is used to update the RCV drop statistics.
  • The update of m_iRcvLastSkipAck happens only if dropping ahead of the current ACK position. Loss lists update as well.
  • Move the TL drop logic into a dedicated function CUDT::dropTooLate(int upTo).
  • Fix the documentation on the pktRcvDrop and pktRcvDropTotal.

@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Dec 23, 2021
@maxsharabayko maxsharabayko added this to the v1.4.5 milestone Dec 23, 2021
@maxsharabayko maxsharabayko self-assigned this Dec 23, 2021
@codecov-commenter

This comment has been minimized.

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 Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants