-
Notifications
You must be signed in to change notification settings - Fork 856
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
[core] Improved input rate calculation. #763
Conversation
Streaming 500 Mbps with master banch. Default configuration, As can be seen on the plots shown below, the initial bandwidth limit of 30 Mbps is active for the first 1 sec. Although after roughly 100 ms the TSBPD mechanism takes over and forces the sender to transmit faster (issue #713 TSBPD suppress max BW limitation). |
274d72a
to
ab46aa0
Compare
SRTO_MAXBW=0; SRTO_INPUTBW=0;
ab46aa0
to
5c758a0
Compare
Fixing bandwidth limitation mode with automatic input bitrate Rinput calculation. Configuration
SRTO_MAXBW=0
,SRTO_INPUTBW=0
, live transmission mode.In this mode the bandwidth limit is Rinput * (1 + OHEAD), with Rinput calculated based on the number of packets added to the sender's buffer (via srt_send*).
The desired behavior of the input rate calculation:
Note. 2000 packets roughly equals to 21 Mbps of 1316 bytes payload. Therefore the condition is true after 0.5 s of 40 Mbps streaming, and the earlier the higher the bitrate is. E.g. for 400 Mbps streaming the input rate will be calculated already after 50 ms.
Changes introduced by this PR
Issue. Initial Input Rate of 10 Mbps for Fast Start Period
The initial input rate for fast start period was only 10 Mbps
static const int SND_INPUTRATE_INITIAL_BPS = 10000000/8;
Now it equals the BW_INFINIT value (30 Mbps, or 1 Gbps after PR #760):
static const int INPUTRATE_INITIAL_BYTESPS = BW_INFINITE;
Issue: Wrong Initial Sampling Period
Wrong condition in
CUDT::updateCC
. Switching to RUNNING mode on 2000 packets condition does not update the input rate, instead the update is delayed for 1 second instead of 0.5 seconds.SND_INPUTRATE_MAX_PACKETS = 2000
Input Rate for Idle Connections (TO DISCUSS)
After this PR the input rate is updated only when new packets are added to the sender's buffer.
Previously the input rate was also updated for idle connections, meaning that if there is a temporal congestion on the link, the input rate estimation might decrease. In this case decreasing the input rate of an idle link is not the desired behavior, because it also decreases the bandwidth limitation, while the expected live stream rate should be at least the same.
Although in some cases it might make sense to decrease the bandwidth limit to decrease the rate of packet retransmission.
CUDT Control Over CSndBuffer's Rnput Rate Calculation Sampling Period
Now CSndBuffer controls input rate calculation sampling period internally, allowing the CUDT to reset the mode back to FAST START.
CSndBuffer::setInputRateSmpPeriod(int period);
made privateCSndBuffer::resetInputRateSmpPeriod(bool disable)
TODO