· 3 min read

Lesser-Known Networking Theories (2)

This article was auto-translated from Chinese. Some nuances may be lost in translation.

In the previous post, we mentioned that while Manchester encoding effectively addresses data streams with long runs of consecutive 0s or 1s, it requires twice the bandwidth for the same amount of data—something we want to avoid in high-speed transmission.

Today, we will introduce 4B/5B encoding, which effectively prevents long runs of 0s and 1s in data streams without sacrificing too much bandwidth.

4B/5B

4B/5B takes raw data in 4-bit blocks and maps them into 5-bit blocks. This way, bit streams such as 0000 and 1111 are encoded so they do not consist entirely of 0s or 1s, preventing the issue of being unable to recover the clock signal.

4bit5bit
000011110
000101001
001010100
001110101
010001010
010101011
011001110
011101111
100010010
100110011
101010110
101110111
110011010
110111011
111011100
111111101

If we look at 0000 and 1111, we can see that after being converted to 5 bits, there is guaranteed to be at least one transition (from high to low voltage or vice versa). Although adding an extra bit requires 20% more bandwidth for the same throughput, it is still a massive improvement compared to Manchester encoding. 1000BASE-X uses 8B/10B encoding, which is conceptually identical to 4B/5B except that it encodes 8 bits at a time. In addition to 1000BASE-X, 8B/10B is also widely used across various high-speed transmission protocols, such as PCIe 1.0/2.0 and USB 3.0.

8B1Q4

For those of us living in 2023, wired network speeds routinely hit 1 Gbps, or even 10 Gbps when higher bandwidth is demanded.

Common Ethernet cables consist of insulated wire pairs twisted together. This twisting design effectively reduces noise. Nonetheless, at very high frequencies, signals are still susceptible to noise interference.

In transmissions such as 100BASE-TX and beyond, 8B1Q4 encoding (8 binary to 1 quinary across 4 pairs) is used. The core principle is sending multiple bits within a single clock cycle to increase data throughput. For instance, although CAT-6 operates at a transmission frequency of 125 MHz, its transmission rate reaches 1 Gbps.

Simply put, 8B1Q4 divides 8 bits + 1 check bit across four pairs. As shown in the image above, there are four wire pairs in total; after dividing the data, each pair represents its data using different voltage levels.

But how is the 9-bit data actually split into four groups? First, it uses 3 bits (the check bit + the first two data bits) to look up a corresponding transformation table. The remaining 6 bits are then encoded according to that table. What is particularly unique is that each wire pair uses 5 distinct voltage levels, rather than just binary high and low voltages. Through this approach, 2 bits can be transmitted per clock cycle across each pair, effectively doubling throughput within the same bandwidth.

This is precisely why CAT-6 achieves a transmission rate of 1 Gbps even though its transmission frequency is only 125 MHz.

Related Posts

Explore Other Topics