xkonekt
Language: EN
  • English
  • Türkçe
  • Español, Coming soon
  • Português, Coming soon
  • Deutsch, Coming soon
  • Français, Coming soon

Ethernet and switching · Introduction · Module 2

How a switch learns and forwards: the MAC address table

Show topologyHide topology
H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerH3host5254.0000.533010.0.1.0/2410.0.1.0/2410.0.2.0/24Et0/0.10Et0/1Et0/2eth0.20Et0/0Et0/0.1Et0/1.1eth0.30Et0/0 = Ethernet0/0.1 = the last number of the addressSW1’s three cables are one network

Interfaces and addresses · MAC addresses are written as IOS prints them.

  • 10.0.1.0/24SW1 Et0/0R1 Et0/0 10.0.1.1 aabb.cc00.0200
  • 10.0.1.0/24SW1 Et0/1H1 Et0/0 10.0.1.10 aabb.cc00.0300
  • 10.0.1.0/24SW1 Et0/2H2 eth0 10.0.1.20 5254.0000.5320
  • 10.0.2.0/24R1 Et0/1 10.0.2.1 aabb.cc00.0210H3 eth0 10.0.2.30 5254.0000.5330
Topology · SW1 joins H1, H2 and R1 in one network, 10.0.1.0/24; R1 joins it to H3’s network, 10.0.2.0/24.

Five device icons joined by four plain cables. At the top the host H1, MAC address aabb.cc00.0300: its Et0/0, address ending .10, is cabled down to the switch SW1’s Et0/1. To the right of SW1, the host H2, MAC address 5254.0000.5320: its eth0, address ending .20, is cabled to SW1’s Et0/2. Under SW1, the router R1: its Et0/0, address ending .1, is cabled up to SW1’s Et0/0. SW1’s three cables are one network, 10.0.1.0/24; SW1 has no address of its own, and its fourth port, Et0/3, has no cable. At the bottom the host H3, MAC address 5254.0000.5330: its eth0, address ending .30, is cabled up to R1’s Et0/1, address ending .1, in the network 10.0.2.0/24.

What a MAC address table is

A table of who is where

A switch keeps a table of who is where

SW1 sends each frame out of one port, or several. How does it know which port leads to which device?

From each frame’s source address. A switch passes frames on within one network, and each frame’s destination MAC address decides the port it leaves by.

For that, SW1 keeps a MAC address table, which lists MAC addresses, each with the port it can be found on. Once H1, H2 and R1 have each sent a frame, it holds one row for each (Figure 2.1; Et0/1 is short for Ethernet0/1).

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routeraabb.cc00.0200Et0/1Et0/2Et0/0SW1’s MAC address tableMAC address · port5254.0000.5320 · Et0/2aabb.cc00.0200 · Et0/0aabb.cc00.0300 · Et0/1
Figure 2.1 · SW1’s table: one row per MAC address, with the port it was seen on. The highlighted row is the one SW1 reads for a frame to H2.

H1 at the top with its MAC address aabb.cc00.0300, SW1 under it, H2 to its right with 5254.0000.5320, and R1 under SW1 with aabb.cc00.0200. SW1’s ports are marked: Et0/1 toward H1, Et0/2 toward H2, Et0/0 toward R1. Under the drawing, SW1’s MAC address table with three rows: 5254.0000.5320 · Et0/2 (highlighted), aabb.cc00.0200 · Et0/0, and aabb.cc00.0300 · Et0/1.

For every frame it receives, SW1 writes the source MAC address with the port the frame came in on. If an earlier frame already gave that address an entry, SW1 updates it. This is MAC learning.

SW1 learns where a device is from the frames that device sends, never from frames sent to it. A device that has sent nothing has no learned entry.

SW1 starts with an empty table and keeps learning as frames arrive, with nothing typed. So does a switch your computer is cabled to.

H2 sends a frame to R1 through SW1. What does SW1 write in its table?

Forward, filter or flood

After learning, SW1 looks up the frame’s destination in its table. What can it do with the frame?

It sends the frame out of one port, out of none, or out of every other port (Figure 2.2).

A frame comes in on a portFirst learnthe source MAC with this portThen look up the destinationThen send iton another portforward out of iton the same portfilter: drop itnot in the tablefloodbroadcastflood
Figure 2.2 · Every frame: learn from the source, then forward, filter or flood by the destination.

