Two essential mechanisms that allow an Ethernet switch to operate well in a network are MAC learning and MAC ageing. They are essential for creating and managing the switch’s Content Addressable Memory (CAM) table, sometimes referred to as the MAC address table.
MAC Learning

The method by which a switch automatically fills its Media Access Control(MAC) address table is known as MAC learning. A switch looks at the frame’s source MAC address when it receives a data frame on one of its ports. After that, the switch associates the MAC address with the particular port (interface) that the frame was received on by adding an entry to its MAC address table. The switch is able to determine precisely which device is attached to which port to this procedure.
Also Read About Importance Of Computer Network Security Protect Your Data
Each item in the MAC address table contains the following bits of information:
- The actual MAC address.
- The port or interface that provides access to the MAC address.
- The VLAN to which the MAC address is assigned.
- The method (static or dynamic) used to learn the MAC address.
After learning a MAC address, the switch can send a subsequent frame to the appropriate port rather than broadcasting it to all ports if the destination MAC address is already in the database. Frame switching, another name for this clever forwarding, lowers superfluous network traffic and enhances network performance in general. The switch floods the frame out of all ports in the same VLAN, excluding the port on which it was received, to make sure it reaches the appropriate recipient if a destination MAC address is missing from the table.
It is possible to learn MAC addresses statically, dynamically, or by “sticky learning”:
- Dynamic Learning: Creates an entry automatically when the source MAC of a frame is not present in the CAM table. MAC addresses that have been dynamically learnt are flushed after a communication-free interval, usually five minutes.
- Static Learning: A network administrator can manually tie a MAC address to a switch interface using static learning. MAC addresses that are statically learnt are not dynamically flushed; instead, they are permanent.
- Sticky Learning (Port Security): After learning MAC addresses dynamically, the switch treats them like static entries and adds them to the active configuration as port-security instructions. If the running configuration is stored, these continue to exist after reboots.
Many devices, like as switches from the QFX and NFX Series, have MAC learning enabled worldwide by default. On the other hand, it can be turned off per logical interface, per VLAN, or globally.
Also Read About Characteristics Of A Network Operating System And Advantages
MAC Aging

The practice of eliminating outdated, unneeded, or inactive entries from the MAC address table is known as MAC ageing. An ageing timer is assigned to each dynamically learnt entry in the table. Every time a frame is received from that MAC address on the corresponding port, this timer is reset. The record is “aged out” and deleted from the table once the timer expires, which indicates that no traffic has been received from that device within the allotted period.
MAC aging’s main goal is to maintain the table’s currency and avoid having too many outdated or unneeded entries. When devices are transferred to a different port or disconnected, this is essential. Network problems would result from the switch continuing to transmit traffic to the outdated, wrong port in the absence of MAC ageing. After a device has aged out, the switch will re-learn its MAC address if it communicates again.
Many switches have an ageing time of 300 seconds (5 minutes) by default, however the network administrator can frequently change this. To change the ageing time globally or per-VLAN, for instance, use the mac address-table aging-time time-in-seconds [vlan vlan-number] command. Even if the new entries are younger than the ageing time setting, the switch may delete the oldest ones to create room for new ones if the MAC address table fills up.
For the switch’s MAC address database to remain current and enable effective and precise frame forwarding in a network, both MAC learning and ageing are essential.
Verification Commands
The MAC address table can be inspected and managed using a number of commands:
show mac address-table
: Shows every entry in the MAC table (secure, static, and dynamic).show mac address-table dynamic
: This only displays MAC addresses that have been dynamically learnt.
: This displays the quantity of MAC entries and room that are available.show mac address-table count
show mac address-table aging-time
: Shows the ageing timer settings for each VLAN and globally.clear mac-address-table dynamic
: Gets rid of all or a portion of dynamic MAC table entries.
Also Read About Network Switching: How Switches Connect For Device Networks