Physical Layer Fundamentals

Imagine two computers connected by a copper wire, a laser, or a burst of radio waves. Before any packet, any frame, any IP address means anything, someone must answer a brutally physical question. How do you turn a stream of 1s and 0s into a voltage, a light pulse, or an electromagnetic wave? And how do you get it back out correctly on the other end? This is the domain of the physical layer, the lowest layer of the networking stack. It is where the abstractions of Delay, Loss, and Throughput in Packet Networks actually get manufactured out of copper, glass, and air. The physical layer matters because every higher-layer guarantee rests on something deeper. Error detection, retransmission, congestion control, all ultimately rest on a noisy analog channel. That channel must do something reasonable most of the time. A Wi-Fi router, a fiber-optic backbone, and a satellite uplink all face the same core problem. A transmission medium has finite bandwidth, is corrupted by noise, and attenuates signals over distance. Engineers must choose an encoding scheme that packs bits efficiently into that bandwidth. It must still let a receiver recover the original bit sequence reliably. This receiver has no shared clock and no prior knowledge of the message. This article builds the physical layer from first principles. It covers what a signal is, and how bandwidth limits the rate of information you can send. It explains how noise sets a hard ceiling on capacity. It also shows how encoding schemes translate bits into physical symbols. We derive and explain the Nyquist and Shannon limits precisely. These are not slogans, but quantities you can compute. We then walk through concrete line codes (NRZ, Manchester, 4B/5B). We show why naive encodings fail in real transmission lines. By the end, you will be able to compute the maximum data rate of a channel. You will need its bandwidth and signal-to-noise ratio to do so. You will be able to explain why clock recovery is a first-class engineering problem. You will see precisely how bits become signals become bits again. This sets up The Link Layer: Role and Services. There, framing and error detection turn a noisy bit pipe into something a network can trust.

Key takeaways
  • The physical layer converts bits into physical signals (voltage, light, radio) over a transmission medium and back.
  • Bandwidth (Hz) of a channel limits the symbol rate; the Nyquist theorem bounds noiseless-channel capacity.
  • The Shannon-Hartley theorem gives the hard capacity ceiling for a channel with a given signal-to-noise ratio.
  • Line codes (NRZ, Manchester, 4B/5B, NRZI) trade bandwidth efficiency against clock recovery and DC balance.
  • Guided media (twisted pair, coax, fiber) and unguided media (radio, microwave) differ in bandwidth, noise, and cost.
  • Modulation (ASK, FSK, PSK, QAM) lets digital data ride on analog carrier waves for long-distance and wireless transmission.
The core insight

Every transmission medium has a hard, computable ceiling on how fast bits can move through it, set jointly by bandwidth and noise — no clever protocol above the physical layer can exceed it.

The idea

The physical layer is the lowest layer of the network stack, responsible for transmitting raw bits across a transmission medium: twisted-pair copper, coaxial cable, optical fiber, or a wireless radio channel. It does not understand packets, addresses, or even byte boundaries; its sole job is to represent a bit stream as a physical signal — a time-varying voltage, light intensity, or electromagnetic field — and to recover that bit stream from the received signal at the other end, despite attenuation, distortion, and noise introduced by the channel. Two quantities govern what is achievable. Bandwidth is the range of frequencies a channel can carry with acceptable attenuation, measured in hertz (Hz); it is a property of the physical medium and the transmission equipment, not of the data. Signal-to-noise ratio (SNR) measures how much stronger the intended signal is than the background noise, usually expressed in decibels. Bandwidth constrains how fast the signal can change (the symbol rate), while SNR constrains how many distinguishable signal levels a receiver can reliably tell apart. Together they set an absolute upper bound on the channel capacity — the maximum bit rate achievable no matter how clever the encoding scheme is.

Encoding is the scheme that maps a sequence of bits onto a physical signal. A line code does this directly with baseband voltage levels (used mainly over short copper links); modulation superimposes the data onto a sinusoidal carrier wave by varying its amplitude, frequency, or phase (used over long distances, wireless links, and fiber). A good encoding must let the receiver recover not just the bit values but also the clock — the timing boundaries between bits — using only the received signal, since sender and receiver do not share a physical clock line. This is the clock recovery or synchronization problem, and it is one of the central design constraints of the physical layer.

