Ethernet encapsulation and VLAN encapsulation type

Source: Internet
Author: User
Tags dsap

The following are various packages:

 

  1. Ethernet II encapsulation:

Ethernet technology is based on Ethernet frames, also known as standard Ethernet frames (ARPA), that is, Ethernet II frames (originally known as DIX, the initials of the three launch companies Intel and Xerox are combined ). The frame format is as follows:

 

Figure 1: Ethernet II packet format

 

The fields in the Ethernet II frame are described as follows:

· Preamble-also called "Syncword" for synchronization. (10101010 here)

· Des-MAC-the destination address can be a broadcast address 0 xffffffffff, a specific 48-bit Unicast address based on the MAC address of the target node, or a multicast address. This MAC address can be found in the source address field of the message during protocol synchronization.

· Sou-MAC-the source address is the 48-bit MAC address of the sender.

· Type-that is, "Ethernet Type". This field is used to identify upper-layer protocols. (See the following for details)

· Payload-load, that is, Data, contains encapsulated data (such as IP groups ). Valid Data Length range of Ethernet II is 46 ~ 1500 bytes.

· FCS-this field contains a 32-bit Cyclic Redundancy Check (Cyclic Redundancy Check, CRC) value to verify damaged frames.

 

The initial Ethernet II frame format has some drawbacks. To allow conflict detection, 10 Mbits/s Ethernet requires the minimum group size to 64 bytes. This means that if the frame length does not reach the standard, 0 must be used to fill the short frame. Therefore, the upper-layer protocol must contain a "length" field to distinguish the actual data from the fill value.

Fortunately, the values allocated for the "Ethernet Type" field-0x0600xns (Xerox), 0x0800ip (Internet Protocol), and 0x6003decnet-are always greater than the decimal value 1500 (0x05dc) the maximum frame length. Therefore, the IEEE 802 committee provides a standard for the solution to this task, namely, 802.3. This method replaces the "Ethernet Type" Field of the same eight-bit group with the "type/protocol" Field of the two eight-bit groups. Thus, the Ethernet II frame is differentiated from the 802.3 frame. The details are as follows:

· If the value of this field is greater than 1500 in decimal format, this field indicates the Ethernet type and is type II.

· If the value of this field is less than or equal to the decimal value 1500, this field indicates the length and is 802.3. (See the description in IEEE 802.3 LLC package)

 

  1. IEEE
    802.3 LLC encapsulation:

After the Ethernet II frame is improved, a new group is still needed to represent the type to identify the upper-layer protocol, therefore, the "length" field in the 802.3 base frame is followed by a logical link control header (which follows IEEE 802.2 ). The frame format is as follows:

 

The fields in the IEEE 802.3 LLC frame are described as follows:

· Preamble-same as Ethernet II frame. (This is 10101011)

· Des-Mac-same as Ethernet II frame.

· Sou-MAC-same as Ethernet II frame.

· Len-that is, the "length" field. This field is used to replace the "Ethernet Type" field in the Ethernet II frame, indicating the frame length, but does not include the Preamble), FCS, destination and source MAC addresses, and length fields.

· DSAP-(Destination Service Access Point) byte, 8 bits. When the value is 0xAA, it indicates the subnet Access Protocol (Subnetwork AccessProtocol, SNAP ).

· SSAP-(Source Service Access Point) byte, 8 bits. When the value is 0xAA, it indicates the subnet Access Protocol (Subnetwork AccessProtocol, SNAP ).

· CTRL-"control" field, specifying the type of the LLC frame.

· Payload-same as Ethernet II frame. The valid data length range of 802.3LLC is 43 ~ 1497 bytes.

· FCS-same as Ethernet II frame. The value must be recalculated.

 

  1. IEEE 802.3 snap encapsulation:

Inherits the frame format of 802.3LLC and adds the SNAP field.

 

The following describes fields in the IEEE 802.3 SNAP frame:

· Preamble-same as 802.3LLC frame.

· Des-MAC-same as 802.3LLC frame.

· Sou-MAC-same as 802.3LLC frame.

· Len-same as 802.3LLC frame.

