Computer Networks
The Physical Layer
2012. Knight Capital Group rolled out a new trading algorithm. Forty-five minutes later the firm was down 440 million USD. The culprit: an 8-millisecond latency gap between servers. The physical layer killed the company faster than a kill-switch could fire.
- **HFT trading**: Virtu Financial runs direct optical lines between exchanges - every microsecond of latency is worth millions
- **Data centers**: Cat8 copper for 30-meter intra-rack runs vs single-mode fiber between buildings - a critical architectural choice
- **5G and industry**: 1-5 ms latency enables robot control and remote surgery - impossible on 4G's 50 ms
Claude Shannon and the channel limit
In 1948, Shannon published a mathematical proof of the upper bound on information rate over any physical channel in the Bell System Technical Journal. C = B log2(1 + S/N) is not empirical - it is a theorem. Bell Labs engineers spent 20 years trying to beat it and failed. Today 5G standards push as close to the Shannon limit as possible: 256-QAM at 27 dB SNR delivers 8 bits/symbol, hitting 99% of the theoretical maximum.
Предварительные знания
Copper cables: twisted pair
**Twisted pair** is the backbone of local networks worldwide. Eight copper conductors twisted into pairs inside one sheath. This cable wires up 90% of corporate networks on the planet.
Why twisted? The twist kills electromagnetic interference: noise hits both wires equally, and they cancel out at the receiver. More twists per meter, better noise rejection.
**UTP vs STP**: UTP (Unshielded) - no shield, cheaper, used in 90% of networks. STP (Shielded) - foil shielding, for industrial environments with strong interference.
The 100-meter limit is physics: signal attenuates. Anything longer demands repeaters or a jump to fiber. Google and Facebook design data centers so no server rack sits more than 30 meters from a ToR switch.
Why are the wires in a twisted pair twisted together?
Fiber optics: light instead of electricity
**Fiber optics** sends data as pulses of light through glass or plastic strands. Light shrugs off electromagnetic interference, generates no crosstalk, and travels tens of kilometers without amplification. A single fiber cable carries 100 Tbps in transatlantic systems shipping in 2023.
Transatlantic cables are fiber bundles laid across the ocean floor. EDFA amplifiers boost the signal every 50-100 km. One cable can push petabits per second.
Fiber connectors: **LC** (small, common in servers), **SC** (square, common in telecom), **ST** (bayonet mount, legacy). Cleanliness rules everything - a single dust speck on the end face blocks the signal. Field engineers carry dedicated cleaning kits for exactly this reason.
What is the key advantage of fiber optics over copper cable?
Wireless transmission: Wi-Fi and more
**Wireless communication** moves data through air on electromagnetic waves. Wi-Fi, Bluetooth, 4G/5G, satellite internet - each runs on its own frequency band and protocol. Every band is a trade between speed, range, and ability to punch through walls.
**Wi-Fi channels**: 2.4 GHz has 14 channels (3 non-overlapping: 1, 6, 11). 5 GHz has more channels and less interference from neighbors. 6 GHz (Wi-Fi 6E) - a clean band, but few devices support it yet.
The wireless medium is **shared**: every device in range hears every other one. Collision and security problems follow - hence encryption (WPA3).
**Half-duplex**: Wi-Fi cannot transmit and receive on the same frequency at the same time. Wired Ethernet runs full duplex; Wi-Fi cannot. A hard physical constraint: a device's own outgoing signal drowns out anything inbound.
Why does Wi-Fi operate in half-duplex mode?
Signal encoding: how to transmit bits
Bits (0 and 1) need a physical representation. **Encoding** picks how: voltage level, signal transition, wave phase, or some combination. The encoding scheme dictates the channel's speed and reliability.
Heavier schemes solve that. **Manchester** encoding puts a transition in the middle of every bit: upward = 0, downward = 1. **4B/5B** swaps 4 bits for 5, killing off the "bad" combinations that have no transitions.
**PAM-4** (Pulse Amplitude Modulation 4-level) - 4 signal levels, transmits 2 bits per clock cycle. Used in 400G Ethernet. Requires quality cables and receivers with good SNR.
Why is simple NRZ encoding rarely used in networks?
Bandwidth and latency
Two key network parameters: **bandwidth** - bits per second the channel can move, and **latency** - time for a packet to reach its destination. Mixing them up is a textbook system design blunder.
**Shannon's Law**: maximum channel capacity = B x log2(1 + S/N), where B is the bandwidth and S/N is the signal-to-noise ratio. A physical limit that no protocol can overcome.
Latency breaks down into: **propagation delay** (speed of light in the medium), **transmission delay** (time to clock out the bits), **processing delay** (router work), **queuing delay** (sitting in a buffer). Propagation is unbeatable - physics sets the floor.
Fast internet = fast loading of everything
High bandwidth helps with large files but does not reduce latency
Opening a web page involves many small requests. Here latency (RTT) matters more than bandwidth. 1 Gbps with 100 ms ping is slower than 100 Mbps with 10 ms ping for browsing.
What matters more for an online game: high bandwidth or low latency?
Key ideas
- **Twisted pair** (UTP/STP) - the backbone of local networks, up to 100 m, Cat5e-Cat8 categories
- **Fiber optics** - light through glass, up to 100+ km, single-mode (longer range) and multi-mode (cheaper)
- **Wireless communication** - half-duplex, shared medium, requires encryption
- **Bandwidth vs Latency** - bandwidth matters for large files; latency matters for interactive applications
- **Shannon's Law** - physical upper bound on channel capacity, a proven theorem
What's next
The physical layer transmits bits. But how do devices know who the data is meant for?
- Data Link Layer — MAC addresses and Ethernet - addressing within a local network
- Switches — The devices that connect everything together
Вопросы для размышления
- Why do data centers typically use fiber optics between racks instead of twisted pair?
- Geostationary satellites orbit at 36,000 km. Calculate the minimum round-trip latency imposed by the speed of light alone.
- Why does Starlink use low orbit rather than geostationary?
Связанные уроки
- net-02-osi-overview — OSI model provides context for the physical layer
- net-04-data-link — Physical layer is the foundation data link sits on
- net-67-latency-numbers — Concrete latency numbers across transmission media
- net-15-tcp-basics — TCP lives above physics - the contrast matters
- arch-08-memory-hierarchy — Same speed/distance/cost trade-off logic
- net-59-troubleshooting — Network diagnostics always starts at the physical layer
- bt-03-serialization