Why do similar devices use a cross-over cable instead of a straight-through cable?
Definition of a cross over cable:
A cross over cable is typically used between devices with the same type of interface (ie computer to computer, router to router, etc). Ethernet cables are usually made as an A or B type interface (which matters simply how it is wired.
A crossover simply has A on one end and B on the other.
What is happening:
Basically what is happening is that the "send" and "receive" are switched so one of the devices "send" wires goes to the other device's "receive" wire, and visa versa with the other wire. (In reality the wires are in pairs, so there are two wires for send and two wires for receive.)
If you were to use a straight through (where the wires are all in line) then a "send" would be going to a "send" and a "receive" to a "receive" so the devices wouldn't be able to communicate.
Keep in mind that many modern devices use Auto MDI-X which is a way for a device to automatically switch the wiring method on its own. If either device on the two ends of the ethernet have Auto MDI-X, then it does not matter if you use a cross over OR straight ethernet cable. Auto MDI-X was introduced in Gigabit ethernet so if either of your devices use Gigabit, such as routers or computers, it has an extremely high chance of having Auto MDI-X already on it.
Ethernet defines interfaces MDI and MDI-X.
This terminology refers to variants of the Ethernet over twisted pair technology that use a female 8P8C port connection on a computer, or other network device.
Ethernet over twisted pair uses 2 wires (one pair) to transmit and other 2 wires (other pair) to receive.
MDI (ethernet card on a PC for example) uses wires
1 and 2 to transmit and
3 and 6 to receive. If this device connects to a switch, the switch needs to use MDI-X that is defined as:
1 and 2 to receive and
3 and 6 to transmit.
If I need to connect two MDI interfaces (one PC to another) then I need a crossover cable. This cable crosses the transmssion pair on one side with the receiving pair on the other side.
There is another standard called Auto MDI-X that automatically detects the required cable connection type and configures the connection appropriately, removing the need for crossover cables to interconnect switches or connecting PCs peer-to-peer.
Once you put crosses into a cable you build into the cable application-specific assumptions. This is undesirable in cases where the same cable can be used for multiple applications. By making the cables straight through the same cables could be used for ethernet, phone, ISDN etc without too much confusion (there was still the issue of which pairs of pins corresponded to a twisted pair in the cable but everyone seemed to settle on an agreement for that).
Unfortunately straight through cables pose a problem for communication standards that use seperate wires for each direction (like 10BASE-T and 100BASE-TX). If you connect two identical devices with a straight through cable then you end up with the transmitter connected to the transmitter and the receiver connected to the receiver. Not good.
The soloution used by 10BASE-T (and later carried forward to 100BASE-TX) was to have two types of ports. "MDI" ports were used on end devices, "MDI-X" ports were used on hubs. Since the pair assignment was swapped between the two port types PCs could be connected to hubs with a straight through cable. Many hubs had an "uplink" port which was wired as "MDI" so that you could connect your hubs together with straight cables too.
Switches followed the same convention as hubs, routers followed the same convention as end devices.
Sometimes you ended up needing to connect two MDI ports (i.e. computer to computer with no hub) or two MDI-X ports (i.e. connecting two hubs where neither hub has an available uplink port). So an external crossover was needed to connect transmiter to receiver. This was most commonly implemented as a special cable (though it could also be implemented as an adaptor).
Later Auto-MDIx came along, this allowed devices to automatically swap transmit and receive. If either of the devices on a link supports auto-mdix then you don't need a crossover cable. My experiance with 100 megabit equipment is that most switches supported auto-MDIx but most NICs did not.
At gigabit all four pairs are used in both directions and afaict basically all gigabit devices support auto-MDIx for figuring out pair arrangement (though IIRC it's not strictly mandated).
Crossover cables redirect the output of one RJ-45 port into the input of the other RJ-45 port.
If you connect the output of PC1 to the output of PC2 (With a straight cable), you won't get anywhere.
Nowadays, NICs are smart enough to automatically reverse the IO pins, so you can achieve the same effect with a straight cable as you would with a crossover cable as long as you are dealing with a recent NIC.
Straight-through cables get their name from how they are made. Out of the 8 pins that exist on both ends of an Ethernet cable, each pin connects to the same pin on the opposite side， for local area network (LAN) use for which the RJ-45 connectors at each end have the same pinout (i.e., arrangement of conductors).
Crossover cables are very similar to straight-through cables, except that they have pairs of wires that crisscross. This allows for two devices to communicate at the same time. Unlike straight-through cables, crossover cables are used to connect like devices without the use of an uplink port.