參考答案
A VLAN is a way to divide a single physical network into multiple logical networks using a switch.
Even though all devices may be connected to the same switch, VLANs make it work as if there were separate networks.
Okay, so to understand this better, you should think of LAN.
In a regular setup, all devices connected to a switch belong to the same broadcast domain. So any broadcast message like ARP is sent to everyone.
Now here's what VLAN does.
- Basically all the devices are grouped into different VLANs, and each VLAN acts like its own separate network. So from here, broadcast traffic stays within that VLAN and does not reach others.
- Another interesting part is that devices in the same VLAN can communicate as if they are on the same LAN, even if they are connected through different physical switches.
This is possible because VLAN information is carried across all the switches by using the 802.1Q standard, which adds a VLAN ID ranging from 1 to 4094 to Ethernet frames.
Now, what if two devices are in different VLANs?
Unfortunately, they won't be able to communicate directly. Communication between VLANs requires inter-VLAN routing, which is done using either a router or a Layer 3 switch.
So Why VLANs are actually used?
With the use of VLAN, the grouping becomes possible based on function instead of physical location.
For example: There can be HR department in one VLAN and Engineering in another
This mainly helps in:
- improving security
- reducing broadcast traffic
- making network management more flexible
Because of this, most switches use VLAN 1, unless it is configured to be otherwise.