How it works

The physical layer's job, end to end, is: bits in at the sender → signal on the medium → bits out at the receiver, correct with high probability. This happens in three conceptual stages.

1. Bandwidth and the Nyquist limit (noiseless channel). If a channel of bandwidth `H` Hz can carry a signal, the highest symbol rate it can support without inter-symbol interference is `2H` symbols per second. This is the Nyquist sampling/signaling limit. If each symbol encodes `log2(V)` bits, where `V` is the number of discrete signal levels, then the noiseless channel capacity is: ``` C = 2H * log2(V) bits per second ``` More levels `V` per symbol means higher raw capacity, but it also means the receiver must distinguish smaller voltage gaps — which is exactly where noise hurts.

2. Noise and the Shannon-Hartley limit (real channel). Every real channel has noise, quantified by SNR (as a power ratio, or in decibels via `SNR_dB = 10 log10(SNR)`). Claude Shannon proved that no encoding scheme, however sophisticated, can exceed: ``` C = H log2(1 + SNR) bits per second ``` This is the <strong>Shannon-Hartley theorem</strong>. It is a hard ceiling independent of the number of signal levels chosen; it accounts for the fact that noise eventually makes closely spaced levels indistinguishable. The Nyquist formula tells you the maximum symbol rate; Shannon tells you the maximum information rate*, folding in how many reliably-distinguishable levels noise actually permits.

3. Line coding / modulation — the concrete mapping. Given a channel and a target data rate under these ceilings, an encoding scheme maps bits to signal transitions. The encoder must satisfy several practical constraints simultaneously:

  • Self-clocking: the receiver must extract bit timing from the signal itself (no separate clock wire).
  • DC balance: long runs of the same voltage level should be avoided (transformers and AC-coupled lines cannot pass DC).
  • Bandwidth efficiency: use as few Hz of bandwidth as possible per bit transmitted.
  • Noise immunity: distinguishable signal levels should be robust to expected noise.

A worked pseudocode view of a widely used self-clocking scheme, Manchester encoding (used in classic 10 Mbps Ethernet), and its decoder: ``` function MANCHESTER_ENCODE(bits[1..n]): signal = [] for i in 1..n: if bits[i] == 1: signal.append(HIGH_THEN_LOW) // transition high->low mid-bit else: signal.append(LOW_THEN_HIGH) // transition low->high mid-bit return signal // one guaranteed transition per bit period function MANCHESTER_DECODE(signal_samples, bit_period, sample_rate): bits = [] samples_per_bit = sample_rate bit_period for each bit_window of size samples_per_bit in signal_samples: mid = bit_window[samples_per_bit / 2] first_half_level = average(bit_window[0 : samples_per_bit/2]) second_half_level = average(bit_window[samples_per_bit/2 : samples_per_bit]) if first_half_level == HIGH and second_half_level == LOW: bits.append(1) else if first_half_level == LOW and second_half_level == HIGH: bits.append(0) else: raise SYNC_ERROR // no transition detected -> clock drift or corruption return bits ``` The guaranteed mid-bit transition is what lets the receiver's <strong>phase-locked loop</strong> re-synchronize its clock every single bit, at the cost of doubling the required bandwidth relative to a scheme with no such guarantee (each bit needs up to* two signal transitions instead of at most one). A more bandwidth-efficient family used in modern links is block coding, exemplified by 4B/5B (used in 100 Mbps Fast Ethernet and FDDI): every 4 data bits are mapped to a 5-bit code chosen so that no code contains more than three consecutive zeros. This guarantees frequent transitions for clock recovery without doubling the bit rate the way Manchester does — you pay a smaller 25% overhead (5 symbol-bits per 4 data-bits) instead of a 100% overhead. ``` function FOURB_FIVEB_ENCODE(nibble): // nibble = 4 data bits return LOOKUP_TABLE_4B5B[nibble] // fixed table, e.g. 0000 -> 11110 function FOURB_FIVEB_DECODE(codeword): // codeword = 5 transmitted bits nibble = REVERSE_LOOKUP_TABLE_4B5B[codeword] if codeword not in REVERSE_LOOKUP_TABLE_4B5B: raise INVALID_CODE_ERROR // detects some transmission errors "for free" return nibble ``` Because only 16 of the 32 possible 5-bit codewords are used for data (the rest are reserved for control symbols or forbidden because of poor transition density), 4B/5B also gains a side benefit: many single-bit errors turn a valid codeword into an invalid one, giving cheap error detection at the physical layer. For long-distance or wireless transmission, bits are not sent as raw baseband pulses but modulated onto a carrier sine wave `A sin(2πft + φ)` by varying one of its three parameters:

  • ASK (Amplitude Shift Keying): vary `A` — simple, noise-sensitive.
  • FSK (Frequency Shift Keying): vary `f` — more noise-robust, used in early modems.
  • PSK (Phase Shift Keying): vary `φ` — efficient, used in Wi-Fi and satellite links.
  • QAM (Quadrature Amplitude Modulation): vary both `A` and `φ` jointly, packing multiple bits per symbol (e.g., 64-QAM encodes 6 bits/symbol) — used in cable modems and modern Wi-Fi to approach the Shannon limit.
