What happens to the MAC address table when a switch receives a frame from a known source MAC address?

Switches use MAC addresses to direct network communications through their switch fabric to the appropriate port toward the destination node. The switch fabric is the integrated circuits and the accompanying machine programming that allows the data paths through the switch to be controlled. For a switch to know which port to use to transmit a unicast frame, it must first learn which nodes exist on each of its ports.

A switch determines how to handle incoming data frames by using its MAC address table. A switch builds its MAC address table by recording the MAC addresses of the nodes connected to each of its ports. Once a MAC address for a specific node on a specific port is recorded in the address table, the switch then knows to send traffic destined for that specific node out the port mapped to that node for subsequent transmissions.

When an incoming data frame is received by a switch and the destination MAC address is not in the table, the switch forwards the frame out all ports, except for the port on which it was received. When the destination node responds, the switch records the node's MAC address in the address table from the frame's source address field. In networks with multiple interconnected switches, the MAC address tables record multiple MAC addresses for the ports connecting the switches which reflect the node's beyond. Typically, switch ports used to interconnect two switches have multiple MAC addresses recorded in the MAC address table.

To see how this works, view each of the steps in Figures 1-6.

The following describes this process:

Step 1. The switch receives a broadcast frame from PC1 on Port 1.

Step 2. The switch enters the source MAC address and the switch port that received the frame into the address table.

Step 3. Because the destination address is a broadcast, the switch floods the frame to all ports, except the port on which it received the frame.

Step 4. The destination device replies to the broadcast with a unicast frame addressed to PC1.

Step 5. The switch enters the source MAC address of PC2 and the port number of the switch port that received the frame into the address table. The destination address of the frame and its associated port is found in the MAC address table.

Step 6. The switch can now forward frames between source and destination devices without flooding, because it has entries in the address table that identify the associated ports.

Note: The MAC address table is sometimes referred to as a content addressable memory (CAM) table. While the term CAM table is fairly common, for the purposes of this course, we will refer to it as a MAC address table.

What happens to the MAC address table when a switch receives a frame from a known source MAC address?

The Ethernet switch has become an integral part of the world’s LAN infrastructure. At its core, the Ethernet is a shared network, each node contending for access to precious bandwidth and dealing with the repercussions of collisions.

Before switches, hubs received Ethernet frames and forwarded them to every connected device. There was no privacy or security and performance was poor. What the network needed was a more logical device that could make decisions for where to send data and block the traffic flow to irrelevant devices. The switch accomplishes these requirements by executing four basic functions: Learning, Forwarding, Filtering and Flooding. These functions are present in a switch by default, right out of the box. No configuration is necessary.

Now, imagine that we have a switch with four ports and four user workstations. We’ll call these workstations A, B, C and D and we’ll number the ports 1, 2, 3 and 4. The chart below provides a list of the four workstations and their respective MAC addresses.

 Workstation MAC Address
 A  02:60:8c:12:34:56
 B  02:60:8c:34:56:78
 C  00:10:4c:39:47:6c
 D  00:02:67:80:5c:1a

It’s important to remember that every Ethernet frame contains two MAC addresses. The source address is always a unicast MAC address. The destination address will be either a unicast addresses, a multicast address or a broadcast address. The switch has the ability to read and process both the destination address and the source address.

Learning

Let’s start with learning. 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. As the switch receives a data packet, it reads the source address and maps the port number to the MAC address in that source field. The following diagram shows what a MAC Address Table entry looks like if Workstation A is plugged into Port 1 of our switch and sends a frame.

 Port # MAC Address
1 02:60:8c:12:34:56
2  
3  
4  

Because the MAC address table is in memory, not persistent storage, the table is also temporary. In fact, MAC address tables have a timer that, once expired, results in the deletion of the entry. There is an important reason for this. Let’s say Workstation A is plugged into Port 1 then quickly switches to Port 2. The same MAC address will appear on both Port 1 and Port 2. The switch will use the port that has the longest timer, indicating that it is the most recent entry and therefore the most accurate. Most switches have a default timer of 300 seconds (5 minutes).

But this is only half of the process. As you can see in the above MAC Address Table, no other device has been identified on our switch. Let’s continue with our scenario. Workstation A was trying to send a frame to Workstation D. But where is Workstation D? From the switch’s perspective, this is unknown. The switch must rely on another function to find the destination. This second function is called Flooding.

Flooding

Flooding means that the switch sends the incoming frame to all occupied and active ports (except for the one from which it was received). In essence, flooding is when a switch pretends to be a hub. There are two basic reasons why a switch will flood a frame.

1. When the switch receives a broadcast, it has no choice but to continue the broadcast. Protocols like ARP and DHCP (among others) rely on these broadcasts for their basic function. The following diagram is an example of what an Ethernet frame header might look like as a broadcast.

[FF:FF:FF:FF:FF:FF] [02:60:8c:12:34:56] [0806]
Destination Source ARP

2. When the switch receives a frame dedicated for a particular destination but that destination does not have an entry in the MAC Address Table, the switch has no choice but to flood the frame. The goal of this flood is that the device using the MAC address in the destination of the frame will receive the flood and respond to the message. If that device responds, then the switch can learn their MAC address and map it to the port into which the message arrives. The following diagram is an example of what an Ethernet frame header might look like. Notice that the destination MAC address does not match the MAC Address Table above.

[00:02:67:80:5c:1a] [02:60:8c:12:34:56] [0800]
Destination Source IP

The following diagram shows the new MAC Address Table now that the response to the flood has been received.

Port #MAC Address
1 02:60:8c:12:34:56
2  
3  
4 00:02:67:80:5c:1a

Forwarding

Now that Workstation A and Workstation D are both identified by their port numbers, the switch can do what switches do. Workstation A can now continue its conversation with Workstation D. But this time, when the switch receives the frame (see the diagram below), it first looks up the destination address in the MAC Address Table. It then forwards the frame to that specific port. In our scenario, Workstation A is connected to Port 1 and Workstation D is connected to Port 4. When the switch receives the frame, it immediately forwards that frame to Port 4.

[00:02:67:80:5c:1a] [02:60:8c:12:34:56] [0800]
Destination Source IP

Filtering

So what about Workstations B and C? Well, due to filtering, Workstations B and C are none the wiser. Let’s fill in the rest of our MAC table.

Port #MAC Address
1 02:60:8c:12:34:56
2 02:60:8c:34:56:78
3 00:10:4c:39:47:6c
4 00:02:67:80:5c:1a

The switch intentionally filters out ports 2 and 3, only forwarding the data to the destination MAC address identified in the frame header.

These four default functions are just the beginning. Managed switches can include performance optimization, security, monitoring, diagnostics and more. But that’s for another discussion.

Recommend courses to become a switch expert

  • Understanding Networking Fundamentals
  • CCNA - Cisco Certified Network Associate

Subscribe

Never miss another article. Sign up for our newsletter.

What does a switch do when it receives a frame with a MAC address for which it has no entry in the switch CAM table?

If no entry exists, it will flood the first packet out of all ports in the VLAN to which the frame belongs, except the port the frame arrived on. Host B will respond to this broadcast and the switch will enter the MAC address of Host B and the port to which it is attached into its CAM table.

When a switch receives an Ethernet frame what does it do if the source MAC address is not in its MAC address table?

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 to a frame on the switch receives it?

It connects multiple devices. It uses MAC addresses of the sender and receiver devices to process the frame. When a switch receives a frame, it reads the source address of that frame and stores it into a table known as the CAM table. This process is known as the Learning addresses.

When a switch receives a frame with a source MAC address that it has not seen previously?

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.