How Switches Forward Frames Explained

An Ethernet switch is a centralized networking device. It works in the middle of the network. It connects end devices to the network. End devices use frames to communicate. A frame is a small piece of the data stream that two end devices exchange. It includes the source address, destination address, protocol-specific information, and data.

A switch has many ports. It forwards an incoming frame only from the port connected to the destination device of the frame. We can divide this process into three phases: learning, decision-making, and forwarding. In this tutorial, we will discuss the decision-making phase.

The following tutorial explains the learning and forwarding phases.

How Switch learns the MAC addresses Explained

Switching Methods and Types Explained

A switch save the MAC addresses of all connected devices into a table known as the CAM table. When it receives a frame, it reads the source MAC address and destination MAC address of the frame. It uses the source address to learn about the connected device. It uses the destination address to make forwarding decision devices.

A switch uses a relatively simple concept to forward a frame. It finds the destination MAC address of the incoming frame in the CAM table. If the CAM table has an entry for the destination MAC address, it forwards the frame from the port mentioned in the entry. If the CAM table does not have an entry for the destination MAC address, it forward the frame from all ports except the port on which it arrived.

The process of forwarding a frame from all ports except the port on which it arrived is called frame flooding. A switch floods a frame if it has an unknown unicast, multicast, or broadcast address in the destination address field. An unknown unicast address is an address that is not available in the CAM table.

A multicast address belongs to a group of devices. A broadcast address belongs to all devices on the local network. Multicast and broadcast are destination-only addresses. These addresses are never used in the source address field of a frame. Since these addresses are never used in the source address field of a frame, and a switch uses the frame's source field to learn addresses, a switch never learns about these addresses. These addresses always remain unknown to the switch.

And as we know, a switch always floods a frame having an unknown address in the destination address field. Because of this, a frame having an unknown unicast, multicast, or broadcast address in the destination address is always flooded by the switch.

Let's understand this process through our example.

PC-1 sends a unicast frame to PC-3. The frame reaches the switch on port 1.

decision making example

The switch reads the destination address field of the frame to make a forwarding decision. A switch reads the frame's destination address field before the source address field. It first makes a forwarding decision based on the destination address and then updates the CAM table based on the source address. This frame has PC3's MAC address in the destination address field. Since PC3's MAC address is not available in the CAM table, the switch decides to flood the frame.

frame flooding

After making a forwarding decision, the switch uses the source address of the frame to update the CAM table. Since this address is already available in the CAM table, it updates the connected port field and resets the aging timer. The frame reaches PC3. PC3 replies with its frame. The frame reaches S1 on port 3.

The switch reads the frame's destination address and finds it in the CAM table to make a forwarding decision. The frame has PC1's MAC address in the destination address field. This address is available in the CAM table. The switch decides to forward the frame from port 1.

frame forwarding

After making the forwarding decision, the switch reads the source address field to update the CAM table. The source address field contains PC3's MAC address. This address is not available in the CAM table. The switch adds a new entry for it in the table. The switch forwards the frame from port 1. The frame reaches PC1.

ComputerNetworkingNotes CCNA Study Guide How Switches Forward Frames Explained