Figure
From bits to signal: encoding, channel, and decoding at the physical layer
Bits: 1 0 1 1 Encoder (Manchester/4B5B) Channel BW=H, noise=N Decoder (clock recovery) Bits: 1 0 1 1 Signal waveform (Manchester, bits 1 0 1 1): 1 0 1 1 Capacity limits Nyquist: C = 2H·log₂(V) Shannon: C = H·log₂(1+SNR) H = bandwidth (Hz) V = signal levels per symbol SNR = signal power / noise power Mid-bit transitions in Manchester encoding let the receiver's clock re-lock every bit period.

Complexity & correctness

The physical layer is not usually analyzed in the algorithmic big-O sense of comparisons or memory, since it operates on continuous physical signals rather than discrete data structures. Its "complexity" claims are instead information-theoretic bounds and per-symbol processing costs, and its "correctness" claims are statistical guarantees about bit-error rates rather than deterministic proofs. Being precise about what is and is not guaranteed here matters.

Why the Nyquist bound is correct. A bandlimited channel of bandwidth `H` Hz, by the sampling theorem, can carry at most `2H` independent samples per second without ambiguity (aliasing) between distinguishable waveforms — this is a direct consequence of Fourier analysis: a signal confined to frequencies in `[0, H]` is fully determined by samples taken at rate `2H`. Sending symbols faster than `2H` per second causes inter-symbol interference, since the channel cannot physically settle between symbol transitions before the next one arrives. If each symbol carries `log2(V)` bits (chosen from `V` distinguishable levels), the maximum noiseless rate is `2H log2(V)` bits/sec — this is an equality achievable in principle for a truly noiseless channel, not merely an upper bound.

Why the Shannon bound is correct, and why it dominates. Shannon's theorem states that reliable communication (arbitrarily low error probability) is possible at any rate below `C = H log2(1+SNR)`, and impossible at any rate above it, given enough coding sophistication (long enough codewords, powerful enough error-correcting codes). The intuition: with average signal power `S` and noise power `N`, the receiver can distinguish roughly `sqrt(1 + S/N)` amplitude levels reliably, because noise smears each level by about `sqrt(N)`. Plugging `V ≈ sqrt(1+SNR)` into the Nyquist formula `2H log2(V)` gives `H log2(1+SNR)` — this is why the two formulas look related but serve different purposes: Nyquist bounds symbol rate given a chosen number of levels; Shannon bounds the achievable number of reliably distinguishable levels given noise, and folds both into one final ceiling. Crucially, Shannon's bound is always at least as tight as any V-level Nyquist calculation: you cannot pick `V` larger than the noise allows and still communicate reliably, so `C_Shannon ≤ C_Nyquist` for any consistent choice of `V`, with equality only in the limit of vanishing noise.

Per-symbol cost of encoding/decoding. Line codes like Manchester or 4B/5B involve constant-time table lookups or fixed local transformations per input bit or nibble — `O(1)` work per symbol, `O(n)` total for a bit stream of length `n`, with small constant-size lookup tables (32 entries for 4B/5B). This is essentially free computationally; the real cost is in analog circuitry (transmitters, receivers, phase-locked loops) and in the bandwidth overhead the code imposes.

