Data
Some Cloudshark captures show a "Trailer" for the vLAN and some do not.
Captures
Question
Why do some and not all VLAN Wireshark captures include data after the IPv4 payload?
Some Cloudshark captures show a "Trailer" for the vLAN and some do not.
Captures
Why do some and not all VLAN Wireshark captures include data after the IPv4 payload?
How do I accurately predict the size of IPv4 packets with vLAN tags from reading the header?
IPv4 packets do not have VLAN tags in the header. Only the ethernet frame (layer-2) header will have VLAN tags. An IPv4 packet (layer-3) is the payload of the frame, and the IPv4 packet header will not know anything about what is in the frame header. These are two separate layers in the network, and IPv4 can be carried by any number of layer-2 protocols, while remaining blissfully ignorant of the layer-2 protocol used.
If you want to know the size of the IPv4 packet, you can look in the IPv4 packet header for the Total Length field (third and fourth octets of the IPv4 header).
See https://wiki.wireshark.org/Ethernet and https://wiki.wireshark.org/VLAN
If the type/length field is:
So if the type/length field is 0x8100 then the Ethernet frame includes a VLAN tag following the type/length field. Skip 2 bytes, and look at the next 2 bytes as a type. For IPv4, that will be 0x0800, and your IPv4 data packet starts immediately following that.