Find the Destination MAC Address
If the destination MAC address is a unicast address, the switch will look for a match between the destination MAC address of the frame and an entry in its MAC address table. If the destination MAC address is in the table, it will forward the frame out the specified port. If the destination MAC address is not in the table, the switch will forward the frame out all ports except the incoming port. This is called an unknown unicast.
As shown in Figure 21-13, the switch does not have the destination MAC address in its table for PC-D, so it sends the frame out all ports except port 1.
Note:
If the destination MAC address is a broadcast or a multicast, the frame is also flooded out all ports except the incoming port.
Figure 21-13 Switch Forwards the Frame Out All Other Ports
1. The destination MAC address is not in the table.
2. The switch forwards the frame out all other ports.
As a switch receives frames from different devices, it is able to populate its MAC address table by examining the source MAC address of every frame. When the MAC address table of the switch contains the destination MAC address, it is able to filter the frame and forward out a single port.
In Figure 21-14, PC-D is replying back to PC-A. The switch sees the MAC address of PC-D in the incoming frame on port 4. The switch then puts the MAC address of PC-D into the MAC Address Table associated with port 4.
Figure 21-14 Switch Learns the MAC Address for PC-D
Next, because the switch has destination MAC address for PC-A in the MAC Address Table, it will send the frame only out port 1, as shown in Figure 21-15.
Figure 21-15 Switch Forwards the Frame Out the Port Belonging to PC-A
1. The switch has a MAC address entry for the destination.
2. The switch filters the frame, sending it only out port 1.
Next, PC-A sends another frame to PC-D as shown in Figure 21-16. The MAC address table already contains the MAC address for PC-A; therefore, the five-minute refresh timer for that entry is reset. Next, because the switch table contains the destination MAC address for PC-D, it sends the frame only out port 4.
Figure 21-16 Switch Forwards the Frame Out the Port Belonging to PC-D
1. The switch receives another frame from PC-A and refreshes the timer for the MAC address entry for port 1.
2. The switch has a recent entry for the destination MAC address and filters the frame, forwarding it only out port 4.
Video – MAC Address Tables on Connected Switches (21.4.4)
A switch can have multiple MAC addresses associated with a single port. This is common when the switch is connected to another switch. The switch will have a separate MAC address table entry for each frame received with a different source MAC address.
Refer to the online course to view this video.
Video – Sending the Frame to the Default Gateway (21.4.5)
When a device has an IP address that is on a remote network, the Ethernet frame cannot be sent directly to the destination device. Instead, the Ethernet frame is sent to the MAC address of the default gateway, the router.
Refer to the online course to view this video.
Activity – Switch It! (21.4.6)
Use this activity to check your understanding of how a switch learns and forwards frames.
Refer to the online course to complete this Activity.