· DSAP-the value 0xAA indicates SNAP.

· SSAP-the value here is 0xAA.

· CTRL-same as 802.3LLC frame.

· SNAP-that is, "Subnetwork Access Protocol". The SNAP header consists of three bytes of vendor code and two bytes of local code. When the vendor code is 0x000000, the local code is an Ethernet Type II for backward compatibility. This new format moves the "Ethernet Type" field eight bytes to the right from its original location in Ethernet II.

· Payload-same as 802.3LLC frame. The valid data length range of 802.3SNAP is 38 ~ 1492 bytes.

· FCS-same as 802.3LLC frame. The value must be recalculated.

 

  1. IEEE 802.1Q encapsulation:

The header of 802.1Q is not actually enclosed in the original frame, but in the Ethernet II frame, add a 32-bit field between the MAC source address field and the "Ethernet Type" field in the original frame ).

 

The fields in the IEEE 802.1Q frame are described as follows:

· Preamble-same as Ethernet II frame.

· Des-MAC-same as Ethernet II frame.

· Sou-MAC-same as Ethernet II frame.

· 802.1Q Header-indicates that this is a VLAN frame and stores VLAN information. (See the following for details)

· Type-same as Ethernet II frame.

· Payload-same as Ethernet II frame. Valid Data Length range: 46 ~ 1500 bytes.

· FCS-same as Ethernet II frame. The value must be recalculated.

 

The 802.1Q header encapsulation follows the following format:

 

 

· TPID-Tag Protocal Identifier (TPID): a group of 16-bit fields used to recognize 802.1Q frames, the value is set to 0x8100 to identify an IEEE 802.1Q frame as the tagged header, because the location of the domain to be calibrated is the same as that of the "Ethernet Type" field in the Ethernet Type II frame in the non-tagged frame, this is used to distinguish untagged frames.

· TCI-Tag Control Information (TCI): The length is 2 bytes and contains PCP, CFI, and VID3 fields.

· PCP-Priority Code Point (PCP): uses a set of three-bit fields as the reference for the p Priority, from 0 (lowest) to 7 (highest ), it is also called "Class of Service (CoS)" to transmit data streams (audio, images, archives, and so on )".

· CFI-Standard Format identifier (Canonical Format Indicator, CFI): 1-bit RMB domain. If the value of this field is 1, the MAC address is in a non-standard format; if it is 0, it is in a standard format; in Ethernet switches, it is usually 0 by default. CFI is used to solve the compatibility problem between the two in the ring between yi tai and the starting ring. If the frame receives data in the ethereum, the CFI value must be set to 1, and this port cannot be bridging with other unlabeled ports.

· Vid-VLAN identifier (VID): a 12-bit domain used to specify the VLAN to which the frame belongs. If the value is 0, the frame does not belong to any VLAN. At this time, the 802.1Q label only represents the priority. The 12-bit value 0xfff is the reserved value. Other values can be used as identifiers for a total of 4094 VLANs. On the bridge, vlan1 is managed as a reserved value.

 

  1. IEEE 802.1ad encapsulation:

IEEE 802.1ad, also known as qinq, is useful to Internet Service Providers (ISPs. It allows the ISP to still use VLANs internally when mixed data with VLAN tags are sent from the client.

 

The fields in the IEEE 802.1ad frame are described as follows:

· Preamble-same as Ethernet II frame.

· Des-Mac-same as Ethernet II frame.

· Sou-Mac-same as Ethernet II frame.

· 802.1Q outertag-the next tosource Mac and representing isp vlan will be unencapsulated before the inner. At this time, a variable tpid may carry 9100, 9200, or 9300 in a 16-digit value, which is usually used as an external tag. However, when the value is 88a8, 802.1ad is violated and cannot be used as an external tag.

· 802.1Q innertag-Internal tag, in the same format as IEEE 802.1Q header.

· Type-same as Ethernet II frame.

· Payload-same as Ethernet II frame. Valid Data Length range: 46 ~ 1500 bytes.

· FCS-same as Ethernet II frame. The value must be recalculated.

 

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.