Learn
Lesson · Capacity Estimation · Storage and bandwidth

Bandwidth: Bits, Bytes and Overhead

A link is sold in bits a second and a payload is measured in bytes, so every bandwidth estimate contains a factor of eight that is easy to drop and impossible to notice afterwards. The second thing in it is overhead: headers are charged once per request whatever the payload, which makes them a fixed cost with a clean crossover — the payload below which most of what crosses the wire is not your data.

bytes per request = payload + header the header is per REQUEST bit/s = 8 · rate · (payload + header) Mbit/s = bit/s / 10⁶ decimal, as a link is sold 2 000 req/s · 1 200 B · 8 = 19 200 000 bit/s = 19.2 Mbit/s header share 200/1 200 = 1/6 16.7% of the wire headers ≥ half ⟺ payload ≤ header crossover at 200 B
Bytes to bits, and what the header costs

Core ideas

What this lesson establishes

Two units and one fixed cost. The units are where the factor of eight lives; the fixed cost is why small requests are expensive in a way that does not scale with their size.

1

A link is bits a second, a payload is bytes

2 000 requests a second at 1 200 bytes each is 2 400 000 bytes a second, and the same traffic is 19 200 000 bits a second, which is 19.2 Mbit/s. The 8 is not a correction or a safety factor; it is the conversion between the unit the payload is measured in and the unit the link is sold in, and an answer that omits it is exactly an eighth of the truth for every possible input.

2

The header is charged once per request

200 bytes of headers on a 1 000-byte payload is 1 200 bytes on the wire, and the headers are 1/6 of it. Double the payload and the header share falls; halve it and the share rises. Overhead is a fixed cost per request rather than a percentage of the payload, which means “add ten percent for overhead” is a rule that is wrong in one direction for large requests and in the other for small ones.

3

The crossover payload is the header size itself

Headers are at least half the bytes on the wire exactly when the payload is no larger than the header: h/(p+h) ≥ 1/2 rearranges to h ≥ p. So with 200 bytes of headers, a 200-byte payload is exactly half overhead and anything smaller is mostly overhead. It is a one-line result and it is the thing to remember about small requests.

The material

From a request rate to a link rate

The unit chain in full, the factor of eight, and what per-request overhead does to small payloads.

Definition · Bandwidth

Bandwidth is a rate of data across a link, measured in bits per second. A megabit per second is 10⁶ bits a second — decimal, like the rest of the units on this course, because that is what a link is sold in. A byte is 8 bits, so bytes per second times 8 is bits per second.

The chain runs requests per second, bytes per request, bits per byte, bits per megabit. Four rows, three of which are conversion factors, and each one carries the unit it leaves behind. Written out like that the factor of eight is unmissable; done in the head it is the single most common defect in a bandwidth estimate, and it is invisible in the answer because an eighth of a plausible number is another plausible number.

requests per second 2 000 req/s × bytes per request 1 200 B/req 2 400 000 B/s × bits per byte 8 bit/B 19 200 000 bit/s ÷ bits per megabit 1 000 000 bit/Mbit 19.2 Mbit/s

Skipping the third row gives 2.4, and calling that Mbit/s is the truth divided by eight. The lab prints both columns side by side with the ratio between them, which is 8 regardless of what the sliders say, because the error is a missing constant and not an approximation.

Definition · Per-request overhead

Overhead is the bytes a request costs beyond its payload — request and response headers, framing, acknowledgements. It is charged per request and does not scale with the payload, so the bytes on the wire are payload + header and the header share is h/(p+h).

Theorem · The crossover payload

Headers are at least half the bytes on the wire if and only if the payload is no larger than the header: h/(p+h) ≥ 1/2 exactly when p ≤ h.

p and h are positive, so p + h > 0 and the inequality h/(p+h) ≥ 1/2 may be multiplied through by 2(p+h) without changing direction, giving 2h ≥ p + h, that is h ≥ p.

Every step is reversible, so the two conditions are equivalent and the crossover sits at p = h exactly, where the share is 1/2.

□

Example · Two thousand requests a second, a kilobyte each

With 200 bytes of headers, each request is 1 200 bytes on the wire and the link carries 19.2 Mbit/s. Headers are 1/6 of that — 16.7% — and the crossover is at a 200-byte payload, where they would be exactly half. Drag the payload slider down past 200 in the lab and the header share crosses 1/2 at precisely the header size, which is what the theorem says it must.

Why the fixed cost matters more than its size

Two hundred bytes is nothing. Two hundred bytes per request, at a rate high enough to matter, is a fixed cost on every one of them, and its share of the traffic is set by the payload rather than by anything about the link. A system whose requests carry kilobytes pays 16.7%; the same system after someone splits those requests into ten smaller ones pays far more, for the same data, without any line of the estimate looking different.

This is the bandwidth version of an argument that recurs on this path: a per-operation cost is the thing to count, and the number of operations is the thing to control. “Latency Numbers on a Log Scale” is the same point about time, and “Round Trips, Not Bytes” on Latency and the Tail is the same point again about the network.

Keep one base

This course is decimal end to end: 1 kB is 1000 bytes, 1 MB is 10⁶, 1 Mbit/s is 10⁶ bits a second. Disks and links are both sold that way. What produces silent errors is mixing the conventions inside one chain — a 1024-based kilobyte multiplied into a decimal megabit — because the discrepancy compounds at every thousand-step and every intermediate figure still looks like a sensible number.

So state the base once, at the top, and use it everywhere. If a figure arrives from somewhere else in the other base, convert it at the boundary rather than partway through, where the conversion is visible in the chain and can be argued with.

Interactive

Rates and unit chains

Per day to per second, one rate into two, and bytes into bits

The unit chainwrite the units down first, because nearly every wrong estimate is a unit error
unit carried forwardthe figure that is rightthe figure the shortcut gives

Method

Sizing a link from a request rate

Bytes per request first, then bits, then the unit the link is sold in.

1

Add the header to the payload before anything else

The bytes on the wire are payload + header, per request. Doing this first means the rest of the chain multiplies a single figure and there is no temptation to add a percentage for overhead at the end, which is the wrong shape of correction.

2

Multiply by the request rate to get bytes per second

req/s × B/req = B/s, with the requests cancelling. This is the last figure in the chain that is still in the units the payload was measured in, and it is worth reading out for that reason.

3

Multiply by eight, and say the word bits

B/s × 8 bit/B = bit/s. Say it out loud as a unit change rather than a factor: the number has not been corrected, it has been re-expressed in the unit the link is sold in.

4

Divide by 10⁶ for megabits, in the same base as everything else

1 Mbit/s is 10⁶ bits a second. Decimal, like the storage units, and stated rather than assumed — a chain that silently changes base partway through produces an error that grows at every step and looks like nothing.

5

Check the header share against the payload

Divide the header size by the bytes per request. If the share is anywhere near a half, the payload is near the header size and the estimate is mostly about overhead, which usually means the right fix is fewer, larger requests rather than a bigger link.

Bits, bytes and headers

Score 0 / 0

2 000 req/s, 1 kB payload, 200 B of headers

The full chain with a unit on every row, then the header share and the crossover payload.

bytes per request 1 000 B payload + 200 B header = 1 200 B/req 2 000 req/s × 1 200 B/req = 2 400 000 B/s 2 400 000 B/s × 8 bit/B = 19 200 000 bit/s 19 200 000 bit/s ÷ 10⁶ bit/Mbit = 19.2 Mbit/s the ×8 forgotten 2 400 000 / 10⁶ = 2.4 "Mbit/s" 19.2 / 2.4 = 8 the whole difference header share 200 / 1 200 = 1/6 = 16.7% of the wire crossover h/(p+h) ≥ 1/2 ⟺ p ≤ h ⟹ 200 B payload at p = 200 B 200/400 = 1/2 exactly half at p = 50 B 200/250 = 4/5 80% overhead

The two lines in the middle are the lesson about units. 2.4 and 19.2 are both plausible link rates, and nothing about the smaller one looks wrong; it is wrong by exactly a factor of eight, for every set of inputs, which means it can never be caught by sanity-checking the answer and can always be caught by writing the units down.

The two lines at the bottom are the lesson about overhead. The share is not a property of the system, it is a property of the payload, and it moves fast once the payload gets near the header size. A design that halves the request size does not halve the bandwidth.

For a faded rehearsal: 5 000 requests a second, 300-byte payloads, 200 bytes of headers. The supplied first move is the bytes per request, 500. Produce the link rate in Mbit/s, the header share as an exact fraction, and the payload at which headers would be half — then set the three sliders in the lab and check. Say the header share before you look; it is larger than most people expect.

Common mistakes

1
Dividing bytes by a million and calling it Mbit/s2 400 000 bytes a second becomes 2.4, which looks like a link rate and is the truth divided by eight, for every input. The factor of eight is not a correction, it is the conversion between the unit the payload is measured in and the unit the link is sold in, so the answer cannot be checked for plausibility — an eighth of a reasonable figure is another reasonable figure. Writing bit/B on its own row is the fix.
2
Mixing 1024-based and decimal units in one chainA kilobyte is 1000 bytes on this course and a megabit is 10⁶ bits, because that is what disks and links are sold in. The failure is not picking the wrong base; it is picking both, in different rows of the same chain. The discrepancy compounds at every thousand-step and is undetectable in the result, since every intermediate figure remains a perfectly sensible number.
3
Adding a flat percentage for overhead“Add ten percent for headers” treats a per-request cost as if it scaled with the payload. With 200 bytes of headers the real share is 1/6 at a kilobyte payload, 1/2 at a 200-byte payload and 4/5 at fifty bytes — the same headers, three different percentages. The overhead has to be added per request, before the rate is multiplied in, or the answer is wrong in a direction that depends on the payload.

Check your understanding

✓
Finish when a link rate quoted without the word bits reads as an unfinished sentence.

You should be able to run a request rate to Mbit/s with a unit on every row, say what dropping the ×8 does and why it cannot be caught by inspection, compute a header share as an exact fraction, and give the crossover payload for any header size without computing anything.

Note: Two of the four things a rate sizes are done. Before the other two — machines and memory — the course needs two quantities that are not rates at all. “Latency Numbers on a Log Scale” is the first: the operations a system is built out of span a range so wide that only a ratio scale holds them, and the ratios between them are the part worth carrying around.

Kept in this browser only, for you. Nothing is sent anywhere and nothing checks it. Carry it to another device.

Feedback and recommendations

Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.

No recommendations yet for this lesson.