Skip navigation
Cisco Learning Home > CCENT/CCNA R&S Study Group > Discussions
This Question is Answered
8289 Views 19 Replies Latest reply: Mar 18, 2012 1:33 PM by bav RSS 1 2 Previous Next

Currently Being Moderated

How switches learn MAC Addresses

Mar 22, 2013 2:26 PM

Brian 22 posts since
Feb 7, 2010

q5.jpg

The correct answer for this question is A and B. I thought B would be the only answer because PC1 sends a frame to PC2 so the Switch will add PC1 MAC  address to the CAM table and then flood port  Fa 0/2 and 0/3. I thought then Fa 0/2 will respond to the flood, and then be added to the CAM table. Then when PC3 tries to send a frame to PC2 MAC address it will then add PC3 MAC to the CAM table and forward the frame directly out of Fa 0/2. Can someone explain how A and B is the correct answer.

  • Muhammad Furqan 73 posts since
    Jun 19, 2009
    Currently Being Moderated
    1. Apr 22, 2011 3:17 AM (in response to Brian)
    Re: How switches learn MAC Addresses

    Infact, Fa0/2 will NOT respond to the flood, and then be added to the CAM table. Switches learn MAC addresses only from source MAC addresses of incoming frames. So the only way our SW1 can dynamically learn the MAC address of PC2 is to receive a frame from PC2 itself; and PC2 would not send a frame unless it has the need to do so. So, in our scenario, when PC3 tries to send a frame to PC2, the situation is no different than PC1 trying to send the frame to PC2 intially. I hope it explains why the correct answer is A and B.

  • Roland Schmid 291 posts since
    Sep 5, 2010
    Currently Being Moderated
    2. Apr 22, 2011 4:38 AM (in response to Muhammad Furqan)
    Re: How switches learn MAC Addresses

    Hi,

     

    how does PC1 know about PC2's Mac address ?

     

    Kind regards,

    Roland

  • Keith Barker - CCIE RS/Security, CISSP 5,351 posts since
    Jul 3, 2009
    Currently Being Moderated
    3. Apr 22, 2011 4:50 AM (in response to Roland Schmid)
    Re: How switches learn MAC Addresses

    Roland Schmid wrote:

     

    Hi,

     

    how does PC1 know about PC2's Mac address ?

     

    Kind regards,

    Roland

    PC1 would use ARP to discover PC2's MAC address.

     

    Keith

  • Keith Barker - CCIE RS/Security, CISSP 5,351 posts since
    Jul 3, 2009
    Currently Being Moderated
    4. Apr 22, 2011 4:56 AM (in response to Brian)
    Re: How switches learn MAC Addresses

    Brian wrote:

     

    q5.jpg

    The correct answer for this question is A and B. I thought B would be the only answer because PC1 sends a frame to PC2 so the Switch will add PC1 MAC  address to the CAM table and then flood port  Fa 0/2 and 0/3. I thought then Fa 0/2 will respond to the flood, and then be added to the CAM table. Then when PC3 tries to send a frame to PC2 MAC address it will then add PC3 MAC to the CAM table and forward the frame directly out of Fa 0/2. Can someone explain how A and B is the correct answer.

    Hello Brian.

     

    Realistically, if PC1 sent a frame to 2222.2222.2222, there was likely a preceding ARP request, that PC2 would have responded to, which would have triggered the the switch learning the MAC address of PC2.    It is also realistic to think that if PC1 sent a unicast frame to 2222.2222.2222, that PC2 would have responded with something, which would also trigger the switch to learn PC2's MAC address (if it hadn't done so already from a previous frame). 

     

    If the conditions were exactly as the question describes, with the frame from PC3, destined to 2222.2222.2222, the switch would not know the MAC address of 2222.2222.2222 (considering that to be an currently unknown MAC), and would flood that frame to every other port in the same VLAN (Ports Fa0/1 and Fa0/2)

     

    Best wishes,

     

    Keith

  • Keith Barker - CCIE RS/Security, CISSP 5,351 posts since
    Jul 3, 2009
    Currently Being Moderated
    5. Apr 22, 2011 4:57 AM (in response to Muhammad Furqan)
    Re: How switches learn MAC Addresses

    Furqan is right on the money. 

  • Roland Schmid 291 posts since
    Sep 5, 2010

    so I have to suppose, there is a Layer3 address part of the question ?

     

    Kind regards,

    Roland

  • Keith Barker - CCIE RS/Security, CISSP 5,351 posts since
    Jul 3, 2009
    Currently Being Moderated
    7. Apr 22, 2011 5:33 AM (in response to Roland Schmid)
    Re: How switches learn MAC Addresses

    Roland Schmid wrote:

     

    so I have to suppose, there is a Layer3 address part of the question ?

     

    Kind regards,

    Roland

     

    The question doesn't involve L3 addressing, and is very hypothetical.

     

    In reality, L3 addressing which has been encapsulated into L2 frames, would be part of the mix.

  • Ben 29 posts since
    Sep 7, 2009

    Brian, I gave the same answer to the question as you and wondered why! Re-reading the question then it it made more sense to me. "If the next frame to reach the switch...." so theres no time for the switch to learn the Mac of PC2 through ARP, hense the answer.

  • Muhammad Furqan 73 posts since
    Jun 19, 2009

    The explanation by Keith is indeed how things work realistically. This would also make B the correct answer.

     

    It appears to me that the more knowledgeable CCNA/CCENT candiadte who can make the realistic assumption that ARP is also at work, would actually get this question wrong... Isn't it quite a dilemma...

  • Keith Barker - CCIE RS/Security, CISSP 5,351 posts since
    Jul 3, 2009
    Currently Being Moderated
    11. Apr 22, 2011 10:50 AM (in response to Brian)
    Re: How switches learn MAC Addresses

    Brian wrote:

     

    ...

    is it saying that both PC1 and PC3 are sending a frame to PC2 at the sametime?

    Hi Brian-

     

    In my opinion, the question, (such as it is ) says that a frame from PC1 and a frame from PC3 both went into the switch, before PC2 has sent any frame into the switch, starting with a completely empty mac address-table on the switch.

     

    Again, it is very much just an exercise, as a client coming up on the network, will send at least 1 frame (and probably many more) just upon booting up, and initializing it's network interface.    (DHCP alone, would account for 2 frames being sent by PC2 if it were a DHCP client).

     

    Keith

  • Rockribbed 49 posts since
    Apr 20, 2011
    Currently Being Moderated
    12. Apr 22, 2011 11:04 AM (in response to Brian)
    Re: How switches learn MAC Addresses

    Well Brian it is as simple first frame has send by Pc1 with destination add as the MAC add of PC2 till now second frame from PC3 hasn''t reached to switch.So It can be assumed here that switch has broadcasted this on all the ports except back to Port for PC1.Now as till now Switch hasn't received any reply from PC2  port and Switch has received another frame from PC3 destined for PC2 but its MAC table has no port associated with the MAC add 22222..bla bla so it will again broadcast this and send it back to port P1 and P2 and not back to P3.

  • kermitsm 11 posts since
    Jun 27, 2008
    Currently Being Moderated
    14. Apr 22, 2011 12:19 PM (in response to Brian)
    Re: How switches learn MAC Addresses

    This is a great discussion as I am exactly in this section of the book and was going to question this Q&A. I assumed only one answer which I chose "B". After reading the comments in this discussion and re-reading the question, the sentence that stuck out was "If the next frame to reach the switch..." This made the answers A&B more clear to me. Thank all who are committing.

Actions

More Like This

  • Retrieving data ...

Bookmarked By (2)