-
Notifications
You must be signed in to change notification settings - Fork 917
Description
Hi!
I already created a small comment about this topic, but as I think it might be a bug in SRT, I thought it would be more appropriate to create a new issue about this.
Describe the bug
When I try to transmit a live video stream with SRT 1.4.1 over a mobile network connection the bandwidth estimations of SRT are far too high.
To Reproduce
Steps to reproduce the behavior:
- Run SRT 1.4.1 on a server listening for an incoming SRT stream
- Connect another device to a mobile network with good LTE connection (my speedtest: 14 Mbps download, 7.7 Mbps upload and 33 ms ping)
- Transmit a video stream over the mobile network to the server and log the mbpsBandwidth
Expected behavior
The value of mbpsBandwith is far higher than the expected 7.7 Mbps.
In my test setup the estimated bandwidth was varying between 400 and 800 Mbps.
Screenshots
Here's a wireshark snipped captured on the server side. The SRT sequence numbers that can be evenly devided by 16 are marked bold. Delta is the time difference to the previous packet.
| No. | Time | Delta | Sequence-No. | Source | Destination | Protocol | Length | Info |
|---|---|---|---|---|---|---|---|---|
| 1 | 0.902803590 | {clientIP} | {serverIP} | UDT | 106 | UDT type: handshake | ||
| 2 | 0.903013058 | 0.000209468 | {serverIP} | {clientIP} | UDT | 106 | UDT type: handshake | |
| 3 | 0.956679062 | 0.053666004 | {clientIP} | {serverIP} | UDT | 122 | UDT type: handshake | |
| 4 | 0.956994934 | 0.000315872 | {serverIP} | {clientIP} | UDT | 122 | UDT type: handshake | |
| 5 | 1.536002451 | 0.307441251 | 1965305408 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 0 msgno: 1 |
| 6 | 1.536056437 | 0.000053986 | 1965305409 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 1 msgno: 2 |
| 7 | 1.536060167 | 0.000003730 | 1965305410 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 2 msgno: 3 |
| 8 | 1.536200554 | 0.000140387 | {serverIP} | {clientIP} | UDT | 86 | UDT type: ack seqno: 1 | |
| 9 | 1.537200313 | 0.000999759 | 1965305411 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 3 msgno: 4 |
| 10 | 1.537219984 | 0.000019671 | 1965305412 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 4 msgno: 5 |
| 11 | 1.537490488 | 0.000270504 | 1965305413 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 5 msgno: 6 |
| 12 | 1.537857188 | 0.000366700 | 1965305414 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 6 msgno: 7 |
| 13 | 1.538060081 | 0.000202893 | 1965305415 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 7 msgno: 8 |
| 14 | 1.538082165 | 0.000022084 | 1965305416 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 8 msgno: 9 |
| 15 | 1.538782887 | 0.000700722 | 1965305417 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 9 msgno: 10 |
| 16 | 1.539773467 | 0.000990580 | 1965305418 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 10 msgno: 11 |
| 17 | 1.542971567 | 0.003198100 | 1965305419 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 11 msgno: 12 |
| 18 | 1.545136250 | 0.002164683 | 1965305420 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 12 msgno: 13 |
| 19 | 1.545158900 | 0.000022650 | 1965305421 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 13 msgno: 14 |
| 20 | 1.545161596 | 0.000002696 | 1965305422 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 14 msgno: 15 |
| 21 | 1.545162677 | 0.000001081 | 1965305423 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 15 msgno: 16 |
| 22 | 1.545163468 | 0.000000791 | 1965305424 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 16 msgno: 17 |
| 23 | 1.556472440 | 0.011308972 | 1965305425 | {clientIP} | {serverIP} | UDT | 246 | UDT type: data seqno: 17 msgno: 18 |
Desktop (please provide the following information):
- OS: Ubuntu 18.04 (Bionic)
- SRT Version: 1.4.1
Additional context
According to the provided wireshark log and the SRT implementation my assumption of the bitrate estimation is the following:
The receiver takes every 16th and 17th packet based on their sequence number and calculates the time difference between those two packets.
Thereafter, the receiver calculates the estimated number of 1500 Byte sized packets that could be transmitted based on the time difference and sends this information to the sender.
The sender converts the number of packets per second into a bitrate.
For simplicity, I intentionally skipped some parts like taking an average value of multiple estimations and throwing away values that are too far away from the median.
Unfortunatly, I'm not sure about the accuracy of the wireshark timestamps, because I could not detect a proper correlation between the bitrate estimation of SRT and the timings in wireshark.
However, I currently have the following theory: this algorithm for bitrate estimation takes the assumption that data packets are equally distributed over time.
Maybe the media access control of mobile networks or something else in the communication path leads to a bundled transmission of data packets. As a consequence, the packet distribution over time would not be even any more.
What do you think of this theory or do you have another idea what might cause this observation?
Thank you very much in advance!