Learning MAC Addresses Thankfully, the networking staff doesn’t need to type altogether those MAC table entries. Instead, the switches do their second main function: to learn the MAC addresses and interfaces to place into its address table. With an entire MAC address table, the switch can make accurate forwarding and filtering decisions as just discussed. Switches build the address table by listening to incoming frames and examining the source MAC address within the frame. If a frame enters the switch and therefore the source MAC address isn’t within the MAC address table, the switch creates an entry within the table. That table entry lists the interface from which the frame arrived. Switch learning logic is that simple. Figure 7-6 depicts the same single-switch topology network as Figure 7-3, but before the switch has built any address table entries. The figure shows the primary two frames sent during this network—first a frame from Fred, addressed to Barney, then Barney’s response, addressed to Fred.
(Figure 7-6 depicts the MAC learning process only, and ignores the forwarding process and thus ignores the destination MAC addresses.) focus on the training process and the way the MAC table grows at each step as shown on the right side of the figure. The switch begins with an empty MAC table, as shown within the upper right a part of the figure. Then Fred sends his first frame (labeled “1”) to Barney, therefore the switch adds an entry for 0200.1111.1111, Fred’s MAC address, related to interface F0/1. Why F0/1? The frame sent by Fred entered the switch’s F0/1 port. SW1’s logic runs something like this: “The source is MAC 0200.1111.1111, the frame entered F0/1, so from my perspective, 0200.1111.1111 must be reachable out my port F0/1.”
Continuing the instance , when Barney replies in Step 2, the switch adds a second entry, this one for 0200.2222.2222, Barney’s MAC address, along side interface F0/2. Why F0/2? The frame Barney sent entered the switch’s F0/2 interface. Learning always occurs by looking at the source MAC address within the frame, and adds the incoming interface because the associated port.
Also Read : Verifying and Analyzing Ethernet Switching
Flooding Unknown Unicast and Broadcast Frames
Now again turn your attention to the forwarding process, using the topology in Figure 7-5. What does one suppose the switch does with Fred’s first frame, the one that occurred when there have been no entries within the MAC address table? because it turns out, when there’s no matching entry within the table, switches forward the frame out all interfaces (except the incoming interface) using a process called flooding. and therefore the frame whose destination address is unknown to the switch is named an unknown unicast frame, or just an unknown unicast. Switches flood unknown unicast frames. Flooding means the switch forwards copies of
the frame out all ports, except the port on which the frame was received. the thought is simple: if you are doing not know where to send it, send it everywhere, to deliver the frame. And, by the way, that device will likely then send a reply—and then the switch can learn that device’s MAC address, and forward future frames out one port as a known unicast frame. Switches also flood LAN broadcast frames (frames destined to the Ethernet broadcast address of FFFF.FFFF.FFFF), because this process helps deliver a copy of the frame to all devices within the LAN. for instance , Figure 7-7 shows the same first frame sent by Fred, when the switch’s MAC table is empty. At step 1, Fred sends the frame. At step 2, the switch sends a copy of the frame out all three of the opposite interfaces.
Avoiding Loops Using Spanning Tree Protocol
The third primary feature of LAN switches is loop prevention, as implemented by Spanning Tree Protocol (STP). Without STP, any flooded frames would loop for an indefinite period of your time in Ethernet networks with physically redundant links. to prevent looping frames, STP blocks some ports from forwarding frames so that just one active path exists between any pair of LAN segments. The results of STP is good: Frames don’t loop infinitely, which makes the LAN usable. However, STP has negative features also , including the very fact that it takes some work to balance traffic across the redundant alternate links. an easy example makes the need for STP more obvious. Remember, switches flood unknown unicast frames and broadcast frames. Figure 7-8 shows an unknown unicast frame, sent by Larry to Bob, which loops forever because the network has redundancy but no STP. Note that the figure shows one direction of the looping frame only, just to reduce clutter, but a replica of the frame would also loop the opposite direction also .
The flooding of this frame would cause the frame to rotate around the three switches, because none of the switches list Bob’s MAC address in their address tables, each switch floods the frame. And while the flooding process may be a good mechanism for forwarding unknown unicasts and broadcasts, the continual flooding of traffic frames as within the figure can completely congest the LAN to the purpose of creating it unusable. A topology like Figure 7-8, with redundant links, is good, but we’d like to prevent the bad effect of these looping frames. To avoid Layer 2 loops, all switches got to use STP. STP causes each interface on a switch to settle into either a blocking state or a forwarding state. Blocking means the interface cannot forward or receive data frames, while forwarding means the interface can send and receive data frames. If a correct subset of the interfaces is blocked, only one currently active logical path exists between each pair of LANs.
LAN Switching Summary
Switches use Layer 2 logic, examining the Ethernet data-link header to choose the way to process frames. especially , switches make decisions to forward and filter frames, learn MAC addresses, and use STP to avoid loops, as follows:
Step 1. Switches forward frames based on the destination MAC address:
- If the destination MAC address may be a broadcast, multicast, or unknown destination unicast (a unicast ex-directory within the MAC table), the switch floods the frame.
- If the destination MAC address may be a known unicast address (a unicast address found within the MAC table):
– If the outgoing interface listed within the MAC address table is different from the interface during which the frame was received, the switch forwards the frame out the outgoing interface.
100-105 Official Cert Guide
– If the outgoing interface is that the same because the interface during which the frame was received, the switch filters the frame, meaning that the switch simply ignores the frame and doesn’t forward it.
Step 2. Switches use the following logic to find out MAC address table entries:
- for every received frame, examine the source MAC address and note the interface from which the frame was received.
- If it’s not already within the table, add the MAC address and interface it had been learned on.
Step 3. Switches use STP to prevent loops by causing some interfaces to dam , meaning that they are doing not send or receive frames.
Questions related to this topic
- What field does a switch use to forward a frame?
- What address does Ethernet use to forward frames?
- How does a switch forward frames?
- What does a switch do when a frame is received on an interface and the destination hardware?
This Blog Article is posted by
Infosavvy, 2nd Floor, Sai Niketan, Chandavalkar Road Opp. Gora Gandhi Hotel, Above Jumbo King, beside Speakwell Institute, Borivali West, Mumbai, Maharashtra 400092
Contact us – www.info-savvy.com