MAC address learning and aging

MAC learning-

  • To switch frames between LAN ports efficiently, the switch maintains an address table called the MAC table.
  • When the switch receives a frame, it associates the media access control (MAC) address of the sending network device with the LAN port on which it was received.
  • MAC address learning is enabled on all VLANs by default
  • The switch dynamically builds the address table by using the MAC source address of the frames received.
  • When the switch receives a frame for a MAC destination address not listed in its address table, it floods the frame to all LAN ports of the same VLAN except the port that received the frame.
  • When the destination station replies, the switch adds its relevant MAC source address and port ID to the address table.
  • The switch then forwards subsequent frames to a single LAN port without flooding all LAN ports.
  • You can also enter a MAC address, which is termed a static MAC address, into the table.
  • These static MAC entries are retained across a reboot of the switch.

MAC aging-

  • You can configure the amount of time that an entry (the packet source MAC address and port that packet ingresses) remains in the MAC table.
  • You can also configure MAC aging time in interface configuration mode or VLAN configuration mode.
  • The MAC aging time specifies the time before an entry ages out and is discarded from the MAC address table.
  • The range is from 0 to 1000000; the default is 300 seconds.
  • Entering the value 0 disables the MAC aging.
  • If a VLAN is not specified, the aging specification applies to all VLANs.