How does a switch learn MAC Addresses

A switch has some intelligence and operates on layer 2 of the OSI model. In this lesson, I’ll demonstrate how a switch learns MAC addresses. Let me show you an example of three computers connected to a switch:

three computers connected to switch

There’s a switch in the middle and we have 3 computers. All computers have a MAC address but I’ve simplified them. Our switch has a MAC address table and it will learn where all the MAC addresses are in the network. Let’s send something from H1 to H2:

switch incoming frame

H1 is going to send some data meant for H2, thus it will create an Ethernet frame which has a source MAC address (AAA) and a destination MAC address (BBB). Our switch has a MAC address table and here’s what will happen:

switch learns mac address

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You’ve Ever Spent on Your Cisco Career!
  • Full Access to our 791 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

1668 Sign Ups in the last 30 days

100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Tags: ,

Forum Replies

  1. How does ComputerA know the mac address of ComputerB?

  2. I had read that tutorial before this one and I asked the question because we were working in layer 2 here (not using IP address)

  3. Ah I see. The switch doesn’t care whatever is in the ethernet frame…only interesting thing for it are the source MAC addresses (to learn) and the destination MAC addresses (to forward).

  4. What about when show mac add-table shows no mac for a port. But you know their is
    a device on the other end

113 more replies! Ask a question or join the discussion by visiting our Community Forum