🚀 Listed in the CNCF Landscape and eBPF Foundation Emerging Project. If you like this project, give it a star on GitHub! ❤️

Blog

Behind Ethernet Link Failures

Why does packet loss still occur when the NIC link stays Up? From link outages and CRC errors to insufficient receive resources, what anomalies can HUATUO capture, and what evidence can it preserve?

A broken fiber, power loss, or signal problems can put a link into CarrierDown. Data can no longer be delivered over that link, causing application requests to time out or be interrupted.

Failure pattern Application impact
Persistent Down state Communication stops; requests fail or time out.
Repeated Up/Down transitions Repeated interruptions cause latency and throughput to fluctuate.
One member of a redundant link fails Traffic may switch paths, or available capacity may decrease.

On the server’s receive path, the optical module first converts an optical signal into an electrical signal. The PHY recovers the bits and encoded data, and the MAC checks the frames. Packets that pass filtering enter the receive buffers and queues. DMA then transfers them over PCIe into host memory at the addresses specified by the descriptors.

Fiber → Optical module/PMD → PMA/SerDes/CDR → PCS → RS/MAC → Filtering/Buffers/Receive queues → DMA → PCIe → Host memory.

This is the complete receive and delivery path; not every stage participates in determining link state. Optical signal problems and physical-layer synchronization failures can cause CarrierDown.

Figure 1. Three types of connections between the controller and a PHY or optical module

Figure 1. Three types of connections between the controller and a PHY or optical module.

Figure 2. Functional sublayers of an Ethernet PHY

Figure 2. PHY functional sublayers.

The MAC belongs to the data link layer, while buffers, queues, DMA, and PCIe handle subsequent delivery. Errors can also occur between the MAC and delivery to the host:

  • MAC: CRC, length, or illegal-byte errors can cause bad frames to be dropped while the port remains Up.
  • Receive buffers/Queues: Insufficient buffer space, a disabled queue, or a lack of free descriptors under certain drop configurations can cause packet loss.
  • DMA/Descriptors: A lack of available descriptors, stalled data transfers, or blocked completion writeback can prevent packets from reaching the host.

Figure 3. The receive path from optical signals to host memory

Figure 3. From optical signals to host memory.

Carrier indicates link state; CRC error counters indicate bad frames; missed and queue-drop counters indicate delivery losses.

Weak, Excessive, or Fluctuating Optical Signals Affect Reception

Received optical power that is too low or exceeds the receiver’s operating limit degrades reception and increases CRC errors. While the link can still stay up, applications may first experience intermittent packet loss. More severe degradation can bring the link down. Assess optical power against the specific module’s specifications and diagnostic thresholds.

Figure 4. Functional roles of the optical transceiver circuits

Figure 4. Functional roles of the transceiver circuits.

Frame Validation Errors

A rising CRC error counter means the receiver has detected frame check errors. Under normal configurations, the NIC usually drops bad frames. CRC detects errors; it does not repair packets.

Figure 5. The difference between block synchronization and frame validation

Figure 5. Block synchronization versus frame validation.

Packet Loss During Delivery to the Host

Another type of loss occurs during delivery: a valid frame fails to reach the host because receive buffers or descriptors are insufficient. This typically appears in rx_missed_errors (referred to below as missed).

Figure 6. The complete Intel 82599 receive flow

Figure 6. Rx Data Flow. Intel, page 42.

Steps 1–3: the host prepares the receive ring, empty buffers, and the tail pointer. Steps 6–12: the MAC receives packets, which pass through filtering into buffers; DMA then writes them into host memory and writes back the descriptors. Steps 13–14: the host is notified, and processing continues through the protocol stack.

Empty buffers and descriptors must be prepared in advance. Waiting for resources after a packet arrives may already be too late.

1. Packets Cannot Proceed When a Queue Has No Resources

Figure 7. Receive queue selection

Figure 7. Receive queue selection.

Filtering rules determine whether to accept a packet and which queue receives it. RSS can distribute packets based on a hash of their headers. Selecting a queue does not mean DMA has completed or the application has received the packet.

A disabled queue, or a lack of free descriptors under certain Drop En configurations, can increase QPRDC. ixgbe aggregates these counts as rx_no_dma_resources.

2. Insufficient Host Buffers

Figure 8. The relationship between NIC buffers, host descriptors, and DMA

Figure 8. The roles of NIC buffers and host memory.

Buffers temporarily hold packets, descriptors provide host buffer addresses and status, and DMA transfers the data. The NIC’s on-chip buffers and the host descriptor ring reside in different locations and must be distinguished.

Figure 9. Receive descriptor ring structure

Figure 9. Receive descriptor ring.

In this example, missed indicates losses associated with receive buffers or delivery resources. The driver’s alloc_rx_page_failed counter indicates failures to replenish host memory resources. They are different counters.

3. Driver Resource Exhaustion

Figure 10. Descriptor and memory ring progression

Figure 10. Descriptor and memory ring progression.

