Got it

Understanding of VLAN - Principle of VLAN Communication

Latest reply: Jun 17, 2021 15:56:59 667 31 27 0 2

OBJECTIVE


The purpose of this post is to present an introduction to Principle of VLAN Communication.


Basic Principle of VLAN Communication


To improve the efficiency in processing frames, frames within a switch all carry VLAN tags for uniform processing. When a data frame reaches a port of the switch, if the frame carries no VLAN tag and the port is configured with a PVID, the frame is marked with the port's PVID. If the frame has a VLAN tag, the switch will not mark a VLAN tag for the frame regardless of whether the port is configured with a PVID.


The switch processes frames differently according to the type of port receiving the frames. The following describes the frame processing according to the port type.


Port Type Untagged Frame Processing Tagged Frame Processing Frame Transmission
Access portAccepts an untagged frame and adds a tag with the default VLAN ID to the frame.
  • Accepts the tagged frame if the frame's VLAN ID matches the default VLAN ID.


  • Discards the tagged frame if the frame's VLAN ID differs from the default VLAN ID.

After the PVID tag is stripped, the frame is transmitted.
Trunk port
  • Adds a tag with the default VLAN ID to the untagged frame and then transmits it if the default VLAN ID is permitted by the port


  • Adds a tag with the default VLAN ID to the untagged frame and then discards it if the default VLAN ID is denied by the port.

  • Accepts the tagged frame if the frame's VLAN ID is permitted by the port.


  • Discards the tagged frame if the frame's VLAN ID is denied by the port.

  • If the frame's VLAN ID matches the default VLAN ID and the VLAN ID is permitted by the port, the switch removes the tag and transmits the frame.


  • If the frame's VLAN ID differs from the default VLAN ID, but the VLAN ID is still permitted by the port, the switch will directly transmit the frame.

Hybrid port
  • Adds a tag with the default VLAN ID to an untagged frame and accepts the frame if the port permits the default VLAN ID.


  • Adds a tag with the default VLAN ID to an untagged frame and discards the frame if the port denies the

default VLAN ID.


  • Accepts a tagged frame if the VLAN ID carried in the frame is permitted by the port.


  • Discards a tagged frame if the VLAN ID carried in the frame is denied by the port.

If the frame's VLAN ID is permitted by the port, the frame is transmitted. The port can be configured whether to transmit frames with tags.
QinQ port
QinQ ports are enabled with the IEEE 802.1 QinQ protocol. A QinQ port adds a tag to a single-tagged frame, and supports a maximum of 4094 x 4094 VLAN tags(Different products support different specifications), which meets the requirement on the number of VLANs.


Table 1 - Frame processing based on the port type


Intra-VLAN Communication


Sometimes VLAN hosts are connected to different switches, in which case the VLAN spans multiple switches. Since ports between these switches must recognize and send packets belonging to the VLAN, the trunk link technology becomes helpful in simplifying this solution.


The trunk link plays the following two roles:


  • Trunk line


The trunk link transparently transmits VLAN packets between switches.


  • Backbone line


The trunk link transmits packets belonging to multiple VLANs.


07


Figure 1 - Trunk link communication


As shown in Figure 1, the trunk link between DeviceA and DeviceB must both support the intra-communication of VLAN 2 and the intra-communication of VLAN 3. Therefore, the ports at both ends of the trunk link must be configured to belong to both VLANs. That is, Port2 on DeviceA and Port1 on DeviceB must belong to both VLAN 2 and VLAN 3.


Host A sends a frame to Host B in the following process:


1. The frame is first sent to Port4 on DeviceA.


2. A tag is added to the frame on Port4. The VID field of the tag is set to 2, that is, the ID of the VLAN to which Port4 belongs.


3. DeviceA A queries its MAC address table for the MAC forwarding entry with the destination MAC address of Host B.


  • If this entry exists, DeviceA sends the frame to the outbound interface Port2.


  • If this entry does not exist, DeviceA sends the frame to all interfaces bound to VLAN 2 except for Port4.


4. Port2 sends the frame to DeviceB.


5. After receiving the frame, DeviceB queries its MAC address table for the MAC forwarding

entry with the destination MAC address of Host B.


  • If this entry exists, DeviceB sends the frame to the outbound interface Port3.


  • If this entry does not exist, DeviceB sends the frame to all interfaces bound to VLAN 2 except for Port1.


6. Port3 sends the frame to Host B.


The intra-communication of VLAN 3 is similar, and is not mentioned here.


Inter-VLAN Communication


After VLANs are configured, hosts in different VLANs cannot directly communicate with each other. To implement communication between VLANs, use either of the following methods:


  • Sub-interface


