← All Guides LAN Switching & VLANs Routing & Device Layers Subnetting Diagrams & Troubleshooting
Cyber Communications Fundamentals · Block 3, Units 1–2

LAN Switching & VLANs

How Layer 2 switches learn, forward, and avoid loops — and how VLANs carve one physical LAN into multiple logical broadcast domains.

01
The Network SwitchTOPIC 01 OF 10
// What It Is
FactDetail
HardwareHardware-based; uses ASICs (Application Specific Integrated Circuits) to make filtering decisions
OSI LayerMoves frames at the Data-Link Layer (Layer 2) by reading the MAC address off the host's NIC. Switching is always a Layer 2 function; a Layer 3 switch adds routing, but that routing function is always Layer 3
RoleA general connectivity/aggregation point that connects LAN components (computers, printers, other switches); used for workgroup connectivity & network segmentation
IdentificationEach device is identified by a 48-bit unique MAC address, which the switch uses to regulate traffic flow — maximizing security, minimizing needed bandwidth, and improving efficiency
Switch vs. HubA hub floods every port with every message (shared bandwidth, no security/ID). A switch is smarter — each switch port is its own collision domain
// Switch Performance Traits
TraitMeaning
Hardware-based bridgingASICs let the switch learn and form multiple internal connections to pass or filter traffic
Wire speedCan be configured to match the media/cable speed (e.g., 100 Mbps Ethernet → set to 100 Mbps)
Low latencyReceives, processes, and applies an update in minimum time so traffic flow resumes quickly
Low cost"Low-cost, high port density" — inexpensive relative to the number of ports available
Broadcast controlCan segment a network into smaller broadcast domains when paired with VLANs. Without VLANs, broadcasts aren't filtered until they reach a Layer 3 device
02
Switch ComponentsTOPIC 02 OF 10
// External Components
ComponentDetail
Console PortDirect local access via a console/rollover cable and terminal emulation software (HyperTerminal, PuTTY) for initial configuration of a "blank" switch. Every networking device has one. DoD policy requires it be password protected because local access only requires physical presence
Network Interfaces (switch ports)Where end devices like computers/printers connect. Count varies and can grow via plug-in modules. Usable to test connectivity (ping). Once an IP is assigned, interfaces can accept a Telnet connection for remote management — the IP is only for logging in; forward/filter decisions still use MAC addresses
// Internal Components
MemoryHolds
Flash MemoryThe operating system (OS); loaded into RAM every time the switch boots
ROM (Read Only Memory)Diagnostic and boot-up routines; burned-in and cannot be accessed or changed
RAM (Random Access Memory)The switch's running memory for all operations; configuration changes live here in the running-configuration file
NVRAM (Non-Volatile RAM)Long-term storage for the startup-configuration file, which loads into RAM at boot and becomes the running-configuration
// Backup habit — Copying the running-configuration into the startup-configuration saves your changes from RAM into NVRAM so they survive a reboot.
03
Layer 2 Protocols & StandardsTOPIC 03 OF 10
// Common Protocols & Standards
Protocol / StandardDescription
PPP (Point-to-Point Protocol)Data-link layer protocol connecting two devices directly, without relying on a host/networking system. Provides encryption, compression, and authentication; encapsulates a network-layer packet inside the PPP frame
STP (Spanning Tree Protocol) — IEEE 802.1DLoop-prevention protocol; switches communicate to discover physical loops and build a loop-free logical topology
IEEE 802.1DThe Ethernet MAC bridges standard, which includes bridging, STP, and others; standardized by the IEEE 802.1 working group
UDLD & LoopguardHandle unidirectional links (traffic fails in only one direction, e.g., bad transmitter/receiver/cable). UDLD shuts down the port that stops hearing its partner; Loopguard instead puts the port into a "loop inconsistent" state
LLDP (Link Layer Discovery Protocol)Open, vendor-neutral IEEE-standard Layer 2 protocol for network management/monitoring. Devices advertise MAC address, VLAN, IP management address, system name, port details, MDI power, and link aggregation to connected neighbors. Runs on Cisco and non-Cisco devices
CDP (Cisco Discovery Protocol)Cisco-proprietary protocol that supports the IEEE 802.1ab version of LLDP; shares information between directly connected Cisco devices
IEEE 802.1Q vs. ISL802.1Q encapsulates a VLAN frame using space in the standard frame header (open, works with all major manufacturers). ISL instead adds a new header and trailer to the existing frame (Cisco devices only)
04
Core Switch FunctionsTOPIC 04 OF 10
// The Three Basic Functions of Every Layer 2 Switch
FunctionWhat Happens
Address LearningThe switch reads a frame's source MAC address and stores it — with its interface ID — in the MAC address table (a.k.a. CAM / Content Addressable Memory), stored in RAM. The table starts empty
Forward/Filter DecisionThe destination MAC is compared to the MAC address table. If it's listed, the frame is forwarded only out that interface (filtering). If it's not listed, the frame is flooded out all active ports except the one it arrived on
Loop AvoidancePrevents multiple paths between devices from crippling the network with broadcast storms, multiple frame copies, or multiple loops
// How the table fills in — When two devices reply to each other after a flood, the switch learns both MAC addresses and makes a point-to-point connection between their ports, so future frames between them no longer need to be flooded.
05
Loop Avoidance & Broadcast StormsTOPIC 05 OF 10
// Why Loops Exist
LoopSimply more than one path to a destination device. Multiple links/switches are used on purpose to avoid a single point of failure — but the resulting loops can cripple the network if left unmanaged
// Resulting Problems
ProblemDescription
Broadcast StormsAlso called a network storm; the network is overwhelmed as nodes send broadcast traffic and other devices keep rebroadcasting it back, eventually failing network communication. Caused by poor technology, low port-rate switches, and improper configuration
Multiple Frame CopiesA device receives the same frame more than once because it arrives from different LAN segments simultaneously. This "thrashes" the MAC address table as it constantly updates source-hardware-address locations
Multiple LoopsLoops occurring within other loops. If a broadcast storm also occurs, all usable bandwidth is consumed and the network can no longer perform packet switching
// Standardized Solution
StandardDetail
STP (IEEE 802.1D)Prevents bridging loops in data networks and provides loop-free topologies
RSTP (IEEE 802.1w)Rapid Spanning Tree Protocol, introduced by IEEE in 2001
06
Switching Methods & CollisionsTOPIC 06 OF 10
// Three Switching Methods
MethodHow It Works
Store-and-ForwardStores the entire frame in memory and checks it with a CRC (cyclical redundancy check) before forwarding. Bad frames are discarded and an error message is sent to the sender's MAC address. Ensures a high level of error-free traffic
Cut-ThroughCopies only the destination MAC address into memory, looks it up, and places the frame on the outgoing interface immediately. Lowest latency, but bad frames are forwarded and the destination must request a resend
Fragment-FreeA hybrid: stores the first 64 bytes before forwarding, since that's where fragmentation is most likely to occur. If fragmentation is found, the frame is discarded and an error message is sent to the sender
// Collisions
TermDetail
CollisionTwo systems transmit at the same time on shared bandwidth — a normal part of Ethernet, not an error condition by itself
Late CollisionA collision that happens after a host has already transmitted the first 64 bytes of its frame — after other hosts should have noticed it was transmitting. Often caused by an oversized/unsegmented LAN, faulty devices, or a duplex mismatch (e.g., half-duplex/full-duplex) between connected devices
// No one-size-fits-all — Cut-Through works best at the core layer, where errors are rare and speed matters most. Some switches use adaptive switching to pick the best method based on current traffic conditions.
07
VLAN FundamentalsTOPIC 07 OF 10
// What & Why
VLAN DefinitionA "logical" grouping of network devices into a single broadcast domain, independent of physical location
Flat NetworkA network with a single broadcast domain, where every connected device sees every broadcast packet transmitted
PurposeSwitches provide limited Layer 3-style broadcast control by using VLANs to segment the network into smaller broadcast domains, keeping problems on one segment from propagating through the internetwork
Inter-VLAN TrafficVLANs keep broadcasts from one VLAN out of another. As a result, communication between VLANs must go through a Layer 3 routing process
// VLAN Benefits
BenefitDetail
Increased SecurityOnly devices in the same VLAN receive its frames. The administrator controls each port and what resources it can reach; traffic from one VLAN is not accessible from another
Flexibility & ScalabilityDevices can be added to or limited from a broadcast domain regardless of physical location
No Geographical BarrierWorkgroups are no longer confined to physical locations — a VLAN can span multiple physical LAN segments while staying one logical broadcast domain
08
VLAN Creation & Port MembershipTOPIC 08 OF 10
// The Basics
DefaultCisco switches come with default VLAN 1 already created; all ports start assigned to VLAN 1 until an administrator changes them
Numbering & NamingVLANs are identified by number (VLAN 1, VLAN 10, VLAN 20…) referenced consistently across systems, and should also get a descriptive name — "Sales" is better than the default "VLAN0010"
Cross-Switch ConsistencyIf VLAN 30 is created on one switch and VLAN 30 on a connected switch, both treat all VLAN 30 traffic as a single local network
ScopeVLANs can exist on a single switch or span multiple switches, such as Access Switches (ASWs) and Distribution Switches (DSWs)
Port MembershipA port can only be a member of one VLAN at a time. View assignments on Cisco switches with show vlan in privileged EXEC mode
Unused PortsAny port not in use should be shut down and assigned to an inactive VLAN to reduce vulnerabilities and improve security
// Example: show vlan Output
VLANNameStatusPorts
1defaultactiveFa0/4–Fa0/11
10SalesactiveFa0/12–Fa0/15
20MarketingactiveFa0/16–Fa0/19
30ResearchactiveFa0/20–Fa0/23
09
VLAN Trunking & TaggingTOPIC 09 OF 10
// Trunk vs. Access Ports
Port TypeDetail
Trunk Port (tagged port)A connection between network devices that can carry more than one VLAN. Frame tagging assigns a user-defined trunking ID to each frame, matching it to its VLAN as it crosses the switch fabric
Access Port (untagged port)A member of only one VLAN. When a frame is placed on an access port, its VLAN tag is removed
// Common Trunking Methods
MethodNotable Facts
ISL (Inter-Switch Link)Cisco-proprietary trunking standard (deprecated); adds a new header and trailer to the existing frame; Cisco devices only
IEEE 802.1QOpen, defined standard for trunks; encapsulates the VLAN tag using space in the standard frame header; works with all major manufacturers' equipment
// Example ISL Configuration
Switch(config)# interface f0/1 Switch(config-if)# description link to CyberDSW Switch(config-if)# switchport trunk encapsulation ISL
// Example 802.1Q Configuration
Switch(config)# interface f0/1 Switch(config-if)# description link to CyberDSW Switch(config-if)# switchport trunk encapsulation dot1q
// Note — If the switchport trunk encapsulation dot1q command isn't recognized, the switch already only uses dot1q encapsulation by default, so there's no need to run it.
10
Management VLANs & Logical SecurityTOPIC 10 OF 10
// Management VLAN
PurposeUsed for Telnet (logging onto a device), SNMP (Simple Network Management Protocol — manage/monitor devices), and syslog (devices sending messages to a logging server)
Default BehaviorSwitches use VLAN 1 as the default VLAN for in-band management and to communicate with other devices using STP, CDP, DTP (Dynamic Trunking Protocol), VTP (VLAN Trunking Protocol), and PAgP (Port Aggregation Protocol) — all as untagged traffic
The RiskIf not appropriately pruned, VLAN 1 may unwisely span the entire network. The larger its scope, the greater the risk of compromise
Best PracticeDo not make VLAN 1 the management VLAN. Prune unnecessary ports from both VLAN 1 and the management VLAN, and separate in-band management, device protocol, and data traffic
// Example Management VLAN Configuration
Switch(config)# interface vlan 99 Switch(config-if)# description Management VLAN Switch(config-if)# ip address 172.16.10.2 255.255.255.0 Switch(config-if)# no shutdown
// Note — Assigning an IP address to the switch is solely for remote access; it is not tied to any particular port.