Packet Coalescing & Interrupt Moderation — Architecture & Performance
Overview
Packet coalescing and interrupt moderation are techniques used in network interfaces and operating systems to reduce CPU overhead, improve throughput, and optimize power consumption. They work by aggregating multiple packets or events before delivering them to the host CPU, thereby reducing the number of interrupts and context switches.
These mechanisms are essential in high‑speed networks, virtualized environments, and mobile systems, where interrupt storms and per‑packet processing overhead can severely limit performance.
Goals of Coalescing and Moderation
These mechanisms aim to:
- reduce CPU interrupt rate
- improve throughput under high load
- lower power consumption
- amortize per‑packet processing overhead
- maintain acceptable latency for interactive traffic
- balance efficiency and responsiveness
The challenge is to optimize performance without harming latency‑sensitive applications.
Architectural Principles
Interrupt Cost
Each interrupt triggers:
- a context switch
- cache pollution
- driver processing
- potential wake‑ups from low‑power states
Reducing interrupt frequency improves efficiency.
Batch Processing
Processing packets in batches amortizes overhead across multiple packets.
Batching improves throughput but increases latency.
Adaptive Behavior
Modern NICs dynamically adjust coalescing parameters based on:
- traffic rate
- packet size
- CPU load
- latency requirements
Adaptive moderation provides the best balance across workloads.
Packet Coalescing
Concept
Packet coalescing aggregates multiple received packets into a single buffer or descriptor before delivering them to the OS.
Benefits:
- fewer DMA operations
- reduced descriptor processing
- improved cache locality
Coalescing is especially effective for small packets.
Receive‑Side Coalescing (RSC)
RSC combines multiple TCP segments into a larger, reassembled segment before passing it to the OS.
Benefits:
- reduces per‑packet overhead
- improves throughput for small TCP segments
- reduces CPU load
Used in modern NICs and OS network stacks.
Large Receive Offload (LRO)
LRO aggregates incoming packets belonging to the same flow.
Differences from RSC:
- LRO is more aggressive
- may break TCP semantics (e.g., out‑of‑order handling)
- not suitable for routing or forwarding devices
Used primarily in servers and end hosts.
Transmit‑Side Coalescing
On the transmit path, NICs may combine small packets into larger frames or batch descriptors.
Benefits:
- reduces DMA overhead
- improves throughput
- lowers CPU usage
Often integrated with TSO (TCP Segmentation Offload).
Interrupt Moderation
Concept
Interrupt moderation delays or batches interrupts so that multiple packets trigger a single interrupt.
Moderation parameters include:
- interrupt delay (timer‑based)
- interrupt threshold (packet count)
- adaptive algorithms
Moderation reduces interrupt storms under high load.
Timer‑Based Moderation
Interrupts are generated only after a timer expires.
Pros: predictable
Cons: increases latency for small bursts
Threshold‑Based Moderation
Interrupts are generated after a certain number of packets or bytes.
Pros: efficient under high load
Cons: may delay small flows
Adaptive Interrupt Moderation (AIM)
NICs dynamically adjust moderation based on traffic patterns.
Benefits:
- low latency under light load
- high throughput under heavy load
- reduced CPU usage
AIM is widely used in modern NICs.
Interaction with Offload Engines
TSO (TCP Segmentation Offload)
TSO reduces transmit overhead by offloading segmentation to the NIC.
Coalescing complements TSO by reducing receive overhead.
GRO (Generic Receive Offload)
GRO is a software‑based coalescing mechanism in the OS.
Benefits:
- flexible
- protocol‑aware
- works with virtualized environments
GRO is widely used in Linux.
GSO (Generic Segmentation Offload)
GSO performs segmentation in software before NIC transmission.
Useful when hardware TSO is unavailable.
Performance Considerations
Latency
Coalescing and moderation increase latency because packets wait before being processed.
Latency‑sensitive applications (VoIP, gaming, HFT) may require:
- minimal coalescing
- low interrupt delay
- priority queues
Throughput
Batching improves throughput by:
- reducing per‑packet overhead
- improving cache locality
- reducing interrupt frequency
High‑speed NICs rely heavily on coalescing to sustain line rate.
CPU Utilization
Moderation reduces CPU load by:
- lowering interrupt rate
- reducing context switches
- improving batching efficiency
Critical for servers and virtualized environments.
Power Consumption
Mobile and embedded systems use coalescing to:
- reduce wake‑ups
- extend battery life
- maintain low‑power states longer
Use Cases in Modern Systems
Data Center Servers
High‑speed NICs (25G/50G/100G/200G) rely on:
- RSC/GRO
- TSO/GSO
- adaptive interrupt moderation
These mechanisms are essential for sustaining high throughput.
Virtualized Environments
Hypervisors and virtual NICs use:
- software coalescing
- batching
- interrupt moderation
These reduce VM exits and improve scalability.
Mobile and IoT Devices
Coalescing reduces:
- power consumption
- CPU wake‑ups
- radio transmission overhead
Used in Wi‑Fi, LTE/5G modems, and low‑power NICs.
High‑Speed Interconnects
PCIe, CXL, and NoCs use:
- event coalescing
- credit batching
- interrupt moderation
These ensure deterministic performance and reduce overhead.
Comparison of Coalescing and Moderation Techniques
| Technique | Latency | Throughput | CPU Load | Typical Use |
|---|---|---|---|---|
| Timer‑Based Moderation | Medium | High | Low | NICs, OS |
| Threshold‑Based Moderation | Medium | High | Low | High‑speed NICs |
| Adaptive Moderation | Low-Medium | Very High | Very Low | Modern NICs |
| RSC/GRO | Medium | Very High | Low | Servers |
| LRO | Medium | High | Low | End hosts |
| TSO/GSO | Low | Very High | Very Low | Servers, virtualization |
Design Tradeoffs
- Latency vs throughput — batching improves throughput but increases delay.
- CPU load vs responsiveness — fewer interrupts reduce CPU usage but delay processing.
- Hardware vs software — hardware is faster; software is more flexible.
- Power vs performance — coalescing saves power but may harm latency.
- Flow granularity vs batching — fine‑grained control reduces batching efficiency.
Related Pages
- Generic Packet Parsing — Architecture & Pipelines
- Packet Scheduling — Architecture & Algorithms
- Queue Management & Congestion Control — Architecture & Algorithms
- Traffic Prioritization & Service Classes — Architecture & Use Cases
- Link Layer Reliability Mechanisms — Architecture & Design Patterns
Summary
Packet coalescing and interrupt moderation reduce CPU overhead, improve throughput, and optimize power consumption by batching packets and events before delivering them to the host. Through RSC, GRO, TSO, adaptive moderation, and batching techniques, modern systems achieve high performance across data centers, virtualized environments, mobile devices, and high‑speed interconnects.