A chart read top to bottom. A box “A frame comes in on a port”, an arrow down to “First learn the source MAC with this port”, an arrow down to “Then look up the destination”, and an arrow down to a box “Then send it” that holds four outcomes in two rows. On another port: forward out of it (highlighted). On the same port: “filter: drop it”. Not in the table: flood. Broadcast: flood.

If the destination is in the table on another port, SW1 sends the frame out of that port only. This is forwarding, what happens to most frames once SW1 knows its devices.

If the destination is in the table on the port the frame came in on, the device is already on that side, so SW1 does not send the frame back out and drops it. This is filtering. It needs a port with several devices behind it, for example behind another switch. SW1 has one device per cabled port.

If the destination is not in the table, SW1 does not know where that device is, so it sends the frame out of every other port that is up in the same network. This is flooding, and such a frame for one device is an unknown unicast.

SW1 floods every broadcast too. A frame for the broadcast address goes out of every other port that is up in the same network, whatever the table holds.

SW1’s fourth port, Et0/3, is turned off and has no cable, and a flooded frame does not go out of it.

Key idea

SW1 learns from source addresses and sends by destination addresses. A known destination gets at most one port; an unknown destination or a broadcast gets every other port that is up.

SW1’s table lists H1 on Et0/1 and H2 on Et0/2. H2 sends a frame to H1. Out of which ports does SW1 send it?

How it works

SW1 learns H1 and H2

From an empty table to two entries

SW1’s table has just been emptied. H1 sends a broadcast, then a frame to H2, and H2 answers. How does the table fill, and where does each frame go?

One frame at a time. Step through Figure 2.3.

Step 1 of 7

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerEt0/1Et0/2Et0/0SW1’s MAC address tableNo entries

SW1’s table is empty.

Step 2 of 7

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerEt0/1Et0/2Et0/0to ffff.ffff.fffffloodedSW1’s MAC address tableaabb.cc00.0300 · Et0/1

H1 sends a broadcast, which comes in on Et0/1. SW1 learns H1’s MAC address on Et0/1. Then it floods the broadcast out of Et0/0 and Et0/2.

Step 3 of 7

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerEt0/1Et0/2Et0/0to H2’s MACno entry for H2SW1’s MAC address tableaabb.cc00.0300 · Et0/1

H1 learned H2’s MAC address before SW1’s table was emptied, and sends H2 a frame. SW1 updates H1’s entry and looks up H2.

SW1’s table lists only H1. Out of which ports does SW1 send this frame?

  • Et0/0 and Et0/2. (Correct): H2 is not in the table yet, so the frame is an unknown unicast. SW1 floods it out of every other port that is up, Et0/0 and Et0/2.
  • Et0/2 only.: H2 is on Et0/2, but SW1 cannot know that yet. H2 has sent nothing since the table was emptied.
  • Et0/0, Et0/1 and Et0/2.: Flooding leaves out the port the frame came in on. Et0/1 leads back to H1, the sender.
  • No port, because SW1 drops a frame it has no entry for.: SW1 does not drop an unknown unicast. It floods it, so the frame still reaches H2.

Step 4 of 7

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerEt0/1Et0/2Et0/0unknown unicastfloodedSW1’s MAC address tableaabb.cc00.0300 · Et0/1

H2 is not in the table, so the frame is an unknown unicast. SW1 floods it out of Et0/0 and Et0/2. R1 gets a copy too and drops it, because the frame is not addressed to R1.

Step 5 of 7

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerEt0/1Et0/2Et0/0H2 answers, to H1’s MACforwarded out of Et0/1SW1’s MAC address tableaabb.cc00.0300 · Et0/15254.0000.5320 · Et0/2

H2 answers H1. SW1 learns H2’s MAC address on Et0/2. It already knows H1, so it forwards the answer out of Et0/1 only.

Step 6 of 7

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerEt0/1Et0/2Et0/0the next frames to H2forwarded out of Et0/2SW1’s MAC address tableaabb.cc00.0300 · Et0/15254.0000.5320 · Et0/2

H1’s next frames for H2 carry H2’s MAC address too. SW1 now knows H2 and forwards each one out of Et0/2 only.

