RFC 8382

Shared Bottleneck Detection for Coupled Congestion Control for RTP Media

๐Ÿ“… published June 2018, from ietf

Shared Bottleneck Detection for Coupled Congestion Control for RTP Media ๐Ÿฆ‹

Okay bestie, this is RFC 8382 โœจ, published in June 2018 by the IETF (Internet Engineering Task Force) ๐ŸŒธ. D. Hayes is the editor (Ed.), and S. Ferlin, M. Welzl, and K. Hiorth are the other authors. The affiliations listed are Simula Research Laboratory (next to S. Ferlin) and University of Oslo (next to K. Hiorth). It's in the Experimental category with ISSN 2070-1721 ๐Ÿงช. The title block doesn't list any document it obsoletes or updates, so it stands on its own ๐Ÿ’….

Abstract ๐ŸŒธ

This document describes a mechanism to detect whether end-to-end data flows share a common bottleneck. This mechanism relies on summary statistics that are calculated based on continuous measurements and used as input to a grouping algorithm that runs wherever the knowledge is needed.

Status of This Memo ๐Ÿ“œ

This document is not an Internet Standards Track specification; it is published for examination, experimental implementation, and evaluation.

This document defines an Experimental Protocol for the Internet community. This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Not all documents approved by the IESG are candidates for any level of Internet Standard; see Section 2 of RFC 7841.

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8382.

Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

Table of Contents ๐Ÿ—บ๏ธ

   1. Introduction ....................................................4
      1.1. The Basic Mechanism ........................................4
      1.2. The Signals ................................................4
           1.2.1. Packet Loss .........................................4
           1.2.2. Packet Delay ........................................5
           1.2.3. Path Lag ............................................5
   2. Definitions .....................................................6
      2.1. Parameters and Their Effects ...............................7
      2.2. Recommended Parameter Values ...............................8
   3. Mechanism .......................................................9
      3.1. SBD Feedback Requirements .................................10
           3.1.1. Feedback When All the Logic Is Placed at
                  the Sender .........................................10
           3.1.2. Feedback When the Statistics Are Calculated at the
                  Receiver and SBD Is Performed at the Sender ........11
           3.1.3. Feedback When Bottlenecks Can Be Determined
                  at Both Senders and Receivers ......................11
      3.2. Key Metrics and Their Calculation .........................12
           3.2.1. Mean Delay .........................................12
           3.2.2. Skewness Estimate ..................................12
           3.2.3. Variability Estimate ...............................13
           3.2.4. Oscillation Estimate ...............................13
           3.2.5. Packet Loss ........................................14
      3.3. Flow Grouping .............................................14
           3.3.1. Flow-Grouping Algorithm ............................14
           3.3.2. Using the Flow Group Signal ........................18
   4. Enhancements to the Basic SBD Algorithm ........................18
      4.1. Reducing Lag and Improving Responsiveness .................18
           4.1.1. Improving the Response of the Skewness Estimate ....19
           4.1.2. Improving the Response of the Variability
                  Estimate ...........................................20
      4.2. Removing Oscillation Noise ................................21
   5. Measuring OWD ..................................................21
      5.1. Timestamp Resolution ......................................21
      5.2. Clock Skew ................................................22
   6. Expected Feedback from Experiments .............................22
   7. IANA Considerations ............................................22
   8. Security Considerations ........................................22
   9. References .....................................................23
      9.1. Normative References ......................................23
      9.2. Informative References ....................................23
   Acknowledgments ...................................................25
   Authors' Addresses ................................................25

1. Introduction โœจ

So here's the tea ๐Ÿซ–: on the Internet, it's not normally known whether flows (like TCP connections or UDP data streams) go through the same bottlenecks ๐Ÿ‘€. Even flows with the same sender and receiver may take different paths, and they may or may not share a bottleneck. Flows that share a bottleneck link usually compete with each other for their share of the capacity. That competition can increase packet loss and delays. It's especially relevant for interactive apps that talk to multiple peers at the same time (like multi-party video) ๐Ÿ“น. For RTP media apps such as RTCWEB, [RTP-COUPLED-CC] describes a scheme that combines the congestion controllers of flows in order to honor their priorities and avoid unnecessary packet loss as well as delay. This mechanism relies on some form of Shared Bottleneck Detection (SBD); here, a measurement-based SBD approach is described.

1.1. The Basic Mechanism ๐Ÿงƒ

The mechanism groups flows that have similar statistical characteristics together. Section 3.3.1 describes a simple method for achieving this; however, a major part of this document is concerned with collecting suitable statistics for this purpose.

1.2. The Signals ๐Ÿ“ก

The current Internet is unable to explicitly tell endpoints which flows share bottlenecks, so endpoints have to infer it from whatever information they have available ๐Ÿ•ต๏ธโ€โ™€๏ธ. The mechanism described here currently uses packet loss and packet delay, but it isn't restricted to those. As Explicit Congestion Notification (ECN) becomes more prevalent, it too will become a valuable base signal that can be correlated to detect shared bottlenecks.

