Skip to content

Commit

Permalink
[core] Added pktReorderTolerance to stats
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko authored and rndi committed Nov 5, 2019
1 parent 65d8e10 commit 544f76c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
19 changes: 13 additions & 6 deletions docs/statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,19 @@ The distance in sequence numbers between the two original (not retransmitted) pa
that were received out of order. Receiver only.

The traceable distance values are limited by the maximum reorder tolerance set by  `SRTO_LOSSMAXTTL`.
`SRTO_LOSSMAXTTL` sets the maximum reorder tolerance value, or the time-to-live for the original packet,
that was received after with a gap in the sequence of incoming packets. Those missing packets
are expected to come out of order, therefore no loss is reported.
The TTL value specifies the number of packet to receive further, before considering the preceding packets lost,
and sending the loss report.

## pktReorderTolerance

Instant value of the packet reorder tolerance. Receiver side. Refer to [pktReorderDistance](#pktReorderDistance).

`SRTO_LOSSMAXTTL` sets the maximum reorder tolerance value. The value defines the maximum
time-to-live for the original packet, that was received after with a gap in the sequence of incoming packets.
Those missing packets are expected to come out of order, therefore no loss is reported.
The actual TTL value (**pktReorderTolerance**) specifies the number of packets to receive further, before considering
the preceding packets lost, and sending the loss report.

The internal algorithm checks the order of incoming packets and adjusts the tolerance based on the reorder
distance, but not to a value higher than the maximum.
distance (**pktReorderTolerance**), but not to a value higher than the maximum (`SRTO_LOSSMAXTTL`).

SRT starts from tolerance value set in `SRTO_LOSSMAXTTL` (initial tolerance is set to 0 in SRT v1.4.0 and prior versions).
Once the receiver receives the first reordered packet, it increases the tolerance to the distance in the sequence
Expand All @@ -289,6 +294,8 @@ Missing packets with sequence numbers 8 and 9 will be reported lost with the nex
The next received packet has sequence number 8. Reorder tolerance value is increased to 2.
The packet with sequence number 9 is reported lost.



## pktRcvAvgBelatedTime

Accumulated difference between the current time and the time-to-play of a packet
Expand Down
1 change: 1 addition & 0 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6454,6 +6454,7 @@ void CUDT::bstats(CBytePerfMon *perf, bool clear, bool instantaneous)
perf->pktRecvNAK = m_stats.recvNAK;
perf->usSndDuration = m_stats.sndDuration;
perf->pktReorderDistance = m_stats.traceReorderDistance;
perf->pktReorderTolerance = m_iReorderTolerance;
perf->pktRcvAvgBelatedTime = m_stats.traceBelatedTime;
perf->pktRcvBelated = m_stats.traceRcvBelated;

Expand Down
3 changes: 2 additions & 1 deletion srtcore/srt.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ struct CBytePerfMon
int pktSndFilterExtra; // number of control packets supplied by packet filter
int pktRcvFilterExtra; // number of control packets received and not supplied back
int pktRcvFilterSupply; // number of packets that the filter supplied extra (e.g. FEC rebuilt)
int pktRcvFilterLoss; // number of packet loss not coverable by filter
int pktRcvFilterLoss; // number of packet loss not coverable by filter
int pktReorderTolerance; // packet reorder tolerance value
//<
};

Expand Down

0 comments on commit 544f76c

Please sign in to comment.