-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't filter vlan and geneve packet #1279
Comments
Does |
The error is below:
Seems that filter isn't supported by bpf.
In addition, I run
The M[0] and M[1] are not initialized to 0? |
I understand the problem is that the filter does not match any packets. If you run the same command without the filter, does it capture any packets? Does it capture the packets you are looking for? Does the problem reproduce with the latest stable versions of tcpdump and libpcap? |
If you use |
I use |
Thank you for confirming. One more question: if you run the following, do you see the packet?
|
I can get the packet using the above command.
|
Thank you. The problem reproduces during the live capture only, that's why offline GENEVE tests do not fail. This also involves Linux VLANs, but matching a UDP port after the VLAN header works correctly, so the root cause looks related to the combination of VLAN and GENEVE. Can you retry the last test using libcpap 1.10.4 and the master branch? |
I compile a tcpdump command using the master branch for libpcap and tcpdump. The same problem as before.
|
There are, I suspect, two problems here.
That's the first one - the compiler is producing code that the kernel rejects, returning an EINVAL error. The second problem may be that libpcap then just uses that filter in userland, but that won't work, because, thanks to Linux's filtering code receiving packets with VLAN tags removed and put into metadata, different filtering code needs to be used in the kernel than in userland. The resulting filter probably won't work in userland unless it's done before libpcap inserts the VLAN tag back into the packet data, with the userland (classic) BPF interpreter supporting the special Linux BPF loads that fetch metadata. |
Yeah, the code generator is broken for this case. |
Thank you for your analysis, whether there are some workarounds to avoid the issue? |
If there's a way to disable Linux's "pull the VLAN tag out" stuff, that might work, but I'm not sure there's a way to do that. This is the result of the BPF compiler code code to handle VLANs in the Linux live capture case using a mechanism that's also used by the BPF compiler code to handle Geneve, and their uses of that mechanism step on top of each other. This will take some detangling.... |
Thanks, Currently we may only parse geneve messages layer by layer without using the geneve keyword. |
A long time ago, somebody (Dave Mills?) came up with the term "Christmas tree packet": https://en.wikipedia.org/wiki/Christmas_tree_packet referring "a packet with every single option set for whatever protocol is in use." I'd like to see somebody construct a "skyscraper packet" or a "Jenga packet": https://en.wikipedia.org/wiki/Jenga with every possible type of tunneling/encapsulation in it - VLAN, MPLS, Geneva, VXLAN, GRE, etc., etc., etc.. |
Even if a Jenga packet always uses every type of header exactly once, quite a few protocols can encapsulate each other many different ways around. Then, given a set of allowed protocols and a matrix of how they may combine, calculating the number of different possible valid Jenga packet varieties would be a matter of a practicable combinatoric exercise. If this number does not yet have a name, let's call it a Harris number. The Harris number for various parts of the Internet, or for the same parts on different years, would be different. However measured, most of the time the value is a non-decreasing function, and each time it increases it almost certainly attracts comments from network protocol analyser developers. On the subject matter, if the same problem stands for |
We want to capture the packets including vlan 1264 and geneve. for example:
We filter the packets using
ovs-tcpdump -i Bond1 -nnevv "(vlan 1264) and geneve"
, but it is failed. I check the related document. From the document's description, I think the above command isn't supported. So I want to know whether there are some filters expressions to support the situation.The text was updated successfully, but these errors were encountered: