Theory about VLAN

Maciej
3 min readSep 20, 2021

What are Virtual LAN and VLAN?

A technology that builds logical segments beyond the physical constraints of L2 switches . This is achieved by assigning a logical number to each physical port of the L2 switch . Although logical, the segments are separated, so for example, a broadcast packet flowing in one logical segment does not reach the other logical segment. There are two types of VLAN technology:

  • A port VLAN that allows only one VLAN ID to be specified for one physical port
  • Tag VLAN that allows you to specify multiple VLAN IDs for one physical port

Port VLAN

A technology that specifies only one VLAN ID for one physical port . Even if they are connected to a single physical L2 switch, the segments created by the VLAN are virtually isolated. Therefore, in order to communicate between these segments, it is necessary to go through layer 3 as in the physical segment. Therefore, if this physical switch is an L3 switch (L2 switch with a routing function), communication between these logical segments can be performed without other network equipment.

On the other hand, when generating multiple logical segments from a simple L2 switch that does not have a routing function, a router is of course required to communicate between these segments.

It is also possible to build a VLAN with two or more physical switches.
However, in this case, all physical switches occupy as many ports as there are logical segments

TAG VLAN

Technology that allows multiple VLAN IDs to be specified for one physical port . It can solve the “problem that ports are occupied by the number of VLANs” peculiar to port VLAN .

How can I solve it ???

  • All VLAN IDs are assigned to the ports (trunk ports) that connect between physical switches.
  • When communicating between different VLANs, embed the tag corresponding to the source VLAN ID in the Ethernet frame at the trunk port of the transmitting switch.
  • At the trunk port of the receiving switch, send (broadcast packets, etc.) to the logical segment specified by the above tag. At the same time, remove the tag from the Ethernet frame.

--

--

Maciej

DevOps Consultant. I’m strongly focused on automation, security, and reliability.