Tradeoffs, stated honestly.

  • Manchester encoding guarantees clock recovery but uses 2× the bandwidth of the raw bit rate (up to two transitions per bit), because each bit period always contains a transition regardless of data pattern.
  • 4B/5B uses only 1.25× overhead (5 transmitted bits per 4 data bits) but requires table-based encoding/decoding and does not guarantee a transition every bit, only that no code has long zero-runs — a weaker but sufficient guarantee for practical phase-locked loops.
  • Higher-order modulation (e.g., 256-QAM vs. QPSK) packs more bits per symbol, approaching the Shannon rate more closely, but requires much higher SNR to keep the denser constellation points distinguishable — pushing systems toward the Shannon ceiling trades noise margin for raw rate.
  • The Shannon limit is an existence result: it does not tell you which code achieves near-capacity performance, only that one exists. Modern turbo codes and LDPC codes get within a fraction of a dB of the Shannon limit but required decades of coding-theory research to discover.

Worked example

Consider a telephone-line-like channel with bandwidth `H = 3000 Hz` (roughly the classic voice-grade telephone bandwidth), and suppose the measured SNR is `30 dB`.

Step 1 — convert SNR from decibels to a ratio. ``` SNR_dB = 30 SNR = 10^(SNR_dB / 10) = 10^3 = 1000 ```

Step 2 — apply the Shannon-Hartley theorem. ``` C = H log2(1 + SNR) = 3000 log2(1001) = 3000 * 9.967 ≈ 29,901 bits/sec ≈ 29.9 kbps ``` This is why classic analog-modem technology topped out near 33.6–56 kbps: it was operating close to the Shannon limit of the telephone channel (56k modems exploited an asymmetric, partly-digital path on one leg to push past the pure analog bound on that side).

Step 3 — compare against the Nyquist bound for a chosen encoding. Suppose the engineer chooses a modulation scheme with `V = 8` distinguishable signal levels per symbol (`log2(8) = 3` bits/symbol). ``` C_Nyquist = 2H log2(V) = 2 3000 log2(8) = 6000 3 = 18,000 bits/sec ``` Here `C_Nyquist (18,000) < C_Shannon (29,901)`, meaning this particular 8-level scheme is not yet exploiting the full noise-limited capacity — the engineer could choose more levels per symbol (say `V = 64`, giving `log2(64) = 6` bits/symbol) to push closer to Shannon's ceiling: ``` C_Nyquist(V=64) = 6000 6 = 36,000 bits/sec ``` Now `C_Nyquist (36,000) > C_Shannon (29,901)` — this tells us that with only 30 dB of SNR, 64 levels are too many* to reliably distinguish; noise will cause frequent decoding errors even though the raw symbol-rate arithmetic "allows" it. The realistic ceiling remains ≈29.9 kbps, and no clever line code changes that; only improving the SNR (better cabling, less interference, signal amplification) or increasing bandwidth `H` can raise it.

QuantityValueFormula used
Bandwidth `H`3000 Hzgiven
SNR (ratio)1000`10^(30/10)`
Shannon capacity≈29,901 bps`H·log2(1+SNR)`
Nyquist capacity, V=818,000 bps`2H·log2(V)`
Nyquist capacity, V=6436,000 bps`2H·log2(V)`
Achievable rate≈29,901 bps (Shannon-limited)min of practical constraint

Common pitfalls & traps

PitfallWhy it happensFix
Confusing bandwidth (Hz) with bit rate (bps)Casual usage of "bandwidth" in everyday speech to mean "speed"Always convert via Nyquist/Shannon; Hz and bps are related but distinct units
Assuming more signal levels always means more throughputIgnoring noise's effect on level distinguishabilityCheck the Shannon bound before increasing `V`; noise, not symbol count, is often the binding constraint
Forgetting clock recovery entirelyTreating "bits arrive" as automatic once voltage is sampledDesign encodings (Manchester, 4B/5B) that guarantee enough transitions for a PLL to lock
Using plain NRZ over AC-coupled/transformer-isolated linesLong runs of 1s or 0s create DC bias and baseline wanderUse DC-balanced codes (Manchester, 8B/10B) or scrambling
Treating Shannon capacity as a rate you can casually approach with any codeBelieving capacity is achievable "for free"Understand it as an information-theoretic ceiling requiring sophisticated error-correcting codes (LDPC, turbo codes) to approach in practice

