Before you start
Objectives: learn which UTP cable to use when connecting different network devices.
Prerequisites: no prerequisites.
Key terms: ethernet, crossing, uplink, port, cable, crossover, router, connector, wire, switch, hub
Connect Two Computers
In the first example let’s look at two computers that need to communicate. They both have NICs installed, and on the picture we can see all 8 pins which are found in the RJ45 connector. If we use a Straight-through cable where the wires go straight across from one connector to another, the transmit would go to the transmit of another computer, which is wrong. As we know, a straight-through cable connects each wire to the same pin on each connector (pin 1 to pin 1, pin 2 to pin 2, etc.).
Image 223. Straigh-trough Cable
When we’re connecting two workstations together we need to use a Crossover cable, which simply twists, or crosses, the transmit to the receive and the receive to the transmit.
Image 223.2 – Crossover Cable
Connect to Hub or Switch
If we use a Hub or a Switch and we connect our two devices through the Hub or the Switch, the ports within the Hub/Switch automatically perform the crossing function. The transmit wires are being crossed automatically inside the Hub/Switch to the receive wires of the host. So in this case, we would use a Straight-through cable for both connections.
Image 223.3 – Connect to Hub or Switch
Most Hubs or Switches have an extra port or two that’s called an Uplink port. The difference between the Uplink port and the standard ports on a Hub or a Switch is that the Uplink port does not provide crossing over function. If we connect some device to the Uplink port instead of to the regular port, the crossover between will not be preformed. So in order to get the crossing to happen in this scenario we use a crossover cable when connecting a device to the Uplink port. The Uplink port is often used when we have another Hub or a Switch that we need to connect together in a chain. In that case, in order to get the crossover to happen we need to use a crossover cable when using the Uplink ports.
Image 223.4 – Using Uplink Port
Now let’s say we take the Switches or Hubs and connect them together trough one Uplink port to one regular port. In this situation we have an Uplink port which does not perform crossing, but we also have a regular port which will perform crossing. So in the case when going from an Uplink port to a regular port we use a Straight-through cable, because the crossing is performed within the Switch or the Hub.
Some Switches will have an X next to each regular port, to designate it as a crossover port. The Uplink port then wouldn’t have the X designation. Keep in mind that not all switches will have the X designation. Also, sometimes on the Uplink port there might be a button which toggles the port between a regular port or an Uplink port.
Connect to Router
Let’s say that we have a Router which also has an network interface card that connects to the network. The Router is much like the workstation, it doesn’t perform crossing within itself. If we connect our Router to the regular port on Switch or Hub, the crossing will be performed. In that case we use a Straight-through cable.
Image 223.5 – Connect Router to Switch
If we add a second Router and if we want to connect the two Routers together directly without a hub or switch in between, it’s the same situation we have with the two workstations. Crossing is not being performed so we need to have a Crossover cable.
Image 223.6 – Connect Router to Router
If we connect our Router to an Uplink port on a Hub or a Switch, the crossing will not be performed, so we need to use a crossover cable.
Connect Two Switches Using Regular Port
Let’s say that we have two Switches or Hubs that we want to connect together through the regular ports. In that case we have crossing performed on both devices. Because we have crossing performed in both places we end up with an even number of crossing. So, in that case we actually need to use a crossover cable, since we need to have an odd number of crossing happening between any two devices. When we have two devices that perform crossing we need to have a third cross within the cable to end up with an odd number of crossing.
How to Distinguish Cables
Crossover cables are usually red, but we can’t really rely on the color of the the cable itself. The only way to really tell the difference is to look at the connectors on the end of the cables and compare how the wires are ordered within the connectors. Start comparing the wires within the connector starting at pin 1.
Image 223.7 – RJ45 Crimped Wires
In our case, on the left connector we have a white with an orange wire, followed by an orange wire. On the right connector we can see the same thing. Actually, we can see that the order of wires on the left connector is the same as on the right connector. This means that this is a Straight-trough cable. If we had a cable with different positions of wires on its ends, then it means that we have a Crossover cable.
Many devices today have a feature called auto MDI or MDIX. This feature enables the Hub, or the Switch, to sense what kind of cable we have plugged into it and what devices are on other end. Then it automatically performs the crossing or not on particular port. If we work with newer devices we can typically always use Straight-trough cable and get away with it in most situations. When we’re connecting two devices together that are the same, but without a Hub or a Switch in between, we’ll need to use Crossover cable.
A Rollover cable has an RJ45 connector on one end and a Serial connector on the other end. The Rollover cable is used to connect a workstation to a Router or a switch through Console port. The Console port on the Router or the Switch has an RJ45 connector. We connect that port to the Serial port on the computer. Then we can run terminal emulation software on the workstation in order to access and manage the Router or the Switch. We do this to configure the routing configuration of the Router, and other settings.
A rollover cable might also have an RJ45 connector on both ends. If that is the case, we have to use use an adapter to convert from the RJ-45 connector to the serial cable. When terminated with an RJ45 connector on both ends, the wires within the connectors are rolled over to the opposite connector as follows:
- Pin 1 is connected to pin 8
- Pin 2 is connected to pin 7
- Pin 3 is connected to pin 6
- Pin 4 is connected to pin 5
When connecting Ethernet devices, it is important that the transmit (Tx) wires from one device are matched with the receive (Rx) wires on the other device. When we’re connecting the same kind of devices together like a workstation to a workstation, a Router to a Router, or a Hub/Switch to a Hub/Switch through it’s regular port, or through the uplink ports, we use a Crossover cable. This is because the crossover will not be performed automatically. In the case of a Hub/Switch to a Hub/Switch using the regular ports the crossover is performed twice so we need an extra crossover in the cable. When connecting two devices that are different we use a Straight-through cable. This is the case when connecting a workstation or a Router to a Hub or a Switch, or when connecting a Hub/Switch together with another Hub/Switch through the regular port on one side and the Uplink port on the other side. In many newer devices we since we can let the auto MDI or the MDIX feature take care of the crossing automatically.