1. First checks
- The driver is optional: it is part of the engine only if it was built with the CMake option
INCLUDE_SNIFFER. It needs the capture library at run time — Npcap on Windows (installer shipped with the sources:npcap-1.84.exe),libpcapon Linux (sudo apt install libpcap0.8). - Start the engine and read the start-up report. The driver prints
SnifferDriverDriver: Stream '<name>' Adapters listfollowed by one line per capture adapter (its exact name, then the description and IPv4 addresses). The"adapter"value must be one of those names, character for character — for example\\Device\\NPF_{GUID}(backslashes doubled in JSON) or\\Device\\NPF_Loopbackfor traffic between programs on the same PC. - Check the line
SnifferDriverDriver: Stream '<name>' Open with '<type>' adapter type(for exampleEN10MB= Ethernet). If it is missing, the adapter was not opened — look for Failed to open adapter. - Check the block counters of the input block in DIPanel or System Layout:
msgCounterrising = packets match and are decoded;errCounterrising = size / header mismatch (section 3). - Start with open settings to prove the capture works:
localIP/remoteIPempty,localPort/remotePort0,sourceanddestination"both"(the defaults). Then narrow down (section 4). - Set input blocks to
"framePerMS": -1(see the note onframePerMS).
2. Message reference
The messages of this driver begin with SnifferDriverDriver: (this spelling is the one in the code). <name> is the stream name.
| Message | Cause | What to do |
|---|---|---|
SnifferDriverDriver: Stream '<name>' Adapters list + lines <adapter name> <description> IPv4: <ip> (info) | Printed once when the driver is created: all adapters that the capture library can open. | Copy the adapter name into "adapter". If the list is empty or only a few adapters appear, Npcap is installed without the needed support, or the process has no right to list adapters (section 5). |
pcap_findalldevs failed: <text> (exception at driver creation) | The capture library could not list the adapters — the Npcap driver / service is not running, or libpcap has no permission. | Install or repair Npcap, check that the "Npcap Packet Driver (NPF)" service is running (sc query npcap); on Linux run with CAP_NET_RAW or as root. |
SnifferDriverDriver: Stream '<name>' Failed to open adapter<library text> (error) | The adapter name does not exist, the adapter is gone, or the process has no right to capture. The second line is the text of the capture library. | Use the exact name from the list. On Windows run once as administrator, or reinstall Npcap without the "restrict to administrators" option. Linux: run as root or give the binary sudo setcap cap_net_raw,cap_net_admin=eip. |
SnifferDriverDriver: Stream '<name>' Open with '<type>' adapter type (info) | The adapter was opened (promiscuous mode, 65536 byte snap length, non-blocking). <type> is the link type, e.g. EN10MB (Ethernet) or NULL (loopback). | Normal. |
SnifferDriverDriver: Stream '<name>' capture with filter + '<filter>' (info) | The capture filter text built from filter, the IP / port fields and source / destination compiled correctly. | Read the printed filter to see what the driver built from your fields. |
SnifferDriverDriver: Stream '<name>' invalid filter '<filter>' + library text (error) | The text in filter is not valid pcap filter syntax (or a combination with the IP / port fields that is invalid). | Fix the syntax (pcap-filter), e.g. udp, udp port 3021, host 10.0.0.5 and not port 22. Test the same text in Wireshark's capture-filter box. |
SnifferDriverDriver: Stream '<name>' adapter not opened | The filter was compiled before the adapter was opened. | Fix the Failed to open adapter error first. |
SnifferDriverDriver: Stream '<name>' invalid source: can be only 'local' / 'remote' / 'both' or nothing (default both). using default 'both'... invalid destination: ... | The value of source / destination is not one of the three words (case does not matter). | Use "local", "remote" or "both". |
Packet: <src ip>:<port> -> <dst ip>:<port> protocol=<n> (info) | Printed for every UDP packet that the adapter delivers to the driver, before the IP / port / direction match is applied. | Useful for finding the real addresses. On a busy network it floods the report window and costs CPU; use a narrow filter or capture on a quiet link. |
SnifferDriverDriver: Stream '<name>' Adapter not open (error, on receive or send) | A read or write was done while the adapter handle is not open. | Fix the open error; restart the engine. |
SnifferDriverDriver: Stream '<name>' Send failed + library text (error) | Sending a raw frame with an output block failed (frame too large, adapter down, adapter does not allow injection). | An output block of this driver must contain a complete Ethernet frame (destination MAC, source MAC, type, payload), up to the MTU. Check the size and the adapter state. |
Streams: '<name>' block '<block>' header '<hex>' size <N> mismatched with received <M> (UDP payload)Streams: '<name>' Unknown header ..., Streams: '<name>' message size mismatched ... Unknown header '<hex>' length <N> | The payload of the captured packet does not fit the block definitions. The same messages as in the UDP / TCP stream, because the sniffer feeds payloads to the same code. | See section 3 and the socket drivers page. |
The status shown for the driver is Driver not initialized when the adapter handle is not open.
3. Payload size mismatch
The driver strips the Ethernet / IP / UDP-or-TCP headers and gives only the payload to the block logic. The block must describe the payload, not the frame: the first block byte is the first byte after the UDP / TCP header.
UDP payloads are matched against the block sizes and headerMarkers (one packet = one message); TCP payloads are cut into blocks like a byte stream. See the socket drivers page for the exact behaviour of the messages.
| Cause | How to recognize it | Fix |
|---|---|---|
| Block described with the Ethernet / IP header included. | The mismatch is always off by 42 (Ethernet + IP + UDP) or 54 (with TCP) bytes, and the printed header is the sender's real data. | Describe only the application payload. |
| Packets bigger than the 10240-byte read buffer: the driver reads a packet into a 10 KB buffer and copies the part that fits. | Only large packets mismatch. On Windows, packets sent by this same PC can be captured as one big segment (up to 64 KB) because of checksum / large-send offload. | Capture the receiving side instead, or disable large-send offload on the NIC (Disable-NetAdapterLso). |
| TCP segments out of order, retransmitted or duplicated (packet loss on the sniffed link). | "Unknown header" from the TCP logic with small varying N. | The sniffer does not re-assemble TCP; it sees segments in capture order. Fix the link loss; use a mirror port / tap that does not drop frames. |
| Packets dropped by the capture itself (the engine reads too slowly). | Random mismatches or missing messages, worse at high packet rates. | One packet is taken per read of the stream, so keep "framePerMS": -1 and a fast minor frame, and reduce the traffic with a narrow filter, IPs and ports. |
Wrong or missing headerMarker / block size (same as for the socket drivers). | Unknown header, constant N. | Compare with a Wireshark capture of the same packet. |
| Several input blocks in the stream. | Counters rise faster than the packets (the sniffer code calls the upload once per input block for every packet). | If counters look multiplied by the number of blocks, use a single input block with a headerMarker per message layout as a work-around, and report it. |
4. Filtering: filter, IP / port, source and destination
- Fields that select packets:
remoteIP/remotePortandlocalIP/localPort(empty IP or port 0 = any), andsource/destination. A packet is accepted only if both its source and its destination match: its source must match the side(s) named bysource(local,remoteorboth) and its destination must match the side(s) named bydestination. - To capture what a remote device sends to this PC use
"source": "remote","destination": "local". For the opposite direction use"source": "local","destination": "remote". The defaultboth / bothaccepts packets in either direction. - The documented example with
"source": "remote"and"destination": "remote"only matches packets whose source and destination both equal the remote address — this is right for the loopback adapter, where both ends are127.0.0.1, and wrong for traffic between two machines. Useremote/localthere. - The
filtertext: in the current source the filter built fromfilter, IPs, ports,sourceanddestinationis compiled and checked (you see capture with filter or invalid filter), but it is not attached to the adapter; the same IP / port / direction conditions are applied by the driver in software after the packet was read. Two consequences: afiltersuch as"udp"does not remove other packets (non-UDP / non-TCP packets are ignored anyway), and the engine still receives every packet of the adapter, which costs CPU on a busy network. - The packet protocol is taken from the packet itself: only UDP and TCP payloads are handed to the blocks; ICMP, ARP, IPv6 neighbour traffic etc. are ignored.
- Packets shorter than 14 bytes (shorter than an Ethernet header) are ignored.
5. Other problems
| Symptom | Cause | Fix |
|---|---|---|
Engine does not start / wpcap.dll or Packet.dll missing (Windows), libpcap not found (Linux) | The capture runtime is not installed (the engine was built with INCLUDE_SNIFFER). | Install Npcap (tick the WinPcap-API-compatible mode if the installer offers it) or libpcap; reboot if the installer asks. |
The driver name SnifferDriver is unknown | The engine was built without INCLUDE_SNIFFER (the option is OFF by default). | Rebuild with -DINCLUDE_SNIFFER=ON. |
| Adapters list is empty or lacks the loopback adapter | Npcap is not installed, installed in "administrator only" mode, or without loopback support. | Reinstall Npcap; the loopback adapter appears as \Device\NPF_Loopback. Run the engine as administrator for the test. |
| Nothing is captured, though Wireshark on the same PC shows the packets | Adapter name differs (several adapters), or the IP / port / direction fields do not match (see section 4), or the packets are not UDP / TCP. | Clear all IP / port fields and use both / both to see what arrives, then narrow. |
| Traffic between two other devices is not seen | On a switched network a NIC only receives traffic addressed to it (and broadcasts). | Use a mirror / SPAN port or a network tap, or put the PC in the path (bridge). Promiscuous mode alone is not enough on a switch. Wi-Fi adapters usually do not deliver other devices' frames. |
| Traffic between two programs on this PC is not seen on the Ethernet adapter | Local traffic does not leave through the NIC. | Capture on the loopback adapter (\Device\NPF_Loopback on Windows, lo on Linux). |
| The sniffer sees the packets but the UDP / TCP stream of the engine does not | The capture library sees the frame before the Windows firewall filters it, so a blocked port is invisible to the sniffer and still blocked for the program. | Add the inbound firewall rule — see the socket drivers page. |
Report window is flooded with Packet: ... protocol=17 | The line is printed for every UDP packet on the adapter. | Capture on a quiet adapter / use a mirror port that carries only the link of interest. |
| High CPU load | Promiscuous capture of a busy link, and every packet is parsed. | Capture on a dedicated NIC with only the target traffic. |
| Capture stops after the adapter is unplugged or disabled | The capture handle becomes invalid; a read error is not reported by a message. | Reset the engine after the adapter is back. |
| Messages in the VLAN-tagged or tunnelled (VPN, VXLAN) traffic do not decode | The IP layer is behind an extra header, or the adapter is a virtual one with another link type (see the Open with '<type>' adapter type line). | Capture on the physical adapter, or on the one that carries the plain IP packet. |