<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 6, 2012 at 6:10 PM, Randell Jesup <span dir="ltr"><<a href="mailto:randell-ietf@jesup.org" target="_blank">randell-ietf@jesup.org</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is the first of a few messages on the details of RRTCC I expect to post, based on analysis (not testing) of the algorithm, and my 8-year experience with an algorithm I designed which had very similar theory and underpinnings.  This has been used (mostly in residential settings) in hundreds of thousands of devices mostly for peer-to-peer calls.<br>



<br>
Please feel free to critique!  I make no assertions that this analysis is guaranteed correct (and in fact I'm sure it will be pointed out several ways in which it's wrong), but I think it will be a helpful starting point.  I also realize there are some simplifications assumed below; I've tried to note them.<br>



<br>
<br>
The first focus is on loss.  I'll primarily focus on the impact of tail-drop policies for now.<br>
<br>
Loss affects a stream in a number of ways:<br>
<br>
1) Directly - loss of a packet in the RTP stream<br>
2) Indirectly - loss of a packet for another traffic stream, for this or another destination<br>
3) "Random" loss (non-congestion)<br>
<br>
Note: Not all channels experience "random" loss, though some "random" loss is momentary congestion of a core router or some type of AQM.  Since in this case we're focusing on tail-drop routers (at the bottleneck), we'll assume this category can be modeled as non-congestive random losses.<br>



<br>
Obviously the more inputs and knowledge of the streams (especially between the two endpoints, via any port, not just the 5-tuple) the better the model can perform.  A confounding issue to be discussed later is how differential packet marking affects congestion and bandwidth models.<br>



<br>
Since RRTCC works from inter-packet-delays (when compared to sending times, either from RTP timestamps of header extensions with closer-to-the-stack sending times), let's look at how these types of loss affect the signals seen by the receiver and the Kalman filter.<br>



<br>
1) Direct loss<br>
-------------------<br>
In this case, we'll see the loss directly.  This is common in access-link self-congestion, where our stream(s) are the only significant user of bandwidth or if there are a very few users, and we've exceeded the capacity of the physical link.<br>



<br>
The inter-packet delay was likely increasing steadily leading up to the loss.  For example, if the other side is sending at 220Kbps at 20ms intervals with an access bottleneck (upstream at their side, or downstream at our side) of 200Kbps, and there's no other traffic on the link, then the packets would have been coming in about 22ms apart instead of 20ms.<br>



<br>
Let's assume a very short queue depth (no bufferbloat!) of 2 packets (40ms), and look what happens.  For whatever reason (packet loss, noisy signal to the filter, long RTT, cross-traffic that just went away, etc) let's assume that the system didn't react before the loss happened.<br>



<br>
When the packet is lost, there must have been 2 packets in the buffer.  The receiver will see packet N, N+1, and then N+3 and N+4. N will have been delayed around 38ms, N+1 around 40ms, N+3 about 22ms, and N+4 around 24ms  Pictorially  this would look like a sawtooth in the delay profile.<br>



<br>
If you naively input these into the filter, it will start to move down away from a 10% slope, and might indicate a flat queue-depth profile or perhaps even negative (draining) for a short time, when in fact we've been over-bandwidth the entire time. </blockquote>


<div><br></div><div>Averaged over a sawtooth, the queue depth *is flat*, right?  So it is rather a question of doing correct detection based on the output of the Kalman filter, and not the Kalman filter not estimating what is happening correctly.</div>

<div><br></div><div>Also, for the Kalman filter in RRTCC, the uncertainty of the samples will increase in this case, which makes the filter slower.</div><div>
 <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> This would depend on the exact filter type and usage, but this certainly violates some of the assumptions about error in a Kalman filter (for example, Gaussian distribution).  At least in this case, a Kalman filter might not be the optimum choice.<br>



<br></blockquote><div><br></div><div>In the non-Gaussian case, the Kalman filter is the best linear (LMMSE) state estimator, while in the Gaussian case it is the optimal (MMSE) state estimator.</div><div><br></div><div>So while it is certainly not the optimum choice, it isn't obviously broken either.</div>


<div><br></div><div>There are computationally more expensive filters such as ensemble Kalman or particle filters, but it is not clear that they will improve significanly over straight Kalman.  Some sort of simulation could sort this out.</div>


<div><br></div><div>Here is a paper where they did this for bi-Gaussian and tri-Gaussian systems.  I am not a statistician, so I can only skim this and sort-of kind-of see what is happening, but it could be an "inspiration" to further work:</div>


<div><br></div><div> <a href="http://www.control.isy.liu.se/~fredrik/reports/05ifac_hendeby.pdf" target="_blank">http://www.control.isy.liu.se/~fredrik/reports/05ifac_hendeby.pdf</a></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



