L2 Switch forwarding process supporting VLAN

Source: Internet
Author: User

Original web site http://blog.csdn.net/yygydjkthh/article/details/6750399

It is the specific forwarding process of the L2 Switch. The following describes the forwarding process in detail.

First, let's take a look at what tpid means?

Frames in the 802.1Q document of VLAN protocol are embodied in the following data packets:

Here, the blue position is the 802.1Q header, and the specific meaning of each item is:

Tag protocol identifier(TAG protocol identifier, tpid): the value of a group of 16-bit fields is set at 0x8100 to identify a frame of IEEE 802.1Q as labeled, the calibration position of this domain is the same as that of the format/length of the form of B in the unlabeled frame, which is used to distinguish the unlabeled frame.Determine whether the value of this parameter is 0x8100 to determine whether the frame is a VLAN frame.
Priority code(Priority code point, PCP): use a set of three-bit fields as the reference for IEEE 802.1p priority, from 0 (lowest) to 7 (highest ), the priority of data streams.Standard Format indication(Canonical Format Indicator, CFI): 1-bit meta field. If the value of this field is 1, the Mac field is in a non-standard format. If the value is 0, it is in a standard format. In the bitrate switch, the default value is 0. CFI is used as the compatibility between the ethereum and the card ring. If the frame receives data in tlab, the CFI value must be set to 1, and this port cannot be used to bridge with other unlabeled ports.Virtual LAN identifier(VLAN identifier, VID): a 12-bit domain used to specify the specific VLAN to which the frame belongs. If the value is 0, the frame does not belong to any VLAN. In this case, the 802.1Q label indicates the priority. The 16-bit value 0, 1, and 0xfff are reserved values. Other values can be used as identifiers smaller than 4094 VLANs.This field indicates a VLAN.
The value of ID.

Next, let's take a look.Switch table supporting VLANTable items:

When a VLAN switch searches for a switch table, the DMAc + vlanid is used as the keyword to find the corresponding sending port number. Of course, this table can be self-learning like a common switch.

Finally,Other abbreviations:
PVID: when the port receives an untaged data frame, the VLAN in which the frame is exchanged cannot be determined. PVID defines the VLAN in which the frame is exchanged. In a sense, PVID can be understood as the default VLAN of the port.

Taged: If the attribute of a port in a VLAN is tag, the data frame forwarded from the port is taged. (Of course, this data frame is switched in this VLAN) untaged: If a port has an UNTAG attribute in a VLAN, the data frame forwarded from this port is untaged, however, before forwarding, you must add a pvid to the vswitch so that a table can be used to forward packets without taged.

DMAc: Destination MAC address

Vid: virtual area network identifier

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.