
In other words, you only get back a 1 when both binary values being compared are 1s. When comparing 2 binary numbers with AND, you should know that 0 AND 0 returns 0, 0 AND 1 returns 0, 1 AND 0 returns 0, and 1 AND 1 returns 1. The ToS byte includes 6 bits for the differentiated services code point per RFC2474 and 2 bits for explicit congestion notification, per RFC3168. If you check out RFC791, the second byte of the IP packet is the Type of Service (ToS) byte. Instead, we’ve selected ip, referring to the second byte (offset of 1). If we’d had ip, we’d be interested in the first byte (no offset). Here, we’ve identified the protocol as IP, with an offset of 1. In the PCAP filter language, the bit in brackets defines which part of the protocol you’re interested in.

Capture filters are less intuitive, as they are cryptic when compared to display filters. Capture filters use a syntax of byte offsets, hex values, and masks coupled with booleans to filter. Display filters aren’t that hard to write once you’ve created a few.

Display filters use a syntax of boolean operators and fields that intuitively describe what you’re filtering on. Display filters are used when you’ve captured everything, but need to cut through the noise to analyze specific packets or flows.Ĭapture filters and display filters are created using different syntaxes. Capture filters only keep copies of packets that match the filter. In Wireshark, there are capture filters and display filters.