Step 7 of 7

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerEt0/1Et0/2Et0/0SW1 knows H1 and H2SW1’s MAC address tableaabb.cc00.0300 · Et0/15254.0000.5320 · Et0/2

SW1 learned H1 and H2 from the frames they sent. Frames for either now leave by one port.

Step 1 of 7

H1 at the top, SW1 under it, H2 to the right of SW1 and R1 under SW1, joined by plain cables. SW1’s ports are marked: Et0/1 toward H1, Et0/2 toward H2, Et0/0 toward R1. Under the drawing, SW1’s table. Step 1: the table reads “No entries”. Step 2: arrows beside the cables go from H1 to SW1 and on to R1 and H2; a note reads “to ffff.ffff.ffff, flooded”; the row aabb.cc00.0300 · Et0/1 appears. Step 3: an arrow from H1 to SW1; the note reads “to H2’s MAC, no entry for H2”. Step 4: arrows from SW1 to R1 and to H2; the note reads “unknown unicast, flooded”. Step 5: arrows from H2 to SW1 and up to H1; the note reads “H2 answers, to H1’s MAC, forwarded out of Et0/1”; the row 5254.0000.5320 · Et0/2 appears. Step 6: arrows from H1 to SW1 and on to H2 only; the note reads “the next frames to H2, forwarded out of Et0/2”. Step 7: both rows; the note reads “SW1 knows H1 and H2”.

Figure 2.3 · SW1 learns each device from the frames that device sends. Until SW1 has learned it, frames for the device are flooded.SW1’s table is empty.H1 sends a broadcast, which comes in on Et0/1. SW1 learns H1’s MAC address on Et0/1. Then it floods the broadcast out of Et0/0 and Et0/2.H1 learned H2’s MAC address before SW1’s table was emptied, and sends H2 a frame. SW1 updates H1’s entry and looks up H2.H2 is not in the table, so the frame is an unknown unicast. SW1 floods it out of Et0/0 and Et0/2. R1 gets a copy too and drops it, because the frame is not addressed to R1.H2 answers H1. SW1 learns H2’s MAC address on Et0/2. It already knows H1, so it forwards the answer out of Et0/1 only.H1’s next frames for H2 carry H2’s MAC address too. SW1 now knows H2 and forwards each one out of Et0/2 only.SW1 learned H1 and H2 from the frames they sent. Frames for either now leave by one port.

show mac address-table dynamic lists SW1’s learned entries. With the table empty, H1 sent broadcasts asking who has 10.0.1.99, an IP address no device has, so nobody answered.

On SW1, right after its learned entries are removed:

Output · IOS XE 17.18.2
SW1#show mac address-table dynamic          Mac Address Table------------------------------------------- 1Vlan    Mac Address       Type        Ports----    -----------       --------    -----
  1. The header, and no entry under it.

On SW1, after H1’s broadcasts:

One entry, from the source of the broadcasts, and nothing from their destination, ffff.ffff.ffff.

Output · IOS XE 17.18.2
SW1#show mac address-table dynamic Mac Address Table-------------------------------------------1Vlan 1Mac Address aabb.cc00.0300Type DYNAMICPorts Et0/1Total Mac Addresses for this criterion: 1
  1. aabb.cc00.0300 on Et0/1, H1’s port.
Full output · 7 lines
SW1#show mac address-table dynamic          Mac Address Table------------------------------------------- Vlan    Mac Address       Type        Ports----    -----------       --------    -----   1    aabb.cc00.0300    DYNAMIC     Et0/1Total Mac Addresses for this criterion: 1

SW1 counts broadcasts sent out of each port; the counts were cleared before H1’s broadcasts. | include keeps only lines holding packets output or broadcasts.

On SW1, the port toward R1:

Output · IOS XE 17.18.2
SW1#show interfaces Ethernet0/0 | include packets output|broadcasts… 2 more lines (see Full output)1     Output 4 broadcasts (0 multicasts)
  1. Output 4 broadcasts: broadcasts went out toward R1.
Full output · 3 lines
SW1#show interfaces Ethernet0/0 | include packets output|broadcasts     Received 0 broadcasts (0 multicasts)     4 packets output, 240 bytes, 0 underruns     Output 4 broadcasts (0 multicasts)

On SW1, the port toward H1:

Output · IOS XE 17.18.2
SW1#show interfaces Ethernet0/1 | include packets output|broadcasts… 2 more lines (see Full output)1     Output 0 broadcasts (0 multicasts)
  1. Output 0 broadcasts: none went back out of Et0/1, the port the broadcasts came in on.

Et0/2, toward H2, also shows Output 4 broadcasts.

Full output · 3 lines
SW1#show interfaces Ethernet0/1 | include packets output|broadcasts     Received 2 broadcasts (0 multicasts)     0 packets output, 0 bytes, 0 underruns     Output 0 broadcasts (0 multicasts)

Then H1 sent H2 five test packets with ping, and H2 replied to each one.

On SW1, after the test:

Two entries, one for H1 and one for H2.

Output · IOS XE 17.18.2
SW1#show mac address-table dynamic Mac Address Table-------------------------------------------1Vlan 1Mac Address 5254.0000.5320Type DYNAMICPorts Et0/22Vlan 1Mac Address aabb.cc00.0300Type DYNAMICPorts Et0/1Total Mac Addresses for this criterion: 2
  1. 5254.0000.5320 on Et0/2: learned from the frames H2 sent.
  2. aabb.cc00.0300 on Et0/1, as before.
Full output · 8 lines
SW1#show mac address-table dynamic          Mac Address Table------------------------------------------- Vlan    Mac Address       Type        Ports----    -----------       --------    -----   1    5254.0000.5320    DYNAMIC     Et0/2   1    aabb.cc00.0300    DYNAMIC     Et0/1Total Mac Addresses for this criterion: 2
SW1’s MAC address table
MAC addressTypePort
aabb.cc00.0300 · H1DYNAMICEt0/1
5254.0000.5320 · H2DYNAMICEt0/2

Task 1 of 1

R1 sends a frame to H1. Out of which ports does SW1 send it?

Tap every port SW1 sends the frame out of, then submit.

R1 sends a frame to H1. Out of which ports does SW1 send it?

Answer

Out of Et0/1.

H1 is in the table on Et0/1, so SW1 forwards the frame out of that port only. It also learns R1 on Et0/0, the port the frame came in on.

Key idea

Until SW1 has seen a device send, frames for it are flooded; then they leave by one port.

Entries do not stay forever

A device can stop sending, or move to another port. How long does SW1 keep an entry?

A learned entry stays for a set time, the aging time, after the last frame from that address, and each new frame from the device starts that time again. An entry an administrator types for an address and a port does not age (Figure 2.4).

H2’s learned entryH2 sends300 seconds with no frame from H2entry removedA typed entrynot aged
Figure 2.4 · Each frame from H2 starts the aging time again. After the aging time with no frame, SW1 removes the learned entry.

Two time lines, left to right. The first, “H2’s learned entry”: three dots close together where H2 sends, then a long gap with a bracket “300 seconds with no frame from H2”, and a dot at its end with the highlighted note “entry removed”. The second, a dashed line, “A typed entry”, with the note “not aged”.

show mac address-table aging-time prints the aging time.

On SW1:

Output · IOS XE 17.18.2
SW1#show mac address-table aging-time1Global Aging Time:  300Vlan    Aging Time----    ----------
  1. Global Aging Time: 300 is the time in seconds, for the whole switch.

So a learned entry leaves five minutes after the device’s last frame.

SW1 was left quiet, with no frames, for longer than the aging time, and its table was read before and after.

On SW1, at the start of the quiet stretch:

Output · IOS XE 17.18.2
SW1#show mac address-table dynamic… 8 more lines (see Full output)1Total Mac Addresses for this criterion: 3
  1. Three learned entries, for H2, R1 and H1.
Full output · 9 lines
SW1#show mac address-table dynamic          Mac Address Table------------------------------------------- Vlan    Mac Address       Type        Ports----    -----------       --------    -----   1    5254.0000.5320    DYNAMIC     Et0/2   1    aabb.cc00.0200    DYNAMIC     Et0/0   1    aabb.cc00.0300    DYNAMIC     Et0/1Total Mac Addresses for this criterion: 3

On SW1, after more than the aging time with no frame:

Every learned entry has aged out.

Output · IOS XE 17.18.2
SW1#show mac address-table dynamic          Mac Address Table------------------------------------------- 1Vlan    Mac Address       Type        Ports----    -----------       --------    -----
  1. The header, and no entry under it.

