Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Write to the understanding of Vlan, trunk and hybrid related to entry-level engineers entering the network threshold.

Shulou Source: shulou.com Published: 2022-06-01 04:26:09 09月22日 Update

Anyone who succeeds can only succeed by standing on the shoulders of giants, not to mention that I haven't succeeded yet. Next, I'll take it from an article and add my own experience to write about the differences between vlan, trunk and hybrid:

There are three link types for Ethernet ports: access, trunk, hybird

Access type ports can only belong to 1 VLAN-like connection to a computer port

Trunk type port can allow multiple VLAN to pass through, and can receive and send multiple VLAN messages. It is generally used for the connection between switches.

The Hybrid type port can allow multiple VLAN to pass through, can receive and send multiple VLAN messages, can be used for the connection between switches and can also be used to connect user computers.

Hybrid port and Trunk port handle data in the same way, the only difference is when sending data: Hybrid port allows multiple VLAN messages to be sent without tagging, while Trunk port only allows VLAN messages to be sent without tagging by default.

Default VLAN:

The Access port only belongs to 1 VLAN, so the default VLAN is the VLAN where it is located. No setting is required.

The Hybrid port and the Trunk port belong to multiple VLAN, so you need to set the default VLAN ID. By default, Hybrid port and Trunk port default VLAN is VLAN 1

If the port default VLAN ID is set, when the port receives the message without VLAN Tag, it forwards the message to the port that belongs to the default VLAN; when the port sends the message with VLAN Tag, if the message VLAN ID is the same as the port default VLAN ID, the system will remove the message VLAN Tag and then send the message.

Note: the default VLAN for Huawei switches is called "Pvid Vlan" and for Cisco switches the default VLAN is called "Native Vlan"

Switch interface entry and exit data processing process:

Acess port receiving message: receive a message to determine whether there is a VLAN message: if not, hit the port PVID and exchange and forward it. If so, directly discard (default) the Acess port to send the message: peel the message VLAN message and send it directly.

Trunk port receiving message: receive a message to determine whether there is a VLAN message: if not, type the port PVID and exchange and forward it. If there is a judgment as to whether the VLAND ID is within the allowable range of the trunk, forward it if it is within the range, otherwise discard it.

Trunk port message: compare the port PVID and the VLAN message to be sent. If the two are equal, split the VLAN message and send it again. If it is not equal, send it directly.

Hybrid port message: receive a message to determine whether there is a VLAN message: if not, hit the port PVID and exchange and forward. If so, determine whether the hybrid port allows the VLAN data to enter: if possible, forward it, otherwise discard it (in this case, the untag configuration on the port is not considered, and the untag configuration only works when sending messages)

Hybrid port message:

1. Judge the VLAN in the local port attribute (disp erface, you can see which VLAN is untag and which VL is the port.

AN is tag)

2. If it is untag, split the VLAN message and send it again. If it is tag, send it directly.

In fact, we are not clear about the direction of sending and receiving data in a switch: because an interface receives data, and at the same time it sends data to the outside, it is easy to confuse an interface.

Tags: Port message information data switch multiple type success interface no label range computer processing configuration same consistent next between Ethernet Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Shulou Information NVidia OPPO Reno vpn