Latency Spinbit Implementation Experience

Last update: 2017-11-28
Questions? Suggestions? devaerep@student.ethz.ch
This document is kinda append only.

Implementation

Test Setup

Experiments & Results

Bulk data upload to server

In this set of experiments, the client initiates a connection to the server and uploads a 100 MiB file. The static links are shaped to have a 10 ms delay. At t = 30 s netem parameters are added to the dynamic links. The results for different netem settings are listed below.

The occasional small packet

In this set of experiments, the client sends a small Hello packet to a server every 100 ms. The static links are shaped to have a 10 ms delay. At t = 30 s netem parameters are added to the dynamic links. Because of the results are very similar, we will focus on delay 10ms <time vs rtt diagram>

We see from the figure that the spinbit data is pretty useless. This is easily understood when we look at the packets flowing. Consider the following example, where every link has delay 1 ms, and Hello packets are send every 10 ms. The following packets are then generated / observed / received:

 10 ms: H 1                 11 ms: H 1                 12 ms: H 1
  0 ms: H 0                  1 ms: H 0                  2 ms: H 0
 +----------+               +----------+               +----------+
 |          |-------------->|          |-------------->|          |
 |  client  |               | observer |               |  server  |
 |          |<--------------|          |<--------------|          |
 +----------+               +----------+               +----------+
  4 ms: A 0                  3 ms: A 0                  2 ms: A 0
 14 ms: A 1                 13 ms: A 1                 12 ms: A 1

Legend:
  H: Hello
  A: Ack
  0: Spin 0
  1: Spin 1

So, the observer sees one spinbit transition per Hello packet transmitted. As Brian puts it: "The spinbit measures the dominant frequency of the protocol".

The occasional small packet with echo

Same as above, but now the server also echos back the Hello packets. We again look at delay 10ms <time vs rtt diagram>. Let us consider again the packets flowing of the network.

 20 ms: HA 0                 21 ms: HA 0               22 ms: HA 0
 10 ms: HA 1                 11 ms: HA 1               12 ms: HA 1
  4 ms: A  1                  5 ms: A  1                6 ms: A  1
  0 ms: H  0                  1 ms: H  0                2 ms: H  0
 +----------+               +----------+               +----------+
 |          |-------------->|          |-------------->|          |
 |  client  |               | observer |               |  server  |
 |          |<--------------|          |<--------------|          |
 +----------+               +----------+               +----------+
  4 ms: EA 0                 3 ms: EA 0                 2 ms: EA 0
 14 ms: EA 1                13 ms: EA 1                12 ms: EA 1

Legend:
  H: Hello
  E: Echo
  A: Ack
  0: Spin 0
  1: Spin 1

We can see that here the correct RTT can be measured only once, after which we again measure the Hello frequency rather than the RTT. Two more things should be noted here:

Single vs dual bit spin signal

To verify how well a dual bit spin signal performs, I ran some tests. I'll only show delay 5ms reorder 50 25 here, as heavy reordering was the only thing the one bit spinbit had problems with. <time vs rtt diagram> <comparison one vs two bits>.

It looks like this two bit signal is completely imune to reordering. In fact, in my current implementation (where I ignore all spin signals that are not (current_spin + 1) % 4), a packet would need to be reorderd 3 RTTs before it causes an incorrect latency measurement.

One bit spinbit with filtering

In order to verify the value added by adding a second bit to the spin signal, I compared it to a number of other approaches:

  1. Rejecting RTT samples if they are bellow a certain static threshold (1 ms).
  2. Rejecting RTT samples if they are bellow a certain dynamic threshold (10 % of minimum of last 10 samples).
  3. Ignoring all packets with Pn's lower than the highest Pn already received (this is similar to what the endpoints do in PR 609).

Some results:

The reason that both considering the Pns and a two bit spin signal give the same results, is because they effectively do the same: they detect reordering. The main performance difference between the two is how much reordering they tollerate. For the two bit signal, reordering up to 3 RTTs can be handled. For the Pns method, reordering up to the point where a Pn wrap around occurs is tollerable. However, when reordering is this heavy, the receiving endpoint can not properly expand the packet numbers anymore, so more bits of the Pn should be send anyway.

In conclusion: adding a second bit to the spin signal does make the spin signal significantly more resilient against reordering. However, similar results can also be obtained by using the information already in the QUIC header. Therefore, the second spin bit adds little or no information for a passive observer.

The Valid Bit

Design

From the above, it is clear that although the spinbit can provide a passive observer with valuable information about the application RTT, the information derived from the spinbit is not always related to the RTT. Furthermore, it is not possible to derive from the spinbit if it is providing a measurement of the RTT or some other frequency. Therefore, it is usefull for a passive observer to have an indication of when the spinbit caries valid information about the RTT.

One proposal is to add a blocked bit the to QUIC header (PR 279). While such a bit might give some information as to when the spinbit signal is valid, and when it is not, this would only be an indirect signal. To ensure that a passive observer can know with complete certainty that the spinbit is carrying valid information about the RTT, I propose the valid bit.

The valid bit works as follows:

The valid bit has a number of advantages:

Test Results

For testing the valid bit, I introduce a new type of traffic patern: bursty. It consists of calm periods of 15 s where heartbeats are send to the server every 100 ms. After this period the client transfers 1 MiB of bulk data, after which the next calm period starts.