Figure 21 The MAC Address Table Is Initially Empty

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

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.

Was this article helpful?

0 0

Post a comment