Can frames still reach a device whose entry has aged out? Yes, as unknown unicasts, which SW1 floods, and as soon as the device answers, SW1 learns it again.

A typed entry is called a static MAC entry. It reads STATIC in the table, while learned entries read DYNAMIC.

Key idea

A learned (DYNAMIC) entry leaves after the aging time with no frame from that device; until the device sends again, frames for it are flooded. A typed (STATIC) entry stays as it was typed.

Try it on SW1 yourself, from an empty table. Choose who sends to whom, watch SW1 learn and then forward or flood, and press the Wait button to let entries age out.

Try a broadcast first, then frames between the hosts.

Sender

Destination

Pick a sender and a destination, then tap Send.

SW1’s MAC address table
MAC addressTypePort
No entries: SW1 knows no one yet.
Three frames through SW1, starting from the table above
FrameSW1 learnsSent out of
H1 → BroadcastH1 on Et0/1Et0/0, Et0/2 (flooding)
H2 → H1H2 on Et0/2Et0/1 (forwarding)
H1 → H2nothing newEt0/2 (forwarding)
SW1 knows H1 on Et0/1 and H2 on Et0/2. Then H2 sends nothing for an hour. Now H1 sends H2 a frame. What does SW1 do with it?

Verify

Read SW1’s table

SW1 prints its table with one command. Where does it send frames for each device?

Out of the port each one sent from. R1, H1 and H2 have each sent a frame from its own port, so expect three learned entries and none for Et0/3.

show mac address-table dynamic lists the learned entries, one line each.

On SW1:

Tap a line, or “Not in the output”, then submit.

Find the line SW1 uses for frames to H2, 5254.0000.5320.

Output · IOS XE 17.18.2
SW1#show mac address-table dynamic

Three learned entries, as expected, and H1 is on Et0/1.

  1. H2’s entry: 5254.0000.5320 on Et0/2. DYNAMIC means learned.
  2. R1’s entry, on Et0/0.
Full output · 9 lines
SW1#show mac address-table dynamic          Mac Address Table------------------------------------------- Vlan    Mac Address       Type        Ports----    -----------       --------    -----   1    5254.0000.5320    DYNAMIC     Et0/2   1    aabb.cc00.0200    DYNAMIC     Et0/0   1    aabb.cc00.0300    DYNAMIC     Et0/1Total Mac Addresses for this criterion: 3

The Vlan column reads 1 on every line, so it does not tell SW1’s ports apart.

For one address without reading every line, use show mac address-table address 5254.0000.5320.

On SW1, for H2’s MAC address only:

Output · IOS XE 17.18.2
SW1#show mac address-table address 5254.0000.5320 Mac Address Table-------------------------------------------1Vlan 1Mac Address 5254.0000.5320Type DYNAMICPorts Et0/2Total Mac Addresses for this criterion: 1
  1. The one entry for 5254.0000.5320: Et0/2.
Full output · 7 lines
SW1#show mac address-table address 5254.0000.5320          Mac Address Table------------------------------------------- Vlan    Mac Address       Type        Ports----    -----------       --------    -----   1    5254.0000.5320    DYNAMIC     Et0/2Total Mac Addresses for this criterion: 1

Key idea

Each entry in SW1’s table is a MAC address and the port SW1 sends frames for that address out of. DYNAMIC lines were learned; a typed entry reads STATIC.

SW1’s table holds the three entries it just printed. R1 sends a broadcast. Out of which ports does SW1 send it?

Troubleshoot

A wrong or missing entry

SW1 sends a frame where its table says. What happens when an entry is wrong, or missing?