1.2.1. Packet Loss ๐Ÿ’ง

Packet loss is often a relatively infrequent indication that a flow traverses a bottleneck. Therefore, on its own it is of limited use for SBD; however, it is a valuable supplementary measure when it is more prevalent (refer to [RFC7680], Section 2.5 for measuring packet loss).

1.2.2. Packet Delay โฑ๏ธ

End-to-end delay measurements include noise from every device along the path, in addition to the delay perturbation at the bottleneck device. The noise is often significantly increased if the round-trip time is used. The cleanest signal is obtained by using One-Way Delay (OWD) (refer to [RFC7679], Section 3 for a definition of OWD).

Measuring absolute OWD is difficult, since it requires both the sender and receiver clocks to be synchronized. However, since the statistics being collected are relative to the mean OWD, a relative OWD measurement is sufficient. Clock skew is not usually significant over the time intervals used by this SBD mechanism (see [RFC6817], Appendix A.2 for a discussion on clock skew and OWD measurements). However, in circumstances where it is significant, Section 5.2 outlines a way of adjusting the calculations to cater to it.

Each packet arriving at the bottleneck buffer may experience very different queue lengths and, therefore, different waiting times. A single OWD sample does not, therefore, characterize the path well. However, multiple OWD measurements do reflect the distribution of delays experienced at the bottleneck. ๐ŸŒˆ

1.2.3. Path Lag ๐Ÿข

Flows that share a common bottleneck may traverse different paths, and these paths will often have different base delays. This makes it difficult to correlate changes in delay or loss. This technique uses the long-term shape of the delay distribution as a base for comparison to counter this.

2. Definitions ๐Ÿ“–

Okay, the rulebook time, and I need you to pay attention ๐Ÿฅน: The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

Acronyms used in this document:

      OWD - One-Way Delay

      MAD - Mean Absolute Deviation

      SBD - Shared Bottleneck Detection

Conventions used in this document:

      T            the base time interval over which measurements
                   are made

      N            the number of base time, T, intervals used in some
                   calculations

      M            the number of base time, T, intervals used in some
                   calculations, where M <= N

      sum(...)     summation of terms of the variable in parentheses

      sum_T(...)   summation of all the measurements of the variable in
                   parentheses taken over the interval T

      sum_NT(...)  summation of all measurements taken over the
                   interval N*T

      sum_MT(...)  summation of all measurements taken over the
                   interval M*T

      E_T(...)     the expectation or mean of the measurements of the
                   variable in parentheses over T

      E_N(...)     the expectation or mean of the last N values of the
                   variable in parentheses

      E_M(...)     the expectation or mean of the last M values of the
                   variable in parentheses

      num_T(...)   the count of measurements of the variable in
                   parentheses taken in the interval T

      num_MT(...)  the count of measurements of the variable in
                   parentheses taken in the interval M*T

      PB           a boolean variable indicating that the particular
                   flow was identified transiting a bottleneck in the
                   previous interval T (i.e., "Previously Bottleneck")

      skew_est     a measure of skewness in an OWD distribution

      skew_base_T  a variable used as an intermediate step in
                   calculating skew_est

      var_est      a measure of variability in OWD measurements

      var_base_T   a variable used as an intermediate step in
                   calculating var_est

      freq_est     a measure of low-frequency oscillation in the OWD
                   measurements

      pkt_loss     a measure of the proportion of packets lost

      p_l, p_f, p_mad, c_s, c_h, p_s, p_d, p_v
                   various thresholds used in the mechanism

      M and F      number of values related to N

โ‹ฏ ๐Ÿฆ‹ to be continued ๐Ÿฆ‹ โ‹ฏ

2.1. Parameters and Their Effects

okay so this is the knob cheat sheet ๐ŸŽ›๏ธ every parameter has a job, and tuning one usually nudges another, so read this part slowly bestie ๐Ÿซถ

T         T should be long enough so that there are enough packets
          received during T for a useful estimate of the short-term
          mean OWD and variation statistics.  Making T too large can
          limit the efficacy of freq_est.  It will also increase the
          response time of the mechanism.  Making T too small will
          make the metrics noisier.

N and M   N should be large enough to provide a stable estimate of
          oscillations in OWD.  Often, M=N is just fine, though
          having M<N may be beneficial in certain circumstances.  M*T
          needs to be long enough to provide stable estimates of
          skewness and MAD.

F         F determines the number of intervals over which statistics
          are considered to be equally weighted.  When F=M, recent
          and older measurements are considered equal.  Making F<M
          can increase the responsiveness of the SBD mechanism.  If F
          is too small, statistics will be too noisy.

c_s       c_s is the threshold in skew_est used for determining
          whether a flow is transiting a bottleneck or not.  Lower
          values of c_s require bottlenecks to be more congested to
          be considered for grouping by the mechanism.  c_s should be
          set within the range of +0.2 to -0.1 -- low enough so that
          lightly loaded paths do not give a false indication.

p_l       p_l is the threshold in pkt_loss used for determining
          whether a flow is transiting a bottleneck or not.  When
          pkt_loss is high, it becomes a better indicator of
          congestion than skew_est.

