802.1Q or dot1q Trunking Protocol Explained

IEEE 802.1Q or dot1Q is a trunking protocol. It provides encapsulation on trunk ports. Trunk ports work with multiple VLANs. They use the trunking protocol to manage VLAN information on Ethernet frames.

All modern Cisco routers and switches use 802.1Q as the default trunking protocol to encapsulate and de-encapsulate VLAN information on Ethernet frames. By default, a switch port works only with a single VLAN. A trunking protocol allows it to work with multiple VLANs.

How 802.1Q trunking protocol works

802.1Q trunking protocol modifies the original Ethernet frame. It inserts a 4-byte field called a tag field, into the header of the original Ethernet frame, and recomputes the original frame’s FCS (checksum) based on this change.

dot1q tag

In this tag, the first 2 bytes are the protocol identifier. For example, an Ethernet frame will use a value 0x8100 to indicate that this is an Ethernet-tagged frame.

The next 3 bits prioritize the frame. This method is defined in the IEEE 802.1p standard.

The fourth bit is used in Token Ring environment.

The last 12 bits are used for the VLAN identifier (number).

Advantages of 802.1Q

Since it adds only 4 bytes to the frame, the frame size does not exceed 1518 bytes. A frame of less than 1518 bytes can be sent from any normal port. You do not need a FastEthernet or GigabitEtherent port to forward an 802.1Q frame. You can use any normal Ethernet port to forward it.

It is a IEEE standarnd. It allows you to create trunks between different vendors’ devices. Therefore, you can implement a multivendor trunking solution without having to worry about whether or not a specific type of trunk connection is or is not supported.

On the sending device, it inserts a tag into the frames' header. On the receiving device, it uses the VLAN ID stored in the tag to identify the VLAN the frame belongs to. It removes the tag from frames before forwarding them from the VLAN ports they belong.

Let us take an example.

The following image shows a network. This network has two ethernet switches with VLAN configuration. Both are connected through a trunk link. Trunk ports on both switches are using the 802.1Q trunking protocol. Both have end devices from VLAN-10.

dot1q tagging example

PC-A sends a broadcast message. The broadcast message reaches the S1 switch's F0/1 port. The S1 switch checks the configured VLAN on the F0/1 port. VLAN-10 is configured on the F0/1 port. S1 forwards the broadcast message from all ports that belong to VLAN-10. A trunk port belongs to all VLANs. It forwards frames of all VLANs to the device connected on the other end of the trunk link. It inserts a tag into all frames before forwarding them.

In this example, S2 is connected to the other end of the trunk link. It receives encapsulated frames from S1 and reads the tag field of each frame to know its VLAN. After reading VLAN information from each frame, it removes the tag from the frame and forwards it from the ports that belong to the frame's VLAN. For example, if the frame belongs to VLAN-10, it forwards the frame from ports that belong to VLAN-10.

Key points: -

  • 802.1Q is an IEEE protocol.
  • 802.1Q works on all routers and switches.
  • 802.1Q works with all types of Ethernet links.
  • 802.1Q inserts a 4-byte tag field into the frame's header.
  • 802.1Q functions at the data-link layer of the OSI model.
  • 802.1Q is the default encapsulation protocol for VLANs on all Cisco devices.

ComputerNetworkingNotes CCNA Study Guide 802.1Q or dot1q Trunking Protocol Explained