Section 7.39

Throughput versus goodput

Definition

Throughput is the amount of data that passes a chosen point of a system per unit of time, counting every byte that passes: headers, retransmitted copies and data that is later thrown away. Goodput is the amount of useful data delivered per unit of time: the application’s own content, counted once, and only when its delivery succeeds by a stated rule. Over the same interval, goodput is at most the throughput of the link that carries the data, because the useful bytes are among the bytes that cross the link.

The idea

A BLE §7.1 (Bluetooth Low Energy) radio in its basic mode sends 1 million bits per second while it transmits. A 100,000-byte update is 100,000×8=800,000100{,}000 \times 8 = 800{,}000 bits, so a quick calculation gives 0.8 s. The real transfer takes longer. Every packet carries addressing and checking bytes besides the update data; the radio waits a fixed time between packets; the receiver answers each packet; lost packets are sent again; the radio is silent between the short exchanges that a connection schedules; and an attempt that fails halfway may be repeated from the start. All of these use time, and only the update data is what the user wanted.

Throughput and goodput answer different questions. Throughput asks how busy a link is; goodput asks how fast useful work gets done. A delivery truck is a fair picture. Throughput is the total weight it moves, including pallets, packaging and parcels sent a second time after the first was lost. Goodput is the weight of the goods that customers ordered and accepted, each counted once. The picture fails in one respect: much network overhead is not waste. Headers carry addresses and checks, and acknowledgments make delivery reliable, so useful delivery is impossible without them. The gap between the two numbers is their price.

How it works

A rate is a fraction: bytes counted, divided by time elapsed. Stating one fully takes four decisions, made before measuring.

  1. The observation point, where bytes are counted. In BLE the candidates, from the bottom up, are the bits on air; the Link Layer §7.6 payload, the data inside each radio packet; the data above L2CAP §7.15 (Logical Link Control and Adaptation Protocol), the layer that directs data to the right protocol; the values written through ATT §7.9 (Attribute Protocol), the protocol for reading and writing values on a device; and the bytes the application accepts.

  2. The numerator, what is counted. Throughput counts every byte that crosses the observation point. Goodput counts each byte of useful content once, and only if its delivery succeeds by a stated rule, such as received, received and authenticated, or received, authenticated and stored. Retransmitted copies and duplicates add nothing to goodput.

  3. The denominator, the interval. State the events that start and end it: the first byte sent and the last byte acknowledged, the user’s request and the device’s confirmation, or a whole session from connection to disconnection. Failed attempts, reconnections and idle gaps that fall inside the interval stay inside it.

  4. Warmup §11.27. The first transfer of a session can include one-time work: opening the connection, agreeing on packet sizes, discovering the device’s values, or erasing flash memory §6.6. Warmup, this initial period that behaves differently from later operation, belongs in a measurement of how long a user waits. It is left out only when the question is the rate of steady operation, and then the report says that it was left out.

In BLE, a write that fills one Link Layer payload shows the headers of each layer. When the two devices have agreed on the largest sizes, a Link Layer payload holds 251 bytes. L2CAP adds 4 bytes, a 2-byte length and a 2-byte channel number, and ATT adds 3 bytes, a 1-byte operation code §2.8 and a 2-byte number that names the value written. That leaves 251−4−3=244251 - 4 - 3 = 244 bytes for application data. On air, the packet adds a 1-byte preamble, a 4-byte access address that identifies the connection, a 2-byte Link Layer header and a 3-byte CRC §4.32 (cyclic redundancy check, an error-detecting code), and on an encrypted link a 4-byte code that detects changes to the packet.

Worked example

A ceiling from airtime §18.2.19. In the basic radio mode, one bit takes 1 microsecond, so one byte takes 8 microseconds. One full unencrypted packet is 1+4+2+251+3=2611 + 4 + 2 + 251 + 3 = 261 bytes on air and takes 261×8=2088261 \times 8 = 2088 microseconds. The peer answers after a fixed gap of 150 microseconds with an empty packet of 1+4+2+3=101 + 4 + 2 + 3 = 10 bytes, which takes 10×8=8010 \times 8 = 80 microseconds, and the next data packet follows after another 150 microseconds. One cycle therefore takes 2088+150+80+150=24682088 + 150 + 80 + 150 = 2468 microseconds and delivers 244×8=1952244 \times 8 = 1952 bits of application data. Even if the radio repeated this cycle without a break, goodput could not exceed 1952/2468≈0.7911952 / 2468 \approx 0.791 bits per microsecond, about 791 kilobits per second or 79% of the radio’s rate, before any loss, retransmission §7.36 or pause between connection events.

