Capturing Ethernet
With the Ethernet (pcap) plugin, a probe on Linux or Windows reads industrial protocols straight off the network – Modbus/TCP, BACnet/IP, NMEA over UDP or anything a custom filter matches. With Modbus/TCP, every telegram becomes a readable frame with sender, receiver and direction.
Where the probe has to listen
The probe only sees traffic that reaches its network card. A normal switch, however, forwards a telegram only to its receiver. Three ways bring the traffic to the probe:
- Mirror port (SPAN) on the switch. A managed switch copies the traffic of one port – say the PLC's – to a second port the probe is plugged into. You set this up in the switch's web interface, usually under “Port Mirroring” or “SPAN”; mirror both directions (Rx and Tx). The probe does not need an IP address in that network. If the mirrored port is very busy, the switch may drop packets on the mirror port.
- Network TAP. A TAP goes into the cable between two devices and passes the traffic to the probe passively. Nothing has to be configured on the switch, and the plant does not notice. An aggregating TAP delivers both directions on one output; a TAP with two outputs (one per direction) needs two network cards and two ports.
- On the device itself. If the probe runs on the computer that talks to the PLC itself (a gateway or SCADA PC running Linux or Windows, for example), it sees that computer's own traffic without extra hardware.
A simple unmanaged switch is not enough: there the probe only sees broadcasts and traffic addressed to itself. Wi-Fi cards often do not support promiscuous mode.
Adding the port
- In the Trace UI, add a port and choose the Ethernet (pcap) plugin.
- Under Network Interface, pick the network card the mirror port or TAP is connected to: on Linux e.g.
eth0; on Windows it is listed under the adapter's description, such as “Intel(R) Ethernet Connection” (not the connection name such as “Ethernet 2”). Leave Promiscuous Mode on – without it, the probe only sees traffic addressed to itself on a mirror port or TAP. - Under Protocol, pick the protocol: Modbus/TCP (TCP port 502), BACnet/IP (UDP 47808–47823), NMEA over UDP (UDP 10110) or Custom filter. Custom filter shows two more fields: Capture Filter for a tcpdump-style filter such as
udp port 5000(must not be empty), and TCP Telegram Framing, which splits TCP streams into telegrams by their length field (Modbus/TCP, TPKT for S7, IEC 60870-5-104 or none). - Choose the interpreter:
- Modbus/TCP: the Modbus/TCP entry from the store. Every telegram becomes a frame, e.g.
10.0.0.5:49152 → 10.0.0.10:502 · unit 1 · Read Holding Registers · start 107 · count 3; connection setup and teardown appear as rows of their own. With the plant's register list (interpreter option Registerliste, labelled in German for now) the row shows names instead of addresses – see Modbus/TCP. - NMEA over UDP: set Output Format to
streamand choose the NMEA 0183 interpreter – the sentences then appear as if from a serial line. - BACnet/IP: the BACnet/IP entry from the store. Every datagram becomes a frame, e.g.
10.47.0.1:47808 → 10.47.0.2:47808 · read-property #1 · analog-value,1 · present-value. With the plant's point list (interpreter option Datenpunktliste (EDE), labelled in German for now) the row shows object names instead of identifiers – see BACnet/IP.
- Modbus/TCP: the Modbus/TCP entry from the store. Every telegram becomes a frame, e.g.
Output Format is set to record: one record per telegram with addresses and direction. stream delivers only the payload like a serial line, split by direction onto two ports – the right choice for NMEA and for serial-over-IP gateways whose protocol already has a serial interpreter. If both sides use the same port (BACnet 47808 ↔ 47808 or NMEA broadcasts, for example), every packet counts as “to the server” and lands on the first port. frame delivers every packet with all its headers – see Inspecting headers.
Inspecting headers
For a custom filter without a matching protocol interpreter, the store has two generic interpreters – depending on what you want to see:
- Who talks to whom: Output Format
recordand the UDP/TCP interpreter. Every datagram and every TCP section becomes a frame with sender, receiver, protocol and length, e.g.10.0.0.5:51000 → 10.0.0.255:5000 · UDP · 42 B; the payload is shown as hex in the details – or, with the option Nutzdaten als Text (payload as text), as text, then also in the frame line, and the search finds words in it. This format does not carry MAC addresses or the IP headers themselves. - All headers: Output Format
frameand the Ethernet interpreter. The probe then passes on every packet exactly as it was on the wire, and the interpreter dissects it like a protocol analyzer: Ethernet with MAC addresses and VLAN tags, ARP, IPv4 (TTL, identification, flags, fragments, options) and IPv6, UDP, TCP (sequence and acknowledgment numbers, flags, window, options) as well as ICMP and ICMPv6. Examples:10.0.0.5:49152 → 10.0.0.10:502 · TCP · SYN · seq 1000 · win 64240orARP · who has 10.0.0.1? tell 10.0.0.5. Withframe, packets without UDP or TCP come through as well, e.g. with the filterarp or icmp or udp.
If you pick one of these interpreters first, the port dialog presets protocol and format; you enter the filter yourself. With frame, Bytes per Frame limits the length per packet (default 1518, a full Ethernet frame); longer packets are cut and marked cut at snaplen. With its headers, every packet costs 30 to 50 bytes more than with record, and every bare TCP acknowledgment comes through as well, so the rate brake kicks in sooner. TCP is not reassembled with frame: every segment is a frame of its own. With frame, payloads above UDP and TCP stay hex – Modbus/TCP and BACnet/IP are decoded by their own interpreters in record format. Checksums are shown, not verified. The frame format needs plugin version 1.2 or later; on the Npcap loopback under Windows, every packet carries a reconstructed Ethernet header with zero MACs.
Permissions
On Linux, capturing needs the CAP_NET_RAW capability. The container probe from the host package already has it, because Docker grants it to every container: there is nothing to set up, and the probe gets no additional rights. libpcap is included in the image. The probe sees the computer's network cards because the host package starts it with network_mode: host; if you run the image yourself in a separate Docker network, it only sees the container's virtual card there.
If you harden the probe and remove capabilities with cap_drop, keep NET_RAW. Without it, adding the port fails with the message needs CAP_NET_RAW or root. A probe running without a container needs root or CAP_NET_RAW and the libpcap0.8 package; without the package, the port reports libpcap is not installed.
Windows: the probe needs Npcap, the capture driver from the Nmap project. Trace does not ship Npcap; you install it once on the probe computer, and it comes with its own license, whose terms you should check for use in a company. Without Npcap, the probe finds no network cards and the port reports Npcap is not installed; after installing it, simply add the port again. If Npcap was installed with the option “Restrict Npcap driver's access to Administrators only”, only programs with administrator rights may capture; otherwise the port reports Npcap is restricted to administrators. Traffic between programs on the same computer, such as to a Modbus simulator on localhost, shows up under the entry “Adapter for loopback traffic capture”.
The browser probe cannot capture, because browsers have no access to network cards.
Limits
- Rate brake: by default, the probe passes on at most 180 kB/s; adjustable under Rate Brake (kB/s), 0 turns it off (not recommended). Anything above is dropped – so a filter set too wide cannot flood the analysis. A typical Modbus plant stays far below.
- Losses are visible: in
recordandframeformat, the interpreters show dropped packets as a redCapture lossframe with their number, and missing pieces of a TCP connection are markedgap before. Withstream, losses only show in the probe log. If the log reports kernel drops, a larger Capture Buffer (KiB) helps. - Encrypted traffic (TLS, VPN) cannot be decoded; fragmented IP packets are not reassembled.
- Concurrent connections: up to 256 TCP connections per port (not relevant for
frame, which reassembles nothing); idle connections are released after five minutes.