

メディア依存インターフェース(MDI )は、コンピュータネットワークにおけるインターフェース(物理的インターフェースと電気/光インターフェースの両方)を、物理層の実装から伝送に使用される物理媒体まで記述します。ツイストペアケーブルを使用したイーサネットでは、メディア依存インターフェースであるクロスオーバー (MDI-X)インターフェースも定義されています。最新のネットワークインターフェースに搭載されているAuto-MDI-Xポートは、接続にクロスオーバーが必要かどうかを検出し、リンクのもう一方の端に合わせてMDIまたはMDI-X構成を自動的に選択します。

広く普及しているイーサネットファミリーは、媒体に依存する共通のインターフェースを定義しています。10BASE5の場合、同軸ケーブルへの接続は、ヴァンパイアタップまたはNコネクタのペアで行われます。10BASE2の場合、同軸ケーブルへの接続は通常、Tピースが取り付けられた単一のBNCコネクタで行われます。ツイストペアケーブル8P8Cでは、モジュラーコネクタ(この文脈ではRJ45と呼ばれることが多い)が使用されます。光ファイバーの場合、メーカーや物理的なスペースの空き状況に応じて、さまざまなコネクタが使用されます。
10BASE-T および 100BASE-TX では、通信の双方向にそれぞれ別のツイストペアケーブルが使用されます。ツイストペアケーブルは従来、ピン同士が直接接続(ストレートスルー)されているため、媒体依存インターフェースには 2 種類のピン配置が使用されます。これらは MDI および MDI-X(媒体依存インターフェースクロスオーバー)と呼ばれます。MDI ポートを MDI-X ポートに接続する場合はストレートスルーケーブルを使用しますが、2 つの MDI ポートまたは 2 つの MDI-X ポートを接続する場合はクロスオーバーケーブルを使用する必要があります。従来、エンドデバイスとルータでは MDI が使用され、ハブとスイッチではMDI-X が使用されます。一部のハブとスイッチには、クロスオーバーケーブルを使用せずに他のハブまたはスイッチに接続するためのMDIアップリンクポート(多くの場合切り替え可能)があります。
この用語は一般的に、コンピュータやその他のネットワーク機器のメス型8P8Cポート接続を使用する、ツイストペアケーブルを使用したイーサネット技術の派生方式を指します。
X は、MDI デバイスの送信ワイヤを MDI-X デバイスの受信ワイヤに接続する必要があることを示しています。ストレートケーブルは、MDI デバイスのピン 1 と 2 (送信) を MDI-X デバイスのピン 1 と 2 (受信) に接続します。同様に、ピン 3 と 6 は、MDI デバイスの受信ピンであり、MDI-X デバイスの送信ピンです。一般的な慣例として、ネットワーク ハブ、ブリッジ、スイッチは MDI-X 構成を使用し、パーソナル コンピュータ、ワークステーション、サーバー、ルーターなどの他のすべてのノードは MDI インターフェイスを使用します。一部のルーターやその他のデバイスには、特定のポートで MDI と MDI-X を行き来するためのアップリンク/ノーマル スイッチがありました。[ 1 ]
一方の側の送信機をもう一方の側の受信機に接続し、その逆も同様に行う必要があるため、2 つのデバイス間には常に奇数個のクロスオーバーが必要になります。MDI-X ポートには内部クロスオーバーが含まれています。したがって、MDI と MDI-X を接続するにはストレート ケーブル (合計 1 つのクロスオーバー) が必要です。MDI と MDI (クロスオーバーなし) または MDI-X と MDI-X (クロスオーバー 2 つ) を接続する場合は、奇数にするためにケーブル内に (もう 1 つの) クロスオーバーが必要です。構造化配線で複数のパッチ パネルを介してより複雑な構成を使用する場合、接続には複数のパッチ ケーブルとビルディング ケーブル セグメントを使用できます。必要なクロスオーバーはすべて片側、つまり中央のハブ/スイッチまたは各セカンダリ ハブ/スイッチのいずれかに配置することをお勧めします。

同じ構成の2つのポート(MDI-MDI間、またはMDI-X-MDI-X間)を10または100 Mbit/sの接続(10BASE-Tまたは100BASE-TX)で接続するには、イーサネットクロスオーバーケーブルが必要です。このケーブルを使用して、各インターフェースが送信に使用するペア線を、もう一方のインターフェースの受信導体に接続します。階層型スターネットワークトポロジー以外では2種類のケーブルが必要になるという混乱が、より自動化されたソリューションの開発を促しました。
A twisted-pair Ethernet port with automatic MDI-X, or auto MDI-X or auto-crossover, automatically detects the required configuration, MDI or MDI-X, eliminating the need for crossover cables to interconnect switches or to connect network nodes peer-to-peer. As long as it is enabled on either end of a link, either type of cable can be used. For auto MDI-X to operate correctly, the data rate and duplex setting on the interface must be set to auto. Auto MDI-X was developed by Hewlett-Packard engineers Daniel Joseph Dove and Bruce W. Melvin.[2] A pseudo-random–number generator determines whether a network port will start in MDI or MDI-X configuration to begin auto-negotiating the link.[3][4]
When two auto–MDI-X 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 5×1021) of a loop in which each end keeps switching.[5]
Subsequently, Dove promoted auto MDI-X within the 1000BASE-T standard[5] and also developed patented algorithms for forced-mode auto MDI-X which allow a link to be automatically established even if the port does not auto-negotiate.[6] This may or may not be implemented on a given device, so occasionally a crossover cable may still be necessary when connecting an auto-MDI-X to an MDI-X (hub or switch) port, especially when autonegotiation is deactivated.[7]
Newer routers, hubs and switches (including some 10/100, and all 1-gigabit or 10-gigabit devices in practice) use auto MDI-X for 10/100 Mbit connections to automatically switch to the proper configuration once a cable is connected.
Gigabit and faster Ethernet links over twisted pair cable use all four cable pairs for simultaneous transmission in both directions. For this reason, there are no dedicated transmit and receive pairs, and consequently, crossover cables are never required for 1000BASE-T communication.[8] The physical medium attachment sublayer (PMA) provides identification of each pair and usually works over crossover cables as well, and even if the pairs are unusually swapped, or if the polarity of a pair is unexpectedly inverted.[9]