-
Notifications
You must be signed in to change notification settings - Fork 872
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
vn-tag support required for bpf #770
Comments
Here is a packet diagram for the tag. |
"The certificate for docs.pica8.com expired on 06/11/2024." |
The server returns HTTP 404 for the page. Other sources suggest that "VN tag" is an alias for 802.1Qbh, which is a work in progress. It seems best not to do any work on this feature request until there is an example packet capture. |
An early proposal is documented here: https://www.ieee802.org/1/files/public/docs2009/new-pelissier-vntag-seminar-0508.pdf - around page 30 is a packet layout. There are other sources backing each other up on the layout: Pica8 linked above looks like it's moved to https://pica8-fs.atlassian.net/wiki/spaces/PicOS4443beta/pages/115898307/VN-tag They all give the same layout, which is essentially this for a full Ethernet header:
And this for VNTag itself with an EtherType of 0x8926:
Like all layer 2-ish protocols (VLAN, MPLS, etc.) it's entirely likely that VNTag could appear anywhere an EtherType could appear. E.g. it's entirely plausible that you could end up with Ethernet -> VLAN -> VNTag -> VLAN -> IPv4 -> ... VNTag, as an extension of 802.1Q, requires an 802.1Q (VLAN) header after the VNTag header. This makes sense since VNTag 'eats' the EtherType and has no native "next payload type" (EtherType) itself. This creates a syntax headache for handling the VLAN after the VNTag. If we force a user to always write So, we should probably look for
This opens the door for other vntag fields if anyone wants to expose them (although I don't see a request for that in this issue and no one I've talked to is looking for it).
I am planning on working up a PR using the
|
Add a "vntag" keyword similar to the existing "vlan" and "mpls" keywords to filter on VNTag frames. VNTag was proposed as 802.1Qbh but has been replaced in the standards by 802.1Qbr although some vendors are still using VNTag. Because VNTag is always followed by VLAN and the following VLAN has the next EtherType, both the VNTag and VLAN have to be present to match and both have to be skipped in processing. So, this commit also adds an optional `vlan [vlan_id]` after the `vntag` keyword to easily filter on the VLAN ID following the VNTag. Fixes the-tcpdump-group#770
Add a "vntag" keyword similar to the existing "vlan" and "mpls" keywords to filter on VNTag frames. VNTag was proposed as 802.1Qbh but has been replaced in the standards by 802.1Qbr although some vendors are still using VNTag. Because VNTag is always followed by VLAN and the following VLAN has the next EtherType, both the VNTag and VLAN have to be present to match and both have to be skipped in processing. So, this commit also adds an optional `vlan [vlan_id]` after the `vntag` keyword to easily filter on the VLAN ID following the VNTag. Fixes the-tcpdump-group#770
Add a "vntag" keyword similar to the existing "vlan" and "mpls" keywords to filter on VNTag frames. VNTag was proposed as 802.1Qbh but has been replaced in the standards by 802.1Qbr although some vendors are still using VNTag. Because VNTag is always followed by VLAN and the following VLAN has the next EtherType, both the VNTag and VLAN have to be present to match and both have to be skipped in processing. So, this commit also adds an optional `vlan [vlan_id]` after the `vntag` keyword to easily filter on the VLAN ID following the VNTag. Fixes the-tcpdump-group#770
Add a "vntag" keyword similar to the existing "vlan" and "mpls" keywords to filter on VNTag frames. VNTag was proposed as 802.1Qbh but has been replaced in the standards by 802.1Qbr although some vendors are still using VNTag. Because VNTag is always followed by VLAN and the following VLAN has the next EtherType, both the VNTag and VLAN have to be present to match and both have to be skipped in processing. So, this commit also adds an optional `vlan [vlan_id]` after the `vntag` keyword to easily filter on the VLAN ID following the VNTag. Fixes the-tcpdump-group#770
I missed a key piece that VLAN may not be REQUIRED; VNTag is similar to VLAN in that it "splits" the ethernet header between dest addr and EtherType. There's still an EtherType after the VNTag header. That could be the TPID of VLAN or it could be 0x0800 (IPv4) or anything else. All of the VNTag diagrams show VLAN, but it might be better to be explicit in the syntax and require "vntag and vlan and ...". So I was wrong the VLAN is required "because there's no EtherType" - there absolutely is one, and so Here's a better, more accurate, diagram of a VNTag packet:
|
Add a "vntag" keyword similar to the existing "vlan" and "mpls" keywords to filter on VNTag frames. VNTag was proposed as 802.1Qbh but has been replaced in the standards by 802.1Qbr although some vendors are still using VNTag. Skips the 6 bytes of the VNTag header similar to the 4 byte skip of VLAN. They both inject themselves between Ethernet dest addr and EtherType. Fixes the-tcpdump-group#770
Add a "vntag" keyword similar to the existing "vlan" and "mpls" keywords to filter on VNTag frames. VNTag was proposed as 802.1Qbh but has been replaced in the standards by 802.1Qbr although some vendors are still using VNTag. Skips the 6 bytes of the VNTag header similar to the 4 byte skip of VLAN. They both inject themselves between Ethernet dest addr and EtherType. This resolves GitHub issue the-tcpdump-group#770
vn-tag comes after ethernet dst map and before vlan tags.
It's 6 bytes long and there is no easy way to skip it with existing bpf.
It would be good to add a vntag keyword that can skip 6 bytes like vlan skips 4.
The text was updated successfully, but these errors were encountered: