In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
I. Overview
Whether or not to mark the Tag,untag and the various port modes of the switch are the concepts that network engineers and technicians come into contact with most when debugging the switch. The tag tag refers to the label of the VLAN and the VLAN to which the packet belongs. There are three port modes of the switch: Access vlan, Trunk vlan, and Hybrid vlan, that is, Ethernet ports have three link types: Access, Hybrid, and Trunk. In Trunk and Hybird modes, there is the concept of port default vlan (pvid, native vlan id).
Whether or not to mark (Tag,untag)
Tag refers to the label of vlan, that is, the id of vlan, which is used to name the vlan,untag index data packet that does not belong to any vlan and does not have a vlan tag. Untag is an ordinary ethernet message, and the network card of an ordinary PC can recognize such messages for communication.
The change of tag message structure is that the vlan information of 4bytes, that is, vlan tag header, is added after the source mac address and destination mac address. Generally speaking, the network card of ordinary PC can not recognize such messages. It is said below that all packets on the 802.1Q encapsulated tag message frame structure ISL Trunk are tag-specific (Cisco-specific). 802.1Q is specially designed not to tag in order to be compatible with the mixed deployment of switches that do not support VLAN: but only one VLAN allows non-tag, so N VLAN, (Ntag 1) are all tag, and packets that do not tag must come from that special VLAN, so they will not be messed up. (of course, all VLAN can be tag.) A frame with 802.1Q inserts a 4-byte identity into a standard Ethernet frame. It contains a 2-byte protocol identifier (TPID), which is currently set to a fixed value of 0x8100, indicating that the frame has 802.1Q tagging information.
2-byte tag control information (TCI), which contains three fields.
The Priority domain, which occupies 3bits, indicates the priority of the message. Values from 0 to 7 are the highest priority and 0 is the lowest priority. This domain is adopted by 802.1p.
Canonical format indicator (CFI) field, accounting for 1 bit, 0 indicates the canonical format, which is applied to Ethernet; 1 indicates the non-standard format, which is applied to Token Ring.
The VLAN ID domain, which occupies 12bit, is used to indicate the attribution of the VLAN.
Three port modes of the switch: Access, Hybrid and Trunk
1. Three port modes Access type ports can only belong to 1 VLAN, which is generally used to connect to the port of the computer
Ports of Trunk type can allow multiple VLAN to pass through, and can receive and send messages of multiple VLAN. It is generally used for ports connected between switches.
The port of Hybrid type can allow multiple VLAN to pass, can receive and send messages of multiple VLAN, can be used to connect between switches, can also be used to connect to users' computers. Comparison between 2.Hybrid port and Trunk port Hybrid port and Trunk port handle data in the same way, the only difference is when sending data: Hybrid port allows messages of multiple VLAN to be sent without tagging, while Trunk port only allows messages of default VLAN to be sent without tagging.
Default VLAN for port 2.1 (native/Pvid vlan)
The Access port only belongs to 1 VLAN, so its default VLAN is the VLAN in which it is located. There is no need to set it.
The Hybrid port and the Trunk port belong to multiple VLAN, so you need to set the default VLAN ID. By default, the default VLAN for Hybrid and Trunk ports is VLAN 1.
If the default VLAN ID of the port is set, when the port receives a message without VLAN Tag, it forwards the message to the port that belongs to the default VLAN; when the port sends a message with VLAN Tag, if the VLAN ID of the message is the same as the default VLAN ID of the port, the system will remove the VLAN Tag of the message and then send the message.
Note: the default VLAN is called "Pvid Vlan" for Huawei switches and "Native Vlan" for Cisco switches.
2.2 pvid
Pvid, the port vlan id number, is the vlan id setting of the untagged port. When an untagged packet enters the switch, the switch checks the vlan setting and decides whether to forward it. If an ip packet enters a switch port without a tag header and pvid is configured on the port, the packet will be tagged accordingly! If the incoming ip packet already has a tag header (vlan data), the switch generally does not add the tag header, even if the port is configured with a pvid number.
Question and answer: what is the difference between the default VLAN and pvid of the port?
Looking at 2.1 and 2.2, there is some contradiction as to where the packets go when the port sends and receives marked packets. -at least I don't understand. The hero can answer questions and questions. Thank you.
The difference between the default VLAN of a port and pvid-it should not be the same thing.
2.3 access data processing process of switch interface
Acess port to receive message:
Receive a message to determine whether there is a VLAN message: if not, call the PVID of the port and exchange and forward it; if so, discard it directly (default)
Acess port message:
Peel off the VLAN information of the message and send it directly
Trunk port to receive message:
Receive a message to determine whether there is a VLAN message: if not, type the PVID of the port and exchange and forward it; if there is a judgment on whether the trunk port allows the data of the VLAN to enter: if possible, forward it, otherwise discard it
Trunk port message:
Compare the PVID of the port with the VLAN information of the message to be sent, peel off the VLAN message if they are equal, then send it again, and send it directly if they are not equal
Hybrid port to receive message:
Receive a message to determine whether there is a VLAN message: if not, type the PVID of the port and exchange and forward it; if so, determine whether the hybrid port allows the data of the VLAN to enter: if possible, forward it, otherwise discard it (at this time, the untag configuration on the port is not considered, and the untag configuration only works when sending messages)
Hybrid port message:
1. Determine the attributes of the VLAN on this port (disp interface can see which VLAN is untag and which VLAN is tag for the port)
2. If it is untag, the VLAN information will be stripped and then sent, and if it is tag, it will be sent directly.
A table for sending and receiving data at each port
Port type send and receive description Access message
Determine whether there is VLAN information: if not, call the PVID of the port and exchange and forward it. If so, directly.
Discard (default)
The sending message strips off the VLAN information of the message and sends it directly to the Trunk to receive the message.
Receive a message to determine whether there is a VLAN message: if not, call the PVID of the port and exchange and forward
If it is judged whether the trunk port allows the data of the VLAN to enter: if so, forward it, otherwise discard it.
Send a message
Compare the PVID of the port with the VLAN information of the message to be sent. If the two are equal, the VLAN information is stripped and then sent.
If it is not equal, send it directly.
Hybrid received message
Receive a message to determine whether there is a VLAN message: if not, call the PVID of the port and exchange and forward
If so, determine whether the hybrid port allows data from the VLAN to enter: if so, forward it, otherwise discard it.
Send a message
Determine the attribute of the VLAN on this port (disp interface can see which VLAN is untag for the port.
Which VLAN is tag) if it is untag, the VLAN information is stripped, and then sent, and if it is tag, it is sent directly.
If a port is designated as an untagged port untagged port in the vlan setting, all packets forwarded from this port are unmarked (untagged)-similar to sending messages from access ports. If a tagged packet enters the switch, the tag will be removed when it passes through the untagged port-similar to the tagged message received by the access port. Because many devices do not support tagged packets, and they cannot recognize tagged packets, the port to which they are connected needs to be set to untagged.
If a port is designated as a tagged port tagged port in the vlan setting, all packets forwarded from this port will be marked (tagged). If an untagged packet enters the switch, the tag will be added as it passes through the tagged port. At this point, it will use the pvid setting on the ingress port as the vlan id number in the added tag.
The following examples can help you understand the hybrid port mode of Huawei switch.
[Switch-Ethernet0/1] int e0/1
[Switch-Ethernet0/1] port link-type hybrid
[Switch-Ethernet0/1] port hybrid pvid vlan 10
[Switch-Ethernet0/1] port hybrid vlan 10 20 untagged
[Switch-Ethernet0/1] int e0/2
[Switch-Ethernet0/2] port link-type hybrid
[Switch-Ethernet0/2] port hybrid pvid vlan 20
[Switch-Ethernet0/2] port hybrid vlan 10 20 untagged
At this time, the PC connected under inter e0swap 1 and inter e0apace 2 is interoperable, but the round trip vlan of the data is different when interworking.
The following example is taken as an example to illustrate that the connected pc1 under inter e0amp 1 accesses the connected pc2 under inter e0lap2.
The data sent out by the pc1 is sent to the switch after the pvid vlan10 where the inter0/1 is located encapsulates the mark of vlan10. The switch finds that inter e0p2 allows the data of vlan10 to pass through, so the data is forwarded to inter e0bank 2. Because vlan10 is untagged on inter e0bank 2, the switch removes the mark of vlan10 on the packet and sends it to pc2 in the form of a normal packet. At this time, pc1- > p2 goes vlan10.
Then analyze the process of pc2 returning packets to pc1. The data sent by pc2 is sent to the switch after encapsulating the mark of vlan20 by the pvid vlan20 where the inter0/2 is located. The switch found that inter e0Unip 1 allows the data of vlan20 to pass, so the data is forwarded to inter e0pact 1. Because the vlan20 on inter e0pact 1 is untagged, the switch removes the mark of vlan20 on the packet and sends it to pc1 in the form of a normal packet. At this time, pc2- > pc1 goes vlan20.
To sum up, the following is a list of Switch transceiver Switch's processing of tags remark
Access (receive) Tagged = PVID does not receive note: some high-end products may receive.
Access (receive) Tagged = / PVID does not receive note: some high-end products may receive.
Access (receive) Untagged receive increases tag=PVID from PC
Access (send) Tagged = PVID forward delete tag
Access (send) Tagged = / PVID do not forward do not handle
Access (send) Untagged does not have this situation
Trunk (receive) Tagged = PVID receive does not modify tag
Trunk (receive) Tagged = / PVID receive does not modify tag
Trunk (receive) Untagged reception adds tag=PVID
Trunk (send) Tagged = PVID If Passing then forward delete tag
Trunk (send) Tagged = / PVID If Passing then forwarding does not modify tag
Trunk (send) Untagged does not have this situation (Note)
Hybrid (receive) Tagged = PVID receive does not modify tag opposite end is trunk
Hybrid (receive) Tagged = / PVID receive does not modify tag the opposite end is trunk
Hybrid (receive) Untagged reception adds tag=PVID class Trunk
Hybrid (send) Tagged = PVID Tag and vlan listed in untag can be viewed by passing for Tag and untag entries
Hybrid (send) the vlan listed in Tagged = / PVID Tag and untag can be viewed by passing for Tag and untag entries
Hybrid (send) Untagged does not have this situation (Note)
It is also important to note that:
(1) Trunk port and isolate-user-vlan cannot be configured at the same time; Hybrid port and isolate-user-vlan can be configured at the same time. However, if the default VLAN is the VLAN with the mapping established in isolate-user-vlan, the default VLAN ID is not allowed to be modified, and can only be modified after the mapping has been unmapped.
(2) the default VLAN ID of this Hybrid port or Trunk port must be the same as the default VLAN ID of the Hybrid port or Trunk port of the connected peer switch, otherwise the message will not be transmitted correctly.
IV. References
1. Understanding of three port modes of switch: Access, Hybrid and Trunk
Http://blog.sina.com.cn/s/blog_65421bc80100ikdj.html
two。 On the relationship between Trunk, Hybrid, Access, Tag, Untag and Pvid
Http://blog.sina.com.cn/s/blog_5f70c7060100kbev.html
3. About Native Vlan or Pvid Vlan.
Http://blog.csdn.net/hxg130435477/article/details/5907430
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.