Pioneers & history

The mathematical foundation of the physical layer, what can and cannot be sent over a noisy channel, was laid by Claude Shannon at Bell Labs, unifying earlier sampling-theory work by Harry Nyquist and Ralph Hartley into a single, complete theory of communication.

Origins · 1 minClaude Elwood Shannon and how this was discovered
CE
Claude Elwood Shannon
1916–2001 · Bell Telephone Laboratories, mid-20th century

Shannon's 1948 paper "A Mathematical Theory of Communication" founded information theory, defining entropy, channel capacity, and the coding theorems that bound what any communication system can achieve. His result that noisy channels have a sharp, computable capacity — and that codes exist approaching it arbitrarily closely — underlies every modern modem, wireless standard, and fiber-optic system's design targets.

History
- 1924 — Harry Nyquist derives the relationship between channel bandwidth and achievable telegraph signaling speed.
- 1928 — Ralph Hartley formalizes the transmission of information over a channel, precursor to entropy-based measures.
- 1948 — Claude Shannon publishes "A Mathematical Theory of Communication," establishing channel capacity and the noisy-channel coding theorem.
- 1949 — Shannon extends the theory explicitly to noisy channels, giving the Shannon-Hartley capacity formula in its modern form.
- 1980s — Practical near-Shannon-limit codes (Reed-Solomon, convolutional codes) become standard in modems, CDs, and satellite links.
- 1990s–2000s — Turbo codes and LDPC codes close in to within fractions of a decibel of the Shannon limit, adopted in 3G/4G/5G and deep-space communication.

Where this matters

Every physical transmission technology in production networks is an engineering answer to the bandwidth/noise/encoding tradeoffs described here. DSL and cable modems operate deliberately close to the Shannon limit of twisted-pair copper and coaxial cable, using adaptive QAM constellations that shrink automatically when line noise rises. Wi-Fi (802.11 family) dynamically switches between modulation schemes (BPSK, QPSK, 16-QAM, up to 1024-QAM in Wi-Fi 6) depending on measured SNR, trading raw rate for reliability as a device moves farther from the access point. Ethernet standards evolved their line codes explicitly along the tradeoff curve described above: 10BASE-T used Manchester encoding (simple, clock-safe, bandwidth-hungry), 100BASE-TX moved to 4B/5B plus MLT-3 for better bandwidth efficiency, and Gigabit Ethernet uses even denser 8B/10B and PAM-5 schemes to push more bits through the same copper.

Optical fiber backbones, the physical substrate of the internet's long-haul links, use pulses of light with far higher usable bandwidth than copper (hence far higher capacity per the same Shannon formula), plus wavelength-division multiplexing to run many independent channels simultaneously over one fiber. Deep-space communication (e.g., NASA's Voyager and Mars missions) operates in extremely low-SNR regimes, relying on powerful error-correcting codes approaching the Shannon limit to extract usable data from signals barely above the noise floor. All of these systems ultimately depend on the physical layer producing a "sufficiently clean bit pipe," which the Link Layer: Role and Services then wraps with framing, addressing, and error detection to build the reliable abstractions that Delay, Loss, and Throughput in Packet Networks analyzes at the packet level.

Ask the tutor: How would you compute the required SNR to reliably support 64-QAM over a 20 MHz Wi-Fi channel?

Is bandwidth the same thing as internet "speed" that ISPs advertise?

Not exactly, though the terms get conflated in marketing. In the strict physical-layer sense, bandwidth is the range of frequencies (in Hz) a channel can carry, a property of the wire, fiber, or radio spectrum. What ISPs advertise as "speed" is actually a bit rate (bps), the practical achievable throughput given that bandwidth, the SNR, and the modulation scheme in use. The Nyquist and Shannon formulas are precisely the bridge between the two: they convert a channel's raw frequency bandwidth into an achievable bits-per-second ceiling, given noise conditions and the encoding chosen. So "more bandwidth" (Hz) generally enables higher bit rate, but the two are related by these formulas, not identical, and a noisy high-bandwidth channel can underperform a clean low-bandwidth one.