c_h       c_h adds hysteresis to the bottleneck determination.  It
          should be large enough to avoid constant switching in the
          determination but low enough to ensure that grouping is not
          attempted when there is no bottleneck and the delay and
          loss signals cannot be relied upon.

p_v       p_v determines the sensitivity of freq_est to noise.
          Making it smaller will yield higher but noisier values for
          freq_est.  Making it too large will render it ineffective
          for determining groups.

p_*       Flows are separated when the
          skew_est|var_est|freq_est|pkt_loss measure is greater than
          p_s|p_mad|p_f|p_d.  Adjusting these is a compromise between
          false grouping of flows that do not share a bottleneck and
          false splitting of flows that do.  Making them larger can
          help if the measures are very noisy, but reducing the noise
          in the statistical measures by adjusting T and N|M may be a
          better solution.

the vibes here are "these numbers just work" ๐Ÿ’– the original paper, [Hayes-LCN14], starts with T=350ms and N=50. then the later tweaks tighten things up a bit: c_s=0.1, p_f=p_d=0.1, p_s=0.15, p_mad=0.1, and p_v=0.7. M=30, F=20, and c_h=0.3 are extra knobs defined in that same paper. the team says these work well across a wide range of real Internet conditions, so yes, they're a solid starting point ๐ŸŒธ

3. Mechanism

okay this is the core idea and it's honestly so clever ๐Ÿฆ‹ when flows go through the same bottleneck, each flow's pile of packet delay measurements ends up with a similar shape. the shape gets summed up with three main stats:

  1. variability estimate (var_est; see Section 3.2.3)
  2. skewness estimate (skew_est; see Section 3.2.2)
  3. oscillation estimate (freq_est; see Section 3.2.4)

and packet loss (pkt_loss; see Section 3.2.5) tags along as a supporting stat ๐ŸŽ€

summary stats are the MVP here because they fix both the noise problem and the path lag problem. they describe the general shape over a pretty long stretch of time, so one jittery packet can't ruin the vibe. each stat gives you a different "view" of the bottleneck, and together they're a super robust way to group flows ๐Ÿ‘‘ also, an RTP media device can be a sender AND a receiver, and SBD can run on either side or both ๐Ÿ’œ

here's the picture of the setup, a little network with three hosts and three links:

                                  +----+
                                  | H2 |
                                  +----+
                                     |
                                     | L2
                                     |
                         +----+  L1  |  L3  +----+
                         | H1 |------|------| H3 |
                         +----+             +----+

A network with three hosts (H1, H2, H3) and three links (L1, L2, L3)

Figure 1

so there are two spots where you can look for a shared bottleneck: the sender side and the receiver side ๐Ÿงš

  1. Sender side: picture H1 sending media streams to H2 and H3, with L1 being the shared bottleneck. H2 and H3 measure the OWD and packet loss, then every T they send either that raw data or the calculated summary stats back to H1. H1 has all that info, so it can figure out the shared bottleneck and adjust its send rates accordingly ๐Ÿ’…
  2. Receiver side: now say H2 is also sending media to H3, and L3 is the shared bottleneck ๐Ÿ‘€ if H3 sends its summary stats to H1 and H2, neither of them has enough info on their own to spot this bottleneck. H3 can though! it combines the summary stats tied to H1 and the ones tied to H2, one set at a time ๐Ÿซถ

3.1. SBD Feedback Requirements

there are three ways this can go, and each one needs different feedback:

  1. Both summary statistic calculations and SBD are performed at senders only. When sender-based congestion control is implemented, this method is RECOMMENDED.
  2. Summary statistics are calculated on the receivers, and SBD is performed at the senders.
  3. Summary statistic calculations are performed on receivers, and SBD is performed at both senders and receivers (beyond the scope of this document, but allows cooperative detection of bottlenecks).

the doc covers all three for completeness, but honestly the expected plan is scenario 1, working together with sender-based congestion control ๐Ÿ’–

3.1.1. Feedback When All the Logic Is Placed at the Sender

this one is so easy to love because everything lives in one place, the sender ๐ŸŒˆ the sender works out the summary stats and decides the shared bottlenecks from them, which keeps most of the functionality together.

for every packet, the sender needs accurate relative OWD measurements with enough precision, plus a heads up about lost packets (or the share of packets lost over an interval). a way to send that measurement data over RTP Control Protocol (RTCP) is described in [RTCP-CC-FEEDBACK] โœจ

sums, var_base_T, and skew_base_T get updated little by little as relative OWD measurements come in from the feedback messages. once there's enough data to cover the base time interval T for every flow, the summary stats get calculated for that T interval (see Section 3.2), and the flows get grouped (see Section 3.3.1). exactly when that happens depends on how often the feedback message shows up ๐Ÿฆ‹

3.1.2. Feedback When the Statistics Are Calculated at the Receiver and SBD Is Performed at the Sender

