MDI/MDIX (medium-dependent interface/MDI crossover)

What is MDI/MDX (medium-dependent interface/MDI crossover)?

MDI/MDIX (medium-dependent interface/MDI crossover) is a type of Ethernet port connection that uses twisted-pair cabling to link two networked devices. MDI is part of the media attachment unit that provides the physical and electrical connection to the cabling medium when linking two endpoint devices.

MDIX is a version of MDI that enables connection between like devices. MDI ports connect to MDIX ports via straight-through twisted-pair cabling. Both MDI-to-MDI and MDIX-to-MDIX connections must use crossover twisted-pair cabling. The following image shows the difference between straight-through and crossover twisted-pair cabling.

Diagram of MDI and MDIX cabling
This image shows how straight-through and crossover twisted-pair cabling differ.

The left side of the image shows the pinouts of an eight-wire twisted-pair Ethernet cable using the standard straight-through configuration. To make it a crossover cable, note that the pinouts flip or cross so that MDI-to-MDI or MDIX-to-MDIX devices can communicate.

All copper cables are color-coded with solid colors and stripes like shown here. This ensures that the cable installer understands how to punch down or crimp the wires using the T568B wiring standard.

What types of Ethernet devices use MDI or MDIX?

MDIs are found in end devices, including PCs, laptops, servers, IP phones and Ethernet-capable switches.

MDIXs, on the other hand, are found mainly in network switching equipment, such as Ethernet switches and network hubs. However, not all network devices use MDIXs. For example, legacy routers and firewalls use MDIs.

MDI vs. MDIX: How do they differ?

MDI and MDIX perform the same tasks. The difference between the two resides in which pins of a twisted-pair copper cable the interfaces expect to use to transmit data and on which pins they expect to receive data. MDI ports transmit on pins 1 and 2 and receive on pins 3 and 6 of an RJ-45 terminated twisted-pair cabling. MDIX ports are the exact opposite. They transmit on pins 3 and 6, while they expect to receive data on pins 1 and 2. The image below displays how transmit (TX) and receive (RX) pins differ between the two interface types.

Charts indicate which pins transmit and receive data
This image shows how TX (transmit) and RX (receive) pins differ between the interface types.

Pins 1 and 2 of MDI are for transmitting data across the wire. On the other side, the same one or two pins are used to receive data on MDIXs. The opposite is true for pins 3 and 6, which MDIXs use for transmitting data; the same pins on MDI are used to receive the data.

What is auto-MDIX?

In the past, network administrators had to be keenly aware of which networking devices used MDI and which used MDIX. For example, an Ethernet uplink port connecting two switches required an Ethernet crossover cable. If a straight-through Ethernet cable was used by mistake, the link would not be established. This led to situations where admins had the wrong type of cable needed to interconnect devices. That wasted time and money because it meant having to keep both cable types on hand.

To solve this issue, networking vendors began outfitting many of their network devices -- including routers, switches, firewalls and hubs -- with Ethernet ports that could auto detect whether the device on the opposite side of the cable was attempting to link via MDI or MDIX. In turn, the interface automatically switches between MDI and MDIX operational mode using software. This enables admins to use either straight-through or crossover cables, and the connection successfully establishes a link and transmits and receives traffic as normal.

How do you choose the right MDI/MDX cabling?

For networking equipment that does not have auto-MDIX, choosing the right type of twisted-pair cabling is necessary to link between devices. But, once an organization understands the differences between the interface types and which devices or components use MDI or MDIX ports as described above, choosing between a straight-through and crossover cable becomes trivial.

The easiest way to think about this is that any two interfaces that are the same require a crossover cable for a link to be established. But, if the device types differ, a straight-through cable is used. The following matrix can help determine which cable should be used.

Chart for selecting cabling based on device type
This matrix can help network administrators determine which cable should be used.

A crossover cable is required when connecting like interfaces, such as MDI-to-MDI or MDIX-to-MDIX. However, if the two communicating interfaces are different, a straight-through cable is used.

Learn how to simplify the complexities of cabling systems using the six components of structured cabling.

This was last updated in December 2021

Continue Reading About MDI/MDIX (medium-dependent interface/MDI crossover)

Dig Deeper on Network infrastructure

Unified Communications
Mobile Computing
Data Center