Case 1 of 2.H2 cannot be reached

  1. Case 1 · Symptom

    H1 tests H2 with ping and gets no reply.

    Output · IOS XE 17.18.2
    H1#ping 10.0.1.20Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.1.20, timeout is 2 seconds:.....1Success rate is 0 percent (0/5)
    1. 0 percent: not one of the five test packets got a reply.
  2. Case 1 · Command

    On SW1, look up where frames for H2 go:

  3. Case 1 · Output

    Output · IOS XE 17.18.2
    SW1#show mac address-table address 5254.0000.5320 Mac Address Table-------------------------------------------1Vlan 1Mac Address 5254.0000.5320Type STATICPorts Et0/3Total Mac Addresses for this criterion: 1
    1. Key line STATIC on Et0/3, a typed entry on a port that is turned off.
    Full output · 7 lines
    SW1#show mac address-table address 5254.0000.5320          Mac Address Table------------------------------------------- Vlan    Mac Address       Type        Ports----    -----------       --------    -----   1    5254.0000.5320    STATIC      Et0/3 Total Mac Addresses for this criterion: 1

    The typed line in SW1’s configuration:

    Output · IOS XE 17.18.2
    SW1#show running-config | include mac address-table1mac address-table static 5254.0000.5320 vlan 1 interface Ethernet0/3 
    1. The typed entry for 5254.0000.5320, on Ethernet0/3.

    After H2 has sent a frame into Et0/2, on SW1:

    Output · IOS XE 17.18.2
    SW1#show mac address-table address 5254.0000.5320 Mac Address Table-------------------------------------------1Vlan 1Mac Address 5254.0000.5320Type STATICPorts Et0/3Total Mac Addresses for this criterion: 1
    1. Still STATIC on Et0/3. H2’s own frame did not move the typed entry.
    Full output · 7 lines
    SW1#show mac address-table address 5254.0000.5320          Mac Address Table------------------------------------------- Vlan    Mac Address       Type        Ports----    -----------       --------    -----   1    5254.0000.5320    STATIC      Et0/3 Total Mac Addresses for this criterion: 1
  4. Case 1 · How far it reaches

    Does H1 still reach R1?

    Output · IOS XE 17.18.2
    H1#ping 10.0.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.1.1, timeout is 2 seconds:!!!!!1Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
    1. 100 percent: frames for R1 still arrive.
  5. Case 1 · What it means

    H1hostSW1switchH2hostR1routerEt0/1Et0/2Et0/0Et0/3no cableSW1 sends framesfor H2 to Et0/3,which is turned off
    Figure 2.5 · Case 1 · A typed entry sends frames for H2 to Et0/3, which is turned off, so they are lost.

    H1 at the top, SW1 under it, H2 to its right and R1 under SW1. An arrow beside the cable from H1 points to SW1. A short stub leaves SW1 down to the right, tagged “Et0/3, no cable”, with an arrow along it and a cross at its end. The cable to H2 is plain. A highlighted note reads “SW1 sends frames for H2 to Et0/3, which is turned off”.

    • Someone typed an entry for H2’s MAC address on Et0/3, for example before H2’s cable was moved. SW1 follows it.
    • Only frames for H2 go to Et0/3.
  6. Case 1 · Fix

    Remove the typed entry in configuration mode, where SW1’s settings are changed. SW1 then learns H2 from its frames again.

    Output · IOS XE 17.18.2
    SW1#configure terminalEnter configuration commands, one per line.  End with CNTL/Z.1SW1(config)#no mac address-table static 5254.0000.5320 vlan 1 interface Ethernet0/32SW1(config)#end
    1. no in front of the typed line removes it.
    2. end leaves configuration mode.

    Impact Removing the entry changes at once where SW1 sends frames for that address.

  7. Case 1 · Proof

    H1 tests H2 again:

    Output · IOS XE 17.18.2
    H1#ping 10.0.1.20Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.1.20, timeout is 2 seconds:!!!!!1Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
    1. 100 percent: H2 replies to every test packet.

End of case 1. Solved: H2 replies, and SW1 has learned it on Et0/2 again.