this scenario keeps feedback to a minimum, but the receivers have to send selected summary stats at a regular interval that everyone agreed on ๐ŸŽ€ here's the handshake the doc imagines to get things started:

  • An initialization message from the sender to the receiver will contain the following information:
    • A list of which key metrics should be collected and relayed back to the sender out of a possibly extensible set (pkt_loss, var_est, skew_est, and freq_est). The grouping algorithm described in this document requires all four of these metrics, and receivers MUST be able to provide them, but future algorithms may be able to exploit other metrics (e.g., metrics based on explicit network signals).
    • The values of T, N, and M, and the necessary resolution and precision of the relayed statistics.
  • A response message from the receiver acknowledges this message with a list of key metrics it supports (subset of the sender's list) and is able to relay back to the sender.

the handshake can be repeated to lock in the final set of metrics ๐Ÿงš every agreed metric has to be supported by every receiver, no exceptions bestie. it's also recommended that the initialization message from the sender carry an identifier for the SBD algorithm version, so that future upgrades can be rolled out easily ๐ŸŒธ the mechanism in this document goes by the identifier "SBD=01" ๐Ÿ’…

once everyone's initialized, the agreed-upon summary stats get fed back to the sender (nominally every T) ๐Ÿ’œ

3.1.3. Feedback When Bottlenecks Can Be Determined at Both Senders and Receivers

this one is still outside the scope of the SBD algorithm in this doc. it's only mentioned so that fancier sender/receiver teamwork for finding bottlenecks stays possible down the road ๐Ÿ”ฎ

it's expected to be set up in a way that's pretty similar to Section 3.1.2 โœจ and after that, both the summary stats and the shared bottleneck determinations should be exchanged, nominally every T ๐Ÿซถ

3.2. Key Metrics and Their Calculation

measurements get calculated over a base interval (T) and then summarized across N or M of those intervals. the good news is that all of the summary stats can be calculated incrementally, so no need to store everything ๐ŸŒˆ

3.2.1. Mean Delay

okay the mean delay is NOT a useful signal for comparing flows ๐Ÿ™ˆ flows can take super different paths, and their clocks aren't necessarily synced. it's still a base measure for the other three summary stats though, so it's important. the mean delay, E_T(OWD), is just the average OWD measured over T.

to make the other calculations work, the last N E_T(OWD) values need to be stored in a cyclic buffer, together with a moving average of E_T(OWD) ๐Ÿ’–

mean_delay = E_M(E_T(OWD)) = sum_M(E_T(OWD)) / M

where M <= N. setting M lower than N makes the mechanism more responsive to changes ๐Ÿฆ‹ but it can cost you a higher error rate, potentially. (see Section 4.1 for a discussion on improving the responsiveness of the mechanism) ๐ŸŽ€

3.2.2. Skewness Estimate ๐Ÿฆ‹

okay so skewness is lowkey hard to calculate efficiently AND accurately ๐Ÿ˜ญ. Ideally you'd calc it over the whole period (M*T) using the mean OWD for that period, but that means storing every single delay measurement across the whole period, and that's a lot of hoarding ๐Ÿ’€. So instead, we estimate skewness over M*T by doing a calc every T, using the previous T's calculation of mean_delay โœจ.

The base for the skewness calc is estimated with a counter that gets reset every T ๐Ÿงฎ. It goes up for OWD samples below the mean and goes down for OWD samples above the mean. So for each OWD sample:

if (OWD < mean_delay) skew_base_T++

if (OWD > mean_delay) skew_base_T--

mean_delay does not include the mean of the current T interval. That's what lets it be calculated iteratively ๐Ÿ”, and honestly that's giving clever.

skew_est = sum_MT(skew_base_T) / num_MT(OWD)

where skew_est is a number between -1 and 1 ๐ŸŽ€.

Note: Care must be taken when implementing the comparisons to ensure that rounding does not bias skew_est. It is important that the mean is calculated with a higher precision than the samples. ๐Ÿ™ˆ

3.2.3. Variability Estimate ๐ŸŒธ

Mean Absolute Deviation (MAD) is a robust variability measure that copes super well with different send rates ๐Ÿ‘‘. It can be implemented in an online manner like this:

var_base_T = sum_T(|OWD - E_T(OWD)|)

Where:

  • |x| is the absolute value of x
  • E_T(OWD) is the mean OWD calculated in the previous T
var_est = MAD_MT = sum_MT(var_base_T) / num_MT(OWD)

3.2.4. Oscillation Estimate ๐ŸŽข

We estimate the low-frequency oscillation of the delay signal by counting and normalizing the significant mean, E_T(OWD), crossings of mean_delay ๐Ÿ”:

freq_est = number_of_crossings / N

where we define a significant mean crossing as a crossing that extends p_v * var_est from mean_delay. In our experiments, we have found that p_v = 0.7 is a good value ๐Ÿ’–.

freq_est is a number between 0 and 1. freq_est can be approximated incrementally as follows:

  • With each new calculation of E_T(OWD), a decision is made as to whether this value of E_T(OWD) significantly crosses the current long-term mean, mean_delay, with respect to the previous significant mean crossing.
  • A cyclic buffer, last_N_crossings, records a 1 if there is a significant mean crossing; otherwise, it records a 0.
  • The counter, number_of_crossings, is incremented when there is a significant mean crossing and decremented when a non-zero value is removed from the last_N_crossings.

This approximation of freq_est was not used in [Hayes-LCN14], which calculated freq_est every T using the current E_N(E_T(OWD)). Our tests show that this approximation of freq_est yields results that are almost identical to when the full calculation is performed every T. Iconic efficiency, no cap ๐Ÿ”ฅ.

3.2.5. Packet Loss ๐Ÿ’ง

The proportion of packets lost over the period NT is used as a supplementary measure ๐Ÿซถ:

pkt_loss = sum_NT(lost packets) / sum_NT(total packets)
Note: When pkt_loss is low, it is very variable; however, when pkt_loss is high, it becomes a stable measure for making grouping decisions. ๐Ÿฅน

3.3. Flow Grouping ๐Ÿงบ

3.3.1. Flow-Grouping Algorithm ๐Ÿ”

The following grouping algorithm is RECOMMENDED for the use of SBD with coupled congestion control for RTP media [RTP-COUPLED-CC]. It's sufficient and efficient for small to moderate numbers of flows. For very large numbers of flows (e.g., hundreds), a more complex clustering algorithm may be substituted ๐Ÿง .

Since no single metric is precise enough to group flows (due to noise), the algorithm uses multiple metrics. Each metric offers a different "view" of the bottleneck link characteristics, and used together they enable a more precise grouping of flows than would otherwise be possible. It's giving teamwork ๐Ÿ‘ฏโ€โ™€๏ธ.

Flows determined to be transiting a bottleneck are successively divided into groups based on freq_est, var_est, skew_est, and pkt_loss.

The first step is to determine which flows are transiting a bottleneck. This is important, since if a flow is not transiting a bottleneck, its delay-based metrics will not describe the bottleneck but will instead describe the "noise" from the rest of the path ๐Ÿ“‰. Skewness, with the proportion of packet loss as a supplementary measure, is used to do this:

  1. Grouping will be performed on flows that are inferred to be traversing a bottleneck by:
skew_est < c_s

   || ( skew_est < c_h & PB ) || pkt_loss > p_l

The parameter c_s controls how sensitive the mechanism is in detecting a bottleneck. c_s = 0.0 was used in [Hayes-LCN14]. A value of c_s = 0.1 is a little more sensitive, and c_s = -0.1 is a little less sensitive ๐ŸŽš๏ธ. c_h controls the hysteresis on flows that were grouped as transiting a bottleneck the previous time. If the test result is TRUE, PB=TRUE; otherwise, PB=FALSE.

These flows (i.e., flows transiting a bottleneck) are then progressively divided into groups based on the freq_est, var_est, and skew_est summary statistics. The process proceeds according to the following steps ๐Ÿชœ:

  1. Group flows whose difference in sorted freq_est is less than a threshold:
diff(freq_est) < p_f
  1. Subdivide the groups obtained in step 2 by grouping flows whose difference in sorted E_M(var_est) (highest to lowest) is less than a threshold:
diff(var_est) < (p_mad * var_est)

The threshold, (p_mad * var_est), is with respect to the highest value in the difference.

  1. Subdivide the groups obtained in step 3 by grouping flows whose difference in sorted skew_est is less than a threshold:
diff(skew_est) < p_s
  1. When packet loss is high enough to be reliable (pkt_loss > p_l), subdivide the groups obtained in step 4 by grouping flows whose difference is less than a threshold:
diff(pkt_loss) < (p_d * pkt_loss)

The threshold, (p_d * pkt_loss), is with respect to the highest value in the difference.

This procedure involves sorting estimates from highest to lowest. It is simple to implement and is efficient for small numbers of flows (up to 10-20) ๐ŸŒท. Figure 2 illustrates this algorithm.

                                        *********
                                        * Flows *
                                        ***.**.**
                                          /    '
                                         /     '--.
                                        /          \
                                   .---v--.    .----v---.
   1. Flows traversing             | Cong |    | UnCong |
      a bottleneck                 '-.--.-'    '--------'
                                    /    \
                                   /      \
                                  /        \
                              .--v--.       v-----.
   2. Divide by               | g_1 |  ...  | g_n |
      freq_est                '---.-.       '----..
                                 /   \          /  \
                                /     '--.     v    '------.
                               /          \                 \
                         .----v-.        .-v----.        .---v--.
   3. Divide by          | g_1a |  ...   | g_1z |   ...  | g_nz |
      var_est            '---.-.'        '-----..        '-.-.--'
                            /   \             /  \        /  |
                           /     '-----.     v    v      v   |
                          /             \                    |
                       .-v-----.       .-v-----.         .---v---.
   4. Divide by        | g_1ai |  ...  | g_1ax |   ...   | g_nzx |
      skew_est         '----.-.'       '------..         '-.-.---'
                           /   \             /  \         /  |
                          /     '--.        v    v       v   |
                         /          \                        |
                  .-----v--.       .-v------.           .----v---.
   5. Divide by   | g_1aiA |  ...  | g_1aiZ |    ...    | g_nzxZ |
      pkt_loss    '--------'       '--------'           '--------'
      (when applicable)

                         Simple grouping algorithm

                                 Figure 2

3.3.2. Using the Flow Group Signal ๐Ÿ“ก

Grouping decisions can be made every T from the second T. However, they won't attain their full design accuracy until after the 2*Nth T interval. We recommend that grouping decisions not be made until 2*M T intervals โณ.

Network conditions, and even the congestion controllers, can cause bottlenecks to fluctuate ๐ŸŒŠ. A coupled congestion controller MAY decide only to couple groups that remain stable, say grouped together 90% of the time, depending on its objectives. Recommendations concerning this are beyond the scope of this document and will be specific to the coupled congestion controller's objectives ๐Ÿ’….

4. Enhancements to the Basic SBD Algorithm โœจ

The SBD algorithm as specified in Section 3 was found to work well for a broad variety of conditions ๐Ÿ‘‘. The following enhancements to the basic mechanisms have been found to significantly improve the algorithm's performance under some circumstances and SHOULD be implemented. These "tweaks" are described separately to keep the main description succinct ๐ŸŽ€.

4.1. Reducing Lag and Improving Responsiveness ๐Ÿƒโ€โ™€๏ธ

This section describes how to improve the responsiveness of the basic algorithm ๐Ÿฆ‹.

Measurement-based shared bottleneck detection makes decisions in the present based on what has been measured in the past. This means there is always a lag in responding to changing conditions ๐ŸŒ. This mechanism is based on summary statistics taken over (N*T) seconds. It can be made more responsive to changing conditions by:

  1. Reducing N and/or M, but at the expense of having metrics that are less accurate, and/or
  2. Exploiting the fact that measurements that are more recent are more valuable than older measurements and weighting them accordingly.

Although measurements that are more recent are more valuable, older measurements are still needed to gain an accurate estimate of the distribution descriptor we are measuring. Unfortunately, the simple exponentially weighted moving average weights drop off too quickly for our requirements and have an infinite tail ๐Ÿ˜ตโ€๐Ÿ’ซ. A simple linearly declining weighted moving average also doesn't give enough weight to the most recent measurements ๐Ÿฅฒ.

So we propose a piecewise linear distribution of weights ๐ŸŒˆ. The first section (samples 1:F) is flat, as in a simple moving average, and the second section (samples F+1:M) has linearly declining weights to the end of the averaging window. We choose integer weights, because this allows incremental calculation without introducing rounding errors ๐Ÿงš.

4.1.1. Improving the Response of the Skewness Estimate โœจ

okay so bestie, the weighted moving average for skew_est (based on the skew_est from Section 3.2.2 ๐Ÿซถ) works out like this ๐Ÿ’…:

   skew_est = ((M-F+1)*sum(skew_base_T(1:F))

                   + sum([(M-F):1].*skew_base_T(F+1:M)))

              / ((M-F+1)*sum(numsampT(1:F))

                   + sum([(M-F):1].*numsampT(F+1:M)))

here's what the bits mean ๐Ÿงš

  • numsampT is an array of the number of OWD samples in each T (i.e., num_T(OWD)), and numsampT(1) is the most recent
  • skew_base_T(1) is the most recent calculation of skew_base_T
  • 1:F refers to the integer values 1 through to F, and [(M-F):1] refers to an array of the integer values (M-F) declining through to 1
  • ".*" is the array scalar dot product operator

to calculate this weighted skew_est incrementally, you do this ๐Ÿ”ฅ

   Notation:    F_ = flat portion, D_ = declining portion,
                W_ = weighted component

   Initialize:  sum_skewbase = 0, F_skewbase = 0, W_D_skewbase = 0

                skewbase_hist = buffer of length M, initialized to 0

                numsampT = buffer of length M, initialized to 0

   Steps per iteration:

   1.   old_skewbase = skewbase_hist(M)

   2.   old_numsampT = numsampT(M)

   3.   cycle(skewbase_hist)

   4.   cycle(numsampT)

   5.   numsampT(1) = num_T(OWD)
   6.   skewbase_hist(1) = skew_base_T

   7.   F_skewbase = F_skewbase + skew_base_T - skewbase_hist(F+1)

   8.   W_D_skewbase = W_D_skewbase + (M-F)*skewbase_hist(F+1)
          - sum_skewbase

   9.   W_D_numsamp = W_D_numsamp + (M-F)*numsampT(F+1) - sum_numsamp
          + F_numsamp

   10.  F_numsamp = F_numsamp + numsampT(1) - numsampT(F+1)

   11.  sum_skewbase = sum_skewbase + skewbase_hist(F+1) - old_skewbase

   12.  sum_numsamp = sum_numsamp + numsampT(1) - old_numsampT

   13.  skew_est = ((M-F+1)*F_skewbase + W_D_skewbase) /
          ((M-F+1)*F_numsamp+W_D_numsamp)

where cycle(...) refers to the operation on a cyclic buffer where the start of the buffer is now the next element in the buffer ๐ŸŒธ


4.1.2. Improving the Response of the Variability Estimate ๐Ÿฆ‹

same energy here, but for var_est ๐Ÿ’–. The weighted moving average for var_est goes like this:

   var_est = ((M-F+1)*sum(var_base_T(1:F))

                  + sum([(M-F):1].*var_base_T(F+1:M)))

             / ((M-F+1)*sum(numsampT(1:F))

                  + sum([(M-F):1].*numsampT(F+1:M)))

the definitions are the same as before ๐Ÿ‘‘

  • numsampT is an array of the number of OWD samples in each T (i.e., num_T(OWD)), and numsampT(1) is the most recent
  • skew_base_T(1) is the most recent calculation of skew_base_T
  • 1:F refers to the integer values 1 through to F, and [(M-F):1] refers to an array of the integer values (M-F) declining through to 1
  • ".*" is the array scalar dot product operator
when you're removing oscillation noise (see Section 4.2), this calculation must be adjusted to allow for invalid var_base_T records. don't skip this one, it's giving "important" ๐Ÿ’€

var_est can be calculated incrementally in the same way as skew_est as shown in Section 4.1.1. however, note that the buffer numsampT is used for both calculations, so the operations on it should not be repeated ๐Ÿ™ˆ


4.2. Removing Oscillation Noise ๐ŸŒŠ

okay this part is lowkey so important ๐Ÿ˜ญ. When a path has no bottleneck, var_est will be very small, and the recorded significant mean crossings will be the result of path noise. so up to N-1 meaningless mean crossings can be a source of error at the point where a link becomes a bottleneck and flows traversing it begin to be grouped. not ideal ๐Ÿ’…

to remove this source of noise from freq_est:

  1. Set the current var_base_T = NaN (a value representing an invalid record, i.e., Not a Number) for flows that are deemed to not be transiting a bottleneck by the first grouping test that is based on skew_est (see Section 3.3.1) ๐Ÿงš
  2. Then, var_est = sum_MT(var_base_T != NaN) / num_MT(OWD).
  3. For freq_est, only record a significant mean crossing if a given flow is deemed to be transiting a bottleneck โœจ

these three changes can help to remove the non-bottleneck noise from freq_est ๐Ÿซง


5. Measuring OWD ๐Ÿ“

this section is all about the OWD measurements the algorithm needs in order to detect shared bottlenecks ๐Ÿฆ‹

the SBD mechanism in this document relies on differences between OWD measurements, so it avoids the practical problems with measuring absolute OWD (see [Hayes-LCN14], Section III.C) ๐Ÿ’œ. since all summary statistics are relative to the mean OWD, and sender/receiver clock offsets should be approximately constant over the measurement periods, the offset gets subtracted out in the calculation. main character energy ๐Ÿ‘‘

5.1. Timestamp Resolution โฑ๏ธ

the SBD mechanism requires timing information precise enough to make comparisons ๐Ÿ”. as a rule of thumb, the time resolution should be less than one hundredth of a typical path's range of delays. in general, the coarser the time resolution, the more care that needs to be taken to ensure that rounding errors do not bias the skewness calculation ๐Ÿ™ˆ. frequent timing information in millisecond resolution, as described by [RTCP-CC-FEEDBACK], should be sufficient for the sender to calculate relative OWD ๐ŸŒˆ

5.2. Clock Skew ๐Ÿ•ฐ๏ธ

generally, sender and receiver clock skew will be too small to cause significant errors in the estimators ๐Ÿ’…. skew_est and freq_est are the most sensitive to this type of noise, because they use a mean OWD calculated over a longer interval. in circumstances where clock skew is high, basing skew_est only on the previous T's mean and ignoring freq_est provides a noisier but reliable signal ๐ŸŽ€

a more sophisticated method is to estimate the effect the clock skew is having on the summary statistics and then adjust statistics accordingly. there are a number of techniques in the literature, including [Zhang-Infocom02] ๐Ÿ“š


6. Expected Feedback from Experiments ๐Ÿงช

the algorithm in this memo has so far been evaluated using simulations and small-scale experiments ๐Ÿ”ฌ. real network tests using RTP Media Congestion Avoidance Techniques (RMCAT) congestion control algorithms will help confirm the default parameter choice ๐Ÿ’–. for example, the time interval T may need to be made longer if the packet rate is very low ๐Ÿข. implementers and testers are invited to document their findings in an Internet-Draft ๐Ÿซถ


7. IANA Considerations ๐ŸŒธ

this document has no IANA actions โœจ


8. Security Considerations ๐Ÿšจ

okay this section is SERIOUS bestie ๐Ÿ˜ญ๐Ÿ”ฅ

The security considerations of RFC 3550 [RFC3550], RFC 4585 [RFC4585], and RFC 5124 [RFC5124] are expected to apply.

non-authenticated RTCP packets carrying OWD measurements, shared bottleneck indications, and/or summary statistics could let attackers alter the bottleneck-sharing characteristics for private gain or to disrupt other parties' communication. yikes ๐Ÿ’€. when using SBD for coupled congestion control as described in [RTP-COUPLED-CC], the security considerations of [RTP-COUPLED-CC] apply ๐Ÿ›ก๏ธ


9. References ๐Ÿ“–

9.1. Normative References ๐Ÿ’œ

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in
              RFC 2119 Key Words", BCP 14, RFC 8174,
              DOI 10.17487/RFC8174, May 2017,
              <https://www.rfc-editor.org/info/rfc8174>.

9.2. Informative References ๐Ÿงš

   [Hayes-LCN14]
              Hayes, D., Ferlin, S., and M. Welzl, "Practical Passive
              Shared Bottleneck Detection using Shape Summary
              Statistics", Proc. IEEE Local Computer Networks (LCN),
              pp. 150-158, DOI 10.1109/LCN.2014.6925767, September 2014,
              <http://heim.ifi.uio.no/davihay/
              hayes14__pract_passiv_shared_bottl_detec-abstract.html>.

   [RFC3550]  Schulzrinne, H., Casner, S., Frederick, R., and V.
              Jacobson, "RTP: A Transport Protocol for Real-Time
              Applications", STD 64, RFC 3550, DOI 10.17487/RFC3550,
              July 2003, <https://www.rfc-editor.org/info/rfc3550>.

   [RFC4585]  Ott, J., Wenger, S., Sato, N., Burmeister, C., and J. Rey,
              "Extended RTP Profile for Real-time Transport Control
              Protocol (RTCP)-Based Feedback (RTP/AVPF)", RFC 4585,
              DOI 10.17487/RFC4585, July 2006,
              <https://www.rfc-editor.org/info/rfc4585>.

   [RFC5124]  Ott, J. and E. Carrara, "Extended Secure RTP Profile for
              Real-time Transport Control Protocol (RTCP)-Based Feedback
              (RTP/SAVPF)", RFC 5124, DOI 10.17487/RFC5124,
              February 2008, <https://www.rfc-editor.org/info/rfc5124>.

   [RFC6817]  Shalunov, S., Hazel, G., Iyengar, J., and M. Kuehlewind,
              "Low Extra Delay Background Transport (LEDBAT)", RFC 6817,
              DOI 10.17487/RFC6817, December 2012,
              <https://www.rfc-editor.org/info/rfc6817>.

   [RFC7679]  Almes, G., Kalidindi, S., Zekauskas, M., and A. Morton,
              Ed., "A One-Way Delay Metric for IP Performance Metrics
              (IPPM)", STD 81, RFC 7679, DOI 10.17487/RFC7679,
              January 2016, <https://www.rfc-editor.org/info/rfc7679>.

   [RFC7680]  Almes, G., Kalidindi, S., Zekauskas, M., and A. Morton,
              Ed., "A One-Way Loss Metric for IP Performance Metrics
              (IPPM)", STD 82, RFC 7680, DOI 10.17487/RFC7680,
              January 2016, <https://www.rfc-editor.org/info/rfc7680>.

   [RTCP-CC-FEEDBACK]
              Sarker, Z., Perkins, C., Singh, V., and M. Ramalho,
              "RTP Control Protocol (RTCP) Feedback for Congestion
              Control", Work in Progress, draft-ietf-avtcore-cc-
              feedback-message-01, March 2018.

   [RTP-COUPLED-CC]
              Islam, S., Welzl, M., and S. Gjessing, "Coupled congestion
              control for RTP media", Work in Progress, draft-ietf-
              rmcat-coupled-cc-07, September 2017.

   [Zhang-Infocom02]
              Zhang, L., Liu, Z., and H. Xia, "Clock synchronization
              algorithms for network measurements", Proc. IEEE
              International Conference on Computer Communications
              (INFOCOM), pp. 160-169, DOI 10.1109/INFCOM.2002.1019257,
              September 2002.

Acknowledgments ๐Ÿซถ

This work was partially funded by the European Community under its Seventh Framework Programme through the Reducing Internet Transport Latency (RITE) project (ICT-317700). The views expressed are solely those of the authors. ๐Ÿ‡ช๐Ÿ‡บโœจ

Authors' Addresses ๐Ÿ’Œ

   David Hayes (editor)
   Simula Research Laboratory
   P.O. Box 134
   Lysaker  1325
   Norway

   Email: davidh@simula.no


   Simone Ferlin
   Simula Research Laboratory
   P.O. Box 134
   Lysaker  1325
   Norway

   Email: simone@ferlin.io


   Michael Welzl
   University of Oslo
   P.O. Box 1080 Blindern
   Oslo  N-0316
   Norway

   Email: michawe@ifi.uio.no


   Kristian Hiorth
   University of Oslo
   P.O. Box 1080 Blindern
   Oslo  N-0316
   Norway

   Email: kristahi@ifi.uio.no
๐Ÿ“ฆ where this page comes from