DEV Community

TAKUMI SUGATA
TAKUMI SUGATA

Posted on

I finally understood the types of LAN cables by focusing on how they actually work.

Introduction

While studying for CompTIA Network+, I couldn't memorize the types of LAN cables and their use cases. Every time I faced these questions in mock tests, I got them wrong because of the complexity. Understanding the structure behind them cleared things up, so I decided to write it down.


What is LAN cable

LAN cable is the cable that connects between computers and network devices physically. The official name is Ethernet cable.

The connectors attached to both ends of the cable are called RJ-45, and each consists of 8 thin wires (pins).


What is a pin

There are 8 thin copper cables inside LAN cable.
These wires, called pins, are each numbered from 1 to 8. Understanding that there are TX (send) and RX (receive) pins is the key to understanding why different cable types exist.

Cross section of RJ-45 connector (8 pins)

┌────────────────────────┐
│ 1  2  3  4  5  6  7  8 │
└────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

4 pins are used to send and receive data.

No 1 & 2 pin →  send data (TX)
No 3 & 6 pin →  receive data (RX)
Enter fullscreen mode Exit fullscreen mode

As a premise, there are TX and RX, which makes us easy to understand the type of LAN cable.


Why we need each type of cables

This is main part of this post.
In the data transfer, both sending and receiving sides are needed.

Device A - sending pin (TX)  → Device B - receiving pin (RX) 
Device B - sending pin (TX)  → Device A - receiving pin (RX)
Enter fullscreen mode Exit fullscreen mode

This TX → RX combination is what makes communication possible.


Cable type

■Straight-Through

This is the cable that pin at both ends are set at the same order.
This cable is used to connect between different devices.

One end          the other end 
No 1 pin  ─────→ No 1 pin
No 2 pin  ─────→ No 2 pin
No 3 pin  ─────→ No 3 pin
…
Enter fullscreen mode Exit fullscreen mode

Why this is used to connect different devices

This is an example of different devices (PC and Switch) ;

PC is designed to send data at No 1 and 2 pins
Switch is designed to receive data at No 1 and 2 pins 
Enter fullscreen mode Exit fullscreen mode

PC and Switch are initially designed to transfer data at reverse pins.
Because of this design difference, using a Straight-Through cable naturally results in a proper TX → RX connection between different devices.

So, it is just to use Straight-Through for sending and receiving data at different devices due to each structure.

PC : TX (No 1 and 2) ──→ Switch : RX (No 1 and 2)
Switch : TX (No 3 and 6) ──→ PC : RX ( No 3 and 6)
Enter fullscreen mode Exit fullscreen mode

Use case

This type of cable is used to connect to different types of devices.

PC → Switch
PC → HUB
Router → Switch
Enter fullscreen mode Exit fullscreen mode

■Crossover

This is the cable that pin at both ends are set at crossed order.
This cable is used to connect between the same type of devices.

One end          the other end 
No 1 pin  ─────→ No 3 pin
No 2 pin  ─────→ No 6 pin
No 3 pin  ─────→ No 1 pin
No 6 pin  ─────→ No 2 pin
…
Enter fullscreen mode Exit fullscreen mode

Why this is used to connect the same type of devices

This is an example of the same type of devices (PCs) ;

Both PC-A and PC-B are the same design to send data at No 1 and 2 pins.
Enter fullscreen mode Exit fullscreen mode

If we use Straight-Through cable;

PC-A : TX (No 1 and 2) ──→ PC-B : TX (No 1 and 2)
 → Both devices end up connected on the sending side, so neither can receive data. 
 → No connection
Enter fullscreen mode Exit fullscreen mode

Therefore, the cable designed crossed pins is needed in this situation.

PC-A : TX (No 1 and 2) ──→ PC-B : RX (No 3 and 6)
PC-B : TX (No 3 and 6) ──→ PC-A : RX (No 1 and 2)
Enter fullscreen mode Exit fullscreen mode

This is the role of crossover cable.


Use case

This type of cable is used to connect to the same type of devices.

PC → PC
Switch → Switch
Router → Router
Enter fullscreen mode Exit fullscreen mode

■Rollover

This is the cable that pins are reversed totally.
This is also called Console cable.

One end          the other end 
No 1 pin  ─────→ No 8 pin
No 2 pin  ─────→ No 7 pin
No 3 pin  ─────→ No 6 pin
…
Enter fullscreen mode Exit fullscreen mode

This is not for data transfer but for managing or configuring devices.


Use case

PC → Router's console port
PC → Switch's console port
Enter fullscreen mode Exit fullscreen mode

What is console port

First of all, we need to understand what console port is.
This is the physical connecting port attached at Router or Switches.

Router's main body
┌───────────────────────┐
│ [LAN] [WAN] [Console] │
└───────────────────────┘
                ↑
This is the console port, which is used to connect by Rollover cable
Enter fullscreen mode Exit fullscreen mode

Why the connection used by console port is needed

Normal networking connection( via LAN)
 → no connection without IP address settings

Console connection
 → connection without IP address settings 
 → use for initial settings or recovery for mechanical issues
Enter fullscreen mode Exit fullscreen mode

Whether you are setting up a device for the first time or have misconfigured it and lost network access, the console port allows you to access the device directly.


Summary

Cable Pin's array Use case Key words
Straight-Through Same order Different devices Different = Straight
Crossover Crossed order Same devices Same = Cross
Rollover Reversed order Console access Only for setting

Additional Tips

Most modern NICs (Network Interface Cards) and switches come with Auto-MDI/MDIX built in. This feature allows devices to connect even if the wrong cable type is used.

Therefore, these function makes us possible to connect with incorrect cables.
However, in the exam of CompTIA Network +, we have to understand each type of cables and those use cases.


Conclusion

I used to struggle with these questions when I tried to rely on memorization alone.
Once I grasped how TX and RX pins work, everything fell into place.

Top comments (0)