Frame Switching Overview
The switch builds a MAC address table to efficiently forward Ethernet frames to destination devices and reduce unnecessary network traffic. The MAC address table on a Cisco switch is like a directory that keeps track of which devices are connected to which ports on the switch, helping the switch to forward data to the correct destination.
This table stores MAC addresses in the switch's RAM (Random Access Memory). By associating MAC addresses with specific switch ports, the table provides a reference for the switch to determine where to send data packets. When the switch receives a unicast frame, it checks the MAC address table to find the corresponding port and forwards the frame through that port.
In the case of multicast frames, the switch forwards the frame to all ports where the multicast group members are located, while for broadcast frames, the switch broadcasts (floods) the frame through all interfaces except the incoming interface.
Flooding also happens when the switch receives an unknown unicast frame, or in other words, a frame with a unicast destination MAC address that is currently not available in the MAC address table.
A Cisco switch uses a process called MAC address learning to populate the MAC address table. When a switch receives a frame with an unknown source MAC address, it saves the source MAC address and the port (interface ID) it received in its MAC address table. This process ensures that the switch knows where to send future data destined for that MAC address.
However, if a device is replaced or moved to a different port, the switch dynamically updates its MAC address table to maintain accurate information about the network's devices and locations. This dynamic learning process guarantees that the switch accurately and efficiently makes forwarding decisions.
Let's explore how MAC address learning works on a Cisco switch. As the image above shows, PC A sends a frame to PC B in the initial step. Since the switch lacks information about the source MAC address in its MAC address table, it records the MAC address and associates it with the incoming port, in this case, FastEthernet0/1.
In the second step, the switch broadcasts the frame on all other ports because it doesn't know the destination MAC address of PC B yet.
When PC B responds to PC A in step three, the switch examines the source MAC address in the frame. Since it doesn't recognize PC B's MAC address, it adds it to the MAC address table and links it to interface FastEthernet0/2.
Subsequently, relying on the MAC address table, the switch forwards the frame to PC A based on the destination MAC address in the frame.