IEEE 802.1Q (also known as VLAN Tagging) was a project in the IEEE 802 standards process to develop a mechanism to allow multiple bridged networks to transparently share the same physical network link without leakage of information between networks (i.e. trunking). IEEE 802.1Q is also the name of the standard issued by this process, and in common usage the name of the encapsulation protocol used to implement this mechanism over Ethernet networks.
802.1Q does not actually encapsulate the original frame. Instead, for Ethernet frames using Ethernet II framing, it sets the EtherType value in the Ethernet header to Tag Protocol ID (TPID) 0x8100, identifying this frame as an 802.1Q frame. It then inserts an extra two-bytes of Tag Control Information (TCI) after the TPID, followed by another two bytes containing the frame’s original EtherType. Together the four bytes of TPID and TCI are called the VLAN Tag.
The format of the TCI is
15:13 |
12 |
11:0 |
user_priority |
CFI |
VID |
The User Priority is a 3-bit field storing the priority level for the frame. Use of this field is defined in IEEE 802.1p.
The Canonical format indicator (CFI): a 1-bit indicator that is always set to zero for Ethernet switches. CFI is used for compatibility between Ethernet and Token Ring networks. If a frame received at an Ethernet port has a CFI set to 1, then that frame should not be bridged to an untagged port.
VLAN ID (VID): a 12-bit field specifying the VLAN to which the frame belongs. A value of 0 means that the frame doesn’t belong to any VLAN; in this case the 802.1Q tag specifies only a priority and is referred to as a priority tag. A value of hex FFF is reserved for implementation use. All other values may be used as VLAN identifiers, allowing up to 4094 VLANs. On bridges, VLAN 1 is often reserved for management.
For frames using IEEE 802.2/SNAP encapsulation with an OUI field of 00-00-00 (so that the protocol ID field in the SNAP header is an EtherType), as would be the case on LANs other than Ethernet, the EtherType value in the SNAP header is set to hex 8100 and the aforementioned extra 4 bytes are appended after the SNAP header.
Because inserting this header changes the frame, 802.1Q encapsulation forces a recalculation of the original FCS field in the Ethernet trailer. It also increases the maximum frame size by 4 bytes.
Double-tagging can be useful for Internet Service Providers, allowing them to use VLANs internally while mixing traffic from clients that is already VLAN-tagged. The outer tag comes first, followed by the inner tag. In such cases, an alternate TPID such as hex 9100, or even 9200 or 9300, sometimes may be used for the outer tag; however this is being deprecated by 802.1ad, which specifies 88a8 for service-provider outer tags. Triple-tagging is also possible.
Configuring an IEEE 802.1Q Tunneling Port
Beginning in privileged EXEC mode, follow these steps to configure a port as an IEEE 802.1Q tunnel port:
Example:
Sw3#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
Sw3(config)#vtp mode transparent
Device mode already VTP TRANSPARENT.
Sw3(config)#vlan 666
Sw3(config-vlan)#name Transport-VLAN
Sw3(config-vlan)#exit
Sw3(config)#int range f0/21 – 22
Sw3(config-if-range)#sh
Sw3(config-if-range)#switchport mode dot1q-tunnel
Sw3(config-if-range)#switchport access vlan 666
Sw3(config-if-range)#no sh
Sw3(config-if-range)#exit
Sw3(config)#system mtu 1504
Sw3(config)#int range f0/19 – 20
Sw3(config-if-range)#sw tr en do
Sw3(config-if-range)#sw mo tr
Sw3(config-if-range)#exit
Sw4#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
Sw4(config)#vlan 666
Sw4(config-vlan)#name Transport-VLAN
Sw4(config)#int range f0/19 – 20
Sw4(config-if-range)#sw tr en do
Sw4(config-if-range)#sw mo tr
Sw4(config-if-range)#exit
Sw4(config)#int range f0/21 – 22
Sw4(config-if-range)#sw mo do
Sw4(config-if-range)#sw a vlan 666
Sw4(config-if-range)#exit
Sw4(config)#vtp mode tra
Setting device to VTP TRANSPARENT mode.
Sw4(config)#system mtu 1504
Sw4(config)#do show int trunk
Port Mode Encapsulation Status Native vlan
Fa0/19 on 802.1q trunking 1
Fa0/20 on 802.1q trunking 1
Port Vlans allowed on trunk
Fa0/19 1-4094
Fa0/20 1-4094
Port Vlans allowed and active in management domain
Fa0/19 1,666
Fa0/20 1,666
Port Vlans in spanning tree forwarding state and not pruned
Fa0/19 1,666
Fa0/20 1,666
Sw4(config)#do show int f0/21 sw
Name: Fa0/21
Switchport: Enabled
Administrative Mode: tunnel
Operational Mode: tunnel
Administrative Trunking Encapsulation: negotiate
Operational Trunking Encapsulation: native
Negotiation of Trunking: Off
Access Mode VLAN: 666 (VLAN0666)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
Sw4(config)#
Sw1(config-if)#int po 1
Sw1(config-if)#no sw
Sw1(config-if)#ip add 122.1.78.7 255.255.255.0
Sw1(config-if)#int range f0/21 – 22
Sw1(config-if-range)#no sw
Sw1(config-if-range)#channel-group 1 mode on
Sw2#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
Sw2(config)#int range f0/21 – 22
Sw2(config-if-range)#exit
Sw2(config)#int po1
Sw2(config-if)#no sw
Sw2(config-if)#ip add 122.1.78.8 255.255.255.0
Sw2(config-if)#no sh
Sw2(config-if)#exit
Sw2(config)#int range f0/21 – 22
Sw2(config-if-range)#no sw
Sw2(config-if-range)#channel-group 1 mode on
Verification:
Sw2#ping 122.1.78.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 122.1.78.7, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Sw2#
this is the best blog i have ever gone through. Very very helpful.
I was confused with Vlan tagging and this post was really very helpful.
great.. we found information about TPID n VID
Reblogged this on The CCIE journey and commented:
Good reading