Clearing MAC address table?

Answered Question
Sep 22nd, 2008

Is it okay to do during production hours? Will there be any loss of connectivity, or problems with ARP cache? Do I need to clear ARP as well?

Thanks!

John

I have this problem too.
0 votes
Correct Answer by Richard Burts about 8 years 2 months ago

John

The mac-address-table and the arp cache are quite separate and distinct. Depending on what your issue is and what you are attempting to accomplish it may be advisable to clear one or the other, or even perhaps both.

The mac-address-table is used by the switch for layer 2 forwarding. It is built by the switch as the switch processes frames going through the switch. With each incoming frame the switch looks at the source MAC address and associates that MAC address with the interface on which the frame was received. Once the MAC address is in the table then the switch uses that entry to make layer 2 forwarding decisions (the switch decides which interface matches the destination MAC for frame that it is forwarding). (note in case of confusion: switch watches the source mac to build the forwarding table, and uses the destination mac to look in the forwarding table and find the correct output interface)

If you have an issue and clear the mac-address-table for a brief time the table is empty and the switch begins to see traffic and will rebuild the mac-address-table. If the switch receives a frame and can not match the destination MAC address in the table the switch does not know which interface is the correct output interface, and in that case the switch will forward the frame out all the interfaces in that VLAN. So while there may be an increase in interface utilization, there is no loss of connectivity.

The ARP table is different. The switch uses the ARP table for its layer 3 functions. If the switch is a layer 3 switch and ip routing is enabled then the switch will generally have in its ARP table the MAC address (and correcponding IP address) for all the devices on local subnets to which it will forward. If the switch is just layer 2 or is a layer 3 switch on which routing is not enabled then the switch has an ARP table which is used only for its own management traffic.

If you have an issue and you clear the ARP table then for a while the switch has an empty ARP table which it will rebuild as it sees traffic. If the switch has a frame to forward using the ARP tble but there is no entry in the ARP table for the destination then the switch will drop the packet and will generate an ARP request. By the time another packet is received (or the first packet is retransmitted) the swithc should have gotten a response and will be able to forward packets to that destination.

So if you clear the mac-address-table there is no loss of frame forwarding. If you clear the arp table there will be a slight loss of packets. But I would say that it is not serious enough to qualify as a loss of connectivity.

HTH

Rick

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.5 (2 ratings)
Loading.
Correct Answer
Richard Burts Mon, 09/22/2008 - 13:11

John

The mac-address-table and the arp cache are quite separate and distinct. Depending on what your issue is and what you are attempting to accomplish it may be advisable to clear one or the other, or even perhaps both.

The mac-address-table is used by the switch for layer 2 forwarding. It is built by the switch as the switch processes frames going through the switch. With each incoming frame the switch looks at the source MAC address and associates that MAC address with the interface on which the frame was received. Once the MAC address is in the table then the switch uses that entry to make layer 2 forwarding decisions (the switch decides which interface matches the destination MAC for frame that it is forwarding). (note in case of confusion: switch watches the source mac to build the forwarding table, and uses the destination mac to look in the forwarding table and find the correct output interface)

If you have an issue and clear the mac-address-table for a brief time the table is empty and the switch begins to see traffic and will rebuild the mac-address-table. If the switch receives a frame and can not match the destination MAC address in the table the switch does not know which interface is the correct output interface, and in that case the switch will forward the frame out all the interfaces in that VLAN. So while there may be an increase in interface utilization, there is no loss of connectivity.

The ARP table is different. The switch uses the ARP table for its layer 3 functions. If the switch is a layer 3 switch and ip routing is enabled then the switch will generally have in its ARP table the MAC address (and correcponding IP address) for all the devices on local subnets to which it will forward. If the switch is just layer 2 or is a layer 3 switch on which routing is not enabled then the switch has an ARP table which is used only for its own management traffic.

If you have an issue and you clear the ARP table then for a while the switch has an empty ARP table which it will rebuild as it sees traffic. If the switch has a frame to forward using the ARP tble but there is no entry in the ARP table for the destination then the switch will drop the packet and will generate an ARP request. By the time another packet is received (or the first packet is retransmitted) the swithc should have gotten a response and will be able to forward packets to that destination.

So if you clear the mac-address-table there is no loss of frame forwarding. If you clear the arp table there will be a slight loss of packets. But I would say that it is not serious enough to qualify as a loss of connectivity.

HTH

Rick

Actions

This Discussion