Modern switches do more than forward frames by MAC address. VLANs (Virtual Local Area Networks) divide a single physical switch into separate broadcast domains, trunking carries many VLANs across one cable, link aggregation bonds interfaces for more throughput, and Spanning Tree Protocol (STP) prevents the loops that redundant links create. Interface speed, duplex, MTU, and jumbo frames all factor into a correctly performing link. These notes follow Prof. Messer’s Network+ N10-009 videos: VLANs and Trunking, Interface Configurations, Spanning Tree Protocol.
⏱ Video — VLANs and Trunking (12:20): 0:02 lan and broadcast domains · 1:25 virtual lans · 2:22 extending vlans across switches · 3:20 vlan trunks and 802.1q · 4:02 the vlan tag · 4:51 isl and the 802.1q standard · 5:14 a tagged frame crosses the trunk · 6:17 default and native vlans · 7:35 layer 3 switches · 8:51 switched virtual interfaces · 9:17 layer 3 switch tradeoffs · 10:00 voice and data on one network · 11:20 separating voice and data vlans
⏱ Video — Interface Configurations (6:31): 0:02 ethernet speed and duplex · 0:51 auto-negotiation · 1:15 mismatched speed and duplex · 1:54 ip configuration · 2:57 link aggregation · 3:44 link aggregation control protocol · 4:14 mtu and fragmentation · 5:02 jumbo frames
⏱ Video — Spanning Tree Protocol (5:57): 0:02 loops on a switched network · 0:47 removing a loop manually · 1:12 the 802.1d standard · 1:25 spanning tree port states · 2:20 a running spanning tree example · 2:47 root designated and blocked ports · 3:39 convergence after a failure · 4:37 rapid spanning tree protocol · 5:20 rstp backward compatibility
VLANs and trunking
- A LAN (Local Area Network) is a group of devices in the same broadcast domain. Two separate switches, unconnected, form two separate broadcast domains — but running two switches costs twice the power, space, and management overhead.
- VLANs solve this by carving one physical switch into multiple logical broadcast domains. Each interface is assigned a VLAN number (not a colour) and only devices in the same VLAN can communicate directly.
- Connecting VLANs across multiple physical switches with a separate cable per VLAN does not scale. Instead, a single trunk (802.1Q) interface carries traffic for all VLANs between switches.
- The 802.1Q VLAN tag is inserted into the Ethernet frame between the source MAC address and the type field. It is 12 bits long, allowing up to 4,094 VLANs on a trunk.
- ISL (Inter-Switch Link) was a Cisco-proprietary trunking protocol that predated 802.1Q. ISL is largely obsolete; nearly all trunks today use 802.1Q.
- On the sending switch, the trunk interface adds the VLAN tag; the receiving switch reads the tag, strips it, and forwards the frame to the correct VLAN.
- A default VLAN (commonly VLAN 1) is the VLAN every interface belongs to out of the box. A native VLAN is the VLAN on a trunk whose frames are not tagged — used for switch-management traffic and for devices that cannot speak 802.1Q. The native VLAN must be configured identically on both ends of the trunk or log errors will appear.
Layer 3 switching
- A Layer 3 switch combines OSI Layer 2 switching (MAC-based forwarding) and OSI Layer 3 routing (IP-based forwarding) in a single chassis. This saves space, power, and administrative overhead.
- Routing between VLANs inside a Layer 3 switch is done through SVIs (Switched Virtual Interfaces). Layer 3 functionality may be disabled by default and often requires a reboot after enabling it.
- The tradeoff: a Layer 3 switch’s routing capability is less capable than a standalone router. The rule of thumb is “switches switch, routers route” — combining both in one device loses functionality, but is a common choice for remote sites and small home routers.
Voice and data VLANs
- With VoIP (Voice over IP), a single Ethernet cable carries both voice and data traffic. The phone connects to the switch, and the computer plugs into the back of the phone.
- Data traffic is bursty; voice needs consistent, low-latency access. If both share the same VLAN, congestion hurts call quality.
- The solution: assign the phone to one VLAN (e.g. VLAN 200) and the computer to another (e.g. VLAN 100). The switch and phone negotiate the trunk so both VLANs traverse the same physical cable.
Interface configurations
| Setting | Description | Pitfall |
|---|---|---|
| Speed | 10 Mbps, 100 Mbps, 1 Gbps, 10 Gbps, etc. | Must match on both sides; no link if mismatched |
| Duplex | Half-duplex (one direction) or full-duplex (both) | Mismatch → link works but performs poorly under load |
| Auto-negotiation | Devices automatically agree on speed and duplex | Usually the safest setting |
- IP configuration: every interface (Ethernet, VLAN, management) needs an IP address, subnet mask, default gateway, and often DNS settings. Validate by checking configured values against what the network admin assigned.
- LAG (Link Aggregation), also called port bonding, bundles multiple physical interfaces into one logical link. Four 1 Gbps ports bonded as a LAG give 4 Gbps of throughput.
- LACP (Link Aggregation Control Protocol) automates LAG configuration. Configure interfaces as LACP, plug them in, and the switches negotiate the bundle automatically. LACP frames are visible in a packet capture.
- MTU (Maximum Transmission Unit): the largest frame a link can carry without fragmentation. Fragmentation slows performance and losing one fragment means retransmitting the whole frame. MTU is usually auto-negotiated but firewalls sometimes block that process, requiring manual configuration.
- Jumbo frames increase the Ethernet MTU from the default 1,500 bytes up to 9,216 bytes (commonly 9,000). Fewer frames mean fewer switch/routing decisions and more data moved per second. Every device in the communication path must support jumbo frames; one non-jumbo device will drop the oversized frames silently.
Spanning Tree Protocol
- Connecting two switches with two cables creates a loop. Ethernet frames have no hop counter at Layer 2, so they circulate indefinitely, eventually overwhelming the switches. The fix: pull one cable.
- Spanning Tree Protocol (STP, IEEE 802.1D) automates loop prevention. It detects loops and blocks one or more ports so no frame circulates.
- STP port states:
- Blocking: no traffic forwarded (the loop-prevention state)
- Listening: clearing existing tables and discovering the topology
- Learning: building the forwarding table (no traffic forwarded yet)
- Forwarding: normal operation, traffic passes
- Disabled: administratively turned off, does not participate in STP
- In a running STP network, ports are classified as:
- Root Port (RP): the port on each non-root switch that has the best path to the single root bridge
- Designated Port (DP): any other port that forwards traffic but is not the root port
- Blocked Port: a port STP has disabled to prevent a loop
- When a link fails, STP converges: it clears old tables, relearns the topology, and unblocks alternate paths. Original STP takes 30–50 seconds to converge.
- Rapid Spanning Tree Protocol (RSTP, IEEE 802.1W) converges in about 6 seconds. RSTP is backwards-compatible with original STP, so mixed-device networks work fine.
Where attacks live — mental map (beyond the video)
Not from the video — why this matters for security.
- VLAN hopping attacks try to escape one VLAN and reach another by exploiting trunk misconfiguration (e.g. double-tagging or setting the native VLAN to a user-facing port). Disable trunking on access ports and use a dedicated, unused native VLAN.
- STP manipulation: an attacker can send BPDU (Bridge Protocol Data Unit) messages to become the root bridge and redirect traffic through their device. Use BPDU Guard and Root Guard on access ports.
- MAC flooding overwhelms a switch’s MAC address table, causing it to fall back to hubs-like flooding — every frame reaches every port, turning the switch into a traffic observable point. Port security limits help.
- A link-aggregation misconfig (one LAG member on a different VLAN or an un-bundled port) can create a loop that STP might not fully mitigate before the network degrades.
- Jumbo frames from an attacker could be dropped silently by intermediate gear, enabling a low-and-slow data exfiltration channel if MTU inconsistencies are known.