[BUG] Broadcast sending logic does not handle the lack of SND buffer space correctly. #2959
Labels
[core]
Area: Changes in SRT library core
Priority: Critical
Type: Bug
Indicates an unexpected problem or unintended behavior
Milestone
Assuming a broadcast connection with two member links A and B.
At some point sending link A may not have enough space to buffer a payload for sending, while the other member B does.
Then the next time the next payload is submitted to link A it is assigned the wrong sequential number of that payload that failed to get a space in the SND buffer.
Then there is a mess, that can even be observed in Wireshark: packets with the same seqno coming from different members have different payload.
Steps to Reproduce
The issue can be easily reproduced on a localhost.
SRT latency: 6s.
Bitrate 50 Mbps.
Default RCV and SND buffer sizes, that are not enough for this streaming configuration.
The following can be observed in the standard output:
11:15:07.812449 [W] [METRICS] Detected loss of 54 packets (seqno [20612; 20666)) 11:15:07.812673 [W] [METRICS] Detected reordered packet, seqno 20651, expected 20667 (dist 16) 11:15:07.812862 [W] [METRICS] Detected reordered packet, seqno 20652, expected 20667 (dist 15) 11:15:07.813048 [W] [METRICS] Detected reordered packet, seqno 20653, expected 20667 (dist 14)
Reordered packet must never come out of an SRT socket!
Details
The issue is on the sender side. For example, here is a log from the receiver. There is no sequence discontinuity neither in pktseqno (
%pktseqno
), nor in msgno (#msgno
), but the first four bytes of the payload do not increase sequentially.First, there is a gap
0x5083
->0x50BA
on the same member link. Then the following payload is read from another member, and it is not out of order:0x50BA
->0x50AB
.SRT v1.5.3 and likely prior versions.
The text was updated successfully, but these errors were encountered: