Section 5.47

Traffic analysis defenses

Definition

Traffic analysis is learning information from the visible pattern of communication, without reading its content: who communicates with whom, when, how often, how much, and in packets of what size. Traffic analysis defenses make chosen parts of that pattern identical across the activities to be hidden. Padding equalizes sizes; fixed-rate sending and cover traffic equalize timing and volume; mixing and relaying hide which incoming message became which outgoing one. Each defense removes specific distinctions, for a specific observer, at a cost in bandwidth, delay or energy.

The idea

A home security sensor encrypts everything it sends. When nothing happens, it sends a 40-byte status message; when it detects motion, it sends a 400-byte report. An eavesdropper who cannot decrypt a single byte still learns when someone moves in the house, from the sizes alone. Encryption hides content. It does not hide length, timing, volume or the addresses of the two ends. The same leak has been shown in practice: researchers have recovered spoken phrases from encrypted voice calls whose packet sizes varied with the sounds being encoded.

A defense works by making two situations look the same in the feature the observer watches. Picture a writer who sends every letter in the same size of envelope, at the same hour each day, whether or not there is anything to say. The picture also shows where each defense stops: the address on the envelope, the fact that letters flow between these two people, and anything the postman can do to the letters are untouched.

How it works

Metadata is data about a communication rather than its content. The defenses below each equalize different metadata.

For each defense, state the distinction it removes, the observer it removes it for, and what stays visible.

Worked example

Padding to blocks of B=128B = 128 bytes. The 40-byte status needs ⌈40/128⌉=⌈0.3125⌉=1\lceil 40 / 128 \rceil = \lceil 0.3125 \rceil = 1 block, so it becomes 128 bytes, with 128−40=88128 - 40 = 88 bytes of filler. The 400-byte report needs ⌈400/128⌉=⌈3.125⌉=4\lceil 400 / 128 \rceil = \lceil 3.125 \rceil = 4 blocks, so it becomes 4×128=5124 \times 128 = 512 bytes, with 512−400=112512 - 400 = 112 bytes of filler. Here ⌈x⌉\lceil x \rceil is xx rounded up to a whole number. The two classes, 128 and 512 bytes, are still easy to tell apart.

Padding to one fixed size of 512 bytes. Both messages become 512 bytes, with 512−40=472512 - 40 = 472 and 512−400=112512 - 400 = 112 bytes of filler. The size distinction is gone for every payload up to 512 bytes. Suppose 90% of messages are status messages and 10% are reports. The average payload is 0.9×40+0.1×400=36+40=760.9 \times 40 + 0.1 \times 400 = 36 + 40 = 76 bytes. Fixed padding sends 512 bytes per message, 512/76≈6.7512 / 76 \approx 6.7 times the payload. Block padding sends on average 0.9×128+0.1×512=115.2+51.2=166.40.9 \times 128 + 0.1 \times 512 = 115.2 + 51.2 = 166.4 bytes, 166.4/76≈2.2166.4 / 76 \approx 2.2 times the payload, which is cheaper but leaks the class.

Fixed-rate sending. One 512-byte record every 10 ms is 100 records per second, 100×512=51,200100 \times 512 = 51{,}200 bytes per second, which is 51,200×8=409,60051{,}200 \times 8 = 409{,}600 bits per second, before protocol headers, whether or not anything happens. If real demand is 2 messages per second, 98 of every 100 records are filler. A message that arrives when the queue is empty waits for the next slot: at most 10 ms, and on average 5 ms if arrival times are spread evenly. If 150 messages arrive within one second, only 100 slots exist, so at least 50 must wait in a queue or be dropped. The extra delay can itself be visible, for example in later replies, which creates a new distinction; a bounded queue §9.31 with a stated policy for overflow keeps this behavior defined.

Stated precisely

Block padding: for a block size of BB bytes and a payload of L≥1L \ge 1 bytes, the padded length is B⌈L/B⌉B \lceil L / B \rceil bytes. Fixed padding to MM bytes maps every payload of at most MM bytes to MM bytes; a longer payload must be split into several records, which reveals the count, or refused. Both formulas count payload bytes only, not the headers and authentication §1.6 tag that encryption and transport add.

General contract: let O(a)O(a) be what the observer records when activity aa takes place, such as the list of times, sizes, sources and destinations of the packets it sees. A defense removes the distinction between activities aa and a′a' for that observer if O(a)O(a) and O(a′)O(a') have the same probability distribution, or distributions that the observer cannot tell apart with advantage greater than a stated ε\varepsilon. Padding to MM makes the size component identical for all payloads up to MM. Fixed-rate sending makes times and sizes identical for all activities whose demand never exceeds the schedule. Neither changes sources or destinations.

These statements rest on three assumptions.

  1. Real and filler records are identical after encryption: same length, and encryption that hides content, such as authenticated encryption §5.16.

  2. The sender’s timing does not depend on content; for example, preparing a report does not delay the next slot.

  3. The observer is passive: it watches but does not delay, drop or insert packets.

Limits and common mistakes

Each defense covers only the features it equalizes. Padding leaves timing and endpoints; fixed-rate sending leaves endpoints and the existence of the connection; relays leave timing at both ends.

Compressing data before encrypting it makes the length depend on the content. Attacks on encrypted web traffic have recovered secrets this way, by injecting guesses and watching the compressed length shrink when a guess matched.

Active observers defeat passive defenses. An attacker can delay packets in a recognizable pattern and look for that pattern elsewhere, or flood a mix with its own messages so that only one real message is in each batch, an attack known as the n−1n - 1 attack.

Leaks accumulate over time. Even a good mix leaks if, over many rounds, one recipient receives a message whenever a particular sender has sent one.

Every defense costs bandwidth, delay or energy. On a battery-powered radio device, fixed-rate sending can dominate the energy budget, and a schedule that cannot carry peak demand trades secrecy against availability §1.10.

Traffic analysis exploits a side channel §1.29 of communication: information that leaks through an effect other than the intended output. Defending the network pattern does not close side channels inside the device, such as power use or the time a computation takes.

Questions answered

Which metadata distinctions does padding or cover traffic actually remove, and at what cost?

Padding removes only differences in message length, and only within the range it pads to; cover traffic, in its strict form of fixed-rate sending, removes differences in when and how much is sent, but only while real demand fits in the schedule. Metadata means the visible facts about communication other than its content. Neither defense hides which two endpoints communicate, that a connection exists, or how long it lasts.

The costs are concrete. Padding a 40-byte message and a 400-byte message both to 512 bytes removes their size difference but adds 472 and 112 filler bytes; if 90% of messages are 40 bytes and 10% are 400 bytes, the link carries about 6.7 times the payload. Padding to 128-byte blocks costs only about 2.2 times the payload but leaves two visible sizes, 128 and 512 bytes. Sending one 512-byte record every 10 ms costs 51,200 bytes per second at all times, adds up to 10 ms of delay to each message, and needs a defined behavior when demand exceeds 100 messages per second. The defenses work only if filler cannot be told apart from real data and the observer is passive.

Related entries: Anonymity (§5.45), Unlinkability (§5.46), Confidentiality (§1.8), Availability (§1.10). Further reading: [100, 101, 356].