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

Added special container to collect loss stats. Added reorder stats #1219

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ethouris
Copy link
Collaborator

Fixes #899.

The calculation of loss stats is given up to a separate container. The collection relies on the following rules:

  1. The jump-over sequence is treated as MISSING packet - we don't know yet if it will turn out to be lost or reordered. It's then added to the container.

  2. If a late packet (with sequence behind the current top) comes in, it's being "unlost" from the stats container so that it won't be notified as lost packet in the stats later.

  3. When ACK is about to be sent, we state that all packets that didn't arrive so far, but have been fake-acked (dropped) can be treated as lost. Although it's possible in theory that a reordered packet has been received with a delay that exceeds the latency, this probability is negligible enough. Therefore at this moment all packets recorded as lost are treated as really lost, the loss statistics are updated, and records removed.

  4. As precaution for a case that the stats loss container might swell out of control, there's a size limit also applied. If during adding it turns out that it would make the size exceed this limit, the oldest record is removed from the container. This record is not completely forgotten though (the size of the loss range will be still reported in the stats), just there's no longer a chance to qualify a packet in this range as reordered. The size is set as a half of the receiver buffer size, which should cover the biggest possible number of loss records.

@ethouris ethouris requested a review from maxsharabayko March 27, 2020 18:16
@ethouris ethouris added this to the v1.5.0 milestone Mar 27, 2020
@ethouris ethouris self-assigned this Apr 1, 2020
@ethouris ethouris added [core] Area: Changes in SRT library core Impact: Significant Priority: Low Type: Maintenance Work required to maintain or clean up the code labels Apr 1, 2020
@maxsharabayko maxsharabayko modified the milestones: v1.5.0, v1.5.1 Jul 27, 2020
@mbakholdina mbakholdina modified the milestones: v1.5.1, Backlog May 26, 2021
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: Low Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Statistics] Perf stats loss packet calculation in case of packet reordering
3 participants