DEV Community

Cover image for VLAN

Posted on



First , No more wait I will be keep on posting content from now on . Lets start so in order to know about VLAN's we need to understand basics of the switch

Purpose of Switch and VLAN

Switches are placed between your router and devices for multiple uses but main purpose is for isolation between organizations and departments (just like subnetting but at an earlier stage) then within that comes our hero VLAN and its main purpose is.... same as switch and subnetting which is isolation . I know it might be confusing [ It will :) ]



As you have seen , First step is the router then switch then comes our VLAN .Lets break it down with an example , Consider you have an office which has multiple departments and each department has multiple teams under it .

Office - Router
Department - switches
Teams - VLAN

Now you see why we need so much isolation , While doing R&D I had a doubt why use VLAN we can just add mutiple switches right ? No , Think about the space and cost and we are using VLANs to have separate broadcast domains under the same switch (same department has mutiple teams under it)

How do they communicate

Each VLAN has a tag (like an identity for it) . Consider a router which has two switches A & B and each switch has 2 VLANs ( Switch A - A1 , A2 ) and ( Switch B - B1 , B2 ).

  • If devices under a VLAN has to communicate , they can communicate directly as they are under same broadcast domain.(Like a team sitting in a same room can communicate directly)

  • If devices in VLAN A1 has to communicate with A2 then they send the MAC address of the device they wanna communicate to the switch (A) then the switch identifies that the MAC address specified in the packet belongs to it but different VLAN so it redirects to that VLAN and goes to the particular device

  • If devices in VLAN A1 wants to communicate with B1 or B2 ( different switch ) , Initially they will send the packet to the switch then the switch identifies it belongs to different switch and adds the VLAN Tag of A1 and sends to the router , the router checks the destination IP address in its routing table and check to which VLAN does it belong (In our case B1 ) so it adds B1's VLAN Tag and checks for the switch it belongs and forwards to it then the switch B check the VLAN Tag and forward to the specific VLAN and then to the device.


Its a hell of a topic and there are still much details to cover , I have just added what is it ? , How does it work and whats the purpose of it . If you have any doubts or clarification comment down below , I will be addressing it ASAP

Okay BYE

Be Nice in comments :)

Top comments (0)