802.1Q packet format

Created: Oct 25, 2019 14:00:15Latest reply: Oct 25, 2019 14:03:37 73 1 0 0
  Rewarded Hi-coins: 0 (problem resolved)

What is the message about the IEEE802.1Q standard?

  • x
  • convention:

Featured Answers
wissal
MVE Created Oct 25, 2019 14:03:37 Helpful(0) Helpful(0)

Hello,
Please find below the answer for your question

IEEE 802.1Q Frame Format

Introduction

This document describes VLAN frame format and QinQ packet encapsulation format.

VLAN Frame Format

A switch identifies packets from different VLANs according to the information contained in its VLAN tags. IEEE 802.1Q adds a 4-byte VLAN tag between the Source/Destination MAC address and Length/Type fields of an Ethernet frame to identify the VLAN to which the frame belongs. Figure 1-1 shows the position of a VLAN tag in a VLAN data frame.

Figure 1-1 IEEE 802.1Q frame format
imgDownload?uuid=e293a66aa668456881268c0

The following are the two types of Ethernet frames in a VLAN:

  • Tagged frame: frame with a 4-byte VLAN tag

  • Untagged frame: frame without a 4-byte VLAN tag

There are two main types of Ethernet links: access links (transmit untagged frames) and trunk links (transmit tagged frames). The two link types differ in the number of VLANs they can carry traffic for: an access link can carry traffic for only one VLAN, and therefore usually connects a switch to a user terminal, such as a host, a server, or an unmanaged switch; a trunk link can carry traffic for multiple VLANs, and as such usually connects a switch to another switch or a router. The frames transmitted on an access link are untagged frames, and the frames transmitted on a trunk link are tagged frames.

All frames processed on a switch carry VLAN tags. After receiving an untagged frame from a user terminal, the switch adds a VLAN tag to the frame, recalculates the frame check sequence (FCS), and then transmits the frame through a trunk link. Before sending the frame to a user terminal, the switch removes the VLAN tag, and sends the untagged frame to the terminal through an access link.

A VLAN tag contains four fields. Table 1 describes the fields.

Table 1-1 Fields in a VLAN tag

Field

Length

Description

Value

TPID

2 bytes

Tag Protocol Identifier (TPID), indicating the frame type.

The value 0x8100 indicates an IEEE 802.1Q frame. An 802.1Q-incapable device discards 802.1Q frames.

Device vendors can define their own TPID values, and users can then change the value to realize interconnection of devices from different vendors.

PRI

3 bits

Priority (PRI), indicating the 802.1p priority of a frame.

The value is in the range from 0 to 7. A larger value indicates a higher priority. If congestion occurs, the switch sends packets with the highest priority first.

CFI

1 bit

Canonical Format Indicator (CFI), indicating whether a MAC address is encapsulated in canonical format over different transmission media. CFI is used to ensure compatibility between Ethernet and token ring networks.

The value 0 indicates that the MAC address is encapsulated in canonical format, and the value 1 indicates that the MAC address is encapsulated in non-canonical format. The CFI field has a fixed value of 0 on Ethernet networks.

VID

12 bits

VLAN ID (VID), indicating the VLAN to which a frame belongs.

The VLAN ID is in the range from 0 to 4095. The values 0 and 4095 are reserved, and therefore available VLAN IDs are in the range from 1 to 4094.

QinQ Packet Encapsulation Format

However, because the 12-bit VLAN tag field defined in IEEE 802.1Q identifies a maximum of 4096 VLANs, the number of users that 802.1Q VLANs can identify and isolate on metro Ethernet networks (MANs) is insufficient. To address this issue, QinQ is developed to expand VLAN space beyond 4096 VLANs so that a larger number of users can be identified on MANs. QinQ is developed to expand VLAN space by adding an additional 802.1Q tag to an 802.1Q packet. This increases the number of VLANs to 4094 x 4094.

The switch forwards packets over a public network according to the outer VLAN tag carried in the packets, and learns MAC addresses from the outer VLAN tag. The inner VLAN tag in the packets is forwarded as payload of the packets. QinQ is applied in scenarios other than simply to expand VLAN space. For example, because the inner and outer VLAN tags can be used to differentiate packets based on users and services, the inner tag can represent a user and the outer tag can represent a service.

Figure 1-2 802.1Q encapsulation and QinQ encapsulation
imgDownload?uuid=34a751ae8a474b66a4cd170

Frame Size

The maximum frame length allowed by each interface on a carrier network should be at least 1504 bytes to accommodate the additional length of QinQ packets compared with 802.1Q packets. By default, the maximum frame length allowed on a switch is larger than 1504 bytes and so does not require modification.

TPID

Different carriers may use different TPID values in outer VLAN tags of QinQ frames. To ensure that QinQ frames sent from a Huawei device can be transmitted across a carrier network, set the TPID value to that used by the carrier. Table 1-2 provides some of the common protocol types and their TPID values, which should not be used in such cases.

Table 1-2 Protocol types and values

Value

Protocol Type

0x0806

ARP

0x8035

RARP

0x0800

IP

0x86DD

IPv6

0x8863/0x8864

PPPoE

0x8847/0x8848

MPLS

0x8137

IPX/SPX

0x8809

LACP

0x888E

802.1x

0x88A7

HGMP

0xFFFD/0xFFFE/0xFFFF

Reserved



Thanks
  • x
  • convention:

Telecommunications%20engineer%2C%20currently%20senior%20project%20manager%20at%20an%20operator%2C%20partner%20of%20Huawei%2C%20in%20the%20radio%20access%20network%20department%2C%20for%2020%20years%20I%20managed%20several%20types%20of%20projects%2C%20for%20the%20different%20nodes%20of%20the%20network.
All Answers
wissal
wissal MVE Created Oct 25, 2019 14:03:37 Helpful(0) Helpful(0)

