delayethernetlossniccarrier

Gigabit Ethernet takes ~370ms to report link down in MII register


To give you some context, I am trying to configure some network redundancy on Ubuntu 20.04. I decided to use NIC bonding with:

It works as expected, when the active slave fails (wire unplugged) the bonding switches to the other slave. However this transition is too slow in my opinion as it takes up to 400ms.

In order to investigate I had a look at the MII register using this command: mii-tool -vv ens33 (-vv is to print raw MII registers content). It generates this kind of output:

enter image description here

Doing a basic bash script I print current time + value of the 2nd MII register which contains the link state. As this is a "while true" loop with no pause, I get a status every 20ms, so it allows me monitoring with enough reactivity.

Observed behavior:

  1. when the interfaces are configured with a 100Mbit/s speed, Full Duplex => the MII register is almost immediately updated (no "visible" delay between the wire unplugging and the update of the register value on the screen).

  2. however when configured at 1Gbit/s, Full Duplex (via auto-negotiation) => the update of MII register takes much more time (it is "visible" with the bash script). By sending pings every 10ms using the bond interface, and logging packets with Wireshark on receiver side, the observed delay is around 370ms.

My questions:

The Ethernet controler is an Intel I210, and I have not found anything relevant in the datasheet.

Thanks for your help :)


Solution

  • Every generation of Ethernet speed has it's own method and requirements.

    As you can see, your measured 370ms are exactly what you can expect from a slave port.

    Sources: