VLAN is a group of physically connected devices to one or more switches, but they are logically separated. All devices in a single VLAN receive broadcast sent by a device in that respective VLAN. By default, all interfaces of switch are in a single VLAN or single broadcast domain.
As in figure 1, shows a flat network without any vlans (i.e. a single broadcast domain). The problem with this type of network is when Host 4 tries to communicate with Host 5 for the first time, a broadcast is sent to all hosts on the network regardless of whether the device needs to receive that data or not.
As in figure 2, vlans are configured with Host 4, 5, 6 in VLAN 1 and Host 1, 2, 3 in VLAN 2. Now when Host 4 tries to communicate with Host 5 for the first time, a broadcast is sent to only Hosts in that particular VLAN means Host 5 & 6; In this case VLAN 1. Imagine, what happens without VLANs in larger network?
Therefore VLANs are configured for below reasons:
- Control broadcasts
- Increase security
- Improve performance
VLANs are isolated from each other so that data in one VLAN cannot cross into another VLAN. So for inter-VLAN communication you need a layer 3 device.