PCAP Doesn't Lie Part 3

It’s time for part 3 of the Network Security Monitoring (NSM) series. Quick review: there are 4 possible locations for packet loss: in transit, on the interface, during processing, and while writing to disk. Part 2 https://alstacilauskas.blogspot.com/2026/02/pcap-doesnt-lie-part-2.html we covered in transit; in this post, we will cover the interface.


We must first understand why packets are lost on the interface. The most common reason for packet loss on an interface is misconfiguration. A normal network interface (operating in standard mode) processes only network traffic intended for that specific device. Each network interface card (NIC) has a unique MAC address that identifies it on the local network. When packets travel across the network, they include a destination MAC address. The NIC examines each packet and determines whether the destination address matches its own MAC address. If it matches, the packet is accepted and passed to the operating system for processing. If the destination MAC address belongs to another device, the NIC discards the packet and prevents the operating system from seeing it.  When taking a network traffic feed from a SPAN (Switched Port Analyzer) or tap, please see part 2 https://alstacilauskas.blogspot.com/2026/02/pcap-doesnt-lie-part-2.html, and plug it into a network interface operating in standard mode. Most of your packets will be dropped.

To prevent the interface from dropping these packets, the interface needs to be put into promiscuous mode. The NIC captures and forwards all packets it sees on the network segment to the NSM software, regardless of the destination MAC address.

Another common reason for packet loss on the interface is that the interface receives too much traffic and, even in promiscuous mode, cannot forward packets to the NSM software quickly enough. To address this issue, NSM engineers typically use two approaches: deploying a network packet broker (NPB) to manage and filter the traffic before it reaches the sensor, or using the PF_RING library to improve high-speed packet capture and reduce packet loss.

A network packet broker (NPB) is a specialized device that collects, filters, and distributes network traffic from multiple sources to monitoring, security, or analytics tools. It can aggregate multiple links, remove duplicate packets, slice or trim packets, load-balance traffic, buffer packets, and filter traffic at a minimum of Layer 4, with some advanced devices performing filtering at Layer 7 (see the OSI model for reference: https://en.wikipedia.org/wiki/OSI_model). These capabilities help reduce the load on the network interface of the NSM device by ensuring that only relevant traffic is forwarded for analysis. Depending on the model and feature set, some packet brokers can also normalize VLANs and tunneling protocols, ensuring monitoring systems receive accurate, optimized traffic with minimal packet loss. Packet brokers are essential in modern networks for efficiently managing east-west and north-south traffic, enabling high-performance monitoring and improved security visibility across large, complex environments.

NPB Diagram



PF_RING is a high-performance packet capture and network traffic analysis framework for Linux. It is a Linux library primarily designed to improve the speed and efficiency of packet capture compared to the standard Linux networking stack.

Think of it as a “supercharged network sniffer” that can handle very high-speed traffic without dropping packets.

Key Features

  1. High-Speed Packet Capture
    • PF_RING bypasses much of the normal Linux networking stack to reduce overhead.
    • It can capture traffic at 10 Gbps or higher with minimal packet loss.
  2. Zero-Copy Mode
    • Normally, every packet is copied from the kernel to user space (libpcap style), which is slow.
    • PF_RING can use zero-copy buffers to allow user-space applications to read packets directly from kernel memory, greatly improving throughput.
  3. Ring Buffers
    • Uses a ring buffer structure in memory to hold captured packets.
    • Multiple applications or threads can read from the ring buffer simultaneously.
  4. Filtering
    • Supports BPF (Berkeley Packet Filter) for selective packet capture.
    • Can filter packets in kernel space, reducing CPU usage.
  5. Support for Multiple Interfaces
    • Can aggregate traffic from multiple NICs into a single capture stream.
    • Useful for network monitoring appliances.
  6. Integration with Tools
    • Works with tools like ntop, Suricata, Snort, and other IDS/monitoring solutions.
    • Provides APIs for building high-speed packet-processing applications.

PF_RING helps address three potential areas of packet loss: at the interface, during processing, and while writing to disk. However, for this topic we will focus on how it helps reduce packet loss at the interface. PF_RING improves capture performance by bypassing much of the normal Linux networking stack to reduce overhead and by placing captured packets into a ring buffer in memory, allowing NSM applications to read them more efficiently.

Summary

Understanding interface-level packet loss is critical for building reliable Network Security Monitoring deployments. Properly configuring interfaces in promiscuous mode ensures that sensors can see all mirrored traffic, while technologies such as network packet brokers and PF_RING help manage high-volume traffic and prevent drops when interfaces become overwhelmed. By addressing these challenges at the interface layer, NSM engineers can significantly improve packet capture reliability and overall visibility. In the next part of the series, we will examine how packet loss can occur during processing and what techniques can be used to minimize it.


Comments

Popular posts from this blog

Mapping CIS Critical Controls to Gartner Markets

Malware Can Hide But It Must Run

PCAP Doesn't Lie Part 2