Data Transmission
A complete, gap-free treatment of how data physically moves: signal encoding, modulation, the mathematics of bandwidth, every component of latency, noise, error correction, QoS, and practical measurement tools.
// CHAPTER 01
What Is Data Transmission?
From electrons to information
Every byte you send — a text message, a video call frame, a DNS query — must ultimately become a physical phenomenon: a voltage on a wire, a light pulse in fiber, an electromagnetic wave in the air. Data transmission is the entire discipline of converting digital bits into physical signals, moving those signals across a medium, and recovering the original bits at the other end as faithfully as possible.
This sounds simple, but three forces work against you: distance weakens signals (attenuation), noise corrupts them, and time limits how fast you can send them. Understanding these forces — and the techniques engineered to fight them — is the foundation of everything else in networking.
// REAL-WORLD SCENARIO
Transmission Media: Where Signals Live
Three physical media dominate modern networking, each with a different physics:
Copper (twisted-pair, coaxial): Current flows through a conductor. Electrons don't actually move fast — they drift ~1 mm/s — but the electromagnetic field propagates at ~67% the speed of light (~200,000 km/s). Twisted pairs (used in Ethernet Cat5e/Cat6/Cat8) twist the two conductors around each other so external noise hits both wires equally and cancels when the receiver takes the differential voltage. Coax uses a center conductor surrounded by a ground shield — still used in cable TV and some last-mile internet.
Fiber optic: Light pulses travel through a glass or plastic core. Single-mode fiber (9 µm core) uses a single laser ray path and supports 100+ km without amplification. Multi-mode fiber (50 or 62.5 µm core) allows multiple ray paths (modes), causes modal dispersion, and is limited to ~300–500 m — used in datacenter and campus backbones. Light in glass travels at ~200,000 km/s (about 67% of c in vacuum). Fiber is immune to EMI, can't be tapped without physical intrusion, and supports terabit-per-second throughput on DWDM systems.
Wireless (radio frequency): Electromagnetic waves propagate through air or vacuum. WiFi uses 2.4 GHz and 5 GHz (or 6 GHz in WiFi 6E). 5G uses frequency bands from 700 MHz (long range, low capacity) to 39 GHz mmWave (short range, very high capacity). Radio signals travel at c ≈ 300,000 km/s in air — faster than in glass. Wireless introduces unique challenges: multipath reflections, interference from neighboring networks, and the shared, unguided nature of the medium.
// CHAPTER 02
Analog vs Digital Signals
The fundamental representation divide
An analog signal is a continuously variable quantity. A telephone's classic voice signal varied voltage in exact proportion to sound pressure — infinite possible values, smooth curves, infinite resolution (at least in theory). Analog signals are elegant but fragile: any amplification also amplifies the noise that has accumulated on the signal, and after many amplification stages noise compounds into distortion.
A digital signal uses a finite set of discrete states — most commonly two: high voltage = 1, low voltage = 0. The key advantage of digital isn't that it sounds better — it's that it can be regenerated, not just amplified. A regenerator reads the incoming signal, decides whether each bit is 0 or 1 (even with noise present), and outputs a clean new signal. Noise below the decision threshold is completely eliminated. This is why digital communication dominates: every repeater restores perfect signal quality.
Signal Parameters
Any periodic signal can be described by:
Amplitude: The peak value (voltage, optical power, field strength). Higher amplitude = higher power = better SNR = longer reach.
Frequency: Cycles per second (Hz). Higher frequency = more oscillations per second = potentially more data per second, but also more attenuation over distance (high-frequency energy is absorbed more by most media).
Phase: The position of the waveform relative to a reference point (0° to 360°). Phase shifts can encode information — PSK and QAM both exploit this.
Wavelength: λ = c / f. The physical distance one complete cycle occupies. In fiber optic, different wavelengths of light carry independent data streams simultaneously (WDM). The C-band (1530–1565 nm) carries most long-haul traffic today.
Baud Rate vs Bit Rate — a Critical Distinction
Baud rate (symbols per second, Bd) is the number of signal state changes per second. Bit rate (bits per second, bps) is the number of data bits per second. These are only equal when each symbol carries exactly 1 bit.
If each symbol can be one of 4 states (2 bits), then: bit rate = baud rate × 2. If each symbol can be one of 64 states (6 bits): bit rate = baud rate × 6. Modern modulations (QAM-4096 in cable DOCSIS 3.1) carry 12 bits per symbol — the baud rate is a fraction of the bit rate. This distinction is critical for understanding why "56K modem" ran at only 8000 baud.
✗ Common Mistake — Confusing baud rate with bit rate
Saying "100 Mbps Ethernet runs at 100 million baud" is wrong. 100BASE-TX Ethernet uses 4B/5B encoding and MLT-3 signaling, running at 125 Mbaud to achieve 100 Mbps. 1000BASE-T uses 4D-PAM5 across 4 pairs, each pair at 125 Mbaud, achieving 1000 Mbps total — baud rate is 125 million, bit rate is 1 billion.
// CHAPTER 03
Signal Encoding
How bits become waveforms on a wire
Line coding is the process of converting a sequence of bits into a sequence of voltage levels (or light pulses) for transmission. The choice of line code directly affects synchronization, bandwidth efficiency, DC component (important for transformers), and error detection capability.
The interactive visualizer below shows the same 8-bit sequence (1 1 0 1 0 0 1 0) encoded in five different schemes. Click each to see the waveform and understand the trade-offs.
// SIGNAL ENCODING VISUALIZER — input bits: 1 1 0 1 0 0 1 0
NRZ-L (Non-Return to Zero Level): 1 = high voltage, 0 = low voltage. Simple but no clock recovery — long runs of same bit lose synchronization.
NRZ-L (Non-Return to Zero Level)
The simplest possible scheme: 1 = high, 0 = low, voltage stays constant throughout the bit period. Used internally in many chips. Problems: (1) DC component — a long string of 1s means DC voltage, which can't pass through AC-coupled transformers; (2) clock recovery failure — long strings of the same bit provide no transitions for the receiver's clock recovery circuit to lock onto. After 10–20 identical bits, the receiver's clock drifts and bits are miscounted.
NRZ-I (Non-Return to Zero Inverted)
Encodes data as transitions rather than levels: a 1 causes a voltage transition, a 0 produces no change. This eliminates the problem with long strings of 1s (every 1 gives a transition). But a long string of 0s still has no transitions. USB 1.1 and 2.0 use NRZ-I with bit-stuffing: a 0 is forcibly inserted after 6 consecutive 1s, which is then removed by the receiver.
Manchester Encoding
Every bit period contains a mandatory mid-bit transition: falling (high→low) encodes a 1; rising (low→high) encodes a 0. This is the IEEE 802.3 convention (10BASE-T Ethernet). Advantages: self-clocking — the receiver can recover the clock from transitions alone, and there are never more than 1 bit period without a transition. Disadvantage: the guaranteed mid-bit transition means Manchester encoding requires twice the baud rate of NRZ for the same bit rate. 10BASE-T at 10 Mbps runs at 20 Mbaud.
Differential Manchester (used in Token Ring) always has a mid-bit transition, but encodes data in whether a transition occurs at the start of the bit period (0 = transition, 1 = no transition). This is more robust to polarity inversion.
4B/5B + NRZI
Used in FDDI and 100BASE-TX (Fast Ethernet): every 4 data bits are mapped to a 5-bit code word selected to guarantee no more than 3 consecutive zeros. The 5-bit code words are then sent using NRZ-I. The 32 code words (out of 32 possible 5-bit patterns) that have too many zeros are simply never used — this gives 16 data codes plus 16 control codes. Efficiency: 4/5 = 80%. To achieve 100 Mbps, 100BASE-TX runs the physical layer at 125 Mbaud.
8B/10B Encoding
A generalization: every 8 data bits map to a 10-bit code. Used in Gigabit Ethernet (1000BASE-X), Fibre Channel, USB 3.0 (SuperSpeed). Guarantees DC balance (equal 1s and 0s over any run) and limits run length. Efficiency: 80%. The codes maintain a running disparity — if more 1s than 0s have been sent recently, the next code word is chosen to have more 0s.
64B/66B Encoding
Used in 10 Gigabit Ethernet and faster. Every 64 data bits are preceded by a 2-bit synchronization header (01 or 10 — never 00 or 11, ensuring transitions). Efficiency: 64/66 ≈ 97%. Much more efficient than 8B/10B, at the cost of more complex scrambling logic.
PAM4 (Pulse Amplitude Modulation, 4-level)
PAM4 uses 4 voltage levels instead of 2, encoding 2 bits per symbol. At the same baud rate as NRZ (PAM2), PAM4 carries twice the data. Used in 400 Gbps and 800 Gbps Ethernet. The trade-off is reduced noise margin: with 4 levels, the voltage difference between adjacent levels is one-third the voltage difference in 2-level signaling, requiring a much better SNR. PAM4 links use sophisticated DSP, forward error correction, and low-noise components.
⚡ How 400G Ethernet achieves 400 Gbps
400GBASE-SR8: 8 optical lanes × 50 Gbps per lane = 400 Gbps. Each lane uses PAM4 at 26.5625 Gbaud × 2 bits/symbol = 53.125 Gbps, then reduced to 50 Gbps after 64B/66B encoding overhead. 400GBASE-DR4: 4 lanes × 100 Gbps each with 50 Gbaud PAM4. Future 800G and 1.6T use the same approach with more lanes and higher baud rates.
// CHAPTER 04
Modulation
Carrying digital data over analog carriers
Line coding works directly on DC signals (voltage levels on wire). But many transmission systems — wireless, DSL, cable, fiber with multiple wavelengths — need to carry digital data by modifying a carrier wave (a continuous sinusoidal signal). This is modulation. Three fundamental properties of a sine wave can be varied to carry data.
ASK — Amplitude Shift Keying
The amplitude (strength) of the carrier changes between states: high amplitude = 1, low amplitude = 0 (or zero amplitude — this is called OOK, On-Off Keying). Simplest conceptually. Problem: amplitude variations are exactly what noise and attenuation cause — any distance attenuates the signal and corrupts the data. Used in optical fiber for simple single-channel systems (on/off laser = 1/0), but avoided in RF systems exposed to fading.
FSK — Frequency Shift Keying
The carrier switches between two different frequencies: one frequency = 1, another frequency = 0. Old analog modems (Bell 103 at 300 bps) used FSK. Frequency changes are robust to amplitude noise (AGC circuits can equalize amplitude). Still used in: low-speed telemetry, some IoT devices (LoRa uses a form of FSK called chirp spread spectrum). Problem: each frequency occupies bandwidth in the spectrum — two frequencies means at least 2× the bandwidth of a single-frequency system.
PSK — Phase Shift Keying
The phase of the carrier changes to represent symbols. BPSK (Binary PSK): 0° = 0, 180° = 1 — 1 bit per symbol, very robust, used in satellite and deep-space comms. QPSK (Quadrature PSK): 4 phases (45°, 135°, 225°, 315°) — 2 bits per symbol. 8-PSK: 8 phases — 3 bits per symbol. Used in GSM, HSPA+. Phase detection requires coherent receivers that maintain a reference phase — adds receiver complexity.
QAM — Quadrature Amplitude Modulation
QAM combines both amplitude and phase variation. Symbols are points on a 2D constellation diagram (in-phase I vs quadrature Q axes). 16-QAM: 16 points in a 4×4 grid — 4 bits per symbol. 64-QAM: 64 points — 6 bits per symbol. 256-QAM: 8 bits per symbol. 1024-QAM (WiFi 6): 10 bits per symbol. 4096-QAM (DOCSIS 3.1): 12 bits per symbol.
Higher-order QAM carries more bits per symbol but requires higher SNR because the constellation points are closer together. Cable DOCSIS 3.1 can use 4096-QAM downstream because cable plants are well-controlled, amplified environments. WiFi must use lower orders at longer distances where SNR degrades.
OFDM — Orthogonal Frequency Division Multiplexing
WiFi, 4G LTE, 5G NR, and ADSL all use OFDM. Instead of one wide carrier, OFDM divides the channel into hundreds or thousands of narrow subcarriers, each carrying a QAM symbol at a low symbol rate. "Orthogonal" means the subcarriers are mathematically perpendicular — each subcarrier's peak coincides exactly with the nulls of all other subcarriers, eliminating inter-carrier interference.
OFDM advantages: (1) multipath resilience — echoes spread over time are contained within the cyclic prefix (guard interval), not contaminating adjacent symbols; (2) frequency-selective fading only affects some subcarriers, not all; (3) can allocate different modulation per subcarrier based on channel quality. WiFi 6 (802.11ax) adds OFDMA, which divides subcarriers among multiple users simultaneously.
// CHAPTER 05
The Nyquist and Shannon Theorems
The mathematics that defines the ceiling
Two theorems form the absolute mathematical foundation of data rate limits. Every network engineer must understand these — they determine what is physically possible, independent of technology.
Nyquist's Theorem (1924)
The maximum data rate of a noiseless channel of bandwidth B Hz, using V discrete signal levels, is:
Nyquist tells us that even in a perfect, noiseless world, you can't sample a signal faster than twice its bandwidth (the Nyquist rate) without aliasing — sampling faster gives you no new information. This is why audio CD quality samples at 44,100 Hz for 20 kHz audio (44,100 ≈ 2 × 22,050 Hz with some headroom).
The limit is only on the sampling rate given the bandwidth — you can still increase the data rate by using more voltage levels. But more levels require better SNR, which brings us to Shannon.
Shannon-Hartley Theorem (1948)
Claude Shannon's theorem gives the absolute theoretical maximum (the channel capacity C) for a real channel with Gaussian noise:
Shannon capacity is an absolute ceiling — no error-correcting code, no modulation scheme, no amount of engineering can exceed it. It can only be approached. Modern systems (LTE Advanced, WiFi 6) operate within a few dB of the Shannon limit thanks to LDPC and Turbo codes.
Reconciling Nyquist and Shannon
The two theorems answer different questions: Nyquist says given a noiseless channel of bandwidth B, the maximum symbol rate is 2B. Shannon says given noise level S/N, the maximum bit rate is B × log₂(1 + S/N). Together: to approach the Shannon limit, you must use many voltage levels (as Nyquist allows), which in turn requires a high SNR to distinguish those levels reliably.
🧮 Why 56K modems were limited to ~53 kbps
The public switched telephone network (PSTN) limited lines to 3.4 kHz bandwidth and had quantization noise equivalent to about SNR = 38 dB. Shannon: C = 3400 × log₂(1 + 6310) ≈ 42,900 bps upstream. Downstream from ISP (pure digital path) could reach 56,000 bps. But FCC Part 68 regulations limited transmit power, capping it at 53.3 kbps in practice. Shannon's theorem predicted the ceiling; physics and regulation determined exactly where it sat.
What's the Shannon capacity of a 20 MHz WiFi channel at 25 dB SNR?
// CHAPTER 06
Bandwidth — Hz vs bps
Two measurements, one confusing word
"Bandwidth" is used to mean two completely different things in networking, and conflating them causes genuine confusion.
Signal Bandwidth (Hz)
In physics and electrical engineering, bandwidth means the range of frequencies a signal occupies, measured in hertz. A 3 kHz telephone channel has a 300 Hz–3400 Hz bandwidth — a 3.1 kHz wide band of the frequency spectrum. A 20 MHz WiFi channel occupies 20 MHz of spectrum. This is a physical property of the channel, determined by filters, regulators (spectrum licenses), and the physics of the medium.
Shannon and Nyquist both use bandwidth in Hz. When we say "more bandwidth enables more data," it is ultimately because more Hz of spectrum allows more independent signal changes per second.
Data Bandwidth / Throughput (bps)
In casual networking usage, "bandwidth" means the data rate — bits per second. "I have 500 Mbps bandwidth" means the link can carry 500 million bits per second. This is more precisely called throughput or link rate.
Three Measurements You Must Distinguish
Bandwidth (link rate): The maximum rate a link can carry bits, as specified by the standard. 1 Gbps Ethernet has a 1 Gbps link rate. This is a property of the link, not of current traffic.
Throughput: The actual measured rate of data transfer, averaged over time. Always ≤ bandwidth due to protocol overhead, retransmissions, collisions, or contention. When you run iperf3, you measure throughput.
Goodput: The application-layer useful data rate — bytes the application actually receives and uses, excluding headers, retransmitted data, and protocol overhead. Goodput ≤ Throughput ≤ Bandwidth. If TCP retransmits 10% of segments due to loss, your goodput is ~90% of throughput.
✗ Common Mistake — Using 'bandwidth' to mean all three things interchangeably
Your ISP advertises "1 Gbps bandwidth." This is the link rate — the maximum possible rate. Your throughput (measured by iperf3) might be 940 Mbps due to your router's CPU. Your goodput (what your browser sees downloading a file) might be 880 Mbps due to HTTP overhead and TCP slow start. All three are different numbers. Never say "I have 1 Gbps" when diagnosing performance — specify which measurement you mean.
// CHAPTER 07
Multiplexing
Sharing one medium among many senders
A physical link is expensive. Multiplexing lets multiple independent data streams share a single physical medium simultaneously, dividing the channel in space (frequency, wavelength, time, or code).
FDM — Frequency Division Multiplexing
Each sender gets an exclusive, non-overlapping frequency band. Guard bands (unused spectrum between channels) prevent interference between adjacent channels. Used in: AM/FM radio (each station gets a 200 kHz FM band), cable TV (each channel gets a 6 MHz band), ADSL (upstream band: 25–138 kHz; downstream band: 138 kHz–1.1 MHz), and ISDN. FDM works in continuous time — all channels transmit simultaneously in their own spectrum slice.
TDM — Time Division Multiplexing
All senders share the full bandwidth but take turns using fixed time slots. In synchronous TDM (used in T1/E1 telephone circuits), each channel gets the same time slot in every frame whether or not it has data to send — wasteful for bursty traffic. A T1 line carries 24 voice channels at 64 kbps each in a 193-bit frame repeated 8000 times/second = 1.544 Mbps.
Statistical TDM (STDM): slots are assigned dynamically to channels that have data to send. Used in packet-switched networks (Ethernet, Internet) — the underlying mechanism of all packet switching. A busy sender can use more slots; an idle sender uses none.
WDM and DWDM — Wavelength Division Multiplexing
In fiber optics, FDM applied to light wavelengths. WDM uses a small number of widely-spaced wavelengths (typically 4–8). DWDM (Dense WDM) packs 80–160+ wavelengths into the C-band (1530–1565 nm) at 100 GHz spacing (0.8 nm). Each wavelength carries an independent data stream at 100–400 Gbps. A single fiber pair with DWDM can carry 80 channels × 400 Gbps = 32 Tbps. Intercontinental submarine cables use DWDM with optical amplifiers (EDFAs) every 50–80 km.
CWDM (Coarse WDM): fewer channels (18) at wider 20 nm spacing — no amplifiers needed, lower cost, shorter reach. Used in metro networks.
OFDM as Frequency Division Multiplexing
OFDM (covered in Chapter 4) is fundamentally FDM within a single communication link — hundreds of orthogonal subcarriers share the channel. The difference from classical FDM is mathematical orthogonality: OFDM subcarriers are spaced exactly 1/(symbol duration) apart, making them orthogonal without needing guard bands between subcarriers. This dramatically improves spectral efficiency.
CDMA — Code Division Multiple Access
Multiple senders transmit simultaneously on the same frequency by multiplying their data with a unique pseudorandom spreading code. Each receiver despreads only its intended signal — other signals appear as noise. Used in 3G UMTS/WCDMA and CDMA2000 cellular. The spreading codes (Walsh codes) are mathematically orthogonal, so they cancel each other when correlated against the wrong code. Near-far problem: a close strong transmitter can overwhelm a distant weak one — requires precise power control.
// CHAPTER 08
The Four Components of Latency
Every millisecond accounted for
When a packet travels from source to destination, the total delay is the sum of four distinct components. Understanding each one is critical for diagnosing network problems — the fix for each type is completely different.
// LATENCY BREAKDOWN CALCULATOR
Link type
Packet size
RTT ≈ 2× one-way. BDP = bandwidth × RTT = 125735 KB in flight
1. Propagation Delay
The time for a signal to physically travel from sender to receiver. Determined entirely by distance and the speed of the signal in the medium:
Propagation delay is a hard physical limit. You cannot make light travel faster. New York to London is ~5500 km of fiber → ~27 ms one-way (the fiber path is not a straight line). This is why trading firms build proprietary microwave relay towers for NY→London: microwave travels in air (≈c) along a straighter path → ~18 ms — saving ~9 ms per trip for high-frequency trading.
2. Transmission Delay (Serialization Delay)
The time to push all bits of a packet onto the wire. Depends on packet size and link bandwidth:
This is why large packet sizes hurt more on slow links. Jumbo frames (9000 bytes) on a 10 Gbps datacenter link add 7.2 µs of transmission delay — negligible. On a 1 Mbps satellite link the same frame takes 72 ms — enough to be the dominant delay component.
3. Processing Delay
The time a router or switch takes to examine a packet header and make a forwarding decision. Involves: CRC check, destination lookup in routing/MAC table, ACL evaluation, header modification (TTL decrement), and output queue selection. On modern hardware routers with ASICs: ~1–10 microseconds. On software routers (Linux): ~50–200 microseconds. Deep packet inspection firewalls: 1–50 ms. Processing delay varies with load (more routes to search, more ACL rules to evaluate = higher processing time).
4. Queuing Delay
The time a packet waits in a router's output queue before being transmitted, when packets arrive faster than the outgoing link can drain them. This is the most variable delay component — it can be zero (empty queue) or hundreds of milliseconds (congested link). Queuing delay depends on: traffic intensity (ρ = λ/μ where λ = arrival rate, μ = service rate), queue length, and scheduling policy.
When ρ approaches 1.0 (queue nearly saturated), queuing delay grows exponentially — this is the mathematical basis for why the internet gets dramatically slower near congestion. Little's Law: L = λW (average queue length = arrival rate × average wait time). At ρ = 0.9, average wait time is 9× the service time. At ρ = 0.99, it's 99×.
🌍 Why GEO satellite internet has 600ms+ RTT
A geostationary satellite orbits at 35,786 km altitude. Signal path: ground → satellite → ground = ~72,000 km total. At ~300,000 km/s: 240 ms one-way, 480 ms RTT just for propagation. Plus queuing at the satellite transponder and processing at the ground station: typical RTT is 580–650 ms. This makes interactive apps (SSH, video calls) feel terrible — each keypress takes 0.6 seconds to echo back. Starlink (LEO) at 550 km altitude achieves ~20–40 ms RTT, solving the interactivity problem.
Round-Trip Time (RTT)
RTT is the time from sending a packet to receiving its acknowledgment — two one-way latencies plus processing time at the destination. RTT is what ping measures. Why RTT matters more than one-way latency: TCP acknowledgments travel backward, so every TCP operation takes at least one RTT. Establishing a TCP connection requires 1.5 RTTs (SYN→SYN-ACK→ACK+data). TLS 1.2 handshake: 2 RTTs. TLS 1.3: 1 RTT (or 0-RTT for resumption). A web page requiring 10 separate HTTP/1.1 requests serially needs 10 RTTs of pure latency before content is fully loaded.
// CHAPTER 09
Bandwidth-Delay Product
How much data is 'in flight' at any moment
The Bandwidth-Delay Product (BDP) is the amount of data that can be "in the pipe" — transmitted but not yet acknowledged — at any given moment. It is fundamental to understanding TCP performance, especially over high-bandwidth, high-latency links.
Why this matters for TCP: TCP's receive window size limits how much unacknowledged data can be in flight. To fully utilize a link, the TCP window must be at least as large as the BDP. The original TCP RFC allowed a maximum window of 65,535 bytes. On a 1 Gbps / 40 ms RTT link, BDP is ~5 MB — 65,535 bytes would only utilize 65,535 / 5,000,000 = 1.3% of the link capacity! This is why TCP window scaling (RFC 7323) was invented — it extends the window to up to 1 GB.
For file downloads: if you have a 10 Gbps link to a server 100 ms away (BDP = 125 MB), you need 125 MB of TCP window space just to saturate the link. If the server's socket buffer is only 4 MB, throughput is limited to 4 MB / 0.1 s = 320 Mbps regardless of link speed. This is why modern servers set tcp_rmem and tcp_wmem to 16–64 MB.
A trans-Atlantic fiber link carries 100 Gbps and has 70 ms RTT. What window size is needed to fill it?
// CHAPTER 10
Throughput, Jitter, and Packet Loss
The three axes of network quality
Beyond raw bandwidth and latency, three metrics define the actual quality of a network path for real applications: throughput, jitter, and packet loss. Each affects different application types differently.
// BANDWIDTH vs LATENCY — what dominates each application?
Bandwidth sensitivity
10/10
Latency sensitivity
1/10
Throughput is everything. Once TCP window is full, latency only matters for slow-start phase. A 10 Gbps link with 100ms RTT moves data faster than a 1 Gbps link with 1ms RTT.
Jitter — Latency Variation
Jitter is the variation in packet arrival times. If packets are sent at t=0, t=10ms, t=20ms and arrive at t=5ms, t=17ms, t=32ms — the one-way latencies are 5ms, 7ms, 12ms. Jitter is the standard deviation (or inter-arrival variation) of these latencies. High jitter means packets arrive bunched together or with gaps, even if the average latency is acceptable.
Sources of jitter: queuing delay variation (packets wait different amounts based on queue state), CPU scheduling jitter in software routers, wireless channel variations, and processing delays. Note that propagation delay is constant (speed of light doesn't vary) — jitter comes from the variable components.
Jitter Buffer
Real-time applications (VoIP, video conferencing) use a jitter buffer to absorb jitter. The receiver deliberately delays playback by a fixed amount (e.g., 60 ms) and stores arriving packets in a buffer. Packets that arrive within the buffer window play smoothly. Packets that arrive after the deadline are either played late (glitch) or dropped.
Adaptive jitter buffer: modern VoIP clients dynamically adjust the buffer depth based on measured jitter. Low jitter → shrink buffer (lower latency); high jitter → grow buffer (more smoothing). The trade-off is latency vs smoothness — deeper buffer = less dropout but more delay.
Packet Loss
Packets are dropped when: (1) queue overflows (tail drop or RED/WRED active queue management); (2) CRC error detected at L2 — frame is silently discarded; (3) TTL reaches zero at a router; (4) wireless channel error too severe for FEC to correct.
Effect on TCP: TCP treats packet loss as a congestion signal (even if the loss was due to wireless error, not congestion). A single lost packet triggers: (1) fast retransmit if 3 duplicate ACKs received; (2) halves the congestion window (cwnd). At 1% packet loss, Mathis equation gives maximum TCP throughput ≈ MSS / (RTT × √loss_rate). At 1% loss on a 100 ms RTT link with 1460 byte MSS: throughput ≤ 1460 / (0.1 × √0.01) = 1460 / (0.1 × 0.1) = 146,000 bytes/s = 1.17 Mbps — regardless of link bandwidth. This is why packet loss is catastrophic for TCP performance.
Effect on UDP: UDP has no retransmission — lost packets are simply gone. Video conferencing handles this with: error concealment (copy last frame), packet interleaving (spread loss across time), and FEC (send redundant packets). At <1% loss, most video codecs recover gracefully. Above 5% loss, video quality degrades severely.
// CHAPTER 11
Noise and Signal Impairments
Everything working against your signal
Every physical transmission is degraded by noise. Understanding noise types helps you diagnose the right problem — some noise types are fundamental (thermal noise), others are engineering failures (grounding issues causing EMI).
Attenuation
Signal strength decreases as it travels through the medium. In copper: resistive losses convert electrical energy to heat. In fiber: Rayleigh scattering and absorption (hydroxyl ions in glass). In wireless: free-space path loss follows the inverse square law — doubling the distance reduces signal power to one-quarter.
Attenuation is measured in decibels (dB): every 3 dB = signal power halved; every 10 dB = signal power ×10 reduction. Cat6a copper cable: ~20 dB loss per 100m at 100 MHz. Single-mode fiber: ~0.2 dB/km at 1550 nm (a 100 km fiber link loses only 20 dB — remarkable). Copper at 100m: same 20 dB loss as 100 km of fiber.
Crosstalk — NEXT and FEXT
In twisted-pair cables, the electromagnetic field of one pair induces voltage in an adjacent pair. NEXT (Near-End CrossTalk): crosstalk measured at the transmitting end — the strongest because the injecting signal is strongest near the source. FEXT (Far-End CrossTalk): crosstalk measured at the far end — weaker because the inducing signal has attenuated. Twisting the pairs with different twist rates per pair reduces crosstalk by ensuring that induced noise tends to cancel over each twist cycle. Cat6a's tighter twist rates achieve 500 MHz bandwidth with acceptable crosstalk; Cat5e only manages 100 MHz.
EMI — Electromagnetic Interference
External electromagnetic sources induce noise currents in cables: fluorescent lights (~30 kHz harmonics), electric motors, microwave ovens (2.45 GHz), and other network cables. Shielded cables (STP/FTP/SFTP) add a foil or braid shield around each pair or the whole cable, connected to ground at one end, to block external EMI. Unshielded cables (UTP) rely entirely on balanced differential signaling to cancel common-mode noise — it works well for moderate EMI but fails in industrial environments.
Thermal Noise (Johnson-Nyquist Noise)
Every resistor generates noise voltage proportional to its temperature and bandwidth: V_noise = √(4kTBR), where k = Boltzmann constant (1.38×10⁻²³ J/K), T = temperature in Kelvin, B = bandwidth in Hz, R = resistance in Ohms. This is the irreducible, fundamental noise floor — it exists at any nonzero temperature. It's why cooling RF amplifiers and ADCs with liquid nitrogen improves SNR in radio astronomy.
Impulse Noise
Short, intense noise bursts: lightning, switching transients, arc welders, elevator motor commutators. Impulse noise can corrupt many consecutive bits — exactly the scenario that Reed-Solomon codes (which correct burst errors) are designed to handle. DSL modems use forward error correction specifically sized for the expected impulse noise duration in telephone lines.
SNR — Signal-to-Noise Ratio
SNR is the ratio of signal power to noise power: SNR(dB) = 10 × log₁₀(S/N). A higher SNR means a cleaner signal and enables higher-order modulation (more bits per symbol). Practical thresholds: below 10 dB SNR, even BPSK becomes unreliable; above 40 dB SNR, 4096-QAM becomes practical. The SNR must be measured at the receiver (after all path losses), not at the transmitter.
BER — Bit Error Rate
BER is the fraction of bits received in error: BER = number_of_errored_bits / total_bits_received. Target BER in different systems:
// CHAPTER 12
Error Detection and Forward Error Correction
Finding and fixing bit errors without retransmission
Once noise corrupts bits, two strategies exist: error detection (detect that something went wrong, request retransmission) and forward error correction — FEC (add enough redundancy to reconstruct the original data even after errors, no retransmission needed).
Error Detection: Parity, Checksum, CRC
Parity bit: Add one bit to make the count of 1s even (even parity) or odd. Detects 1-bit errors; fails for 2-bit errors (probability ½ of missing 2-bit errors). Used in RAM (ECC adds more parity bits for correction).
Checksum: Sum all words in the message and include the complement. IPv4, TCP, UDP headers include 16-bit Internet Checksum (one's complement addition). Weak — doesn't detect all error patterns, especially when two errors cancel. CRC is always preferred for link-layer error detection.
CRC (Cyclic Redundancy Check): Treat the message as a polynomial and divide by a generator polynomial. The remainder becomes the CRC. Ethernet uses CRC-32 (4 bytes appended to every frame). CRC-32 detects: all single-bit errors, all 2-bit errors, all burst errors ≤ 32 bits, and 99.9999977% of longer burst errors. If CRC fails, the frame is silently dropped at L2 — no error message, no retransmission request. Recovery is the job of upper layers (TCP retransmits; UDP applications must decide).
FEC: Reed-Solomon Codes
Reed-Solomon (RS) codes treat data as polynomial coefficients over a finite field (Galois field). RS(n,k): k data symbols + (n-k) parity symbols. Can correct up to (n-k)/2 symbol errors. RS(255,223) is the NASA standard: can correct 16 erased bytes out of 255. Used in CDs (RS corrects scratches), DVDs, QR codes, DSL, and 100G Ethernet (RS(544,514) with 10-bit symbols).
RS is excellent for burst errors — errors clustered together (a scratch on a CD, an impulse noise spike) — because even large bursts only corrupt a few symbols.
FEC: Turbo Codes
Invented in 1993 and used in 3G/4G cellular. Two parallel recursive systematic convolutional (RSC) encoders process the data (one with a pseudo-random interleaver). The receiver uses iterative Bayesian decoding (belief propagation), passing soft-decision estimates back and forth between the two decoders. After 5–10 iterations, the decoder converges. Turbo codes approach within 0.5 dB of the Shannon limit — a breakthrough. Key advantage: linear encoding complexity, manageable decoding complexity.
FEC: LDPC Codes (Low-Density Parity Check)
Introduced by Gallager in 1963, forgotten for 30 years, rediscovered in the 1990s. LDPC codes use a sparse parity check matrix (most entries are zero — hence "low-density"). Decoded with belief propagation on a Tanner graph. LDPC achieves performance within 0.0045 dB of the Shannon limit (practically perfect). Used in: WiFi (802.11n/ac/ax), DVB-S2/T2, 10G/100G Ethernet, and 5G NR (replacing Turbo codes for data channels). LDPC can be decoded in parallel, making high-throughput hardware implementation practical.
FEC: Polar Codes
The newest entrant — proven theoretically optimal by Arıkan in 2009. Achieves Shannon capacity as code length N → ∞. Used in 5G NR control channels. Polar codes are based on channel polarization: combining many uses of a noisy channel creates some "perfect" channels and some "completely noisy" channels — data is sent only on perfect ones. Decoding uses successive cancellation with list decoding for finite lengths.
🛸 Voyager 1 and Reed-Solomon
Voyager 1 is ~22 billion km from Earth (as of 2025). Its 22-watt radio transmitter sends data at 160 bps. The received signal power at Earth is 10⁻¹⁶ watts — a femtowatt. The SNR at reception is close to the thermal noise floor. Without FEC, almost every bit would be wrong. With concatenated Reed-Solomon + Golay FEC, engineers recover perfect images and scientific data from 22 billion km. FEC doesn't just improve links — it makes some links possible at all.
// CHAPTER 13
Bufferbloat and Active Queue Management
When bigger buffers make the internet worse
For most of the 2000s, network engineers followed a simple heuristic: "more buffer = better performance." Routers and home DSL/cable modems shipped with increasingly large buffers. By 2011, Jim Gettys identified a crisis: bufferbloat — large buffers that cause enormous, variable latency under load.
The mechanism: when a link is congested, packets fill the buffer. A large buffer takes a long time to drain, meaning packets can queue for hundreds of milliseconds. Worse: TCP's congestion control needs to detect congestion (via packet loss) to reduce its sending rate. With a huge buffer, the link never drops packets — instead, queuing delay grows without bound. TCP sees no loss and happily keeps sending, filling the buffer further. The result: latency of 1000–5000 ms on consumer links under load, making gaming and VoIP unusable while a download runs.
Tail Drop (the default, and why it's bad)
Traditional queue discipline: accept packets until the queue is completely full, then drop all new arrivals. Problems: (1) TCP flows all see loss simultaneously (tail drop synchronizes all senders to reduce rates at the same moment), causing oscillation in network load; (2) UDP flows can fill the queue and starve TCP; (3) the buffer stays full continuously, maximizing queuing delay for all packets.
RED — Random Early Detection
RED drops packets probabilistically as the average queue length increases, before the queue is full. When average queue length is between min_thresh and max_thresh, drop probability increases linearly (0 to max_p). Above max_thresh, drop every packet. Advantages: signals congestion to TCP senders early, before the queue is full; prevents queue synchronization; maintains lower average queue depth. Problems: doesn't distinguish between large (bandwidth-consuming) and small (interactive) flows.
CoDel — Controlled Delay
CoDel (Controlled Delay, pronounced "coddle") was the breakthrough algorithm proposed by Nichols and Jacobson in 2012 and standardized in Linux 3.5. Key insight: measure the sojourn time (how long each packet waits in the queue), not the queue length. Goal: keep sojourn time below 5 ms. Algorithm: if sojourn time exceeds 5 ms for a sustained 100 ms interval, start dropping packets. The drop rate increases over time until congestion is signaled. When sojourn time falls below 5 ms, stop dropping.
FQ-CoDel (Fair Queuing + CoDel): combines CoDel's delay control with per-flow fair queuing. Packets are hashed into 1024 flow queues. A deficit round-robin scheduler ensures each flow gets equal bandwidth. Small flows (DNS, ACKs, interactive SSH) are served immediately without waiting behind large flows. This eliminates bufferbloat while also providing isolation between flows. FQ-CoDel is the default qdisc in many modern Linux systems and home routers (OpenWrt, LEDE).
// CHAPTER 14
Quality of Service (QoS)
Giving priority to what matters most
All traffic on a network is not equal. A VoIP call packet delayed by 200 ms causes a noticeable glitch; a bulk file transfer packet delayed by 200 ms is invisible to the user. QoS is the set of mechanisms to differentiate treatment of packets based on their service requirements.
DSCP — Differentiated Services Code Point
The IPv4 Type of Service (ToS) byte was redefined by RFC 2474 as the DS field. The top 6 bits form the DSCP (Differentiated Services Code Point), providing 64 possible traffic classes. The bottom 2 bits are the Explicit Congestion Notification (ECN) field.
Queuing Disciplines
Priority Queuing (PQ): Multiple queues with strict priority levels. High-priority queue is always served before low-priority queues. Risk: a flood of high-priority traffic can completely starve low-priority queues — used only when you're certain about traffic volume. Typical use: VoIP at highest priority, then interactive, then bulk.
Weighted Fair Queuing (WFQ): Each flow or class gets a weighted share of bandwidth. No class is completely starved (unlike strict PQ). A VoIP class might get weight 30%, video 40%, data 30%. If a class isn't using its allocation, others can borrow it. Computationally expensive for software implementations but widely available in hardware routers.
CBWFQ (Class-Based WFQ): Cisco's implementation: classify traffic into classes via ACL/DSCP, assign bandwidth guarantees, apply WFQ within classes. Low-latency queuing (LLQ) adds a strict-priority class for real-time traffic on top of CBWFQ.
Traffic Shaping vs Traffic Policing
Traffic shaping smooths bursty traffic by holding excess packets in a buffer and releasing them at the committed rate. Uses a token bucket algorithm: tokens accumulate at the CIR (committed information rate), each packet consumes tokens equal to its size. When tokens run out, packets are held (not dropped) until tokens refill. Shaping adds delay but preserves traffic — good for regulating your own outbound traffic.
Traffic policing enforces a rate limit by dropping (or remarking) packets that exceed the limit. No buffering — excess packets are immediately dropped or marked with lower DSCP. Used by ISPs to enforce customer bandwidth commitments. If you exceed your committed rate, packets are dropped immediately (hard policing) or remarked to "best effort" (soft policing).
ECN — Explicit Congestion Notification
ECN allows routers to signal congestion without dropping packets. When a router detects congestion (via RED/CoDel), instead of dropping the packet it sets the CE (Congestion Experienced) bit in the ECN field of the IP header. The receiver echoes this back to the sender via the ECE flag in the TCP header. The sender reduces its window as if a packet had been lost — but the packet itself was delivered. Result: congestion control without the retransmission and throughput penalty of actual loss. Both endpoints must support ECN (negotiated during TCP handshake with CWR and ECE flags). Widely deployed; enabled by default in Linux and macOS.
// CHAPTER 15
Transmission Modes
Directions and channels of communication
Before two devices can communicate, they must agree on the directionality and structure of communication: who can send when, and on how many physical paths.
Simplex
Communication in only one direction: sender transmits, receiver never responds. Examples: over-the-air broadcast TV (the tower transmits; your television has no transmitter back to the tower), traditional radio, one-way paging. The full channel capacity is available in one direction. No return path means no acknowledgments, no error recovery — a fire-and-forget model.
Half-Duplex
Communication in both directions, but only one direction at a time. Both parties share the same channel and must take turns. Examples: walkie-talkies (press-to-talk, "over"), legacy Ethernet hubs (CSMA/CD governs turns), police radio, early WiFi. Half-duplex requires a mechanism to resolve contention: CSMA/CD for Ethernet, CSMA/CA for WiFi, the push-to-talk convention for voice radio.
Maximum theoretical throughput is half of full-duplex — the channel is idle in one direction whenever the other is transmitting.
Full-Duplex
Both parties can transmit and receive simultaneously, using separate channels (or echo cancellation on a shared medium). Examples: modern Ethernet over twisted pair (each direction uses a separate pair — or in 1000BASE-T, all 4 pairs with DSP-based echo cancellation), telephone calls (hybrid transformers separate send/receive on the same wire pair), cellular (FDD uses separate frequency bands for uplink and downlink; TDD uses separate time slots).
Full-duplex doubles effective throughput compared to half-duplex. Modern gigabit and 10G Ethernet switches always operate full-duplex on point-to-point links — there are no shared collision domains.
Serial vs Parallel Transmission
Parallel transmission: multiple bits are sent simultaneously over multiple physical wires. The original PC parallel port (LPT) sent 8 bits at once over 8 data lines. Early IDE disk interfaces (PATA) used 16-bit parallel. Advantages: higher data rate at lower clock frequency. Problems: skew (bits on different wires arrive at slightly different times), crosstalk between wires, and cable bulk. At high frequencies, skew becomes the dominant limitation — by ~2 GHz, parallel buses fail.
Serial transmission: bits are sent one at a time over a single differential pair. USB, PCIe, SATA, HDMI, DisplayPort, Ethernet — all modern high-speed interfaces are serial. The key insight: by sending one bit at a time, you can run the clock much faster, easily exceeding parallel interfaces. PCIe 5.0 runs at 32 GT/s per lane. 10 PCIe 5.0 lanes = 320 Gbps. USB 4 Gen 3×2: 40 Gbps over 2 pairs. Modern serial achieves this with embedded clocking (8b/10b or 128b/130b encoding), CDR (clock and data recovery), and pre-emphasis/equalization.
// CHAPTER 16
Measuring Transmission Performance
iperf3, ping, mtr, and traceroute
Theory is only useful when you can measure it. These four tools, used correctly, let you diagnose almost any transmission problem.
ping — Measuring RTT and Packet Loss
ping sends ICMP Echo Request packets and measures RTT. Run 100+ pings for meaningful statistics — 5-ping measurements are unreliable due to queuing jitter.
traceroute / tracert — Mapping the Path
Traceroute sends probe packets with incrementally increasing TTL values (1, 2, 3...). Each router that decrements TTL to 0 sends back an ICMP Time Exceeded — revealing its address and RTT. This maps the entire path hop by hop.
mtr — Continuous Path Statistics
mtr (Matt's Traceroute) combines traceroute + ping, sending continuous probes and computing per-hop loss and jitter statistics. Far superior to a one-shot traceroute for diagnosing intermittent packet loss.
iperf3 — Measuring Throughput and Goodput
iperf3 measures the actual achievable TCP (or UDP) throughput between two endpoints. Requires running a server on one end and a client on the other.
Diagnosing Common Transmission Problems
// CHAPTER 17
Interview Questions
From beginner to PhD — all levels
What is the difference between bandwidth and throughput?
What are the four components of network latency?
Why does packet loss hurt TCP so much more than UDP?
Explain the Shannon-Hartley theorem and what it implies about WiFi performance.
What is the Bandwidth-Delay Product and why does it matter for TCP tuning?
Explain bufferbloat: its cause, effect, and the CoDel solution. What does CoDel measure and why is that better than measuring queue length?
A link achieves only 1% of its theoretical Shannon capacity. What physical and protocol factors could cause this? How would you diagnose each?
Physical factors:
1. SNR far below assumed value — the modulation order is being reduced. Measure: check radio statistics for MCS (Modulation and Coding Scheme) index; a WiFi AP reporting MCS 0 (BPSK 1/2) where MCS 11 (1024-QAM 5/6) was expected explains 12× throughput reduction.
2. High BER requiring FEC to absorb most capacity — even with FEC, the code rate overhead may be consuming 50%+ of capacity. Measure: check pre-FEC and post-FEC BER at the optical transponder; RS(544,514) overhead is 5.8% normally but link BER may require retransmission at higher layers.
3. Channel bandwidth mismatch — the actual allocated bandwidth is less than assumed (e.g., only 20 MHz allocated instead of 80 MHz). Measure: spectrum analyzer or PHY statistics.
Protocol factors:
4. BDP >>> TCP window — on high-latency links, default socket buffers prevent more than a tiny fraction of BDP from being in flight. Single-stream iperf3 on a 10G/100ms link with 64 KB window achieves ~5 Mbps of 10 Gbps. Fix: increase socket buffers, use parallel streams, or use QUIC (maintains its own flow control).
5. Head-of-line blocking — HTTP/1.1 with a single connection; one large object blocks all others. Fix: HTTP/2 multiplexing or HTTP/3 QUIC streams.
6. Extreme packet loss causing TCP cwnd collapse — even 2% loss collapses TCP to near-zero throughput via the Mathis formula. Measure: iperf3 retransmission count, mtr loss statistics.
Diagnosis: iperf3 -P 64 (removes window limitation), mtr (finds loss), radio/optical management plane statistics (checks physical layer), Shannon calculation from measured SNR/bandwidth (computes theoretical max to compare against measured).
🎯 Key Takeaways
- ✓Analog signals vary continuously; digital signals use discrete states and can be regenerated perfectly — this is why digital communication dominates.
- ✓Baud rate (symbols/second) ≠ bit rate (bits/second). PAM4 carries 2 bits per symbol, so a 50 Gbaud PAM4 lane achieves 100 Gbps.
- ✓Line coding schemes (NRZ-L, Manchester, 4B/5B, LDPC, PAM4) solve DC balance, clock recovery, and bandwidth efficiency — each with different trade-offs.
- ✓Modulation (ASK, FSK, PSK, QAM) encodes digital data onto a carrier wave. Higher-order QAM (e.g., 4096-QAM) carries more bits/symbol but requires much higher SNR.
- ✓Nyquist theorem: max noise-free data rate = 2 × B × log₂(V). Shannon-Hartley: C = B × log₂(1 + S/N). Shannon's limit is absolute — no technology can exceed it.
- ✓"Bandwidth" means Hz (signal bandwidth) in physics and bps (data rate) in networking. Bandwidth (link rate) ≥ Throughput ≥ Goodput — these are three different measurements.
- ✓FDM, TDM, WDM/DWDM, OFDM, and CDMA are the major multiplexing techniques. DWDM enables terabit-per-second throughput on a single fiber pair.
- ✓Latency has four components: propagation (distance/speed), transmission (size/rate), processing (routing lookup), and queuing (output buffer wait). Each requires a different fix.
- ✓Bandwidth-Delay Product (BDP = bandwidth × RTT) is the amount of data that must be in-flight to saturate a link. TCP window size must be ≥ BDP for full utilization.
- ✓Jitter (latency variation) is the enemy of real-time apps. Jitter buffers absorb jitter at the cost of additional latency. FQ-CoDel eliminates bufferbloat by targeting sojourn time.
- ✓Noise types: attenuation, crosstalk (NEXT/FEXT), EMI, thermal noise, impulse noise. SNR determines which modulation order is usable; BER measures the result.
- ✓FEC (Reed-Solomon, LDPC, Turbo, Polar codes) adds redundancy to correct errors without retransmission, approaching the Shannon limit. Modern 400G Ethernet requires FEC.
- ✓QoS uses DSCP marking, priority queuing, WFQ, and ECN to give latency-sensitive traffic preferential treatment. Traffic shaping holds excess; policing drops it.
- ✓Tools: ping (RTT/loss), traceroute (path mapping), mtr (per-hop loss + jitter over time), iperf3 (throughput with -P for parallel streams, -w for window size tuning).
Discussion
0Have a better approach? Found something outdated? Share it — your knowledge helps everyone learning here.