

Normally this helps, but when you’re capturing packets this commonly hurts. Higher-end network cards include additional features that handle some of the packet processing on the card itself rather than depending on the main processor to do it all. The “Hardware offload” features on the capture port screw up the capture.The switch has no choice but to discard some of the traffic. When the switch is asked to copy all this traffic out the mirror port, it can’t – you can’t stuff 2Gb/s out through a 1Gb/s mirror port. The monitored port on a gigabit switch could have as much as 1Gb/s flowing outbound and have 1Gb/s coming inbound.That’s why a heavily loaded switch may not send everything through to the mirror port.

The first priority is to send packets to their original destination sending a copy of these to the mirror port is definitely a secondary goal. When this happens, the switch has to decide how it will use its (limited) processor. Depending on where you do your capture, this may have the effect of only capturing the packets in a single direction. If your outbound traffic heads out to one ISP, but the response packets come back through another, a given switch may only see one side of the conversation.
#Packet sniffer upgrade#
In order to capture traffic, upgrade the switch where you need mirroring to be a managed switch (most will include port mirroring, but check the specs for a reference to “mirror”, “span”, or “copy”.) Unmanaged switches cannot do this – they lack the management interface needed to configure mirroring.Once configured, we place an Ethernet cable from that specific port to the capture port on our Zeek sensor – the red line in the diagram above – and now we get to see all of the traffic to and from the monitored port. You have to configure this in the management interface on the switch. To get around that, managed switches will commonly allow you to set one of the ports as a mirror¹ port which gets all packets heading to or from one of the other ports (called the monitored port).That means we can’t take a capture program, plug it into any port on a switch, and see the traffic for everyone else too.

By default, a device plugged into a switch only gets the packets destined for that device (along with multicast and broadcast packets).
#Packet sniffer software#
While we may occasionally refer to Zeek in our “potential fixes” section, the general concepts and approaches we discuss should apply to any packet capture software running on any platform.
#Packet sniffer code#
In our example we’re running Zeek ( source code ), an open source packet capture and analysis program that runs on Linux and MacOS. In this blog we’ll look at what it is, why it exists, and what you can do to minimize it. Packet loss is a topic that comes up frequently when talking about capturing and analyzing packets from a network. When I run a sniffer on a network, I assume I’m going to see all packets on that network.
