absurdum reductus

The Error Counter Said Zero and the Cable Tested Perfect

The night our WAN moved onto a wired Starlink link, CI plans started failing on DNS reads and an offsite upload slowed to a third of its speed. Our monitoring said the port was clean. We swapped the cable, and nothing changed. Then both cables tested perfect. The thing that finally made the errors stop is one line on the router console, and it tells us less than it seems to.


The counter that does not count#

Our edge router is a MikroTik running RouterOS, scraped into Prometheus by mktxp, the community exporter. The first thing anyone checks on a suspect link is its error counter, and the first thing we checked was mktxp_interface_rx_error_total on the WAN port. It read zero. So did the drop counter. We wrote down “the port is clean” in more than one place.

The router’s own console disagreed:

/interface ethernet print stats where name=ether2

It showed 123,251 receive FCS errors and 134,928 receive error events in about 86.4 million frames: roughly one frame in 700 arriving with a bad checksum. The exporter does carry that number. It is just not under the name you search for. It lives under switch, because mktxp reads it from the router’s switch-port statistics rather than the interface’s:

sum(mktxp_interface_rx_error_total{name="ether2"})
sum(mktxp_switch_rx_fcs_error_total{name="ether2"})

Run against our Prometheus today, a few days and one fix later:

0
245521

Two series about the same port, one of them always zero. With history to look at, the FCS series was zero until the hour of the cutover and non-zero in every hour after it. Every other port on the router read zero. So the corruption was on this one link: the cable, its connectors, or the device on the far end. The counter could not say which.

That is the first lesson and it is not specific to MikroTik. An interface error counter is a sum of whatever the driver or exporter decided to put in it. Before an error counter that reads zero is allowed to clear a link, find out which errors it counts. FCS is the one a bad cable produces, and it is the one that was missing.

A step, not a slope#

The obvious next move was to swap the cable for a short one. We did, and the errors carried on. Before anyone reached for a third cable, we laid the error counter against the receive rate, minute by minute, for 1,929 minutes on the replacement:

Receive rateMinutesMedian errors per minuteMedian errors per MiB
under 3.5 Mbit/s1,1610.70.03
3.5 to 56 Mbit/s7437 to 420.15 to 0.20
56 Mbit/s and up253,009 to 5,4844 to 6

Every one of the 25 busy minutes had more than a thousand errors, and those 25 minutes held 73% of all the errors in 1.3% of the time. Per megabyte the error rate rose about thirty times between the middle band and the top one. The link was negotiated at a gigabit, and the busy minutes ran at 180 to 250 Mbit/s, so the wire was nowhere near full.

That shape argues against the cable before anyone touches it. A dirty contact or a cracked conductor corrupts a roughly fixed share of what passes over it. Push twice the traffic and you get twice the errors, at the same errors per megabyte. A line that is clean at a trickle and falls apart past some rate is the signature of something that changes under load: signalling, power, heat, how a device sends its bursts.

We cleaned the connector anyway, because it is cheap. The next burst came at the same density as before. Then we did the thing that should have been easy, and found it was not.

Testing a cable alone is harder than it sounds#

The question was simple: is this cable good at a gigabit? Every obvious way to answer it tests something else.

Loop it between two ports on the same switch, and spanning tree sees its own hello frames come back and blocks one of the ports. The cable “fails” without a single bit being corrupted. Turn spanning tree off and, if the two ports are in different VLANs, you have just joined them.

Run the test between two hosts through the network, and the path now includes every trunk and switch between them. A throughput number from that path is a number about the path.

Put both NICs in one machine and run the test between them, and the cable carries nothing at all. The kernel sees that the destination address is its own and delivers the traffic locally, through loopback. Here is that, with a virtual cable (a veth pair) standing in for the real one: first with both ends in one network namespace, then with the far end moved into a namespace of its own.

