Lesser-Known Networking Theories (1)
By “lesser-known,” I mean technical terms and theories that I personally don’t hear about very often.
As software engineers, when it comes to the OSI 7-layer model, we usually deal with the transport layer and above—such as common protocols like TCP/IP and HTTP. Even without knowing every intricate detail, we generally have a good idea of how they work. Conversely, we rarely touch the lower layers of the OSI model.
However, at the physical layer, there are actually far more details to consider than in many software implementations. Physical signal transmission operates in a relatively unstable, noise-filled environment, so these factors must be accounted for during system design.
Encoding
How is data encoded within a network? Regardless of what the file content is, we ultimately need to convert data into physical signals—such as high or low voltage levels—to transmit it. The process of converting data into a different format or structure for computer processing is commonly referred to as encoding.
The same applies to electrical circuits: generally, a high voltage level is treated as 1, and a low voltage level as 0.
NRZ (Non-Return-to-Zero)
NRZ is an encoding method used in digital communications that represents bit values using voltage levels.
A defining characteristic of NRZ encoding is that within each unit of time, the signal’s voltage remains constant until the next bit interval begins.
The crucial point here is “within each unit of time,” meaning the interval between each bit is fixed. Both parties need a synchronized periodic signal to know how to read the data stream; otherwise, they might interpret completely different results.

If the clock is too fast or too slow, it can lead to data errors. But here lies the question: how do both sides know what the clock frequency is? Although we could add an extra line dedicated to transmitting a clock signal, in practical applications, fewer wires are always preferred. Furthermore, if the data stays at the same voltage level for an extended period, synchronization drift can easily occur.
Clock Recovery
In practice, we infer the original clock frequency directly from the incoming signal, and the receiver generates a corresponding periodic waveform to decode it. This process is known as Clock Recovery.
Clock Recovery generally involves a few steps:
- Detecting transitions, typically accomplished using a delay circuit
- Identifying the period via FFT (Fast Fourier Transform)
- Synchronizing the signal using Phase-Locked Loops (PLLs)
For the detailed principles behind clock recovery, you can refer to Wikipedia. In essence, its primary purpose is to adjust the phase or frequency via feedback whenever the reference signal shifts, keeping the two in sync.
However, this introduces another issue: what if the data remains at a constant high or low voltage level for a long time? Wouldn’t it become impossible to determine the clock frequency? To solve this, other encoding schemes were introduced.
Manchester Encoding
If we don’t want the data stream to stay at a constant low or high level, why not make the voltage transition constantly? Manchester encoding uses a clever approach to distinguish between 0 and 1.
Manchester encoding represents 0 and 1 through transitions between voltage levels:
0: Transition from low to high voltage1: Transition from high to low voltage
This way, even if the raw data consists of consecutive zeros or ones, it doesn’t matter because the voltage transitions continuously, allowing for reliable clock recovery. IEEE 802.3 also adopts this encoding scheme. However, its most fatal drawback is that it requires twice the transmission bandwidth of NRZ: detecting a voltage transition within a single bit period practically demands double the bandwidth.
4B/5B
Related Posts
- When a Measure Becomes a Target: From the Window Tax to Pull Request Counts I once wrote a script to tally how many PRs I contributed in a quarter, how many reviews I left, and how many tickets I closed, hoping to use numbers to prove my output to my manager. My manager simply remarked that performance isn't just about output. Years later, I finally understood—when a measure becomes a target, it ceases to be a good measure. From the British window tax and the Hanoi rat bounty to evaluating developers by PR counts today, the underlying mechanism is exactly the same.
- Using Cloudflare Images for Image Storage and Transformation Putting an image on a webpage is the simplest task in frontend development. But doing it properly—including resizing, generating multiple formats, and withstanding heavy traffic—is actually an entire end-to-end solution. Eventually, I offloaded everything to Cloudflare Images, keeping only a single original image.
- Stop Using AWS Access Keys Access Keys are an easily overlooked security risk in AWS. By pairing OIDC with IAM Roles, GitHub Actions can securely operate AWS resources without storing any secrets.
- Database Primary Keys: AUTO_INCREMENT, UUID, and UUIDv7 Backend developers often face the choice of primary keys: should you use auto-increment or UUID? What about collisions? How does UUIDv7 compare to created_at + index in performance? Here are the design decisions and benchmark results from testing 20 million rows.