A Virtual Local Area Network (VLAN) allows a physical network infrastructure to be logically partitioned into multiple distinct broadcast domains. This architecture enhances performance, security, and administrative flexibility by grouping hosts based on organizational functions rather than physical locations.
In traditional local area networks (LANs), physical network segments correspond directly to logical broadcast domains. Every device connected to the same shared hub or Layer 2 switch structure belongs to the same broadcast domain.
As networks scale, the sheer volume of broadcast traffic (such as ARP requests, DHCP discoveries, and routing updates) increases exponentially. If represents the number of active host devices, and represents the broadcast generation rate of host , the total background broadcast traffic processing load on every network interface card (NIC) can be modeled as:
In a large, non-segmented network, this overhead degrades overall node performance, as every CPU must interrupt its pipeline to parse frames destined for the MAC address FF:FF:FF:FF:FF:FF.
VLANs solve this scalability problem by restructuring the broadcast domain boundaries at Layer 2 (Data Link Layer) of the OSI model using software-driven logical boundaries. Instead of physically running separate switches and cabling for different departments (e.g., Sales, Engineering, Human Resources), network architects configure a single physical switch to act as multiple isolated logical switches.
TRADITIONAL PHYSICAL LAN LOGICAL VLAN SEGMENTATION
+-----------------------+ +-----------------------+
| Layer 2 Switch | | Layer 2 Switch |
+---|---|---|---|---|---+ +---|---|---|---|---|---+
| | | | | | | | | |
PC1 PC2 PC3 PC4 PC5 PC1 PC2 PC3 PC4 PC5
|_________________| |_____| |_________|
Single VLAN 10 VLAN 20
Broadcast Domain (Sales) (IT)
(Separate Broadcast Domains)A switch manages its VLAN layout by classifying ports and associating physical frames with a specific VLAN ID.
The Virtual LAN layout utilizes identification parameters defined by the system standard. The limits of VLAN scale are calculated using basic bitwise allocations. A standard VLAN Identifier (VID) consists of :
These IDs are categorized as follows:
To transport traffic across multiple switches, switch ports must be classified into specific operating modes. These modes dictate how the switch handles incoming and outgoing frame headers.
+------------------+ +------------------+
| Cisco Switch A | | Cisco Switch B |
+--------+---------+ +--------+---------+
| |
| [Port: Trunk Mode]---------[Trunk]---| [Port: Trunk]
| |
+----------------+----------------+ +----------------+----------------+
| | | |
[Port: Access] [Port: Access] [Port: Access]
(VLAN 10) (VLAN 20) (VLAN 10)
| | |
[ PC 1 ] [ PC 2 ] [ PC 3 ]An Access Port is assigned to exactly one specific VLAN.
A Trunk Port is a point-to-point link configured to multiplex traffic belonging to multiple VLANs across a single physical connection.
To keep track of which frame belongs to which VLAN over a trunk link, the transmitting switch inserts a 4-byte (32-bit) header modification known as an IEEE 802.1Q Tag into the original Ethernet frame layout.
The tag is injected between the Source MAC Address and the EtherType/Length fields of the original frame:
The (32-bit) 802.1Q tag header contains the following internal fields:
| Field Name | Bit Width | Description | | :--- | :--- | :--- | | TPID (Tag Protocol Identifier) | | Set to value to identify the frame as 802.1Q tagged. | | PCP (Priority Code Point) | | Used for Quality of Service (QoS) class prioritization (IEEE 802.1p). | | DEI (Drop Eligible Indicator) | | May be used separately or in conjunction with PCP to indicate frames eligible to be dropped during congestion. | | VID (VLAN Identifier) | | Specifying the exact VLAN ( to ) to which the frame belongs. |
Configuring VLANs and port modes is a fundamental operational task performed via the command-line interface (CLI). Below is the structured Cisco IOS configuration workflow.
Switch# configure terminal
Switch(config)# vlan 10
Switch(config-vlan)# name SALES
Switch(config-vlan)# exit
Switch(config)# vlan 20
Switch(config-vlan)# name IT
Switch(config-vlan)# exitWe will configure interfaces FastEthernet 0/1 and 0/2 to belong to the SALES department (VLAN 10), and interfaces 0/3 and 0/4 to the IT department (VLAN 20).
Using the interface range command optimizes configuration efficiency:
Switch(config)# interface range fa0/1 - 2
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 10
Switch(config-if-range)# exit
Switch(config)# interface range fa0/3 - 4
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 20
Switch(config-if-range)# exitTo ensure that traffic from both VLAN 10 and VLAN 20 can flow to an upstream router or switch connected to interface FastEthernet 0/5, we establish a trunking relationship:
Switch(config)# interface fa0/5
Switch(config-if)# switchport mode trunk
Switch(config-if)# exitBecause each VLAN is configured as an isolated Layer 2 broadcast domain and logical IP subnet, hosts in different VLANs cannot directly communicate at Layer 2. If PC1 (VLAN 10) attempts to send an IP packet to PC3 (VLAN 20), the traffic must be routed at Layer 3 (Network Layer) through a default gateway.
One common and efficient approach to route between VLANs using limited physical ports is the Router-on-a-Stick (ROAS) design.
+------------------------+
| Layer 3 Router |
+-----------+------------+
| (Physical interface e.g., fa0/0)
| (Multiplexed logical sub-interfaces)
|
| [Trunk Link]
|
+-----------+------------+
| Layer 2 Switch (fa0/5)|
+-----+------------+-----+
| |
(fa0/1) | | (fa0/3)
| |
[ PC 1 ] [ PC 3 ]
VLAN 10 VLAN 20For this routing example, the IP network design splits a class C block using typical VLSM metrics. The subnet masks are configured at a boundary:
On the router, the single physical interface (e.g., FastEthernet 0/0) is enabled without an IP address. Instead, we generate logical sub-interfaces matching each VLAN parameter.
Router> enable
Router# configure terminal
! Enable the physical link, but do not bind an IP address to it
Router(config)# interface fa0/0
Router(config-if)# no shutdown
Router(config-if)# exit
! Configure Sub-interface for VLAN 10
Router(config)# interface fa0/0.10
Router(config-subif)# encapsulation dot1Q 10
Router(config-subif)# ip address 192.168.1.1 255.255.255.0
Router(config-subif)# exit
! Configure Sub-interface for VLAN 20
Router(config)# interface fa0/0.20
Router(config-subif)# encapsulation dot1Q 20
Router(config-subif)# ip address 192.168.2.1 255.255.255.0
Router(config-subif)# exitThe application of Virtual LAN strategies provides several immediate engineering benefits:
A logical division of a computer network in which all nodes can reach each other by broadcast at the data link layer (Layer 2).
A logical grouping of network nodes configured via software rather than physical rewiring, operating as an isolated broadcast domain.
A switch port configured to carry traffic for a single, designated VLAN; typically connected to end-user devices.
A physical link on a switch or router capable of multiplexing and carrying traffic for multiple VLANs simultaneously, typically using 802.1Q tagging.
An inter-VLAN routing configuration where a single physical router interface is partitioned into logical sub-interfaces to route traffic between distinct VLANs.
Test your understanding with 5 questions
Which of the following describes the primary Layer 2 purpose of a Virtual LAN (VLAN)?
What is the size of the IEEE 802.1Q VLAN tag added to a standard Ethernet frame, and how many unique VLAN IDs can it theoretically support?
A network administrator needs to connect an end-user workstation to a switch port. Which port mode should be configured on the switch interface?
Under the 'Router-on-a-Stick' architecture, what configuration step is required on the physical router interface to enable routing between VLAN 10 and VLAN 20?
Which of the following occurs when a switch receives a broadcast frame on an access port assigned to VLAN 10?
6 Modules
6 Modules