Part 315 min read

The Cable You Plugged In Without Thinking

Eight wires, two pairs that work, two LEDs that tell you everything. The hidden engineering inside an Ethernet cable.

What you will learn

  • Understand why an Ethernet cable has eight wires when fewer would work
  • Reason about the cost of leaving spare capacity in any infrastructure
  • Distinguish hubs and switches by what each one knows
  • Connect physical-layer symptoms (link LEDs) to software-layer problems

The Cable You Plugged In Without Thinking

Pick up a standard Ethernet cable. The kind you find under every desk in every office. Look at the end of it.

The connector is called RJ45. Inside it are eight metal contacts, arranged in a row. Behind those contacts, inside the plastic sheath, the cable holds four twisted pairs of copper wire — eight individual wires in total.

You have probably plugged hundreds of these in. Now we are going to ask the questions you have never asked about it.

Why eight wires?

You don't actually need eight. For a baseline Ethernet connection, only four wires do real work. Two of them carry data — one for transmit (TX) and one for receive (RX). One handles signaling and negotiation between the two ends, so they can agree on speed and link quality. One acts as ground.

The other four are reserved. They exist because the engineers who designed this cable were thinking about the future. They wanted headroom for higher-speed standards, more lanes, and — eventually — Power over Ethernet.

This is a small thing to notice, and a big lesson. Good infrastructure decisions leave room you cannot yet justify. The four "wasted" wires in your office Ethernet cable have already paid for themselves twice over, because they let the world add gigabit Ethernet and PoE without ripping every cable out of every wall.

When you design an API, a data schema, or a config file, ask yourself: what are my four extra wires?

Why twisted?

Pairs are twisted because untwisted parallel wires pick up electromagnetic interference, and the more current you push, the worse it gets. Twisting the pair around itself cancels most of that interference, because the noise hits both wires roughly equally and gets subtracted out in the receiver. This is one of the cheapest and oldest tricks in electrical engineering, and it is the reason you can run a hundred meters of unshielded cable along the floor of a fluorescent-lit office and still get a clean signal.

If you have ever heard of STP and UTP cables — shielded twisted pair and unshielded twisted pair — the difference is exactly what it sounds like. STP wraps the twisted pairs in a metal shield for environments with heavy electrical noise (industrial sites, outdoor runs, near big motors). UTP is the cheaper, lighter cable used inside most offices. The choice between them is, as always, cost versus the environment you are running through.

You may also have heard the names Cat5, Cat5e, Cat6, Cat6a, Cat7. These are quality grades. Higher grades support higher frequencies, which translates into higher speed and longer reliable distance. The cable you use determines the ceiling of your link. A perfectly good Cat5 cable cannot carry 10 Gbps no matter how good the rest of your setup is.

What about the LEDs?

Look at the back of a switch or the side of a laptop's Ethernet port and you'll see two tiny LEDs near each jack — usually one green and one amber or orange. They are not decoration. One LED indicates link — a physical electrical connection has been established with the device at the other end. The other indicates activity — data is currently moving. The colors and blink patterns also encode the link speed on many devices.

The first thing a senior engineer does when "the internet doesn't work" is not run ping. It is look at the LEDs. No link light means there is nothing for software to do. The problem is below software. It is in the cable, the port, the connector, or the physical layer of the device.

The hub vs. the switch.

Now think about a room. The cable from your laptop has to end somewhere. In a modern office, it ends in a switch. A switch is a small box with many ports that forwards traffic between connected devices.

Older networks used a hub. A hub is simpler — when a packet comes in on any port, the hub copies it out to every other port. Everyone on the network hears every conversation. The bandwidth of the whole hub is effectively shared. If two computers want to talk to each other at 100 Mbps, every other computer has to wait or share.

A switch is smarter. It learns which device lives on which port, and when a packet comes in, it forwards the packet only to the port where the destination lives. The result: two pairs of computers can talk simultaneously at full speed without interfering with each other. The same eight-port box does dramatically more work, because it became aware.

This is one of the cleanest examples in all of computing of how adding intelligence at the right layer changes the economics of an entire system. We will see the same pattern again with NAT, with CDNs, and with GPUs. Remember it.

Two laptops, no switch.

Here is a question worth chewing on. Can you connect two laptops directly with an Ethernet cable, with no switch in the middle?

The honest answer is: yes, but not with a standard cable. A standard cable wires the same pin to the same pin at both ends. If both laptops try to transmit on the same wire, they shout over each other and nothing happens. You need a crossover cable, which flips the TX and RX pairs internally so that one laptop's transmit wire lands on the other laptop's receive wire. Switches handle this flip in their internal circuitry, which is why a standard cable Just Works when there is a switch in the middle.

Most modern Ethernet ports now support something called Auto-MDIX, which silently does the flip in software. But the underlying truth is still there: somebody has to make sure transmit on one end lines up with receive on the other. Either the cable does it, or one of the devices does.

If you are wondering why I am spending this much time on a cable: because most engineers I meet have never noticed any of this. They know the cable works. They do not know what makes it work, and they do not know what makes it fail. That gap is the entire point of this book.

Push On It

  1. Crack open the spec for the T568A and T568B wiring standards. Why two standards? Which pairs carry data in 100BASE-T? Which pairs become active when you upgrade to 1000BASE-T?
  2. Walk to the nearest network switch in your office and identify the link LEDs for at least three ports. What colors are they? What does each color mean on that specific model? Read the manual. Manuals are senior tools.
  3. Find a damaged or suspect cable and a cable tester. Test it. If you have never seen what a "broken pair" looks like on a tester, you have a hole in your hands-on knowledge.

Read the LEDs

Walk to the nearest network switch (in your office, your home, or a server room). Identify the link LEDs for at least three ports. Note the colors and what each color means on that specific model. Read the manual if you have to. Manuals are senior tools.

Flashcards (6)

How many wires are inside an RJ45 Ethernet cable, and how many actually carry data on a baseline link?

Why are the pairs inside an Ethernet cable twisted?

What's the difference between a hub and a switch?

+3 more flashcards

The Cable You Plugged In Without Thinking | Junior2Senior.dev | Junior2Senior.dev