Network link errors

Video 088 of 140 in Virtualization Foundations, in the unit “Hardware failure and health”. 3:40, with English and Hindi audio.

A network cable can look fine and still lose packets. The link light may stay solid while frames are quietly lost and sent again, so transfers slow down without any outright failure. This article explains what a link error is, how a damaged frame is caught, and how to read the port counters and the link speed with the ip and ethtool commands on Linux.

What you will learn

Why a slow server can have a green link light

Picture a physical Linux server at Harbor Point that runs reports for one group of users, and it is slow. Its port shows a solid link light, so nobody suspects the network. But the port is quietly losing frames. Each lost frame is sent again, so transfers slow down, yet nothing fails outright.

A link can be up and still be bad. The port's counters tell the truth.

How a damaged frame is caught

Data crosses an Ethernet link in units called frames. Each frame ends with a check code, which is calculated from its contents. The sender adds the code, and the receiver recalculates it. If the contents changed on the way, the code no longer matches.

Dirt on a connector, a bent fibre, or a loose plug can damage the signal. The receiver then throws the frame away, and the port counts it as a CRC error. Many such errors point to a physical fault, not to software.

Reading the port counters and link speed

The ip command with its statistics option shows the errors and drops for each direction of a port. Use the name your system gives your port. In the example below, eno1 stands for that port name.

Show the error and drop counters of a port
ip -s link show eno1

The ethtool command shows the link speed, the duplex mode, and whether the link is detected at all. In the example output, the link runs at 25000Mb/s, in full duplex, and is detected.

Show the speed, duplex and link state
ethtool eno1 | grep -E 'Speed|Duplex|Link detected'

For deeper driver counters, search the statistics for words such as CRC or error. Their names differ by network card.

Show the driver counters for CRC and other errors
ethtool -S eno1 | grep -i -E 'crc|err'

What goes wrong, and how to fix a bad link

To fix a bad link, clean or reseat the connector, or replace the cable or the optic. Then watch the counter, and it should stop rising.

Read the counters of one network port

You need a Linux server with sudo rights. Use the name of your own port in place of eno1, and compare the counts again after a few minutes.

  1. Show the receive and transmit counters of the port, including errors and dropped frames.

    ip -s link show eno1

    What you should see: The RX and TX counters show errors, dropped and overrun frames. Watch whether they rise.

  2. Check the speed, the duplex mode and whether the link is detected.

    ethtool eno1 | grep -E 'Speed|Duplex|Link detected'

    What you should see: The example output shows Speed: 25000Mb/s, Duplex: Full and Link detected: yes.

  3. Search the driver counters for CRC and other error counts.

    ethtool -S eno1 | grep -i -E 'crc|err'

    What you should see: Driver counter names differ by network card. A CRC count that rises points to a physical fault.

Terms

Frame
One unit of data sent over an Ethernet link, which ends with a check code calculated from its contents.
CRC error
An error counted when a received frame's check code does not match its contents, so the frame was damaged on the way.
Duplex mismatch
A fault in which the two ends of a link run in different duplex modes, so transfers crawl.

Check yourself

Why can a port with a solid link light still lose frames?

The light shows a connection, not a clean one. Damaged frames are dropped and sent again, so transfers slow without a clear failure.

What does a CRC error mean?

A frame's check code did not match its contents, so the frame was damaged on the way and was thrown away.

What is a sign of a duplex mismatch?

Transfers crawl with few obvious errors, because one end runs full duplex while the other runs half.

Previous: Sensors, fans and the BMC's event log. Next: Predictive failure, and opening a vendor support case.