Straight through vs. crossover cable?

I am studying for CCNA and the book I’m reading lists the cases where crossover and straight thru cables are used.

But why? The book doesn’t explain.

Before just about every Ethernet device supported auto-MDiX, you would use straight through cables to go from a Terminal device (PC network card, printer, etc)) to hub or switch, and a crossover cable if you had to connect direct from a terminal device to another terminal device.

The analogy I like to use is that the pipes need to go from the mouth of one device to the ear of the other. Devices that were expected to connect together ( say a PC and a switch) are designed so you could use simpler straight pipes. Two PCs needed a crossover so that the two mouths didnt connect to the same pipe. Now of course nearly everything automatically switches the wires as needed.

In general however the issue with crossovers remains. Whilst modern Ethernet NICs do it for you, older ones do not, and most other protocols don’t. Back in the day of serial lines it was horrid, as many manufacturers simply ignored the standards and created devices how they felt. In general you have transmit pins and receive pins. Ethernet over twisted pair has a pair of pins for transmit and a pair for receive (or for 10G, two pairs each.) Serial lines had one pin for each. Where it all came unstuck was whether a device was a data terminal (DTE), or a data communication (DCE). If you connect to end points together, clearly you need to connect transmit to receive, and thus cross them over. But you don’t swap them over if you connect to a device whose job it is to take the communication further (a DCE). The communication equipment did the swap over for you somewhere in the midst of its operation. If you used a phone line to connect two computers, you had a modem at each end of the phone line and connected a computer to each modem. The computers were DTEs, and the modems DCEs. With Ethernet, switches, hubs, and routers are like DCEs. So that connecting a computer to a switch over Ethernet did not require a crossover, and two computers could communicate via a switch, each connected with a straight through cable. But if you wanted to connect two computers directly with a cable, it would need to be wired as a crossover. In the days of serial lines, a crossover device was often called a “null modem” because it behaved like two modems at each end of a phone line - it crossed over the transmit and receive. (It became unstuck when some manufacturers decided that it would be so much easier if the computer looked like a DCE, so a straight bit of cable could connect to a terminal, and then some other manufacturers decided that their terminals should look like DCEs, so that a computer with a DTE connection would connect to them with a straight cable. In the need you never knew if you needed a crossover or not, or even which sex of connector might be needed. Mostly historical now thank goodness.)

One pair is transmit and one pair is receive on the 4-pair ethernet cable (for good old 10Mb and 100Mb ethernet - the other 2 pair were not used). The original spec was that hubs were MDI-x and PC’s were MDI. Thus transmit from hubs went to receive of PC’s and vice versa.

For CCNA, it got confusing because a router is a network device, but unlike a hub (nowadays a switch) it is an endpoint that also plugged into a switch, so it was configured as a PC-like MDI device.

So if you had a little closet where you just connected two routers together by ethernet ports? Or you wanted to plug a PC into a router or another PC for a very simple network? Then the Xmit from one had to go to the Rcv of the other annd vice versa - hence a cross-over cable.

Or, you needed to cascade two switches or hubs, for a longer network? same - cross-over needed. Many older switches and hubs had an “uplink” port where it was MDI so you could connect tihs outer-area switch to the master switch in the main closet. Others even had a pushbutton switch for port, say, 24 to make it MDI (uplink) or MDIx (Regular switch port) on demand.

For fiber feed this was irrelevant, because you could track Xmit fiber from switch A and plug it into Rcv switch B and vice versa.

All that is irrelevant today, because the vast majority of modern devices are auto-sensing, and will adjust to MDI or MDIx depending on what they sense from the other end.