Case 2 of 2.SW1 has no entry for H2

  1. Case 2 · Symptom

    Someone looks for H2 in SW1’s table and finds no line for it. Is H2 cut off?

  2. Case 2 · Command

    Look up H2’s MAC address in SW1’s table:

  3. Case 2 · Output

    Output · IOS XE 17.18.2
    SW1#show mac address-table address 5254.0000.5320          Mac Address Table------------------------------------------- 1Vlan    Mac Address       Type        Ports----    -----------       --------    -----
    1. Key line Nothing under the header. SW1 has no entry for 5254.0000.5320.
  4. Case 2 · How far it reaches

    H1 tests H2 with ping:

    Output · IOS XE 17.18.2
    H1#ping 10.0.1.20Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 10.0.1.20, timeout is 2 seconds:!!!!!1Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
    1. 100 percent: every test packet got a reply.
  5. Case 2 · What it means

    H1hostSW1switchH2hostR1routerEt0/1Et0/2Et0/0no entry for H2the first frameis flooded
    Figure 2.5 · Case 2 · With no entry for H2, SW1 floods the first frame for H2 out of Et0/0 and Et0/2.

    H1 at the top, SW1 under it, H2 to its right and R1 under SW1. Arrows beside the cables go from H1 to SW1 and on to both R1 and H2. A highlighted note reads “no entry for H2, the first frame is flooded”.

    • H2 had sent nothing for longer than the aging time, so SW1 removed its entry.
    • Until H2 sends again, a frame for H2 is an unknown unicast, so SW1 floods it.
    • H2 replied to H1’s test, and SW1 learned it again.
  6. Case 2 · Fix

    Nothing to fix.

  7. Case 2 · Proof

    Right after H1’s test, on SW1:

    Output · IOS XE 17.18.2
    SW1#show mac address-table address 5254.0000.5320 Mac Address Table-------------------------------------------1Vlan 1Mac Address 5254.0000.5320Type DYNAMICPorts Et0/2Total Mac Addresses for this criterion: 1
    1. DYNAMIC on Et0/2: SW1 learned H2 again from H2’s replies.
    Full output · 7 lines
    SW1#show mac address-table address 5254.0000.5320          Mac Address Table------------------------------------------- Vlan    Mac Address       Type        Ports----    -----------       --------    -----   1    5254.0000.5320    DYNAMIC     Et0/2Total Mac Addresses for this criterion: 1

End of case 2. Solved: Frames for H2 leave by one port again.

Both cases

Key idea

SW1 sends a frame where its table says. A typed entry stays as it was typed; a missing entry means flooding until the device sends.

Someone types an entry that puts R1’s MAC address, aabb.cc00.0200, on Et0/2. What happens?

Check

From which field of a frame does SW1 learn?
SW1’s table lists only H2, on Et0/2. H2 sends a frame to H1. Out of which ports does SW1 send it?

SW1’s table after a stretch longer than the aging time in which only H1 and H2 sent frames:

Tap a line, or “Not in the output”, then submit.

Find the line SW1 uses for frames to R1, aabb.cc00.0200.

Output · IOS XE 17.18.2
SW1#show mac address-table dynamic
Full output · 8 lines
SW1#show mac address-table dynamic          Mac Address Table------------------------------------------- Vlan    Mac Address       Type        Ports----    -----------       --------    -----   1    5254.0000.5320    DYNAMIC     Et0/2   1    aabb.cc00.0300    DYNAMIC     Et0/1Total Mac Addresses for this criterion: 2
SW1’s table lists R1 on Et0/0, H1 on Et0/1 and H2 on Et0/2. H1 sends a frame to R1. What does SW1 do?
A typed entry puts H2’s MAC address on Et0/2. H2’s cable is then moved to Et0/3, and Et0/3 is turned on. Where does SW1 send frames for H2?

Summary

H1hostaabb.cc00.0300SW1switchH2host5254.0000.5320R1routerEt0/1Et0/2Et0/0SW1 knows H1 and H2SW1’s MAC address tableaabb.cc00.0300 · Et0/15254.0000.5320 · Et0/2
Figure 2.3, recap · SW1 learned H1 and H2 from the frames they sent. Frames for either now leave by one port.

H1, SW1, H2 and R1, with SW1’s ports Et0/1, Et0/2 and Et0/0 marked. Under the drawing, SW1’s table with two rows, aabb.cc00.0300 · Et0/1 and 5254.0000.5320 · Et0/2, and the note “SW1 knows H1 and H2”.

  • SW1’s MAC address table lists MAC addresses, each with the port SW1 sends frames for that address out of.
  • SW1 learns from the source address of each frame, with the port it came in on.
  • Known on another port: forward. Known on the same port: filter. Unknown, or a broadcast: flood out of every other port that is up.
  • The first frame for a device SW1 has not learned is flooded; once the device answers, frames for it leave by one port.
  • Learned entries age out after the aging time with no frame; typed entries stay.
  • show mac address-table dynamic shows the port of each device SW1 has learned.
  • A wrong typed entry sends frames for a device out of the wrong port; a missing entry only causes flooding until the device sends.