Sharing notes from my ongoing learning journey — what I build, break and understand along the way.
Network Interface Cards (NICs): Architecture, Performance & Tuning
What a NIC Is and How It Shapes Speed, Latency, and Stability
Although I’ve been deep into the software side lately, today my focus is the network interface card (NIC): the piece that lets my computer “see” the network at a physical level. What does it do, what’s inside it, how does it influence throughput and latency, and which settings matter most—I’ve pulled it all together below.
What exactly is a NIC?
A NIC is a Layer-2 interface device that wraps bytes from the operating system into frames and puts them onto the medium (cable or radio). It also takes incoming frames off the medium, unwraps them, and hands them to the OS. Its typical outputs are Ethernet (wired) or 802.11 (Wi-Fi) frames.
Core duties
- Framing: Converts upper-layer payloads (IP/TCP/UDP) into L2 frames; reverses the process on receive.
- Addressing: Carries your local network identity via a MAC address.
- Timing & buffering: Queues packets in RX/TX ring buffers to keep send/receive smooth.
- Hardware offload: Performs certain computations itself (e.g., checksums) to spare the CPU.
Internal architecture: NIC components
- MAC/Controller (chip): Frame handling, queues, interrupts, RSS (Receive Side Scaling), multi-queue management.
- PHY (Physical Layer): Converts signals to the cable (Ethernet) or to radio/antenna (Wi-Fi); link speed, duplex, and RF specifics live here.
- On-card buffers (ring buffers): Circular memory regions where incoming/outgoing frames wait (RX/TX).
- Driver & firmware: Expose features to the OS, toggle capabilities, handle faults.
- Antenna/Radio (for Wi-Fi NICs): MIMO chains (1×1, 2×2, 3×3…), modulation/coding (MCS), beamforming.
Form factors
- On-board (integrated on the motherboard)
- PCIe add-in cards (desktop/server)
- USB adapters (portable) — note: USB 2.0 caps out around 480 Mb/s and cannot fully feed 1 GbE; prefer USB 3.x
- SFP/SFP+ slots for pro fiber/copper NICs
How a NIC impacts performance
1) Throughput ceiling
- The link rate (e.g., 1 GbE, 2.5 GbE; or the Wi-Fi PHY rate) defines the practical upper bound.
- On Ethernet, real-world 1 GbE typically tops out near ~940 Mb/s due to preamble, inter-frame gap, and L2/L3 overheads.
- On Wi-Fi, even if the driver shows a high PHY rate, contention/retransmissions/CSMA-CA reduce real throughput. MIMO (2×2 vs 1×1) and channel width (80/160 MHz) on the NIC matter a lot.
2) Latency and jitter
- Interrupt Moderation (coalescing): Batches interrupts before notifying the CPU. This can reduce jitter; if too aggressive, it adds delay.
- MSI/MSI-X: Lets the NIC deliver interrupts to multiple cores; with RSS, packet processing parallelizes.
- Queue depth & ring sizes: Too small → drops; too large → added latency. Defaults are usually balanced.
3) CPU load (offloads)
- Checksum Offload (IPv4/IPv6/TCP/UDP)
- TSO/GSO (TCP/Generic Segmentation Offload): NIC splits large payloads into MSS-sized segments.
- LRO/GRO/RSC (receive-side coalescing): NIC/stack aggregates many small packets into larger units before handing them to the OS.
These significantly cut CPU use at high speeds. If you hit odd driver issues, toggling them for A/B testing can help diagnostics.
4) Power management and stability
- EEE (Energy Efficient Ethernet): Lowers idle power; in some combos can slightly increase micro-latency.
- USB NIC power saving: Over-aggressive settings can produce “ticks” in packet flow.
- Wi-Fi NIC + Bluetooth coexistence: If both share 2.4 GHz chains, heavy BT traffic can collide with Wi-Fi; good coexistence logic matters.
Ethernet NIC
- Auto-Negotiation: NIC and switch agree on speed and duplex. A bad negotiation can drop you to 100 Mb/s or create collision-like behavior.
- Full- vs half-duplex: Modern links should be full-duplex; half-duplex invites delays/collisions.
- Flow control (802.3x Pause): During congestion, the NIC can send pause frames to slow the peer. Powerful in data-center storage paths, but must be tuned carefully.
- Cable quality & MDI-X: Cat5e is fine for 1 GbE; for 2.5/5/10 GbE, Cat6/Cat6A is safer. Automatic MDI-X eliminates crossover-cable headaches.
- MTU & Jumbo Frames: Many NICs support 9000 MTU. Enable only if every hop end-to-end supports it (great for LAN copies). For internet traffic, 1500 is safest.
Wi-Fi NIC
- MIMO chains: 2×2 generally beats 1×1 under the same SNR, giving higher PHY rates and better stability. This is a key selection criterion.
- Standard support: 802.11ax (Wi-Fi 6/6E) brings OFDMA, MU-MIMO, BSS Coloring that improve multi-user efficiency and latency handling.
- Antenna and placement: External-antenna USB/PCIe solutions often have better receiver sensitivity than tiny embedded antennas.
- Regulatory domain/country code: The NIC’s allowed channels/tx power (as set by driver/firmware) influences achievable rates.
Drivers and operating systems
Windows
- Power Management: Unchecking “Allow the computer to turn off this device to save power” often helps ping/jitter.
- Advanced (Ethernet): Interrupt Moderation, Receive/Transmit buffers, RSS, Large Send Offload, EEE—for troubleshooting, change one at a time and A/B test.
- Wi-Fi drivers: Options like “Roaming aggressiveness,” “Preferred band,” or “Throughput booster” may exist per NIC.
Linux
ethtool
(Ethernet NIC): Inspect speed/duplex/auto-neg, toggle offloads (-k/-K
), adjust ring sizes (-g/-G
).iw
/iwconfig
/nmcli
(Wi-Fi NIC): Check supported MCS, driver features, power management.- For IRQ distribution (RSS), look at
/proc/interrupts
andirqbalance
.
macOS
- Driver updates are tied to system updates; NIC tuning surface is more limited.
Troubleshooting flow
- Verify link speed/duplex (Ethernet): If you expect 1 GbE but see 100 Mb/s, suspect cable/port/auto-neg. Swap ports/cables.
- If it’s a USB NIC: Ensure a USB 3.x port and non-aggressive power saving.
- Wi-Fi NIC rates don’t match expectations: Is it 1×1 vs 2×2? Is the driver current? How’s the antenna situation?
- Ping/jitter spikes: On Windows, disable NIC power saving; try low/off Interrupt Moderation; confirm RSS is enabled.
- High CPU at speed: Are TSO/LRO/GRO enabled? (Some older drivers misbehave—A/B test.)
- Local packet loss: Ring buffers might be too small; update the driver; try different driver versions.
- MTU weirdness (VPN/PPPoE): If path fragmentation occurs, tune MTU at the OS interface (1500 or lower as needed).
Which NIC should I choose?
Ethernet NIC
- At least 1 GbE; for new desktop/NAS plans, 2.5 GbE is a strong value.
- Prefer well-supported chip families and actively maintained drivers.
- For labs/virtualization: SR-IOV, VLAN offload, multi-queue (RSS) support.
- For heavy copies/IO: Jumbo Frames (only if every device along the path supports them).
Wi-Fi NIC
- 802.11ax (Wi-Fi 6/6E), ideally 2×2 MIMO.
- External-antenna options (on desktops) and a stable driver ecosystem.
- If Bluetooth shares the module, consider coexistence quality and 2.4 GHz behavior.
Mini terms
- MAC address: The NIC’s L2 identity (e.g.,
00:1A:…
). - Frame vs. packet: The NIC deals in frames (L2); packets are L3 (IP).
- PHY rate (link rate): Raw medium rate; real throughput is lower due to overhead/contests.
- RSS/MSI-X: Distributes interrupts/flows across CPU cores to parallelize NIC work.
- TSO/LRO/GRO: Split on transmit, coalesce on receive → lower CPU use.
The NIC is the hardware gateway to the network. It directly influences your top-end speed, latency/jitter, stability, and CPU load.
On Ethernet, negotiation/duplex, cable quality, offloads, and ring tuning matter;
on Wi-Fi, MIMO chains (2×2), ax/6E support, and driver/power behavior are the big levers.
A well-chosen, well-tuned NIC delivers higher practical throughput and lower latency under the same ISP and router conditions.