From 544f76c86423ea4deddc6f122ce8dfa338c16371 Mon Sep 17 00:00:00 2001 From: Maxim Sharabayko Date: Tue, 5 Nov 2019 13:33:20 +0100 Subject: [PATCH] [core] Added pktReorderTolerance to stats --- docs/statistics.md | 19 +++++++++++++------ srtcore/core.cpp | 1 + srtcore/srt.h | 3 ++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/statistics.md b/docs/statistics.md index 1fb7782ad..8e22b7e19 100644 --- a/docs/statistics.md +++ b/docs/statistics.md @@ -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 @@ -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 diff --git a/srtcore/core.cpp b/srtcore/core.cpp index 2564e51f5..7d08cd751 100644 --- a/srtcore/core.cpp +++ b/srtcore/core.cpp @@ -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; diff --git a/srtcore/srt.h b/srtcore/srt.h index 163b9547b..11834dc69 100644 --- a/srtcore/srt.h +++ b/srtcore/srt.h @@ -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 //< };