So now, guys.
Next thing that we should study in order to understand Vlan tagging is the Vlan tagged ethernet header
format.
So you can see in this diagram the following is a normal ethernet header.
Right.
So we already know that ethernet header comprises of eight bit field of preamble six byte field of destination
address, six byte field of source address and two byte field of type.
Then the rest of the data in the Ethernet header is the payload followed by four bytes of checksum.
Right.
Now, whenever a frame, a frame means a packet at the data link layer is called frame.
So whenever a frame enters an L2 switch through an interface which is actually operating in an access
mode, then that frame gets tagged with a Vlan ID, it means that in the Ethernet header of the frame
L2 switch inserts an additional header called 802.1 q vlan header.
So you can see that this header is actually four bytes long.
So you can see that this header is actually four bytes long and it is inserted in the ethernet header
of a frame after the source address field.
So this special header is called 802.1 q vlan header.
Right.
So when this header is inserted into the ethernet header of a frame, we say that ethernet header gets
tagged with the vlan ID.
And now the question is who does the Vlan tagging or tagging?
The answer is L2 switches.
As I have already said that whenever the frame enters into an L2 switch or it exits the L2 switch,
the L2 switch actually tags or tags the frame with 802.1 q vlan header.
We will going to discuss this in detail in the coming slides.
Now let us try to expand this 802.1 q vlan header and see what are the other fields which are part of
this Vlan header.
So we can see that 802.1 q vlan header actually comprises of four fields.
The first field is called tag protocol identifier, which has a fixed value of 8100.
Right.
So when this value is 8100, it means that this Ethernet header has been tagged with the 802.1 Vlan
header.
So 8100 is actually the identifier of 802.1 Q protocol.
The next field is a three bit field which is actually used for quality of service.
So the discussion of this field is out of context here.
The CFI field, which is a one bit field, is not used anymore and the rest of the 12 bits field are
actually used to represent a Vlan ID.
Now since Vlan ID is made up of 12 bits, so the maximum number of Vlan ID that can be used is 4095.
And please take a note of the notation here.
The capital B means bytes and the small B means bits.
So whenever a frame enters into an L2 switch or it leaves an L2 switch, it gets tagged or untagged
with 802.1 header.
So when frame gets tagged or untagged, the last field of the frame that is checksum is recalculated
again.
So only Ethernet header is tagged or untagged when frame moves across the switch boundaries.
No change in any other header of the frame happens.
That is the IP header, transport header or application header.
If present in a frame, they stay untouched.
The 802.1 q vlan header is either inserted or removed from the ethernet header of the frame as the frame
moves across L2 switch boundaries.
So now next we will going to discuss the rules that when the L2 switch decides to tag a frame with 802.1
q vlan header and when l2 switch decides to untag the 802.1 q vlan header from the ethernet header of
a frame.