Ethernet LANs are most widely built using UTP cables. UTP cable is made of 8 copper wires, grouped together in four twisted pairs. Each pair has a color scheme in which one wire is solid colored and the other one is the same color but striped.
Typical Ethernet UTP cable has RJ-45 connectors on both ends. Each RJ-45 connector has eight pins into which the eight wires can be inserted into. Based on the scheme that is used to tell each wire goes into which pin, UTP cables are straight-through cable or cross-over cable.
Different cable types are required when you connect different devices because some devices transmit data on pins 1&2 and receive on pins 3,6 and others transmit on pins 3,6 and receive on pins 1,2. So in order to connect the transmit pair of pins on one device to the receiving pair of pins on the other you have to use the correct cable type.
UTP Cabling Pinouts
In order to understand the difference between the two main types of Ethernet cables: straight-through cable and crossover cable, we must first understand how different types of devices transmit electrical signals on their RJ45 ports. As an example, we will use some of those rules for the 10BASE-T and 100BASE-T Ethernet standards.
Let's first have a look at the first group of devices such as Computers, Routers, and Wireless Access Points. These devices use pins 1 and 2 to transmit data in the form of electrical signals and pair of pins at positions 3 and 6 to receive data.
Shown in Figure 1 is an example of an RJ-45 port that transmits on pins 1 and 2 and receives on pins 3 and 6, and the devices that use these rules for communicating over UTP copper cables.
The other group of devices such as Ethernet Hubs, Bridges and Switches use pins 3 and 6 to transmit data in the form of electrical signals and pair of pins at positions 1 and 2 to receive data. If you look closer you will see that this is exactly the opposite of the devices shown in Figure 1.
A straight-through cable, as the name implies, connects the wire at pin 1 on one end of the cable straight to pin 1 at the other end of the cable; the wire at pin 2 to pin 2 on the other end of the cable; pin 3 on one end connects to pin 3 on the other, and so on, as shown in Figure 3.
So let's look at what happens when we connect a device that transmits on pins 1,2 with a device that receives on pins 1,2. For example, a PC connected to a LAN switch using a straight-through UTP cable. As shown in Figure 4, everything works correctly because the devices on the right use the opposite pins to transmit and receive electrical signals.
But let's look at what will happen if we connect two like devices with a straight cable as shown in Figure 5. For example, a router connected to a router or computer's NIC card connected directly to a router. The figure shows what happens on a link between the devices. The two routers both transmit on the pair at pins 1 and 2, and they both receive on the pair at pins 3 and 6. So the signal being transmitted on both sides can't get to the respective receiving end and communication is not possible.
The solution to this problem is to cross-connect the cable wires in such a way, so the transmitting pins on one side to connect to the receiving pins on the other side and vice versa. If some of the wires are crossed, the cable is not "straight" anymore, that's why it is called a crossover cable.
So in summary, the logic in choosing the correct cable to connect Ethernet devices is:
- Crossover cable: If both devices transmit on the same pin pair
- Straight-through cable: If both devices transmit on different pin pairs
NOTE Nowadays, if you connect two Cisco devices together using whatever cable you like, the link will still work because there is a feature called auto-mdix that notices when the wrong cable is used and automatically changes its logic to make the link work. However, for the CCNA exam, you must be able to identify whether the correct cable used.
Example of using a wrong cable
Let's look at the following example of what happens if we use wrong cable type to connect two device and auto-mdix is disabled.
First let's look the case where crossover cable is used and auto-mdix is diabled on this interface, so the switch cannot automatically figure out the correct pins to use.
Switch#show interface Fa0/1
FastEthernet0/1 is down, line protocol is down (disabled)
Hardware is Lance, address is 0001.4274.6001 (bia 0001.4274.6001)
BW 100000 Kbit, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 100Mb/s
input flow-control is off, output flow-control is off
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:08, output 00:00:05, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue :0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
956 packets input, 193351 bytes, 0 no buffer
Received 956 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 watchdog, 0 multicast, 0 pause input
0 input packets with dribble condition detected
2357 packets output, 263570 bytes, 0 underruns
0 output errors, 0 collisions, 10 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
You can see that the physical status of the interface is down and the line protocol is down. Let's see what happens if we enable the auto-mdix.
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int fa0/1
Switch(config-if)#?
cdp Global CDP configuration subcommands
channel-group Etherchannel/port bundling configuration
channel-protocol Select the channel protocol (LACP, PAgP)
description Interface specific description
duplex Configure duplex operation.
exit Exit from interface configuration mode
ip Interface Internet Protocol config commands
lldp LLDP interface subcommands
mdix Set Media Dependent Interface with Crossover
mls mls interface commands
no Negate a command or set its defaults
shutdown Shutdown the selected interface
spanning-tree Spanning Tree Subsystem
speed Configure speed operation.
storm-control storm configuration
switchport Set switching mode characteristics
tx-ring-limit Configure PA level transmit ring limit
Switch(config-if)#mdix ?
auto Enable automatic MDI crossover detection on this interface
Switch(config-if)#mdix auto
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Switch(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
Now if we check the interface status, we can see that the interface is up/up and fully operational.
Switch#show interface Fa0/1
FastEthernet0/1 is up, line protocol is up (connected)
Hardware is Lance, address is 0001.4274.6001 (bia 0001.4274.6001)
BW 100000 Kbit, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 100Mb/s
input flow-control is off, output flow-control is off
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:08, output 00:00:05, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue :0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
956 packets input, 193351 bytes, 0 no buffer
Received 956 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 watchdog, 0 multicast, 0 pause input
0 input packets with dribble condition detected
2357 packets output, 263570 bytes, 0 underruns
0 output errors, 0 collisions, 10 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
Summary
- We use different ethernet cables based on the pinouts because different type of devices transmit and receive electrical signals on different pins of the RJ45 connector.
- There are two main types of copper cables based on the pinouts: straight-trough and crossover. The general rule of thumb is that you use straight-trough to connect different types of devices like PC to a switch and you use crossover to connect devices of the same type like to connect switch to a switch.
- Modern network devices automatically detect the cable and swaps their transmitting and receiving pins so the cable works. The protocol responsible for this is called auto-mdix.
- It is always a good pratice to use the correct cable but it is even more important for the CCNA exam that you correctly identify the type of cable needed to connect a particular set of network devices.