As shown in Figure 2, DeviceA is a Layer 3 switch supporting sub-interface, and DeviceB is a Layer 2 switch. LANs are connected using the switched Ethernet interface on DeviceB and the routed Ethernet interface on DeviceA. User hosts are assigned to VLAN2 and VLAN3. To implement inter-VLAN communication, configure as follows:


  • On DeviceA, create two sub-interfaces Port1.1 and Port2.1 on the Ethernet interface connecting to DeviceB, and configure 802.1Q encapsulation on sub-interfaces corresponding to VLAN2 and VLAN3.


  • Configure IP addresses for sub-interfaces.


  • Set types of Ethernet interfaces connecting DeviceB and DeviceA to Trunk or Hybrid, to allow VLAN2 and VLAN3 frames.


  • Set the default gateway address to the IP address of the sub-interface mapping the VLAN to which the user host belongs.


08

Figure 2 - Inter-VLAN communication using sub-interfaces


Host A communicates with host C as follows:


1. Host A checks the IP address of host C and determines that host C is in another VLAN.


2. Host A sends an ARP request packet to DeviceA to request DeviceA's MAC address.


3. After receiving the ARP request packet, DeviceA returns an ARP reply packet in which the source MAC address is the MAC address of the sub-interface mapping VLAN2.


4. Host A obtains DeviceA's MAC address.


5. Host A sends a packet whose destination MAC address is the MAC address of the sub-interface and destination IP address is host C's IP address to DeviceA.


6. After receiving the packet, DeviceA forwards the packet and detects that the route to host C is a direct route. The packet is forwarded by the sub-interface mapping VLAN3.


7. Functioning as the gateway of hosts in VLAN3, DeviceA broadcasts an ARP packet requesting host C's MAC address.


8. After receiving the packet, host C returns an ARP reply packet.


9. After receiving the reply packet, DeviceA sends the packet from host A to host C. All packets sent from host A to host C are sent to DeviceA first to implement Layer 3 forwarding.


VLANIF interface


Layer 3 switching combines routing and switching techniques to implement routing on a switch, improving the overall performance of the network. After sending the first data flow, a Layer 3 switch generates a mapping table on which it records the mapping between the MAC address and the IP address for the data flow. If the switch needs to send the same data flow again, it directly sends the data flow at Layer 2 based on the mapping table. In this manner, network delays caused by route selection are eliminated, and data forwarding efficiency is improved.


In order for new data flows to be correctly forwarded, the routing table must have the correct routing entries. Therefore, VLANIF interfaces are used to configure routing protocols on Layer 3 switches to reach Layer 3 routes.


A VLANIF interface is a Layer 3 logical interface, which can be configured on either a Layer 3 switch or a router.


As shown in Figure 3, hosts connected to the switch are assigned to VLAN 2 and VLAN 3.


To implement inter-VLAN communication, configure as follows:


  • Create two VLANIF interfaces on the device, and configure IP addresses for them.


  • Set the default gateway address to the IP address of the VLANIF interface mapping the VLAN to which the user host belongs.


09

Figure 3 - Inter-VLAN communication through VLANIF interfaces


Host A communicates with host C as follows:


1. Host A checks the IP address of host C and determines that host C is in another subnet.


2. Host A sends an ARP request packet to Device to request Device's MAC address.


3. After receiving the ARP request packet, Device returns an ARP reply packet in which the source MAC address is the MAC address of VLANIF2.


4. Host A obtains Device's MAC address.


5. Host A sends a packet whose destination MAC address is the MAC address of the VLANIF interface and destination IP address is host C's IP address to Device.


6. After receiving the packet, Device forwards the packet and detects that the route to host C is a direct route. The packet is forwarded by VLANIF3.


7. Functioning as the gateway of hosts in VLAN3, Device broadcasts an ARP packet requesting host C's MAC address.


8. After receiving the packet, host C returns an ARP reply packet.


9. After receiving the reply packet, DeviceA sends the packet from host A to host C. All packets sent from host A to host C are sent to Device first to implement Layer 3 forwarding.


VLAN Switch


VLAN switch allows hosts in different VLANs to communicate with each other. For details, see VLAN Switch.



--- End

Interesting sharing
View more
  • x
  • convention:

Vlada85
MVE Author Created Jun 9, 2021 17:05:53

Very good article! Understanding of VLAN - Principle of VLAN Communication-3964215-1
View more
  • x
  • convention:

Excellent
View more
  • x
  • convention:

An article that is worth saving for future viewing.
View more
  • x
  • convention:

Good share
View more
  • x
  • convention:

Thanks for sharing
View more
  • x
  • convention:

Very interesting
View more
  • x
  • convention:

Good share
View more
  • x
  • convention:

Informative. Keep up the good work.
View more
  • x
  • convention:

123
Back to list

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.