Medium Dependent Interface
A Medium Dependent Interface (MDI) describes the interface (both physical and electrical) in a computer network from a physical layer implementation to the physical medium used to carry the transmission. Ethernet over twisted pair also defines a medium dependent interface crossover (MDIX) interface. Auto-MDIX ports on newer network interfaces detect if the connection would require a crossover, and automatically chooses the MDI or MDIX configuration to properly match the other end of the link.
The popular Ethernet family defines common medium dependent interfaces. For 10BASE5 connection to the coaxial cable was made with either a vampire tap or a pair of N connectors. For 10BASE2 the connection to the coaxial cable was typically made with a single BNC connector to which a T-piece was attached. For twisted pair cabling 8P8C modular connectors are used (often called "RJ45" in this context). For fiber a variety of connectors are used depending on manufacturer and physical space availability.
With 10BASE-T and 100BASE-TX separate twisted pairs are used for the two directions of communication. Since twisted pair cables are conventionally wired pin to pin there are two different pinouts used for the medium dependent interface. These are referred to as MDI and MDI-X (medium dependent interface crossover). When connecting a MDI port to an MDI-X port a straight through cable is used while to connect two MDI ports or two MDI-X ports a crossover cable must be used. Conventionally MDI is used on end devices while MDI-X is used on hubs and switches. Some network hubs or switches have an MDI port (often switchable) in order to connect to other hubs or switches without a crossover cable.
MDI vs. MDIX 
The X refers to the fact that transmit wires on an MDI device must be connected to receive wires on an MDIX device. Straight through cables connect pins 1 and 2 (transmit) on an MDI device to pins 1 and 2 (receive) on an MDIX device. Similarly pins 3 and 6 are receive on an MDI device and transmit on an MDIX device. The general convention was for network hubs and switches to use the MDIX configuration, while all other nodes such as personal computers, workstations, servers and routers used an MDI interface. Some routers and other devices had an uplink/normal switch to go back and forth between MDI and MDIX on a specific port.
To connect two ports of the same configuration (MDI to MDI or MDIX to MDIX), an ethernet crossover cable is needed to cross over the transmit and receive signals in the cable, so that they are matched at the connector level. The confusion of needing two different kinds of cables for anything but hierarchical star network topologies prompted a more automatic solution.
Auto-MDIX 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. As long as it is enabled on either end of a link, either type of cable can be used. For auto-MDIX to operate correctly, the data rate on the interface and duplex setting must be set to "auto". Auto-MDIX was developed by Hewlett-Packard engineers Daniel Joseph Dove and Bruce W. Melvin. A pseudo-random number generator decides whether or not a network port will attach its transmitter, or its receiver to each of the twisted pairs used to auto-negotiate the link.
When two auto-MDIX ports are connected together, which is normal for modern products, the algorithm resolution time is typically < 500 ms. However, a ~1.4 second asynchronous timer is used to resolve the extremely rare case (with a probability of less than 1 in 1021) of a loop where each end keeps switching.
Subsequently, Dove promoted auto-MDIX within the 1000BASE-T standard and also developed patented algorithms for "forced mode auto-MDIX" which allow a link to be automatically established even if the port does not auto-negotiate. This may or may not be implemented on a given device, so occasionally a crossover cable may still be necessary when connecting auto-MDIX to MDIX (hub or switch), especially when autonegotiation is deactivated. Newer routers, hubs and switches (including some 10/100, and all 1 Gigabit or 10 Gigabit devices in practice) use auto-MDIX to automatically switch to the proper configuration once a cable is connected. The other four wires are used but are not crossed since auto-MDIX is mandatory at the higher data rates (1000BASE-T transmits and receives on all pairs simultaneously without any dedicated send/transmit pairs).
See also 
- Netgear Model EN104tp EN106tp EN108tp Ethernet Hub Installation Guide. Bay Networks. August 3, 1998. p. 5. Retrieved June 18, 2011.
- "HP Auto-MDIX technology". Hewlett-Packard web site. Retrieved June 17, 2011.
- Daniel J. Dove and Bruce W. Melvin. "Apparatus for automatically configuring network media connections". US Patent 6,175,865 filed November 12, 1989 and issued January 16, 2001.
- Daniel J. Dove and Bruce W. Melvin. "Apparatus for automatically configuring media connectors of a node interface". US Patent 6,460,078 filed October 18, 2000 and issued October 1, 2002.
- Daniel Dove (February 1998). 802.3 "1000BASE-T Automatic Crossover Algorithm". Presentation to IEEE 802.3ab working group. Retrieved June 17, 2011.
- Daniel Joseph Dove. "Apparatus & method for automatically switching media connections when operating in forced speed and duplex mode". US Patent 7,366,771 filed March 12, 2002 and issued April 29, 2008.
- HP ProCurve 2910al Installation and Getting Started Guide, March 2010, Pub No. 5992-3084
- MDI/MDIX Auto Cross
- "Apple products that require an Ethernet crossover cable". Apple support web site. October 22, 2008. Retrieved June 17, 2011.
- Diagram of non-automatic connections between MDI and MDIX devices