What happens if a MAC address is not stored in CAM on a switch?

The MAC Address Table (7.3)

Compared to legacy Ethernet hubs, Ethernet switches improve efficiency and overall network performance. Although traditionally most LAN switches have operated at Layer 2 of the OSI model, an increasing number of Layer 3 switches are now being implemented. This section focuses on Layer 2 switches. Layer 3 switches are beyond the scope of this book.

Switch Fundamentals (7.3.1)

Now that you know all about Ethernet MAC addresses, it is time to talk about how a switch uses these addresses to forward (or discard) frames to other devices on a network. If a switch just forwarded every frame it received out all ports, your network would be so congested that it would probably come to a complete halt.

A Layer 2 Ethernet switch uses Layer 2 MAC addresses to make forwarding decisions. It is completely unaware of the data (protocol) being carried in the data portion of the frame, such as an IPv4 packet, an ARP message, or an IPv6 ND packet. The switch makes its forwarding decisions based solely on the Layer 2 Ethernet MAC addresses.

An Ethernet switch examines its MAC address table to make a forwarding decision for each frame. In contrast, a legacy Ethernet hub repeats bits out all ports except the incoming port. In Figure 7-14, the four-port switch was just powered on. The table shows the MAC address table, which has not yet learned the MAC addresses for the four attached PCs.

What happens if a MAC address is not stored in CAM on a switch?

Figure 7-14 Switch Powers Up with an Empty MAC Address Table

Switch Learning and Forwarding (7.3.2)

A switch dynamically builds its MAC address table by examining the source MAC addresses of the frames received on a port. The switch forwards frames by searching for a match between the destination MAC address in a frame and an entry in the MAC address table.

Examine the Source MAC Address

Every frame that enters a switch is checked for new information to learn. It does this by examining the source MAC address of the frame and the port number where the frame entered the switch. If the source MAC address does not exist, it is added to the table, along with the incoming port number. If the source MAC address does exist, the switch updates the refresh timer for that entry. By default, most Ethernet switches keep an entry in the table for 5 minutes.

In Figure 7-15, for example, PC-A is sending an Ethernet frame to PC-D. The table shows that the switch adds the MAC address for PC-A to the MAC address table.

Find the Destination MAC Address

If the destination MAC address is a unicast address, the switch looks 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, the switch forwards the frame out the specified port. If the destination MAC address is not in the table, the switch forwards the frame out all ports except the incoming port. This is called an unknown unicast.

As shown in Figure 7-16, 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.

What happens if a MAC address is not stored in CAM on a switch?

Figure 7-16 Switch Forwards the Frame Out All Other Ports

Filtering Frames (7.3.3)

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, the switch is able to filter the frame and forward out a single port.

In Figure 7-17, PC-D is replying 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.

Next, because the switch has the destination MAC address for PC-A in the MAC address table, it sends the frame only out port 1, as shown in Figure 7-18.

What happens if a MAC address is not stored in CAM on a switch?

Figure 7-18 Switch Forwards the Frame Out the Port Belonging to PC-A

Next, PC-A sends another frame to PC-D, as shown in Figure 7-19. The MAC address table already contains the MAC address for PC-A; therefore, the 5-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 out only port 4.

What happens if a MAC address is not stored in CAM on a switch?

Figure 7-19 Switch Forwards the Frame Out the Port Belonging to PC-D

What happens if an MAC address is not in a forwarding table on the switch?

If the destination MAC address is in the table, the switch forwards the frame out the specified port. If the destination MAC address is not in the table, the switch forwards the frame out all ports except the incoming port. This is called an unknown unicast.

Does Switches store MAC address?

Switches need to keep track of the MAC addresses of all connected devices. Without the learning function, the switch would not know to which port the destination device is connected. At the center of the learning function is a part of the switch's memory. We refer to this memory location as the MAC Address Table.

What is the purpose of the MAC address table in a switch?

The MAC address table is where the switch stores information about the other Ethernet interfaces to which it is connected on a network. The table enables the switch to send outgoing data (Ethernet frames) on the specific port required to reach its destination, instead of broadcasting the data on all ports (flooding).
A MAC Address is given by the manufacturer and it is embedded in the chip that allows your device to connect to a network. For a network switch, it is likely to have many MAC addresses, since one MAC address is assigned to every interface on the switch.