The CAM Table or MAC address Table

Ethernet switches store the MAC addresses of all connected devices in a table known as CAM or MAC address table and use it to make forwarding decisions. The CAM table is also known as MAC forward table, MAC filter table, MAC address table, switching table, or bridging table.

A CAM table uses entries to store information. There are two ways to add entries to the CAM table: static and dynamic. In the static method, we manually add entries to the CAM table. In the dynamic method, the switch automatically adds entries to the CAM table.

The static method is complex and tedious. Administrators use this method to add only the MAC addresses of critical resources such as servers and firewalls for security reasons.

The dynamic method is easy. It is also the default method on all Cisco switches. In this method, switches automatically learn the MAC addresses of the connected devices from incoming frames.

The CAM table saves each MAC address in a separate entry. With each MAC address, it also saves port and aging information. The switch uses the port information to make forwarding decisions. It uses the aging information to remove old entries.

cam table

Switches use two types of configurations: running configuration and startup configuration. It uses running configuration to save all the dynamically learned information and configuration changes we make on the switch.

When we restart a switch, the running configuration is lost. To preserve the configuration across the reboot, switches use startup configuration.

They save startup configuration in NVRAM. When a switch boots, it loads the startup configuration from NVRAM to RAM.

Switches save the CAM table entries in the running configuration. To preserve entries across the reboot, we need to save them in the startup configuration. The following privileged exec mode command saves the running configuration in the startup configuration.

Switch#copy running-config startup-config

saving running configuration

CAM tables are not sharable

CAM tables are not sharable. A switch cannot share its CAM table with another switch. Similarly, it cannot use another switch's CAM table. Each switch has to build its own CAM table.

Viewing CAM table entries

To view the entries of the CAM table, we use the "show mac-address-table" command in privileged exec mode. This command displays the real-time entries of the CAM table.

If we use this command just after turning on the switch, it displays a blank CAM table. The switch adds a device MAC address to the CAM table only when it receives a frame from that device on one of its ports.

The following image shows the CAM table just after the switch is on.

cam table without entry

The following image shows the CAM table after the switch has learned the MAC address of its connected devices.

cam table with entry

Key points: -
  • Switches use the CAM table to save the MAC addresses of the connected devices.
  • The CAM table saves each MAC address in a separate entry with the port and aging information.
  • The switch uses port information to make forwarding decisions.
  • The switch uses aging information to age out old entries.
  • There are two ways to update the CAM table: manual and dynamic.
  • In the manual method, we manually add MAC addresses to the CAM table.
  • In the dynamic method, the switch automatically adds the MAC addresses of the connected devices from incoming frames.
  • Switches save CAM table entries in the running configuration.
  • Running configuration doesn't preserve across the reboot.
  • To preserve the running configuration after the reboot, we need to copy it into the startup configuration.

ComputerNetworkingNotes CCNA Study Guide The CAM Table or MAC address Table