Hello,
Please find below the answer for your question

IEEE 802.1Q Frame Format

Introduction

This document describes VLAN frame format and QinQ packet encapsulation format.

VLAN Frame Format

A switch identifies packets from different VLANs according to the information contained in its VLAN tags. IEEE 802.1Q adds a 4-byte VLAN tag between the Source/Destination MAC address and Length/Type fields of an Ethernet frame to identify the VLAN to which the frame belongs. Figure 1-1 shows the position of a VLAN tag in a VLAN data frame.

Figure 1-1 IEEE 802.1Q frame format
imgDownload?uuid=e293a66aa668456881268c0

The following are the two types of Ethernet frames in a VLAN:

  • Tagged frame: frame with a 4-byte VLAN tag

  • Untagged frame: frame without a 4-byte VLAN tag

There are two main types of Ethernet links: access links (transmit untagged frames) and trunk links (transmit tagged frames). The two link types differ in the number of VLANs they can carry traffic for: an access link can carry traffic for only one VLAN, and therefore usually connects a switch to a user terminal, such as a host, a server, or an unmanaged switch; a trunk link can carry traffic for multiple VLANs, and as such usually connects a switch to another switch or a router. The frames transmitted on an access link are untagged frames, and the frames transmitted on a trunk link are tagged frames.

All frames processed on a switch carry VLAN tags. After receiving an untagged frame from a user terminal, the switch adds a VLAN tag to the frame, recalculates the frame check sequence (FCS), and then transmits the frame through a trunk link. Before sending the frame to a user terminal, the switch removes the VLAN tag, and sends the untagged frame to the terminal through an access link.

A VLAN tag contains four fields. Table 1 describes the fields.

Table 1-1 Fields in a VLAN tag

Field

Length

Description

Value

TPID

2 bytes

Tag Protocol Identifier (TPID), indicating the frame type.

The value 0x8100 indicates an IEEE 802.1Q frame. An 802.1Q-incapable device discards 802.1Q frames.

Device vendors can define their own TPID values, and users can then change the value to realize interconnection of devices from different vendors.

PRI

3 bits

Priority (PRI), indicating the 802.1p priority of a frame.

The value is in the range from 0 to 7. A larger value indicates a higher priority. If congestion occurs, the switch sends packets with the highest priority first.

CFI

1 bit

Canonical Format Indicator (CFI), indicating whether a MAC address is encapsulated in canonical format over different transmission media. CFI is used to ensure compatibility between Ethernet and token ring networks.

The value 0 indicates that the MAC address is encapsulated in canonical format, and the value 1 indicates that the MAC address is encapsulated in non-canonical format. The CFI field has a fixed value of 0 on Ethernet networks.

VID

12 bits

VLAN ID (VID), indicating the VLAN to which a frame belongs.

The VLAN ID is in the range from 0 to 4095. The values 0 and 4095 are reserved, and therefore available VLAN IDs are in the range from 1 to 4094.

QinQ Packet Encapsulation Format

However, because the 12-bit VLAN tag field defined in IEEE 802.1Q identifies a maximum of 4096 VLANs, the number of users that 802.1Q VLANs can identify and isolate on metro Ethernet networks (MANs) is insufficient. To address this issue, QinQ is developed to expand VLAN space beyond 4096 VLANs so that a larger number of users can be identified on MANs. QinQ is developed to expand VLAN space by adding an additional 802.1Q tag to an 802.1Q packet. This increases the number of VLANs to 4094 x 4094.

The switch forwards packets over a public network according to the outer VLAN tag carried in the packets, and learns MAC addresses from the outer VLAN tag. The inner VLAN tag in the packets is forwarded as payload of the packets. QinQ is applied in scenarios other than simply to expand VLAN space. For example, because the inner and outer VLAN tags can be used to differentiate packets based on users and services, the inner tag can represent a user and the outer tag can represent a service.

Figure 1-2 802.1Q encapsulation and QinQ encapsulation
imgDownload?uuid=34a751ae8a474b66a4cd170

Frame Size

The maximum frame length allowed by each interface on a carrier network should be at least 1504 bytes to accommodate the additional length of QinQ packets compared with 802.1Q packets. By default, the maximum frame length allowed on a switch is larger than 1504 bytes and so does not require modification.

TPID

Different carriers may use different TPID values in outer VLAN tags of QinQ frames. To ensure that QinQ frames sent from a Huawei device can be transmitted across a carrier network, set the TPID value to that used by the carrier. Table 1-2 provides some of the common protocol types and their TPID values, which should not be used in such cases.

Table 1-2 Protocol types and values

Value

Protocol Type

0x0806

ARP

0x8035

RARP

0x0800

IP

0x86DD

IPv6

0x8863/0x8864

PPPoE

0x8847/0x8848

MPLS

0x8137

IPX/SPX

0x8809

LACP

0x888E

802.1x

0x88A7

HGMP

0xFFFD/0xFFFE/0xFFFF

Reserved



Thanks
  • x
  • convention:

Telecommunications%20engineer%2C%20currently%20senior%20project%20manager%20at%20an%20operator%2C%20partner%20of%20Huawei%2C%20in%20the%20radio%20access%20network%20department%2C%20for%2020%20years%20I%20managed%20several%20types%20of%20projects%2C%20for%20the%20different%20nodes%20of%20the%20network.

Comment

Reply
You need to log in to reply to the post Login | Register

Notice Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " Privacy."
If the attachment button is not available, update the Adobe Flash Player to the latest version!
Login and enjoy all the member benefits

Login and enjoy all the member benefits

Login