What is Virtual LAN (VLAN)?

VLAN stands for Virtual Local Area Network. It is a logically isolated local area network that shares the same network devices with other networks. This enables computers on the same physical network to function as a separate physical network.

This tutorial will explain what VLAN is, its advantages and disadvantages, and how to configure VLAN and inter-VLAN routing.

How VLAN works with reference to the OSI model?

The OSI is a reference model with seven layers, each covering a network functionality. As per the OSI model, VLAN works at the data link layer, and the VLAN tagging is at the frame level.

What is Virtual LAN (VLAN)?

The introduction of VLAN has enabled to setup multiple isolated networks using shared hardware devices, such as a switch, hub, etc., which was not possible previously. For instance, a six-port switch in an office can accommodate a maximum of 6 LAN computers. What if the admin wants to set up two isolated LANs with three computers each?

Switch with no VLAN.

There is no VLAN support in the existing device. Therefore, the administrator must purchase another switch to set up two different LANs. Since the introduction of VLAN, this process has been simplified. It is possible for each port to be assigned its own LAN ID, known as a VLAN ID.

In the given scenario, two isolated networks can be created by assigning VLAN ID 1 to ports 1 to 3, and the rest of the ports, i.e., ports 4 to 6, can be tagged with VLAN ID 2. Here 1 and 2 are the LAN IDs virtually those sharing the switch.

Switch With VLAN

What are the advantages of VLAN?

A question that arises now is: Is VLAN always good? Looking at what we have learned so far, the answer would be yes, but there are times when it is better to buy hardware rather than go for VLAN-enabled devices. Let us look at an example to understand why this is being said.

If LAN computers are connected with HUB and it does not support VLAN, to make it compatible, purchasing a VLAN device is an expensive option compared to buying another hub. A VLAN is feasible only if the LAN already uses a switch.

Despite some limitations, VLAN has many advantages. Some of the benefits are listed below.

  • Improved Network Performance by Reducing Broadcast- Since the ports in a switch of one VLAN cannot communicate with machines on other VLAN ports, it reduces the broadcast requests. This enhances the switch performance, which in turn, increases the performance of the network.
  • Security- As we know, VLAN is the separation of networks over the common hardware, so different departments can work in isolation using VLANs. For example, the HR department of an organization has nothing to do with the Finance department; therefore, their work should be separated. To do this, both departments could be given access to different VLANs so that employees of one department can’t access the other department’s machines.
  • Cost Reduction-VLAN reduces the cost of additional hardware, such as a router. For example, if two teams of the same department are located far apart, they can connect via VLAN through two switches using a trunk port. Otherwise, the switch will connect to the router, which incurs additional costs. The trunk port carries the traffic for all VLANs. Two trunk ports connect as a point-to-point network topology.
  • Easy Management– As we have read in this article earlier, VLAN permits easy change of machines from one department to another. Only changing the VLAN tag can do this. Otherwise, it would be a lengthy process of changing the configuration.

What is Inter VLAN Routing?

We know that one VLAN machine cannot access another machine on another VLAN. What if people from two departments, i.e., HR and Finance, are working together on a project, and an employee from HR needs to access data from the Finance department server?

Configuring a router with a switch or using a layer three-managed switch can do this. In this process, the request will first go to the router. Then the router sends the request to the destination machine on another VLAN.