* Possible modifications:<br>
a) drop samples where there's a loss, since losses frequently perturb the delta of the next packet<br>
    This will reduce the 'noise' in the inputs to the filter, especially in simple cases like above.<br></blockquote><div><br></div><div>Which samples in your example would you not feed to the Kalman filter? Deciding when to start feeding samples into the Kalman filter is another classification problem, or it can be done ad-hoc (ad-hoc ~= non-probabilistic).</div>


<div><br></div><div>Also, reducing the 'noise' in the inputs to the filter makes it react faster, which is not necessarily what you want in this particular case.</div><div><br></div><div>Note that there is an outlier filter in RRTCC.  A sample is capped at 3 std.dev from the (exponential decay) jitter.  </div>


<div><br></div><div>(end of section 3.1)</div><div><a href="http://tools.ietf.org/html/draft-alvestrand-rtcweb-congestion-00#section-3.1" target="_blank">http://tools.ietf.org/html/draft-alvestrand-rtcweb-congestion-00#section-3.1</a><br>


</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
b) increase the "uncertainty" of the next packet dramatically in the input to the filter<br>
    This is an attempt to get the Kalman filter to weight the packet much lower, but not ignore it entirely.  I don't see this as very useful in practice.<br></blockquote><div><br></div><div>I think this is conceptually cleaner.  What RRTCC is doing now is calculating the exponential decay jitter of incoming packets.   In the sawtooth-example, in stock RRTCC, the jitter variance will increase, which means that the filter will become slower.  I think this is a good property.</div>


<div><br></div><div>The exponential decay jitter calculations means that this will not happen on the *first loss*, but some time thereafter (i.e. the filter cannot react instantaneously).  </div><div><br></div><div>By using extra knowledge, we can probably build a more accurate model.  My point is that it is not "obviously broken".  A model in the filter that accounts for an absolute queue length while still retaining the current features would seem to be non-linear though, and thus require a different filter approach.</div>


<div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
c) look at whether there was a significant drop in delay following a loss, and use that as a separate indicator that we're over-bandwidth<br>
<br></blockquote><div><br></div><div>There will only be a significant drop in delay if the queue is short (no bufferbloat).  To know whether a drop is "significant", a notion of queue length must be added to the model of the network.</div>

<div><br></div><div>The larger the queue, and the higher the bandwidth, the smaller drops in delay is what we're searching for, and assuming that the queue sits egress on the sender, additional jitter is added on the rest of the path.  Thus on the receiver side, an ad-hoc filtering (non probabilistic) could easily be far from optimal.</div>


<div><br></div><div>I think it would certainly be interesting to look at a model that includes queue length as well as delay, but I think it should be probabilistic in nature, probably inside the filter, not as ad-hoc filtering on the outside.</div>

<div><br></div><div>Alexander</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In my algorithm, I termed these "fishy" losses - they implied a queue suddenly shortened.  Too many (more than 1) of these in a short period of time meant I would decrease sending bandwidth by a significant extra amount, since the implication is not just delay, but a full queue, which I really want to get out of fast.  This is a form of modification 'c'.<br>



<br>
If we're not the only stream on the bottleneck, and we just got "unlucky" and had our packet get dropped, similar issues may occur, but the reduction in delay of the next packet may be less or much less, since we're typically metering in our packets at a frame rate.  With enough other traffic, the delay of the next packet will be roughly flat (or 40ms in the case above).  So this modification (c) is of most use in detecting the bandwidth/queue limit of a relatively idle link, typically an access (especially upstream) link.  It therefore may want to be combined with other mechanisms.<br>



<br>
If we see a direct loss without a significant reduction in delay, we need to assume it's either a congested link (not a physical layer limit we're hitting on an idle link) or it's a "random" loss. Losses on a congested link also indicate a full queue, and so even though the delay stopped increasing (or stayed on=average stable after you've hit the max and started dropped), you still want to decrease sending rate.  If it's a "random" loss (and not AQM), this causes a minor under-utilization, but for a truly congested link or if AQM is causing "random" drops, it's a signal we should reduce to try to start the queue draining.   To avoid over-reaction and 'hunting', it may be good to use some type of threshold, perhaps averaged or filtered.  If the loss rate reached ~5%, I'd make a mild cut in sending rate on top of any filter-suggested cuts, and if it reached ~10% I'd make a strong cut.<br>



<br>
(to be continued in another post)<span><font color="#888888"><br>
<br>
-- <br>
Randell Jesup<br>
<a href="mailto:randell-ietf@jesup.org" target="_blank">randell-ietf@jesup.org</a>  <br>
<br>
______________________________<u></u>_________________<br>
Rtp-congestion mailing list<br>
<a href="mailto:Rtp-congestion@alvestrand.no" target="_blank">Rtp-congestion@alvestrand.no</a><br>
<a href="http://www.alvestrand.no/mailman/listinfo/rtp-congestion" target="_blank">http://www.alvestrand.no/<u></u>mailman/listinfo/rtp-<u></u>congestion</a><br>
</font></span></blockquote></div><br></div>