0% found this document useful (0 votes)
133 views

Basic Switching Course 2

The document discusses how switches learn MAC addresses. It explains that switches build MAC address tables to map MAC addresses to switch ports. When a frame is received, the switch adds the source MAC address and incoming port to its table. It then floods the frame to all ports except the incoming port, allowing the destination device to respond and the switch to learn its location. The document provides an example of three hosts connected to a switch to demonstrate this process, and shows how the switch's MAC address table is populated over time. It also shows examples of commands to view and clear entries from the MAC address table on a Cisco switch.

Uploaded by

sithuratun1989
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views

Basic Switching Course 2

The document discusses how switches learn MAC addresses. It explains that switches build MAC address tables to map MAC addresses to switch ports. When a frame is received, the switch adds the source MAC address and incoming port to its table. It then floods the frame to all ports except the incoming port, allowing the destination device to respond and the switch to learn its location. The document provides an example of three hosts connected to a switch to demonstrate this process, and shows how the switch's MAC address table is populated over time. It also shows examples of commands to view and clear entries from the MAC address table on a Cisco switch.

Uploaded by

sithuratun1989
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

1|Pa g e VOL: 1

Basic switching course (II)


How does a switch learn MAC addresses?

Identify interface and cable issues

Vritual LAN (VLAN)

Trunking

Native VLAN

Voice VLAN
2|Pa g e VOL: 1

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:

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:
3|Pa g e VOL: 1

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:
4|Pa g e VOL: 1

Our switch will build a MAC address table and only learns from source MAC addresses. At this
moment it just learned that the MAC address of H1 is on interface 1. It will now add this
information in its MAC address table. As you can see our switch currently has no information
where H2 is located. There’s only one option left….flood this frame out of all its interfaces
except the one where it came from. H2 and H3 will receive this Ethernet frame.
5|Pa g e VOL: 1

Since H2 sees its MAC address as the destination of this Ethernet frame it knows it’s meant for
him, H3 will discard it. H2 is going to respond to H1, build an Ethernet frame and send it
towards our switch. At this moment the switch will learn the MAC address of H2.

That’s the end of our story, the switch now knows both MAC addresses and the next time it can
“switch” instead of flooding Ethernet frames. H3 will never see any frames between H1 and H2
except for the first one which was flooded.

Verification
Let me show you what this looks like on a real Cisco switch. I will use a topology with one switch
and three host devices:
6|Pa g e VOL: 1

This is the topology I’ll use, it’s the same as the previous example but I have added some
interface numbers.

Let’s verify if all interfaces are up and running:

All interfaces are connected, let’s check the MAC address table:
7|Pa g e VOL: 1

The show mac address-table dynamic command gives us all MAC addresses that the switch has
learned dynamically. We can see it has learned three MAC addresses.

There are a couple of parameters we can use with this command. For example:

This only gives us the output for the MAC address of H1. We can also get an overview of all
MAC addresses that were learned on a single interface:
8|Pa g e VOL: 1

If the switch doesn’t see a particular MAC address for 300 seconds, it will be removed from the
MAC address table.

What if we want to manually remove something from the MAC address table? This is possible
with the clear mac address-table command:
9|Pa g e VOL: 1
10 | P a g e VOL: 1

Take a look at the output of these two switches, especially their GigabitEthernet0/3 interfaces:
11 | P a g e VOL: 1

As you can see above, SW1 has learned the MAC addresses of H3 and H4 on its
GigabitEthernet0/3 interface. SW2 has learned the addresses of H1 and H2:

This is just a quick example to explain that a switch is able to learn multiple MAC addresses on a
single interface.

I hope this lesson has been useful to understand the MAC address table of your Cisco Catalyst
switch.
12 | P a g e VOL: 1

Identify interface and cable issues (collisions,


errors, mismatch duplex, and/or speed)
13 | P a g e VOL: 1
14 | P a g e VOL: 1
15 | P a g e VOL: 1
16 | P a g e VOL: 1
17 | P a g e VOL: 1
18 | P a g e VOL: 1
19 | P a g e VOL: 1
20 | P a g e VOL: 1
21 | P a g e VOL: 1
22 | P a g e VOL: 1
23 | P a g e VOL: 1
24 | P a g e VOL: 1
25 | P a g e VOL: 1
26 | P a g e VOL: 1
27 | P a g e VOL: 1

You might also like