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

Unexpected estimations increases under congestion #4

Closed
ggarber opened this issue Mar 27, 2017 · 3 comments
Closed

Unexpected estimations increases under congestion #4

ggarber opened this issue Mar 27, 2017 · 3 comments

Comments

@ggarber
Copy link
Contributor

ggarber commented Mar 27, 2017

I'm running some tests in a constrained network (uplink 200kbps) and the bandwidth estimation is usually correct (˜150 kbps) but from time to time there is a sudden increase to 500-700kpbs that creates a lot of congestion.

After debugging it I found that the offending code is the one below. In my case some times delta value is -2.X and in that case the target bitrate is increased X3 instead of decreasing like it is supposed to do according to the comment and my expectations.

                float delta = (kGainDown * offTarget * bytesNewlyAcked * mss / cwnd);
                cwnd += (int)(delta);
                
                /*
                 * Especially when running over low bitrate bottlenecks, it is
                 *  beneficial to reduce the target bitrate a little, it limits
                 *  possible RTP queue delay spikes when congestion window is reduced
                 */
                float rateTotal = 0.0f;
                for (int n = 0; n < nStreams; n++)
                    rateTotal += streams[n]->getMaxRate();
                if (rateTotal < 1.0e5f) {
                    delta = -delta / cwnd;
                    float rateAdjustFactor = (1.0f - delta);
                    for (int n = 0; n < nStreams; n++) {
                        Stream *tmp = streams[n];
                        tmp->targetBitrate = std::max(tmp->minBitrate,
                                                      std::min(tmp->maxBitrate,
                                                               tmp->targetBitrate*rateAdjustFactor));
                    }
                }

In my case these were the values of some relevant variables one of the times I could reproduce the issue:

OffTarget = -7.2
cwnd = -2920
Delta = -2.13

For the time being I will change that code to do nothing if rateAdjustFactor > 1 but I'm not sure of the implications.

This is a graph with encoded and sent bitrate, bandwidth estimation and rtt where you can see how the bwe suddenly increased for no reason in the middle of the session:

image

@IngJohEricsson
Copy link
Contributor

IngJohEricsson commented Mar 27, 2017 via email

@IngJohEricsson
Copy link
Contributor

IngJohEricsson commented Mar 28, 2017 via email

@ggarber
Copy link
Contributor Author

ggarber commented Mar 28, 2017

That's great! Thank you very much for your fast response Ingemar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants