The Ethernet port of a vswitch has three link types:
1. Access user mode;
2. Trunk link Trunk mode;
3. Hybrid is similar to Trunk but more advanced than trunk;
(1) Access Port:
Only the Ethernet frame of the default vlan is allowed, that is, only one vlan can belong to. The Access port is tagged with a vlan after the Ethernet frame is received, and the vlan label is removed during forwarding, generally, one end is connected to a computer;
(2) Trunk Port:
Packets that can pass through multiple VLANs can receive and forward packets from multiple VLANs generally act on ports connected to switches. In terms of the layered network structure, trunk is interpreted as "port aggregation ", that is, bind multiple physical ports together as one logical port to expand bandwidth and back up links; =
(3) Hybrid Port:
The Hybrid port is similar to the trunk port. It allows multiple VLANs to pass through, and can receive and send packets from multiple VLANs, acting between switches, it can also act on the computer port connecting the user. Different from the trunk port, the Hybrid port can allow multiple VLANs to be sent without being tagged, the trunk port only allows the default vlan packet to be sent without being tagged;
Detailed explanation:
(1) default vlan: strictly speaking, it refers to the default vlan configured by the vendor, which is usually vlan 1; cisco switches default vlan --- "Native Vlan"] H3C switch default vlan --- "Pvid "]
[1]. An Access port belongs to only one vlan, so its default vlan is its vlan;
[2]. The Hybrid port and the Trunk port belong to multiple VLANs. Therefore, you must configure the default vlan id, default VLAN 1 of the Hybrid and Trunk ports. When the port receives packets without VLAN tags, the packet is forwarded to the port of the default VLAN (if the default vlan id of the port is set ).
When a port sends a packet with a VLAN Tag, if the vlan id of the packet is the same as the default vlan id of the port, the system removes the VLAN Tag of the packet and then sends the packet.
(2) process of three port handling packages: Access, trunk and hybrid:
Access receiving:
When receiving a packet, first determine whether there is vlan information. If not, append the pvid on the outbound port, and then perform exchange and forwarding. If yes, the packet is discarded directly!
Access transmission:
Remove the vlan information of the packets and send them out. It can communicate with hosts under the same vlan in the same switch, or implement default vlan switching between switches]
Trunk receiving:
When a packet is received, determine whether there is vlan information. If yes, determine whether the trunk port permits the passing of the vlan information. If yes, release the vlan information. If not, set the pvid of the port, and exchange and forwarding.
Trunk send:
First, compare the vlan information and pvid information. If they are not equal, send them directly. If they are equal, remove the vlan and pvid;
Working instance application: (Hybrid)
Implement communication between different VLANs and the same network segment in the same Lan!
Topology:
[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
Hybrid port receipt:
When a packet is received, determine whether the VLAN information exists. If yes, determine whether the hybrid port allows data from the VLAN to enter. If yes, the packet is forwarded, otherwise, discard (in this case, the untag configuration on the port does not need to be considered. The untag configuration only takes effect when sending packets );
If no port exists, the PVID of the port is set and the port is forwarded.
Hybrid port sends messages:
1. Determine the attributes of the VLAN on the current port (The disp interface can see which VLANs are untags and which VLANs are tags)
2. If it is an untag, the VLAN information is stripped and then sent. If it is a tag, it is directly sent.