Why do we need line codes at all — why not just send raw voltage levels for 1s and 0s?

Raw unencoded binary (plain NRZ, Non-Return-to-Zero) has two serious problems. First, long runs of identical bits (many 1s or many 0s in a row) produce no signal transitions, so a receiver's clock-recovery circuit has nothing to lock onto and can drift out of sync, misreading bit boundaries. Second, long runs create a DC bias (sustained voltage offset), which many real transmission lines cannot carry because they use transformers or capacitive coupling that block DC entirely. Line codes like Manchester or 4B/5B exist specifically to guarantee frequent transitions and balance the average voltage near zero, at the cost of some bandwidth or table-lookup overhead, making the signal survive real physical hardware.

What's the practical difference between Nyquist's and Shannon's formulas — don't they contradict each other?

They don't contradict each other; they answer different questions. Nyquist's formula, `C = 2H log2(V)`, tells you the maximum symbol rate for a noiseless channel given that you've already chosen `V` distinguishable signal levels — it's a statement about signaling rate and level count. Shannon's formula, `C = H log2(1+SNR)`, tells you the maximum reliable information rate given the channel's actual noise, independent of how many levels you naively try to use. If you pick `V` larger than what the SNR supports, Nyquist's arithmetic will overestimate the truly achievable rate; Shannon's bound is what actually holds in the presence of noise, and it's always the binding constraint in any real, noisy channel.

Why does Wi-Fi speed drop when I move farther from the router?

Moving away from a Wi-Fi access point weakens the received signal power relative to the ambient noise floor, lowering the effective SNR. Per the Shannon-Hartley theorem, a lower SNR means a lower achievable capacity for the same bandwidth. Wi-Fi devices respond by dynamically switching to a lower-order, more robust modulation scheme (say, from 256-QAM down to QPSK), which uses fewer distinguishable signal levels per symbol and is thus more resistant to noise, but carries fewer bits per symbol. This adaptive modulation is a direct, real-time application of the bandwidth/SNR/rate tradeoff, trading raw throughput for reliability as conditions worsen.

Is fiber optic communication exempt from the Shannon limit since it uses light instead of electricity?

No — the Shannon-Hartley theorem is a general information-theoretic result and applies to any physical channel, including optical fiber. Fiber's key practical advantage is that it offers enormously more usable bandwidth (many terahertz of low-attenuation spectrum) and typically much higher SNR (light in glass suffers far less interference than electrical signals in copper), which is exactly why the Shannon formula gives it a vastly higher capacity ceiling, not because it escapes the formula. Wavelength-division multiplexing further multiplies effective capacity by running many independent wavelength channels (each with its own Shannon ceiling) simultaneously down one physical fiber strand.

What role does modulation (ASK, FSK, PSK, QAM) play versus line coding?

Line coding (like Manchester or 4B/5B) directly represents bits as baseband voltage transitions, typically over short, wired, low-noise links such as Ethernet cables. Modulation instead encodes data by varying properties (amplitude, frequency, phase) of a continuous carrier sine wave, which is essential for transmission over long distances, through the air (wireless), or over media like fiber where baseband pulses are less practical to shape and detect precisely. QAM in particular, used in cable modems and Wi-Fi, combines amplitude and phase variation to pack multiple bits into each transmitted symbol, letting real systems approach the Shannon capacity ceiling more closely than simpler schemes like ASK or FSK.

Why can error-correcting codes get "close to" the Shannon limit but the article says they can't exceed it?

Shannon's theorem is a two-sided result: it proves both that rates below capacity are achievable with arbitrarily low error probability (given long enough, cleverly designed codes) and that rates above capacity are fundamentally impossible, no matter how sophisticated the code. Modern codes like LDPC and turbo codes were specifically designed, decades after Shannon's original proof, to closely approach the achievable side of that bound in practice, often within a fraction of a decibel of SNR from the theoretical ceiling. But the impossibility side is absolute: it follows from rigorous probabilistic arguments about distinguishing signals corrupted by noise, so no coding scheme, however advanced, can push a channel's reliable rate past `H log2(1+SNR)`.

Before this

Where this leads