Networking Fundamentals · lesson 7 of 17 · 12 min
How switches work A switch is a Layer 2 device that connects devices on the same local network. Unlike a hub (which broadcasts to all ports), a switch learns which MAC address is on which port and forwards frames only to the correct destination. MAC address table When a frame arrives, the switch records the source MAC and the port it came from in its MAC address table (CAM table). When it needs to forward a frame, it looks up the destination MAC. If not found, it floods the frame to all ports except the source. VLANs VLANs (Virtual LANs) logically segment a physical switch into multiple isolated networks. Devices on VLAN 10 cannot communicate with VLAN 20 without going through a router (or Layer 3 switch). VLANs are a key security control — they isolate sensitive systems (servers, IoT devices) from general user traffic.
Switching quiz
A switch receives a frame destined for a MAC address not in its CAM table. What does it do?
- Drops the frame
- Sends it to the default gateway
- Floods it to all ports except the source
- Sends an ARP request
Answer: Floods it to all ports except the source
When the destination MAC is unknown, the switch floods the frame to all ports. The correct device will respond, and the switch will learn its port.
What is the primary security benefit of VLANs?
- They encrypt traffic between devices
- They isolate network segments so devices on different VLANs cannot communicate directly
- They prevent MAC address spoofing
- They replace the need for firewalls
Answer: They isolate network segments so devices on different VLANs cannot communicate directly
VLANs create logical isolation. Traffic between VLANs must pass through a router or Layer 3 switch, where security policies can be enforced.
Previous lesson: Subnetting practice
Back to Networking Fundamentals
Next lesson: How routers work