Skip to content
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] FileCC improvements #807

Merged
merged 1 commit into from
Sep 3, 2019

Conversation

maxsharabayko
Copy link
Collaborator

@maxsharabayko maxsharabayko commented Aug 9, 2019

Improving FileCC. Mainly bearing with losses below 2%. Also reduced reaction on losses.

Changes to FileCC::updateSndPeriod

Experiments have shown that the bandwidth estimation value BW = m_parent->bandwidth() is not reliable enough. However, it was used to determine the highest possible sending bitrate in FileCC.

The value B determines the difference between the estimated bandwidth BW, and current sending rate R=1000000/m_dPktSndPeriod (packets per second):

B = BW - R (pkts/s)

The new sending rate will be increased exponentially the higher the value of B is.

In case BW is overestimated, the increase wll be too rapid and will instantly fall into network congestion.

Therefore, in this PR the last point where the loss was detected is used. The value of that is multiplied by two so that the increased value hits the area around that point.

loss_bw = 2 * (1000000 / m_dLastDecPeriod); // 2 times last loss point

Changes to Loss Processing FileCC::slowdownSndPeriod

When a loss report is received, FileCC enters the loss avoidance mode (m_bLoss = true).

If the number of lost packets is less than 2% of the packets in flight (unacknowledged), then do not decrease the sending rate, but do not increase as well. Remember the loss point (m_dLastDecPeriod).

Then, if the number of lost packets is higher than 2% of the packets in flight, then decrease the sending rate, but not as rapid, as it was decreased in the previous version of FileCC.

Further improvements

  1. The higher the loss ratio is, the higher the sending rate is decreased. This improvement was tested in experimental branch, but is not included in the current PR.
if (CSeqNo::seqcmp(lossbegin, m_iLastDecSeq) > 0)
{
    const double mult = lost_pcent_x10 < 30 ? 1.03 : ((1000 + lost_pcent_x10) / 1000.0);
    m_dPktSndPeriod = ceil(m_dPktSndPeriod * mult);
  1. speedupToWindowSize is called in case of LATE_REXMIT. This means that the sender considers some packets lost, because it does not receive neither ACK, nor LOSS report for some time. In that case FileCC should also stop increasing sending rate. At the moment FileCC ignores that.

Related PRs

#802 is to reduce the number of retransmitted packets.

@maxsharabayko maxsharabayko added the [core] Area: Changes in SRT library core label Aug 9, 2019
@maxsharabayko maxsharabayko added this to the v1.3.4 milestone Aug 9, 2019
@maxsharabayko maxsharabayko self-assigned this Aug 9, 2019
srtcore/congctl.cpp Outdated Show resolved Hide resolved
@maxsharabayko
Copy link
Collaborator Author

maxsharabayko commented Aug 13, 2019

AZ EUW to USW transmission test.
Configuration: transtype=file, messageapi=1, rcvbuf=625000000, sndbuf=625000000, fc=40000.

Congested network conditions: effective transmission rate ~550 Mbps.

The same number of packets is being transmitted. v1.3.3 takes 125 seconds to transmit the data, while the new version takes ~100 seconds.
Number of retransmitted packets (v1.3.3 vs PR): 461 242 vs 241 718

v1.3.3

euw_usw-alg-master-filecc-msgsize-1456-stats-take5-snd-packets

euw_usw-alg-master-filecc-msgsize-1456-stats-take5-snd-rate

euw_usw-alg-master-filecc-msgsize-1456-stats-take5-snd-pktsendperiod

This PR

euw_usw-alg-filecc-filecc-msgsize-1456-stats-take5-snd-packets

euw_usw-alg-filecc-filecc-msgsize-1456-stats-take5-snd-rate

euw_usw-alg-filecc-filecc-msgsize-1456-stats-take5-snd-pktsendperiod

@maxsharabayko
Copy link
Collaborator Author

AZ EUW to USW transmission test.
Configuration: transtype=file, messageapi=1, rcvbuf=625000000, sndbuf=625000000, fc=40000.

Better network conditions: possible transmission rate ~1500 Mbps.

v1.3.3

euw_usw-alg-master-filecc-msgsize-1456-take3-stats-snd-packets

euw_usw-alg-master-filecc-msgsize-1456-take3-stats-snd-rate

euw_usw-alg-master-filecc-msgsize-1456-take3-stats-snd-pktsendperiod

This PR

euw_usw-alg-filecc-filecc-msgsize-1456-take3-stats-snd-packets

euw_usw-alg-filecc-filecc-msgsize-1456-take3-stats-snd-rate

euw_usw-alg-filecc-filecc-msgsize-1456-take3-stats-snd-pktsendperiod

@maxsharabayko maxsharabayko marked this pull request as ready for review August 27, 2019 14:08
srtcore/congctl.cpp Outdated Show resolved Hide resolved
srtcore/congctl.cpp Outdated Show resolved Hide resolved
srtcore/congctl.cpp Outdated Show resolved Hide resolved
@ethouris ethouris added Status: Review Needed Type: Maintenance Work required to maintain or clean up the code labels Aug 28, 2019
@rndi rndi merged commit bc52749 into Haivision:master Sep 3, 2019
@maxsharabayko maxsharabayko deleted the develop/filecc-improvement branch September 4, 2019 09:33
@maxsharabayko
Copy link
Collaborator Author

Also related to #413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants