Networking HowTos
Networking HowTos

Fix Ethernet Port Flapping on MikroTik RB3011

October 13, 2020 MikroTik / RouterOS, Networking

The RB3011 router from MikroTik can sometimes have issues with Ethernet ports flapping, which can sometimes be traced back to using different link speeds on different ports on the one switch chip. The RB3011 contains two switch chips, both being the QCA8337 switch chip. The first switch chip being make up of ethernet ports 1-5, and the second being made up of ethernet ports 6-10.

Each switch chip has a 1 Gb/s connection to each of the two CPU cores (2Gb/s aggregated. See block diagram below). If you are experiencing port flapping, and you notice you have ports with different link speeds on the same switch chip ports (1-5, or 6-10), this article may help resolve that issue.

MikroTik RB3011 Block Diagram

RB3011 Block Diagram
source: https://mikrotik.com/product/RB3011UiAS-RM

The block diagram above shows the two switch chips, the ports linked to each switch chip, and how the switch chips link back to the main cpu cores.

Cause
The root cause of the issue appears to be caused by the switch buffer needing to be cleared before forwarding traffic to the other port, and when you mix link speeds, it cant always keep up, and flaps the port down/up.

Workaround / Prevention
The obvious simple workaround for this issue is to make sure all ethernet ports connected to the same switch chip are running at the same link speed. This may require turning off auto negotiation, and lowering the link speed manually. Ethernet ports 1-5 are connected to one of the switch chips, and ports 6-10 are connected to the other.

Resolution
This may not resolve the issue in all use cases, but it seems that the issue can be negated by disabling the CPU flow control option, which was introduced/fixed in RouterOS version v6.47 (stable) and v6.46.7 (long term).

Changelog from v6.47 (stable) and v6.46.7 (long term):

...
*) switch - correctly enable and disable CPU Flow Control on RB3011UiAS;
...

Unfortunately these options are not available from the WinBox GUI, and must be done using the CLI.

You can determine if you currently have flow control enabled or disabled by running the following command:

/interface ethernet switch export verbose

you should see something like this:

/interface ethernet switch
set 0 cpu-flow-control=yes mirror-source=none mirror-target=none name=switch1
set 1 cpu-flow-control=yes mirror-source=none mirror-target=none name=switch2

To disable the cpu-flow-control option, use the following command(s):

/interface ethernet switch set switch1 cpu-flow-control=no
/interface ethernet switch set switch2 cpu-flow-control=no 

If you only want to disable it on one of the switch ports, only run the relevant command above for the switch chip you want to disable it for. See the block diagram for which ports are linked to which switch chip.

You Might Also Like