During the early days of personal computing, connecting ten computers in a small business office presented a terrifying engineering challenge. If administrators connected machines directly to one another in a peer-to-peer mesh, wiring just ten workstations required forty-five individual copper cables crisscrossing office floors and nine separate network expansion cards crammed into every single computer tower. If the office grew to fifty computers, direct cabling would require a mind-boggling 1,225 cables.
Modern networking solved this physical cabling nightmare by adopting the Star Topology powered by an intelligent central hardware device: the Layer 2 Ethernet Switch. Instead of running cables between individual computers, every workstation runs a single, neat Category 6 cable straight into a dedicated port on a central switch. The switch becomes the central traffic controller, seamlessly directing millions of data frames per second between connected machines.
How Layer 2 Switches Learn
Unlike early legacy hubs that blindly copied incoming electrical signals and blasted them out of every port simultaneously, a modern Layer 2 switch is an intelligent computer in its own right. It contains high-speed dedicated memory known as the MAC Address Table (or Content-Addressable Memory / CAM Table). When you power on a switch, this table is completely blank.
The switch populates and maintains its CAM table through a continuous three-stage operational cycle:
- Learning (Source Inspection): Whenever an electrical frame enters any physical port, the switch inspects the Source MAC address inside the Ethernet header. It immediately writes an entry into its CAM table: "Device MAC 00:1B:44:11:22:33 is plugged into physical Port 1."
- Forwarding (Target Lookup): When the switch needs to deliver a frame, it inspects the Destination MAC address. If that MAC already exists in its CAM table, the switch forwards the frame strictly and exclusively out the matching target port. Other computers hear complete silence on their ports, preserving their bandwidth and maintaining privacy.
- Flooding (Unknown Unicast): If the destination MAC has not yet been learned, the switch does not discard the frame. Instead, it floods a copy of the frame out of every active port except the one the frame came in on, guaranteeing that the target computer receives it and responds.
| Switch Physical Port | Learned Device MAC | Connected Host | VLAN Assignment |
|---|---|---|---|
| FastEthernet 0/1 | 00:1B:44:11:22:33 |
Workstation PC-1 | VLAN 1 (Default) |
| FastEthernet 0/2 | 00:1B:44:22:33:44 |
Workstation PC-2 | VLAN 1 (Default) |
| FastEthernet 0/3 | 00:1B:44:33:44:55 |
Workstation PC-3 | VLAN 1 (Default) |
Collision Domain Elimination: In the era of legacy network hubs, all connected computers shared a single collision domain; if two machines spoke simultaneously, electrical signals collided and corrupted. Ethernet switches provide micro-segmentation: each switch port is an independent, isolated collision domain operating at Full Duplex, allowing simultaneous 100 Mbps transmission and reception.
Broadcast Domains and Flooding
While an Ethernet switch cleanly isolates individual collision domains, all ports on an unmanaged Layer 2 switch share the same Broadcast Domain. When PC-1 broadcasts an ARP request (FF:FF:FF:FF:FF:FF) asking for the owner of IP 192.168.1.30, the switch floods that ARP frame to PC-2 and PC-3.
PC-2 inspects the request, sees that the IP is not its own, and quietly discards the packet. PC-3 detects its own IP, formulates an ARP reply, and sends it back through Port 3. The moment that reply enters Port 3, the switch learns PC-3 MAC address and establishes bidirectional unicast forwarding.
Hands-On Switch Lab
In this lab on the right, Workstation PC-1 (192.168.1.10) and PC-2 (192.168.1.20) are already connected to Port 1 and Port 2 of Office Switch SW1. However, Workstation PC-3 (192.168.1.30) is sitting unconnected with no physical cable link.
Select the Cable tool from the left toolbar, choose a standard Copper Straight-Through cable, and connect PC-3 to Switch SW1 Port 3. Observe the green link indicators illuminate on both sides. Next, open the PC-1 Terminal tab and execute ping 192.168.1.30 to verify that the switch successfully forwards packets across the star topology with zero packet loss.
