1.9 Switching Concepts
Key Takeaways
- Switches learn MAC addresses by reading the source MAC of incoming frames and storing them in the MAC address table.
- If the destination MAC is known, the switch forwards the frame to the specific port (known unicast).
- If the destination MAC is unknown, the switch floods the frame out all ports except the source port.
- Broadcast frames (FF:FF:FF:FF:FF:FF) are always flooded to all ports in the VLAN.
- The MAC address table (CAM table) entries age out after 300 seconds (5 minutes) by default.
Switching Concepts
Understanding how Layer 2 switches process Ethernet frames is essential for the CCNA exam. Switches are the most common devices in enterprise LANs, and their behavior is the foundation for VLANs, STP, and EtherChannel.
MAC Address Table (CAM Table)
The MAC address table (also called the Content Addressable Memory (CAM) table) maps MAC addresses to switch ports. This table is how the switch knows where to send frames.
MAC Address Learning
When a frame arrives on a switch port:
- The switch reads the source MAC address
- It records the MAC address and the port it arrived on in the MAC address table
- If the MAC address already exists but on a different port, the switch updates the entry
- Each entry has a timer that resets when the MAC is seen again (default: 300 seconds)
MAC Address Table Example
| MAC Address | Port | VLAN | Timer |
|---|---|---|---|
| 00:1A:2B:3C:4D:5E | Gi0/1 | 10 | 180s |
| 00:1A:2B:3C:4D:5F | Gi0/2 | 10 | 240s |
| 00:1A:2B:3C:4D:60 | Gi0/3 | 20 | 120s |
Viewing the MAC address table on Cisco IOS:
Switch# show mac address-table
Switch# show mac address-table dynamic
Switch# show mac address-table address 00:1A:2B:3C:4D:5E
Frame Forwarding Decisions
When a switch receives a frame, it makes one of three decisions based on the destination MAC address:
1. Known Unicast (Forward)
If the destination MAC is in the MAC address table, the switch forwards the frame out the specific port associated with that MAC. This is the most efficient forwarding behavior.
2. Unknown Unicast (Flood)
If the destination MAC is NOT in the MAC address table, the switch floods the frame out all ports in the VLAN except the port it was received on. This ensures the frame reaches its destination even when the switch doesn't know where it is.
3. Broadcast (Flood)
If the destination MAC is the broadcast address (FF:FF:FF:FF:FF:FF), the switch floods the frame out all ports in the VLAN. ARP requests are a common example of broadcast frames.
4. Multicast
By default, switches treat multicast frames like broadcasts and flood them. With IGMP snooping enabled, the switch can forward multicast frames only to ports that have requested the multicast group.
Frame Switching Methods
| Method | Description | Latency | Error Handling |
|---|---|---|---|
| Store-and-Forward | Receives the entire frame, checks CRC, then forwards | Higher | Drops corrupt frames |
| Cut-Through | Begins forwarding after reading the destination MAC (first 6 bytes) | Lower | No error checking |
| Fragment-Free | Reads the first 64 bytes (collision fragment size) before forwarding | Medium | Catches collision fragments |
On the Exam: Modern Cisco Catalyst switches use store-and-forward switching by default. This is the most reliable method because it checks the frame's CRC before forwarding, preventing corrupt frames from consuming bandwidth.
Collision Domains and Broadcast Domains
Understanding domain boundaries is critical:
| Domain | Definition | Boundary Device |
|---|---|---|
| Collision domain | Area where frames can collide (only in half-duplex) | Switch port, router port |
| Broadcast domain | Area where broadcast frames are delivered | Router interface, VLAN |
Key facts:
- Each switch port is a separate collision domain (assuming full-duplex)
- All ports in the same VLAN are in the same broadcast domain
- Routers create broadcast domain boundaries
- Switches create collision domain boundaries but NOT broadcast domain boundaries (within a VLAN)
Example: 24-Port Switch
- Collision domains: 24 (one per port)
- Broadcast domains: 1 (if all ports are in the same VLAN)
Example: 24-Port Switch with 3 VLANs
- Collision domains: 24 (one per port)
- Broadcast domains: 3 (one per VLAN)
On the Exam: A common question pattern: "How many collision domains and broadcast domains exist in this topology?" Count each switch port as a collision domain, and count each VLAN (or each router interface) as a broadcast domain boundary.
What does a switch do when it receives a frame with a destination MAC address that is NOT in its MAC address table?
By default, how long does a MAC address entry remain in a Cisco switch MAC address table before aging out?
A switch with 48 ports and 4 VLANs configured has how many broadcast domains?