Sub topic 2
Looking Up the Destination and Forwarding
Assume you know Ethernet frame fields, MAC addresses, and the difference between a switch, hub, and router. This chapter focuses on how a switch chooses the output port after receiving a frame.
Destination lookup
A switch reads the frame's destination MAC address and searches its MAC address table. The table maps a MAC address to a port, usually within a VLAN.
If the destination is a known unicast address, the switch sends the frame only through the matching port. A unicast address identifies one network interface.
| Destination condition | Switch action |
|---|---|
| Known unicast on another port | Forward to that port |
| Unknown unicast | Flood within the VLAN |
| Broadcast or multicast | Flood within the VLAN |
| Known address on the ingress port | Filter the frame |
“Flood” means sending a copy through every eligible port except the port where the frame arrived. The switch floods an unknown unicast because it has no information about the destination's location. The destination can then receive the frame and send a reply, allowing the switch to learn its address.
Broadcast addresses target every device in the broadcast domain. Multicast addresses target a group of devices. Basic switching treats both as flooding traffic, although multicast-specific features can reduce unnecessary copies.
Filtering
Filtering means transmitting no copy from the ingress port. This happens when the destination MAC is already associated with the same port where the frame arrived. The destination is reachable through that port, so sending the frame elsewhere would be unnecessary.
Aging
A learned entry is temporary. The switch refreshes its timestamp whenever it receives a frame with that source MAC. If no frame arrives before the aging timer expires, the switch removes the entry. The next frame for that address is treated as an unknown unicast and flooded.
Aging handles disconnected hosts and changing topologies. It also prevents obsolete mappings from remaining indefinitely.
Exercise
A frame arrives on port 1 for a unicast MAC learned on port 1. What does the switch do?
Show answer
It filters the frame and sends no copy out of any port.