Figure 21 The MAC Address Table Is Initially Empty

Mac Address TableAddress Table The Network Devices

In this example network, consider what happens when device A sends a frame destined for device D. The switch receives the frame on port 1 (from device A). Recall that a frame includes the MAC address of the source device and the MAC address of the destination device. Because the switch does not yet know where device D is, the switch must flood the frame out of all the other ports; therefore, the switch sends the frame out of ports 2, 3, and 4. This means that devices B, C, and D all receive the frame. Only device D, however, recognizes its MAC address as the destination address in the frame; it is the only device on which the CPU is interrupted to further process the frame.

In the meantime, the switch now knows that device A can be reached on port 1 (because the switch received a frame from device A on port 1); the switch therefore puts the MAC address of device A in its MAC address table for port 1. This process is called learningthe switch is learning all the MAC addresses that it can reach.

At some point, device D is likely to reply to device A. At that time, the switch receives a frame from device D on port 4; the switch records this information in its MAC address table as part of its learning process. This time, the switch knows where the destination, device A, is; the switch therefore forwards the frame only out of port 1. This process is called filteringthe switch is sending the frames only out of the port through which they need to gowhen the switch knows which port that israther than flooding them out of all the ports. This reduces the traffic on the other ports and reduces the interruptions that the other devices experience.

Over time, the switch learns where all the devices are, and the MAC address table is fully populated, as shown in Figure 2-2.

Figure 2-2. The Switch Learns Where All the Devices Are and Populates Its MAC Address Table

Figure 2-2. The Switch Learns Where All the Devices Are and Populates Its MAC Address Table

Mac Address Table Image Networking

The filtering process also means that multiple simultaneous conversations can occur between different devices. For example, if device A and device B want to communicate, the switch sends their data between ports 1 and 2; no traffic goes on ports 3 or 4. At the same time, devices C and D can communicate on ports 3 and 4 without interfering with the traffic on ports 1 and 2. Thus, the overall throughput of the network has increased dramatically.

The MAC address table is kept in the switch's memory and has a finite size (depending on the specific switch used). If many devices are attached to the switch, the switch might not have room for an entry for every one, so the table entries will time out after a period of not being used. For example, the Cisco Catalyst 2950 switch defaults to a 300-second timeout. Thus, the most active devices are always in the table.

Continue reading here: Redundancy in Layer 2 Switched Networks

Was this article helpful?

0 0

Readers' Questions

  • THOMAS
    Which type of address does a switch use to build the mac address table?
    9 months ago
  • A switch uses the Layer 2 Media Access Control (MAC) address to build its MAC address table.
    • marco
      What type of network device keeps a table of the mac addresses of the devices connected to it?
      10 months ago
    • A switch.
      • luwam
        How switch learns mac address?
        10 months ago
      • A switch learns MAC addresses as it receives and sends frames. When a frame is forwarded out of a port, the switch updates its MAC address table with the source address of the frame, associating it with the port it was sent on. When a frame is received by the switch, the destination address of the frame is compared to the entries in the MAC address table. If a match is found, the frame is forwarded out of the port associated with the destination address. If a match is not found, the frame is flooded out of all ports on the switch, except for the port it was received on.