A measured session. In a hypothetical session, a host sends a 9,760-byte update as 40 writes of 244 bytes each, so each write fills one 251-byte Link Layer payload. The observation point is the host’s Link Layer, and every payload it transmits is counted.

In total, 5,020+10,793=15,8135{,}020 + 10{,}793 = 15{,}813 bytes were transmitted in 4+2+8=144 + 2 + 8 = 14 s, and the useful content is the 9,760-byte update, counted once.

Only 9,760/15,813≈0.6179{,}760 / 15{,}813 \approx 0.617, about 61.7%, of the transmitted bytes were useful. The 697.1 bytes per second is the rate the user experienced. The 1,220 bytes per second is the rate of a successful attempt. Reported as “the goodput” without saying that the failed attempt was left out, it overstates the user’s rate by a factor of 14/8=1.7514 / 8 = 1.75.

Stated precisely

Let T>0T > 0 be the length of the stated interval in seconds. Let BallB_{\mathrm{all}} be the number of bytes that cross the observation point during the interval, and BuB_{\mathrm{u}} the number of distinct useful bytes whose delivery succeeds, by the stated rule, during the interval. Throughput is X=Ball/TX = B_{\mathrm{all}} / T and goodput is G=Bu/TG = B_{\mathrm{u}} / T, both in bytes per second. If every useful byte crosses the observation point at least once during the interval, then Bu≤BallB_{\mathrm{u}} \le B_{\mathrm{all}}, and so G≤XG \le X. The efficiency η=Bu/Ball=G/X\eta = B_{\mathrm{u}} / B_{\mathrm{all}} = G / X is the fraction of the traffic that was useful; in the session above, η≈0.617\eta \approx 0.617.

A reported rate is defined only when it states five things.

  1. The observation point.

  2. The counting rule for the numerator: which headers count, whether retransmissions and duplicates count, and what counts as success.

  3. The start and end events of the interval, and whether warmup, failed attempts and idle gaps lie inside it.

  4. The unit: bits or bytes, and decimal prefixes (1 kilobyte is 1000 bytes) or binary ones (1 KiB is 1024 bytes).

  5. For several runs, whether the rate is total bytes over total time or the mean of the rates of the individual runs.

Limits and common mistakes

The radio’s rate is neither throughput at a higher layer nor goodput. The 1 million bits per second of the basic BLE radio mode is the rate while the radio transmits. Headers, gaps, acknowledgments and idle time between connection events all come out of it.

Bits and bytes differ by a factor of 8. One million bits per second is 1,000,000/8=125,0001{,}000{,}000 / 8 = 125{,}000 bytes per second, before any overhead.

Goodput alone hides cost. A high goodput can come with many failed attempts and retransmissions. Report the efficiency η\eta, or the bytes transmitted per useful byte, and the number of failed attempts next to the goodput.

Leaving out failed attempts answers a narrower question. The rate of successful attempts is a conditional rate: it says how fast a transfer runs when it succeeds, not how fast the user is served.

An average of rates and a rate of totals differ. A run that moves 1000 bytes in 1 s and a run that moves 1000 bytes in 4 s have rates of 1000 and 250 bytes per second. Their mean is (1000+250)/2=625(1000 + 250) / 2 = 625 bytes per second, but the total rate is (1000+1000)/(1+4)=400(1000 + 1000) / (1 + 4) = 400 bytes per second. The Ratio of aggregates versus aggregate of ratios §11.40 entry explains when each is right.

The link is not always the limit. A device that must erase and write flash memory for each received block can deliver a goodput below what the radio could carry. The bottleneck is then the storage, and faster radio settings do not help.

Questions answered

Are headers, retransmissions, warmups, and failed attempts included?

Headers, retransmissions, warmups and failed attempts are included or not according to the rate being reported, and the report must say which. Headers and retransmissions are part of throughput, the data per second crossing a chosen point, because they cross the link and use its time. They are never part of goodput, the useful data per second, which counts each byte of application content once and only when its delivery succeeds. Warmup, the one-time work at the start of a session, and failed attempts concern the interval. Their bytes never count as useful, but their time belongs in the interval whenever the question is how fast a user is served, because the user waits through them. They may be left out only when the stated question is the rate of steady, successful operation, and then the report must say that they were left out and how many there were.

For example, a session that took 14 s in all, including a failed attempt and a reconnection, and delivered a 9,760-byte update has a goodput of about 697 bytes per second. Counting only the successful 8 s attempt gives 1,220 bytes per second, which answers a different question.

Related entries: Ratio of aggregates versus aggregate of ratios (§11.40), Connection interval (§7.7), MTU and fragmentation (§7.14), Warmup and steady state (§11.27), Retransmission and duplicate delivery (§7.36). Further reading: [91, 92, 93].