Skip to content

hop 4 of 32 · 5 min

Turning bits into a signal

A wire carries voltage, not ones and zeroes. Something has to agree on how one becomes the other, and how much can be pushed through.

The naive encoding fails

Represent 1 as high voltage and 0 as low. Send a hundred zeroes and the line sits flat for a long time, and the receiver's clock drifts until it no longer knows where one bit ends and the next begins.

Manchester encoding solves it by putting a transition in the middle of every bit: high to low is one, low to high is zero. The clock is recovered from the signal itself, at the cost of needing twice the transitions for the same data rate.

code
data      1     0     1     1
NRZ     ▔▔▔▔▔________▔▔▔▔▔▔▔▔▔▔
Manch.  ▔▔▔___▔▔▔▔___▔▔▔___▔▔▔___
        each bit has a transition in the middle

Bandwidth is not speed

Bandwidth is the range of frequencies a channel carries, measured in hertz. Data rate is bits per second. They are related and not the same, and the relationship has a hard limit.

Nyquist, for a noiseless channel:

code
max rate = 2 x bandwidth x log2(levels)

Encoding more voltage levels per symbol carries more bits per symbol, which is why more levels means a higher rate without more bandwidth.

Shannon, once noise exists:

code
capacity = bandwidth x log2(1 + signal/noise)

This is a physical ceiling, not an engineering difficulty. A 3 kHz telephone line with a typical signal to noise ratio caps at roughly 30 kbps, which is why dial up modems stopped improving where they did.

Bandwidth and latency are independent

MeansImproved by
Bandwidthhow much per secondmore capacity, better encoding
Latencyhow long one bit takes to arriveshorter distance, fewer hops

A satellite link can have enormous bandwidth and 600ms round trip latency. Adding bandwidth does nothing for latency, and latency is bounded below by the speed of light: Chennai to London is about 40ms each way at best, and no amount of money changes that.

This is the single most useful distinction in the subject, because "the network is slow" almost always means latency while people try to fix it with bandwidth.