Hello, everyone!
Today, I will continue to write about the basic principle of VLAN technology. Now, I will explain the 802.1Q forwarding principles for hybrid port and packet forwarding mechanisms of switches.
802.1Q forwarding principles for hybrid port
The hybrid port receives a frame
In this situation, the switch checks to see if the frame has a VLAN tag. If there is no VLAN tag, then the switch checks the PVID of the hybrid VLAN is in the allowed VLAN ID list. If it is on the list, then the switch marks it with the PVID and can process it. If the PVID of the hybrid VLAN is not listed, then the switch discards the frame. If the frame has a VLAN tag, then the switch checks to see if it is allowed to pass to the hybrid port. If the frame is allowed to enter, the processing process starts, otherwise, the frame is discarded.

Figure 1. 802.1Q forwarding principles for hybrid port
The hybrid port sends a frame
The switch checks to see if a VLAN has been added to the interface in untagged or tagged mode. The switch will delete the VLAN then and send the frame when the interface is added to the VLAN in untagged mode. The switch will send the frame directly if a VLAN is added in tagged mode.
Packet forwarding mechanism of switches
MAC address tables can be divided into IVL (Independent VLAN Learning) and SVL (Shared VLAN Learning). I will write briefly about these tables.

Figure 2. IVL and SVL
IVL (Independent VLAN Learning)
Based on the destination MAC address, the switch finds the output port and sends the packet. In case the destination MAC address cannot be found in the table, then the switch forwards the packet to all ports.
In this mode, each VLAN has its own table. The destination MAC address can be located in several different tables (these are also different VLANs).
SVL (Shared VLAN Learning)
Switch checks the MAC address in the table. If the VLAN is on the interface is the same as the VLAN that has the packet, then the switch forwards the packet. Otherwise, it is discarded. If the switch cannot find the destination MAC address in the table, then it does the packet is sent in the VLAN to which the packet belongs.
In this mode, there is one large table and the mapping relationship is MAC-VLAN-port.
This is the end of this topic.
Thank you!



