0
\$\begingroup\$

Most of these days, the Ethernet PHY/switch devices support Auto-MDIX and Autonegotiation. So, when a link partner is getting connected to a PHY or a Switch, which of these two phenomenons happens first? Auto-MDIX or Autonegotiation?

My thought is that for Autonegotiation to happen, (which bascially advertises the speed and duplex setting between the partners), the TX and RX connection between the link partners should be aligned and matched first. So, I believe Auto-MDIX happens first before Autonegotiation.

If the TX and RX between the PHY/Switch and the link partner is not aligned, the auto negotiation information will not be received by the link partner correctly. Because MDIX basically maps TX to RX and vice versa. So, if MDIX doesn't happen first, the auto negotiation info might not get conveyed correctly, right?

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

I guess if you want to really split hairs you could argue that MDI/MDIX detection happens first but really they happen at the same time as part of the same operation, and it's only the completion of autonegotiation that confirms that auto MDI/MDIX has been completed.

Unlike other interfaces such as serial, HDMI, USB and so on, Ethernet uses transformers to provide electrical isolation between two connected ports so there are no static voltages or resistances that can be used to tell that a port is connected. The only way is by seeing data starting to appear on the receive lines; this is why autonegotiation of speed/duplex mode is necessary for auto MDI/MDIX to work as it provides a burst of data that can be detected and confirm that the lines are the right way round.

An Auto MDIX port will randomly choose to start up in either MDI or MDIX mode and attempt to autonegotiate on the link in that state. If it hasn't succeeded after a random length of time it will swap into the other mode and try again, and it will keep swapping and retrying until it does succeed.

Note that the use of random times is important so that both ends don't keep swapping over at exactly the same time and never managing to coordinate. The whole process is normally completed within about half a second.

\$\endgroup\$
2
  • \$\begingroup\$ I like that answer. Do you have a source for further reading? \$\endgroup\$
    – kruemi
    Mar 18 at 13:32
  • 1
    \$\begingroup\$ @kruemi You'd probably need the formal specifications for more details. \$\endgroup\$
    – Finbarr
    Mar 18 at 14:07
1
\$\begingroup\$

They can be thought as two separate processes that happen simultaneously and individually.

For while searching for link partner, the MDI pairs need to be connected correctly before link partner can be found. And you cannot detect if MDI pairs are connected properly before a link partner is found.

And unless you are not aware, the autonegotiation happens by advertizing features sent as data using link detection pulses, so basically it's autonegotiation data that can be received over link pulses, when MDI can detect link pulses.

So detecting the link pulses allows to know when Auto-MDI has correctly determined the swapping and then autonegotiation data can be exchanged over link pulses, before selecting which speed to use.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.