MAC address learning process

A switch learns MAC addresses using a process called MAC address learning or learning and forwarding. Here’s how it works:

  1. Receives a Frame: When a switch receives an Ethernet frame on a port, it examines the frame’s source MAC address.
  2. Updates the MAC Table (CAM Table):
    • The switch stores the source MAC address and the port number in its MAC address table (also called the Content Addressable Memory (CAM) table).
    • This way, the switch knows which device is connected to which port.
  3. Forwards the Frame:
    • If the destination MAC address is already in the MAC table, the switch forwards the frame only to the corresponding port.
    • If the destination MAC address is not in the table, the switch floods the frame to all ports except the one it was received from. This is called unknown unicast flooding.
  4. Refreshes Entries:
    • MAC address entries have a timeout (typically 5 minutes by default).
    • If a device doesn’t send traffic for a while, its MAC entry is removed from the table to free up space.

Example Scenario:

This process helps switches efficiently forward traffic and reduce unnecessary network congestion.

renjithbs Avatar

Posted by

Leave a comment