Software replenishes available descriptors, which the hardware uses to write packets. After processing completion status, the driver replenishes them again. If processing or replenishment cannot keep pace with incoming traffic, receive resources can be exhausted.

DMA completion → Interrupt/NAPI → Driver processing → GRO/Protocol stack → Socket/Application

NAPI processes receive completions in batches; one interrupt does not correspond to one packet. When host receive pressure rises, examine CPU activity, NET_RX, and softnet_stat, then use dropwatch to locate observable drops in the kernel.

Check three things together: whether the link went down, whether frames were valid, and whether valid frames reached the host.

3. HUATUO: My Evidence Trail

HUATUO records NIC link state changes and kernel anomalies. Aligning this data with application incident times lets you reconstruct what happened during a failure.

Figure 11. HUATUO host-side evidence and supplementary telemetry

Figure 11. HUATUO host-side evidence and supplementary telemetry.

Diagnostic question Evidence from HUATUO Scope and limitations
Did the link go down, or was the interface administratively disabled? netdev_events: carrier and administrative state changes, along with interface and driver information. Records changes observed by the host; it cannot directly identify a damaged component.
Are receive errors increasing while the link stays Up? netdev: trends in standard interface statistics such as CRC errors and missed. Available breakdowns depend on the Netlink collection source and the data the driver actually provides.
Were packets lost during hardware receive delivery? netdev_hw: hardware receive-drop metrics for supported drivers. Disabled by default in the example configuration; the metric does not cover all hardware drops.
Where are packets dropped inside Linux? dropwatch: supported drop reasons, call stacks, and network context. Bad frames already dropped inside the NIC usually have no corresponding kernel event.
Why is processing slow after packets enter the host? net_rx_latency: latency for TCP packets from the driver receive point to subsequent processing points. Excludes PHY processing and time before DMA completion; excludes the host network namespace by default.

Reference: Receive Path Functions and Errors

The table below summarizes each stage’s role, possible faults, and diagnostic interfaces. The layer that records an error does not necessarily contain the faulty component.

Stage Core function Possible faults and effects Statistics or diagnostic interfaces
Optical module/PMD Converts received optical signals into electrical signals; performs electrical-to-optical conversion on transmit. Broken fiber, optical power that is too low or too high, or module transmit/receive faults; bit errors may appear first, with signal loss in severe cases. ethtool -m for available power, temperature, and alarm information; read LOS, Tx Fault, and other status indicators where supported by the device.
PMA/SerDes/CDR Recovers the sampling clock and converts the high-speed serial bitstream into internal data. Unstable clock recovery, loss of lock, or degraded signal quality can prevent link establishment or cause bit errors. Vendor signal and lock diagnostics; standard Linux statistics may not expose these details.
PCS Identifies encoded block boundaries, descrambles and decodes the stream, and recovers data and control information. Decoding errors, a high bit error rate, or loss of block synchronization can trigger fault states and, in severe cases, link failure. Block-lock and high-bit-error-rate status, along with decoding error counters, for the operating mode in use.
RS Adapts data, control, and fault indications between the PHY and MAC. Local/Remote Fault indications report faults in the corresponding direction; they do not directly identify the damaged component. Supported fault status, events, and link logs.
MAC Checks Ethernet frame FCS and length, and handles enabled link control functions. CRC, length, and illegal-byte errors; bad frames may be dropped while the port remains Up. Hardware counters such as CRCERRS, RLEC, and ILLERRC; available ixgbe statistics such as rx_crc_errors and rx_length_errors.
Receive buffers/Queues Selects queues through filtering rules, RSS, and related mechanisms; buffers packets awaiting delivery. Insufficient buffer space, disabled queues, or no free descriptors under certain drop configurations can cause packet loss. rx_missed_errors and QPRDC; in this example, QPRDC is aggregated as rx_no_dma_resources.
DMA/Descriptors Reads descriptors, transfers packets into the specified host buffers, and writes back completion status. A lack of available descriptors, stalled data transfers, or blocked completion writeback can prevent delivery. Descriptor completion status, queue drops, and driver diagnostics; there is no universal DMA error total across NICs.
PCIe Connects the NIC to the host and carries the memory transactions required for DMA. Link speed or width below expectations, transaction errors, or link outages may constrain or block host-side transfers. LnkCap/LnkSta from lspci -vv, available AER statistics, and kernel and driver logs.
Host memory/Driver Prepares receive buffers, processes completions, and continuously replenishes descriptors. Memory allocation failures or delays in processing and replenishment can, in turn, exhaust NIC receive resources. alloc_rx_page_failed and alloc_rx_buff_failed, alongside queue, CPU, and NAPI processing information.

HUATUO is an open-source project from DiDi, incubated under the China Computer Federation (CCF), that provides observability across operating system kernels and agent sandboxes. It serves infrastructure scenarios including AI sandboxes, AI computing, general-purpose computing, cloud-native systems, and intelligent driving systems.

Project repository: https://github.com/ccfos/huatuo