For years, connecting two "same-type" devices — PC to PC, or switch to switch — meant reaching for a special crossover cable. Modern Ethernet quietly retired that ritual with Automatic MDI/MDI-X: the port itself decides which pins transmit and which receive. This guide explains MDI vs MDI-X at the RJ45 jack (female 8P8C socket / 母座) level, why Gigabit made crossover cables obsolete, and the one part of the job the jack does and does not do.
Short answer: MDI is the pinout of an end device (PC/router) — it transmits on pins 1&2 and receives on 3&6. MDI-X is the switch pinout, which swaps those internally (receive on 1&2, transmit on 3&6) so a plain straight-through cable links the two. Auto-MDI/MDI-X lets a port detect its partner and flip automatically. It is mandatory in 1000BASE-T (IEEE 802.3 Clause 40) and standard on 2.5G/5G/10GBASE-T, so with any Gigabit-or-faster gear you no longer need a crossover cable. The RJ45 jack does not perform the crossover — it routes all four pairs to the PHY, and the PHY does the swapping.
The 8-position/8-contact (8P8C) modular jack is defined mechanically by IEC 60603-7, and the pair-to-pin mapping by ANSI/TIA-568 (T568A/T568B). On top of that pinout, IEEE 802.3 defines two roles for a port: MDI (Medium Dependent Interface) for end stations, and MDI-X (MDI Crossover) for switches and hubs. The only difference is which pair carries transmit and which carries receive.
| Pin | Pair (T568B) | MDI — end device (PC/router) | MDI-X — switch/hub |
|---|---|---|---|
| 1 | 2 | TX+ (transmit) | RX+ (receive) |
| 2 | 2 | TX− | RX− |
| 3 | 3 | RX+ (receive) | TX+ (transmit) |
| 4 | 1 | — (spare) | — (spare) |
| 5 | 1 | — (spare) | — (spare) |
| 6 | 3 | RX− | TX− |
| 7 | 4 | — (spare) | — (spare) |
| 8 | 4 | — (spare) | — (spare) |
Read the two right-hand columns and the historical problem is obvious: connect an MDI device to an MDI-X switch and transmit lands on the partner's receive — it just works with a straight cable. But connect MDI to MDI (two PCs) or MDI-X to MDI-X (two switch ports) and both sides transmit on the same pins. That is what the old crossover cable fixed: it physically swapped pair 2 (pins 1-2) with pair 3 (pins 3-6) inside the cable so transmit met receive again.
Automatic MDI/MDI-X moves that swap off the cable and into the port. When a link comes up, each PHY can configure its RJ45 interface as either MDI or MDI-X. To keep two auto-capable ports from both flipping at once (which would re-create the mismatch), the standard uses a pseudo-random algorithm: each end seeds a random value and toggles its MDI/MDI-X state across link attempts until the pair resolves to exactly one MDI end and one MDI-X end. The whole negotiation finishes in well under a second, before the link LED settles.
Crucially, this is resolved during Auto-Negotiation (IEEE 802.3 Clause 28). For 10BASE-T and 100BASE-TX, auto-MDI-X is an optional vendor feature. For 1000BASE-T it is mandatory (Clause 40), and it carries forward into 2.5GBASE-T, 5GBASE-T (IEEE 802.3bz) and 10GBASE-T (Clause 55). Gigabit and faster also use all four pairs bidirectionally, so their auto-crossover additionally corrects pair swaps and polarity — which is why essentially any cable, straight or crossover, brings up a modern link.
| Standard | Speed | Pairs used | Auto-MDI/MDI-X | Crossover cable needed? |
|---|---|---|---|---|
| 10BASE-T | 10 Mb/s | 2 (pins 1-2, 3-6) | Optional (vendor) | Only if neither port supports auto-MDI-X |
| 100BASE-TX | 100 Mb/s | 2 (pins 1-2, 3-6) | Optional (vendor) | Only if neither port supports auto-MDI-X |
| 1000BASE-T | 1 Gb/s | 4 (all pins) | Mandatory (Cl. 40) | Never — any cable links |
| 2.5G/5GBASE-T | 2.5 / 5 Gb/s | 4 (all pins) | Yes (802.3bz) | Never |
| 10GBASE-T | 10 Gb/s | 4 (all pins) | Yes (Cl. 55) | Never |
Auto-MDI/MDI-X lives in the PHY, not the connector. The RJ45 jack is a passive socket: it lands the eight contacts onto four pairs and passes them — through the isolation transformer and common-mode choke — to the PHY, which decides MDI vs MDI-X. So the jack cannot "do" crossover, but a poorly chosen jack can prevent it from working. Two rules for board and panel designers:
1. Route all four pairs. Gigabit auto-crossover needs every pair present. A socket wired for only two pairs (a 10/100-only design) blocks not just Gigabit but the pair-swap correction that comes with it. Choose a true 8-contact jack that carries pairs 1-2, 3-6, 4-5 and 7-8 to the PHY.
2. Keep the pin-to-pair mapping standard. Auto-MDI/MDI-X reconciles the crossover between two link partners; it does not rescue a mis-terminated jack, a split pair, or contacts landed on the wrong PHY lanes on your own PCB. Terminate to T568A or T568B consistently and let the PHY handle the rest.
For an integrated-magnetics RJ45 socket (magjack), the transformer and choke sit inside the housing but are transparent to MDI/MDI-X — the crossover still happens in the PHY. VOOHU's SYT-series integrated RJ45 jacks route pairs 1-2/3-6/4-5/7-8 through built-in magnetics (350 µH OCL, 1CT:1CT, 2250 VDC isolation, insertion loss ≤1.0 dB) and are offered from 10/100M up to 10G Base-T, so one socket supports auto-crossover at every speed the PHY negotiates. Discrete jacks in VOOHU's RJ45 catalog cover the same pin arrangement in DIP (THT) and SMT mounts, tab-up or tab-down, single-port through 2×8 multiport, rated to 750 mating cycles and up to −40~+85 °C industrial temperature.
No. Automatic MDI/MDI-X is mandatory in 1000BASE-T (IEEE 802.3 Clause 40) and built into 2.5G/5G/10GBASE-T, so any Gigabit-or-faster port auto-detects and swaps its transmit and receive pairs. A plain straight-through cable links PC-to-PC, switch-to-switch or PC-to-switch. Most modern 10/100 gear also supports auto-MDI-X; a crossover cable is only needed when connecting two legacy 10/100 devices where neither port implements it.
MDI (Medium Dependent Interface) is the pinout of an end device such as a PC or router: it transmits on pins 1 and 2 and receives on pins 3 and 6. MDI-X (MDI Crossover) is the switch/hub pinout, which swaps those roles internally so it receives on 1 and 2 and transmits on 3 and 6. Because the switch already crosses over, an ordinary straight-through cable connects an MDI device to an MDI-X port correctly.
No. The RJ45 jack is a passive 8P8C socket that lands all eight contacts onto the four pairs and passes them, through the isolation magnetics, to the Ethernet PHY. The auto-MDI/MDI-X decision is made in the PHY during auto-negotiation. The jack's job is to route every pair correctly to the PHY; if the socket only wires two pairs, or is mis-terminated, no amount of auto-crossover can fix it.
In most implementations, yes. The crossover state is resolved as part of auto-negotiation, so both link partners settle on one MDI end and one MDI-X end. Hard-forcing a fixed speed and duplex disables auto-negotiation on many PHYs and can disable auto-MDI-X with it — a common cause of a dead link that only comes up after swapping to a crossover cable. Leaving auto-negotiation on is the reliable choice.