Русские Блоги
Краткое описание Auto MDI / MDI-X и последовательность сетевых головок
[Есть 2 типа сетевых кабелей]
Стандарт сетевого кабеля подразделяется на метод подключения типа A (TIA / EIA-568-A) и метод подключения типа B (TIA / EIA-568-B).
Сетевой кабель с прямым подключением (наиболее распространенный сетевой кабель, также называемый положительной линией) представляет собой соединение типа A или соединение типа B на обоих концах сетевого кабеля;
Пересекающийся кабель (также называемый обратным кабелем) состоит из различных типов соединений на обоих концах кабеля.
[Как подключить студентов-инженеров]
Обычно, если необходимо подключить два устройства разных типов, требуется прямое подключение.
Например, коммутатор подключен к маршрутизатору, а коммутатор подключен к ПК;
Если два одинаковых устройства должны быть подключены друг к другу, необходимо использовать перекрестный кабель.
Например, коммутатор подключен к коммутатору, маршрутизатор подключен к маршрутизатору, ПК подключен к ПК, а маршрутизатор подключен к ПК.
[Оптимизировано для либеральных искусств мягкая девушка]
Но современная технология коммутации позволяет пользователям или сетевым администраторам не слишком заботиться о прямых и перекрестных кабелях.
Поскольку коммутатор имеет функцию автоматического переключения портов (адаптивную последовательность строк), то есть функцию Auto MDI / MDIX.
[Что такое МДИ]
MDI — это медиа-зависимый интерфейс, определенный Fast Ethernet 100BASE-T.
Автоматическое переключение портов (Auto MDI / MDIX) позволяет сетевому оборудованию автоматически распознавать кроссовер или прямое соединение,
и он может перейти к последовательности строк, чтобы игнорировать последовательность физических строк и передавать сигналы между различными устройствами.
[Большинство устройств поддерживают MDI]
В настоящее время большинство коммутаторов Cisco и Huawei поддерживают функции Auto MDI / MDIX и включены по умолчанию.
Но большинство маршрутизаторов не поддерживают эту функцию. Причина в том, что маршрутизаторы обычно подключаются к коммутаторам, а коммутаторы имеют эту функцию.
Маршрутизатор не нужен.
Поэтому, если маршрутизатор подключен к маршрутизатору, все равно необходимо использовать перекрестный кабель для подключения.
[Последовательность сетевого кабеля]
а. Порядок пересечения линий (слева направо):
Последовательность строк A: зеленый и белый, зеленый, оранжевый и белый, синий, синий и белый, оранжевый, коричневый и белый, коричневый
Другой конец последовательности строк B: оранжевый белый, оранжевый, зеленый и белый, синий, синий и белый, зеленый, коричневый и белый, коричневый
б) прямое соединение (слева направо):
Два конца одинаковы, оба являются последовательностью строк A;
или оба являются последовательностью строк B
[Изображение стандарта IEEE 802.3]: первый использует перекрестный кабель, второй использует прямой кабель
Basic Switch Configuration
Until recently, certain cable types (straight-through or crossover) were required when connecting devices. Switch-to-switch or switch-to-router connections required using different Ethernet cables. Using the automatic medium-dependent interface crossover (auto-MDIX) feature on an interface eliminates this problem. When auto-MDIX is enabled, the interface automatically detects the required cable connection type (straight-through or crossover) and configures the connection appropriately. When connecting to switches without the auto-MDIX feature, straight-through cables must be used to connect to devices such as servers, workstations, or routers and crossover cables must be used to connect to other switches or repeaters.
With auto-MDIX enabled, either type of cable can be used to connect to other devices, and the interface automatically adjusts to communicate successfully. On newer Cisco routers and switches, the mdix auto interface configuration mode command enables the feature. When using auto-MDIX on an interface, the interface speed and duplex must be set to auto so that the feature operates correctly.
The commands to enable auto-MDIX are shown in Figure 1.
Note: The auto-MDIX feature is enabled by default on Catalyst 2960 and Catalyst 3560 switches, but is not available on the older Catalyst 2950 and Catalyst 3550 switches.
To examine the auto-MDIX setting for a specific interface, use the show controllers ethernet-controller command with the phy keyword. To limit the output to lines referencing auto-MDIX, use the include Auto-MDIX filter. As shown in Figure 2, the output indicates On or Off for the feature.
Use the Syntax Checker in Figure 3 to configure the FastEthernet 0/1 interface on S2 for auto-MDIX.
CCIE Pursuit Blog
This thread in GroupStudy about using Auto-MDIX to enable the use of straight-through cables between switches reminded me of a real world issue involving the same technology. At my previous job, there was a “senior” engineer who supported a large site. She was having an issue with hard-setting the speed and duplex of an uplink port (I think it was a “stack” of 2950s) on a Cisco switch. While most of our uplinks were fiber, this one was copper (it was a small office that just needed to connect to the MDF on the floor directly above it). Our standard was to use a cross-over cable for any switch-to-switch connections and to hard-set the speed and duplex on both sides of the connection. She was having a problem with setting the speed and duplex. If she hard-set these settings on both sides of the link, then the link would go down. If she let one side of the link auto-negotiate, the link would come up, but the connection would not meet our standards. I eventually got dragged into this issue.
Looking at the switch settings, I noticed something odd: auto-MDIX was enabled (globally) on both switches. Our standard was to disable this on every switch. This gave us a little protection from users making unauthorized switch-to-switch connections (accidentally or on purpose) as cross-over cables were not generally available to end users (most wouldn’t know what a cross-over cable was). I asked the engineer if she was using a cross-over cable on the uplink.
Her response: “That’s not the problem. You can use a straight-through cable.”
“Sure you CAN, but our standard is to use crossover cables because….blah, blah, blah.”
Long story shorter: she refused to adhere to our standards and use a cross-over cable and I refused to waste my time on the issue. I wasn’t sure that the cabling was the issue, but if disabling auto-MDIX and using the proper cabling did not fix the issue then we could at least take those elements out of the equation.
She muddled on for a couple more days (she couldn’t be bothered to open a TAC case) and the problem remained. Finally our top-level LAN guy looked into the issue. He found the answer after a few minutes on Cisco’s web site (this is specific to the 3560):
Configuring Auto-MDIX on an Interface
When automatic medium-dependent interface crossover (auto-MDIX) is enabled on an interface, the interface automatically detects the required cable connection type (straight through or crossover) and configures the connection appropriately. When connecting switches without the auto-MDIX feature, you must use straight-through cables to connect to devices such as servers, workstations, or routers and crossover cables to connect to other switches or repeaters. With auto-MDIX enabled, you can use either type of cable to connect to other devices, and the interface automatically corrects for any incorrect cabling. For more information about cabling requirements, see the hardware installation guide.Auto-MDIX is enabled by default. When you enable auto-MDIX, you must also set the interface speed and duplex to auto so that the feature operates correctly. Auto-MDIX is supported on all 10/100 and 10/100/1000-Mbps interfaces and on 10/100/1000BASE-TX small form-factor pluggable (SFP)-module interfaces. It is not supported on 1000BASE-SX or -LX SFP module interfaces.
So you can use a straight through cable to connect two switches, but you then cannot explicitly set the speed and duplex. The engineer was told that the solution to her problem was to disable auto-MDIX and use a cross-over cable. Where had I heard that before?
To be fair, I wasn’t aware of the auto-MDIX needing auto-negotiation issue, BUT whenever you are troubleshooting a problem you want to minimize any deviations from known working configurations to eliminate unnecessary variables. I think that I remember reading that auto-MDIX uses the same protocol as auto-negotiation and that’s why both need to be enabled. I’m not positive about that though.
This table is pretty interesting. I assume that “correct cabling” means a cross-over cable and “incorrect cabling” means a straight-through cable.
| Local Side Auto-MDIX | Remote Side Auto-MDIX | With Correct Cabling | With Incorrect Cabling |
| On | On | Link up | Link up |
| On | Off | Link up | Link up |
| Off | On | Link up | Link up |
| Off | Off | Link up | Link down |
You can refer to the table below, but it’s pretty easy to determine if a link will be up or not: at least one side needs to have auto-MDIX enabled along with auto-negotiation of speed and duplex, otherwise the link will be down.
sw1
sw2
This makes sense because you need at least one side to be able to logically switch the pinouts of a straight-through cable to emulate a cross-over cable. Hard-setting the speed or duplex disables the auto-negotiation protocol (which auto-MDIX must utilize as well) which effectively disables auto-MDIX:
Note: The only command that I know of that will show the auto-MDIX state of an interface (other than looking at the running-configuration of the interface) is the rather verbose “show controllers ethernet-controller fax/x phy | include MDIX” command.
Note: The default setting for switch ports is to have auto-MDIX enabled. This is a pretty recent change though. IOS versions prior to 12.2(20)SE will use the default of “no mdix auto”.
“mdix auto” is the default, so it does not show in the running-configuration:
sw2(config)#do sh run int fa0/32
Building configuration…
Current configuration : 34 bytes
!
interface FastEthernet0/32
endWe can verify that auto-MDIX is on for this interface:
sw2(config)#do sh controll eth fa0/32 phy | i MD
Auto-MDIX : On [AdminState=1 Flags=0x00052248]Let’s hard-set the speed and see what happens to auto-MDIX:
sw2(config)#int fa0/32
sw2(config-if)#speed 100
sw2(config-if)#do sh control eth fa0/32 phy | i MD
Auto-MDIX : Off [AdminState=1 Flags=0x00010A48]Notice that our configuration does not state that auto-MDIX has been disabled:
sw2(config-if)#do sh run int fa0/32
Building configuration…Current configuration : 45 bytes
!
interface FastEthernet0/32
speed 100
end
This verifies that hard-setting the speed and/or duplex turns off auto-MDIX for the interface.
Note: I did test to see if DTP was effected by auto-MDIX. It was not. As long as the link was up, DTP could work it’s trunking magic.
So the long and the short of it is: you can use straight-through cables to connect two Cisco switches as long as you are willing to sacrifice the ability to hard-set the speed and/or duplex on both sides of the link.
Auto MDI-X
Medium Dependent Interface (с англ. — «интерфейс, зависящий от передающей среды») или MDI — порт Ethernet абонентского устройства (например, сетевых карт ПК). Позволяет таким устройствам, как сетевые концентраторы или коммутаторы подключаться к другим концентраторам без использования кроссоверного кабеля или нуль-модема, которые выполняют перекрестное соединение сигналов приема и передачи. MDI немного отличается подключением контактов от своей вариации MDIX. Контакты 1 и 2 используются для передачи (Tx) информации (сигналов), 3 и 6 — для приема (Rx).
Содержание
MDIX (MDI-X, Medium Dependent Interface with Crossover , с англ. — «Интерфейс, зависящий от передающей среды с перекрестным соединением») — Ethernet-интерфейс RJ45, используемый в свитчах и хабах. Его главное отличие от MDI, использующегося для оконечных устройств, цоколевкой выводов на RJ45. Контакты 1 и 2 используются для приема (Rx) информации (сигналов), 3 и 6 — для передачи (Tx).
Для соединения MDI-MDIX применяют прямой патч-корд витой пары, а для соединений MDI-MDI и MDIX-MDIX — перекрестный, так называемый кросс-кабель Ethernet.
Auto MDI-X [ | ]
Поддержка Auto MDI-X означает, что интерфейс сам определяет, какие пары в кабеле работают на прием, а какие на передачу и может работать с любым кабелем, обычным или кроссоверным [1] . Достаточно, чтобы Auto MDI-X поддерживал только один интерфейс из двух. Поддержка Auto MDI-X является частью стандарта 1000Base-T (Gigabit-Ethernet) и выше, кроме того, поддерживается многими 100-Мбитными коммутаторами и маршрутизаторами, может поддерживаться и сетевыми картами на 100 Мбит/с.
Примеры [ | ]
Чтобы соединить один концентратор с MDI-портом с MDIX-портом компьютера или другого концентратора, используется обычный кабель. Однако, чтобы соединить MDI-порт с MDI-портом другого устройства, нужен кроссоверный кабель (так же, как и для соединения двух MDIX-портов).
Некоторые производители сетевого оборудования (Planet, Danpex, Level One, Zelax и др.) используют обозначение MPR и DTE, что соответствует MDI и MDI-X. [2] [3]