Switches: The Rest of the Story


In the previous section, the switch had a MAC address table, and it made its decisions about where to forward the frames based on that table. However, you don't yet know how the table got into the switch, or whether the information is accurate. Also, what happens when the switch gets a frame, and the destination MAC address isn't in the MAC address table? Simply put, you haven't seen all the details yet, so in this next section, I'll fill in the holes in the story. First, you'll read about how a switch learns the entries to put in the MAC address table. You'll also read about what a switch does when it doesn't yet have an entry for a particular MAC address.

Painting the Road Signs: Learning MAC Addresses

Switches forward frames based on the destination MAC address in the frame. But how does the switch figure out what should be in the MAC address table in the first place? Well, as it turns out, switches dynamically learn MAC addresses and the corresponding ports. This process of learning MAC addresses, according to switch experts, is cleverly called learning.

Figure 6-9 shows the familiar old network with Fred and the gang. However, at Step 1, the switch has no entries in the MAC address table. This is typical when the switch first powers up.

Figure 6-9. Learning by ListeningA Great Life Lesson


The switch learns the MAC address of the sender of each frame by examining the source MAC address. Whenever a NIC sends an Ethernet frame, the NIC places its own MAC address into the frame as the source MAC address. Figure 6-9 shows two frames: one sent by Fred and one sent by Barney. The following list describes what happens in the switch as a result of each frame:

1.

When Fred sends a frame, the frame contains Fred's MAC address (0200.1111.1111) in the source address field of the Ethernet header. The switch knows that the MAC address of whoever sent the frame should be in the source address field. So, the switch believes MAC address 0200.1111.1111 is connected to the port in which the switch received the frameport E0 in this case. The switch simply adds 0200.1111.1111 to the MAC address table, and it associates port E0 with that MAC address.

2.

When Barney sends a frame, the switch learns Barney's MAC address (0200.2222.2222) by looking at the source address of the frame that Barney sent. The switch associates that MAC address with port E1 because that's the port in which the frame was received.

The Forward Versus Filter Decision

Switch pundits refer to the basic logic of how a switch forwards frames as the forward versus filter decision. Simply put, when a switch receives a frame, it sends the frame out one port, based on a comparison of the destination MAC address and the MAC address table. That is considered to be a forwarding decision. Conversely, by not sending the frame out other ports, the switch has simply filtered the frame from exiting those ports, which is a filtering decision.

What to Do When the Road Sign (Address Table) Doesn't List Your Destination

What should a switch do with a frame that is sent before the switch has learned the MAC address table? Well, in short, the switch performs a function called flooding. Essentially, flooding means that when the switch receives a frame whose destination address is not in the MAC address table, the switch forwards the frame out all ports except the one in which the frame was received.

note

Does that switch flooding logic sound familiar? It should. It's the same effect as what a hub does, all the time. So, sometimes people refer to a hub's behavior as flooding as well.


Figure 6-10 shows the same familiar network, this time focusing on the first frame Fred sent to Barney, before the switch knew where Barney's MAC address resided.

Figure 6-10. Switch Logic for Unknown Destinations


As shown in the figure, the switch floods the frame, so Barney, Wilma, and Betty all get a copy. Barney replies, and at that point, the switch table has an entry for Barney's MAC address. Therefore, any future frames sent to Barney will be forwarded correctly.

How to Go Everywhere at the Same Time

So far, when discussing MAC addresses (in other words, Ethernet addresses), I have always implied that a MAC address represented an individual NIC attached to a LAN. Well, it is true that many MAC addresses represent individual NICs. Addresses that represent an individual NIC are called unicast MAC addresses.

Ethernet also defines a special MAC address, called the broadcast address. The Ethernet broadcast address is FFFF.FFFF.FFFF. When a computer sends a frame with a destination address of FFFF.FFFF.FFFF, it means that the frame should be forwarded to all devices on the LAN.

So, imagine that a switch receives a frame, a frame whose destination MAC address is the broadcast address. What should it do? The switch simply floods the frame out all ports (except the port in which it was received), as shown in Figure 6-11.

Figure 6-11. Switch Flood Broadcast Frames


Summary of Switch Logic

Throughout this chapter, you've learned several points about how a switch works. Before you move on to the last section of this chapter, it's worthwhile to review the key points:

  • Switches decide where to forward frames by comparing the destination address of the frame to the MAC address table.

  • Switches build the entries in the MAC address table by looking at the source MAC address of frames they receive.

  • The forward versus filter decision simply means that the switch forwards the frame out only the required ports (forwarding) and does not forward (in other words, it filters) the frame from being sent out other ports.

  • The switch floods frames that are sent to unknown unicast addresses; unknown unicast addresses are unicast addresses that the switch has not added to its MAC address table yet.

  • The switch floods frames sent to the broadcast address.

  • Switches avoid collisions by buffering frames instead of trying to send multiple frames out the same twisted pair at the same time.




Computer Networking first-step
Computer Networking First-Step
ISBN: 1587201011
EAN: 2147483647
Year: 2004
Pages: 173
Authors: Wendell Odom

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net