Ethernet is a shared-medium network technology based on CSMA/CD (Carrier Sense Multiple Access/Collision Detect). A large number of hosts cause serious collisions, broadcast storms, performance degradation, and network outages. Switches reduce collisions but cannot isolate broadcast traffic.
VLAN (Virtual Local Area Network) technology solves this by splitting a physical LAN into multiple logical broadcast domains. Devices within a VLAN communicate as if on the same LAN; different VLANs cannot communicate directly, limiting broadcasts.

VLANs are not limited by physical location. Devices can be on the same switch, cross switches, or span routers while belonging to the same VLAN.
Advantages of VLAN:
To identify VLAN frames, a VLAN tag is added to the Ethernet header at the data link layer (Layer 2).
IEEE standardized VLAN tagging with the 802.1Q protocol in 1999. It defines a standard method for tagging Ethernet packets with VLAN information.
802.1Q inserts a 4-byte tag between the source MAC address and the EtherType field:
TCI includes PCP (Priority Code Point), CFI (Canonical Format Indicator), and VID (VLAN ID).

Figure 1-2 Traditional Ethernet Frame Format

Figure 1-3 VLAN Tag Fields
VLAN Tag Fields:
Note: For double-tagged (QinQ) frames, the switch processes only the outer tag; inner tags are treated as payload.
LLDP (Link Layer Discovery Protocol) allows devices to advertise and receive neighbor information over the local network. Information is stored in MIBs and can be queried via SNMP (RFC 2922).
LLDP uses TLV (Type/Length/Value) structures to carry device information. Multiple TLVs form an LLDPDU (LLDP Data Unit).
| Type | Length | Value |
| 7 bits | 9 bits | 0-511 bytes |
Figure 1-4 TLV Structure
LLDP-MED (Media Endpoint Discovery) is an extension for VoIP devices, providing:
Note: LLDP and LLDP-MED cannot run simultaneously on the same port.
LLDP Functions on IP Phones:
When LLDP is enabled, the phone periodically advertises itself and listens to the switch. If the Application Type = Voice, the phone automatically learns the Voice VLAN ID from the switch, updates its configuration, and reboots to apply the VLAN.
LLDP Configuration Steps (Web UI):

Figure 1-5 LLDP Configuration Interface
After enabling LLDP, the phone:



CDP (Cisco Discovery Protocol) is a Cisco proprietary layer 2 protocol for device discovery.
CDP Functions on IP Phones:
The phone advertises itself and listens to CDP packets from the switch. It automatically learns the Voice VLAN ID, updates configuration, and reboots.
CDP Configuration Steps (Web UI):

Figure 1-6 CDP Configuration Interface



The phone supports VLAN discovery via DHCP. By default, it uses Option 132 to obtain the VLAN ID. Up to 5 custom DHCP options are supported.
DHCP VLAN Configuration Steps (Web UI):

Figure 1-7 DHCP VLAN Configuration Interface
Operation Flow:


VLAN is disabled by default. You can configure VLAN for the WAN (Internet) port and LAN (PC) port separately with VLAN ID and 802.1p priority (0–7, 7 highest).
WAN VLAN Configuration (Web UI):

Figure 1-8 WAN VLAN Configuration
LAN VLAN Configuration (Web UI):

Figure 1-9 LAN VLAN Configuration
Phone LCD VLAN Configuration:
Menu → Advanced (Password:123) → Network → QoS&Vlan → WAN VLAN / LAN VLAN


Configuration Verification:
Capture packets to verify 802.1Q tags, VLAN ID, and 802.1p priority in SIP and RTP frames.


Ethernet switch ports support three modes:
Key Rules:
| Port Type | Ingress Processing | Egress Processing | |
| Untagged Frame Received | Tagged Frame Received | ||
| Access | Add PVID tag | Drop if VLAN != PVID | Remove tag and forward |
| Trunk | Add PVID tag if allowed | Accept if VLAN allowed | Remove tag only if VLAN = PVID |
| Hybrid | Add PVID tag if allowed | Accept if VLAN allowed | Tag or untag based on port configuration |
| Parameter | Default | Range |
| VLAN ID | 1 | 1–4094 |
| VLAN Name | VLANxxxx | — |
| MTU | 1500 | 1500–18190 |
| Status | Active | Active/Suspended |
| Step | Command | Purpose |
| 1 | configure terminal | Enter global config mode |
| 2 | vlan | Create or edit VLAN |
| 3 | name | Set VLAN name |
| 4 | end | Exit to privileged mode |
| 5 | show vlan | Verify configuration |
| 6 | copy running-config startup-config | Save config |
| Step | Command | Purpose |
| 1 | configure terminal | Enter global config |
| 2 | no vlan | Delete the VLAN |
| 3 | end | Exit |
| 4 | show vlan brief | Verify deletion |
| Step | Command | Purpose |
| 1 | configure terminal | Global config |
| 2 | interface | Select port |
| 3 | switchport mode access | Set as access port |
| 4 | switchport access vlan | Assign VLAN |
| 5 | end | Exit |
| Step | Command | Purpose |
| 1 | configure terminal | Global config |
| 2 | interface | Select port |
| 3 | switchport mode trunk | Set as trunk |
| 4 | switchport trunk native vlan | Set native VLAN |
| 5 | end | Exit |
switchport trunk allowed vlan { add | all | except | remove }
switchport trunk native vlan
Cisco 2960 Series Switches