#!/bin/sh
# Two NICs joined by a wire (a veth pair), first in one network
# namespace, then with the far NIC moved into a namespace of its own.
IMG=${IMG:-docker.io/library/alpine:3.20}
podman run --rm --cap-add NET_ADMIN,NET_RAW,SYS_ADMIN "$IMG" sh -c '
apk add -q iproute2 >/dev/null
tx() { cat /sys/class/net/nic0/statistics/tx_packets; }
ip link add nic0 type veth peer name nic1
ip addr add 192.0.2.1/24 dev nic0
ip addr add 192.0.2.2/24 dev nic1
for i in lo nic0 nic1; do ip link set "$i" up; done
echo "== one namespace"
ip route get 192.0.2.2 from 192.0.2.1 | head -n 1
a=$(tx); ping -q -c 1000 -i 0.002 -I 192.0.2.1 192.0.2.2 | grep transmitted
echo "packets nic0 put on the wire: $(( $(tx) - a ))"
echo "== far NIC in its own namespace"
ip netns add far
ip link set nic1 netns far
far() { nsenter --net=/run/netns/far "$@"; }
far ip addr add 192.0.2.2/24 dev nic1
far ip link set nic1 up
far ip link set lo up
ip route get 192.0.2.2 from 192.0.2.1 | head -n 1
sleep 2
a=$(tx); ping -q -c 1000 -i 0.002 -I 192.0.2.1 192.0.2.2 | grep transmitted
echo "packets nic0 put on the wire: $(( $(tx) - a ))"
'
== one namespace
local 192.0.2.2 from 192.0.2.1 dev lo uid 0
1000 packets transmitted, 1000 packets received, 0% packet loss
packets nic0 put on the wire: 6
== far NIC in its own namespace
192.0.2.2 from 192.0.2.1 dev nic0 uid 0
1000 packets transmitted, 1000 packets received, 0% packet loss
packets nic0 put on the wire: 1002

A thousand pings, every one answered, and the wire carried a handful of packets that were not pings. The route lookup says it plainly: local ... dev lo. A cable test in that configuration measures the loopback interface. Move the far NIC into its own namespace and the same thousand pings leave through nic0, which is what a test is supposed to look like.

So the test that works is the boring one. Connect the cable back to back between two physical NICs, with nothing in between, and hand each NIC whole to its own container (in Incus, a nic device with nictype=physical), so neither side can see the other’s address as local. Then run iperf3 between the containers. The short replacement, sixty seconds per run (the original cable passed the same way):

RunRateTCP retransmits
reverse (-R)942 Mbit/s, 6.58 GB0
forward, capped at 300 Mbit/s300 Mbit/s, 2.10 GB0
both directions at once (--bidir)933 and 936 Mbit/s0 and 1

A frame that fails its checksum is dropped by the receiver, so on TCP it turns into a retransmit. At the error rate the WAN port showed under load, about 0.85% of frames, a 6.5 GB run should have produced thousands. The cable produced at most one in each direction at full gigabit.

The test has an honest limit: both ends were Linux NICs, not the Starlink equipment and the router port. It clears the copper. It says nothing about the two ports that copper was plugged into. We put the tested cable on the WAN anyway, and in the next 21 minutes, on an almost idle link, the router counted 75 FCS errors.

One line on the console#

What was left was the conversation between two specific gigabit ports. That suggested a cheap test: stop them having it. On the router console:

/interface ethernet set ether2 advertise=100M-baseT-full

The link renegotiated at 100 Mbit/s full duplex. These are not the same signalling at a tenth of the speed. 1000BASE-T drives all four pairs in both directions at once, five-level PAM coding with echo cancellation on every pair; 100BASE-TX uses two pairs, one each way, with a far simpler line code. A port that cannot hold the first can be perfectly happy with the second.

Over the next 24 hours the port received about 32 GiB in 1,465 minutes and counted zero FCS errors. Twenty of those minutes ran above 56 Mbit/s, the rate that had never once passed without a thousand errors. The heaviest of them was a daily bulk transfer, nine minutes at 84 to 96 Mbit/s, which at a gigabit had collected 38,537 errors one day and 38,711 the next. This time it collected none.

The DNS failures that started all this went with it. Before the change, 7 of 10 plan pipelines hit DNS read failures, from 1 to 30 per run. Since then, 15 of 15 have had none. We have not proved that those DNS queries crossed this port, so that is a strong correlation on a small number of runs, not a measured cause. We note it and do not lean on it.

What the stopgap costs, and what it does not say#

The cost is easy to state. The downlink is now capped at about 95 Mbit/s, and at a gigabit the busy minutes reached up to 250 Mbit/s. The daily transfer takes longer. Everything else is unaffected.

The setting is also invisible. It lives in the router’s running configuration and nowhere else. Nothing in our infrastructure code manages that port’s Ethernet properties, so no apply will quietly revert it, and nothing in our infrastructure code records it either. The only place it is written down is the incident it came from. A stopgap that lives only on the device is the one somebody “tidies up” in a year, on a quiet afternoon, and the corruption comes back with nobody remembering why it ever left.

And the fix is not a diagnosis. Dropping to 100 Mbit/s moved the fault from “the link” to “gigabit signalling between these two ports”, which is real progress, but it does not say which port. It could be the router’s, the Starlink equipment’s, or the two of them together on a marginal day. The next test splits that: plug the Starlink side into a Linux NIC at a gigabit and read the NIC’s own CRC counters under a download, or move the WAN to a different router port. Either one takes the WAN down while it runs.

The rules we took away, in the order we should have applied them: