What Does CAM table Mean?
On This Page
Quick Definition
A CAM table helps a switch remember which device is connected to which port. When a switch receives a network message, it looks up the destination MAC address in the CAM table to decide which port to forward the message out of. This makes the switch efficient and prevents unnecessary flooding of data.
Commonly Confused With
The ARP cache is stored on a host or router and maps IP addresses to MAC addresses. The CAM table is stored on a switch and maps MAC addresses to switch ports. They operate at different layers of the OSI model: ARP is Layer 3 to Layer 2 resolution; CAM is purely Layer 2 forwarding.
When your laptop wants to send to 192.168.1.1, it first looks in its ARP cache to find the MAC address for that IP. The switch, upon receiving your frame, then looks in its CAM table to find which port has that MAC address.
A routing table is found on routers and Layer 3 switches and maps IP networks to next-hop IP addresses. It is used for Layer 3 forwarding. The CAM table is used for Layer 2 forwarding within the same network. They serve entirely different purposes and cannot be interchanged.
If a packet needs to go to a different subnet, the router uses its routing table to find the next hop. Inside the local subnet, the switch uses its CAM table to deliver the frame to the correct device.
A transparent bridge uses the same concept as a switch, it learns MAC addresses and ports, but a bridge typically has only a few ports. A switch is a high-port-density multiport bridge with hardware-based forwarding. The term CAM table is commonly used for both, but the scale and performance are different.
A home router might include a 4-port bridge inside; that bridge uses a small MAC address table. A business switch with 48 ports uses a much larger CAM table with faster lookups.
Must Know for Exams
The CAM table is a core topic in the CCNA exam, specifically under the Network Access domain (20-25% of the exam). It appears in questions about switch operation, MAC address learning, VLANs, and troubleshooting. Cisco expects candidates to understand how a switch builds and uses a CAM table, how VLANs affect the table, and how to interpret the output of "show mac address-table".
Exam objectives that involve the CAM table include: - Describe the operation of a switch: learning, forwarding, flooding - Configure and verify VLANs and trunking - Implement port security - Troubleshoot Layer 2 connectivity issues - Understand the differences between a switch and a hub
In the CCNA 200-301 exam, you may see questions that ask you to predict which ports a frame will be forwarded out of based on a given CAM table. For example, a question might provide a topology and a partial CAM table, then ask what happens when Host A sends a frame to Host B. You would need to check if Host B's MAC address is in the table; if yes, forward only to that port; if no, flood all ports except the source port.
Another common question type involves MAC flooding: what happens when a switch's CAM table becomes full? The correct answer is that the switch floods all unknown unicast frames out of all ports, effectively operating like a hub until entries age out. You may also see questions about aging timers, static MAC entries, and the difference between dynamic and static entries.
Port security questions often tie into the CAM table. For instance, if you configure port security with a maximum of 2 MAC addresses, the switch will only learn up to 2 MAC addresses on that port. Any additional source MAC addresses will trigger a security violation. Understanding that the CAM table is where those learned MAC addresses are stored helps you conceptualize the limit.
Finally, exam simulations may require you to clear the CAM table with "clear mac address-table dynamic" and then verify that entries re-learn after traffic flows. Knowing how to read the output, including the VLAN, MAC address, type (dynamic, static, or secure), and port, is critical for passing the CCNA.
Simple Meaning
Imagine you are the mailroom manager for a large office building. Every day, letters arrive addressed to different people in different offices. If you had no memory of where anyone sits, you would have to shout each person's name and wait for them to come get their mail. That would be slow and disruptive. Now imagine you keep a clipboard with a list of every employee and their office number. When a letter arrives, you check your clipboard, walk directly to the correct office, and hand it over. That is what a CAM table does for a network switch.
The switch is a device that connects computers, printers, servers, and other devices in a local network. Each device has a unique hardware identifier called a MAC address, which is like a serial number burned into its network card. When a device sends data, the switch sees the source MAC address and the port the data came in on. The switch writes that information into its CAM table. Later, when another device wants to send data to that first device, the switch looks up the destination MAC address in the CAM table, finds the matching port, and forwards the data only out that specific port.
Without a CAM table, a switch would behave like a hub, sending every message out every port, which wastes bandwidth and creates security risks. With a CAM table, the switch learns exactly where each device lives. The table is dynamic, meaning it updates automatically as devices connect, disconnect, or move to different ports. Entries also have a timeout, so if a device goes silent for a while, its entry is removed to keep the table current. This learning process is a fundamental part of how Ethernet switches work and is essential for building fast, secure local area networks.
Full Technical Definition
A CAM table, also called a MAC address table or content-addressable memory table, is a data structure stored in the memory of an Ethernet switch. It maps destination MAC addresses to specific switch ports and VLANs. The term CAM refers to content-addressable memory, a specialized type of high-speed memory that allows the switch to perform lookups in a single clock cycle, which is critical for wire-speed forwarding.
The CAM table is built dynamically using a process called MAC address learning. When a frame arrives on an ingress port, the switch examines the source MAC address field in the Ethernet header. If that MAC address is not already in the CAM table, the switch creates a new entry associating that MAC address with the ingress port and the VLAN ID of the frame. If the entry already exists, the switch optionally refreshes its aging timer. The default aging timer on most Cisco switches is 300 seconds, but this can be adjusted using the command "mac address-table aging-time" in global configuration mode.
When a frame arrives with a destination MAC address, the switch performs a lookup in the CAM table. If a matching entry is found, the switch forwards the frame only out of the port listed in that entry. This is called unicast forwarding. If no matching entry exists, the switch floods the frame out of all ports in the same VLAN except the ingress port. This is called unknown unicast flooding. Broadcast frames (destination MAC address FF:FF:FF:FF:FF:FF) are always flooded, because they are intended for all devices.
The CAM table has a finite size, typically ranging from a few thousand entries on small access switches to over a hundred thousand on modular enterprise switches. When the table is full, the switch cannot learn new MAC addresses and must flood frames for any unknown destination, which increases CPU load and can degrade performance. This is a common attack vector in MAC flooding attacks, where an attacker sends frames with many different source MAC addresses to fill the CAM table and force the switch into hub mode, allowing packet sniffing.
VLANs add another layer to the CAM table. Each entry includes a VLAN ID, because the same MAC address can exist in different VLANs. The switch uses both the destination MAC address and the VLAN ID to determine the outgoing port. This is why trunk ports with multiple VLANs require careful planning of MAC address learning across VLANs.
On Cisco IOS, you can view the CAM table with the command "show mac address-table" or the older "show mac-address-table". You can clear the table with "clear mac address-table dynamic". Static MAC address entries can be configured using "mac address-table static" to hard-code a MAC address to a specific port, which is sometimes used for security or to guarantee certain traffic is not flooded.
Real-Life Example
Think of a large airport. When you land, you go to a specific gate. The gate number is like a switch port. Your face (your MAC address) is unique. Now imagine the airport has a directory at every junction that lists every passenger's face and the gate they arrived at. When you need to find your friend who arrived on another flight, you can check the directory and walk directly to their gate.
In this analogy, the airport is the switch. The directory is the CAM table. When a passenger (data frame) arrives at a gate (ingress port), the airport security scans their face (source MAC address) and writes down: "Face 1234 is at Gate B12." Later, when another passenger wants to deliver a message to Face 1234, they check the directory, find Gate B12, and walk directly there. Without the directory, they would have to go to every gate and shout the passenger's name, which is exactly what a switch does when it does not have a CAM table entry for the destination.
If the airport gets too many new passengers arriving, the directory might run out of space. New passengers cannot be listed, so messages for them must be broadcast to all gates, causing chaos. That is what happens when a CAM table fills up in a MAC flooding attack. Also, if a passenger moves to a different gate, the directory is updated after a short delay, just like the aging timer in a real CAM table. The airport workers do not constantly rewrite the entire directory; they only update it when a passenger arrives at a new gate or when an old entry expires.
Why This Term Matters
The CAM table is the core mechanism that allows Ethernet switches to be intelligent forwarding devices rather than simple repeaters. Without it, every frame would be broadcast to every port, consuming bandwidth and creating unnecessary collisions in half-duplex environments. In modern full-duplex switched networks, the CAM table enables simultaneous conversations between different pairs of devices without interference, dramatically increasing network throughput.
From a practical IT perspective, understanding the CAM table is essential for troubleshooting connectivity issues. If a device cannot communicate with another device on the same VLAN, a common first step is to check whether the switch has learned the destination MAC address in its CAM table. The command "show mac address-table" can reveal whether a device is connected to the expected port, whether it has been learned on the correct VLAN, or whether the entry has aged out. Network engineers also use the CAM table to verify that traffic is being forwarded as expected across trunk links and to identify devices that are moving between ports unexpectedly, which can indicate a bridging loop or a misconfigured port security feature.
Security professionals must also understand CAM table behavior. A MAC flooding attack can force a switch into fail-open mode, allowing an attacker to receive traffic destined for other hosts. Mitigations include port security with a maximum MAC address limit, dynamic ARP inspection, and using private VLANs. The CAM table is involved in Spanning Tree Protocol operations, where temporary MAC address table changes occur during topology changes, and understanding this helps prevent packet loss during failovers.
How It Appears in Exam Questions
CAM table questions on the CCNA exam typically fall into three patterns: forwarding behavior scenarios, show command interpretation, and troubleshooting scenarios.
Forwarding behavior scenarios: The question describes a small network topology with a switch connected to several hosts. It provides a partially populated CAM table and asks which port(s) will receive a frame when a specific host sends a frame to a specific destination. For example, "Switch SW1 has the following MAC address table entries: VLAN10 00:11:22:33:44:AA - Gi0/1, VLAN10 00:11:22:33:44:BB - Gi0/2. Host A with MAC 00:11:22:33:44:AA sends a frame to Host C with MAC 00:11:22:33:44:CC. How will SW1 forward the frame?" The correct answer is that since Host C's MAC is not in the table, SW1 will flood the frame out of all ports in VLAN10 except Gi0/1. These questions test your understanding of learning, forwarding, and flooding.
Show command interpretation: You are given the output of "show mac address-table" or "show mac address-table vlan 10" and asked to identify which MAC addresses are dynamically learned, which are static, how many entries exist, or which port a particular MAC address is associated with. Sometimes the output shows an empty table, and you must explain why (e.g., no traffic has been sent, or aging timer expired). Another variant shows multiple entries for the same MAC address on different VLANs, testing your understanding of VLAN isolation.
Troubleshooting scenarios: A user complains that they cannot reach a server on the same VLAN. You are given partial outputs from the switch. The CAM table shows the server's MAC address on a different port than expected, or it shows no entry for the server at all. You must identify the cause: perhaps the server is connected to the wrong port, the port is in the wrong VLAN, the server is not transmitting (e.g., powered off, bad cable), or the CAM table entry aged out because of no recent traffic. Another troubleshooting scenario involves port security: a violation has occurred because too many MAC addresses were learned on a single port. You need to know that the CAM table will show the offending MAC addresses and that you can use "show port-security" to investigate.
Some questions are more conceptual: "What happens to the CAM table entries when spanning tree recalculates?" The answer is that entries pointing to ports that are now blocking may be aged out or cleared immediately, depending on the STP version. Also, questions about MAC flooding attacks ask: "What is the effect of an attacker sending frames with many different source MAC addresses to a switch?" Correct answer: the CAM table fills, and the switch begins flooding frames for unknown destinations, allowing the attacker to see traffic that would otherwise be unicast.
Finally, configuration-based questions: "Which command is used to configure a static MAC address in the CAM table?" Options: "mac address-table static", "switchport port-security mac-address", etc. You must know the correct syntax and that static entries do not age out.
Practise CAM table Questions
Test your understanding with exam-style practice questions.
Example Scenario
You are setting up a small office network with one Cisco Catalyst 2960 switch. You connect four devices: a laptop (MAC: AAAA.AAAA.AAAA) to port FastEthernet0/1, a printer (MAC: BBBB.BBBB.BBBB) to port FastEthernet0/2, a server (MAC: CCCC.CCCC.CCCC) to port FastEthernet0/3, and another laptop (MAC: DDDD.DDDD.DDDD) to port FastEthernet0/4. All devices are in VLAN 1.
Initially, the CAM table is empty because no traffic has been sent. Now the laptop on port 1 sends a ping to the printer on port 2. The ping command creates an ICMP echo request frame. The frame has a source MAC of AAAA.AAAA.AAAA and a destination MAC of BBBB.BBBB.BBBB. When the switch receives this frame on port Fa0/1, it learns the source MAC and records an entry: VLAN1, AAAA.AAAA.AAAA, Fa0/1, DYNAMIC. Next, the switch looks up the destination MAC in the CAM table. The printer's MAC address (BBBB.BBBB.BBBB) is not yet in the table (the printer hasn't sent any frames), so the switch floods the echo request frame out of all ports except Fa0/1: that is, Fa0/2, Fa0/3, and Fa0/4. The printer on Fa0/2 receives the request and sends an echo reply. The printer's source MAC (BBBB.BBBB.BBBB) is now learned on port Fa0/2. The switch adds that entry. The echo reply is unicast directly to the laptop on Fa0/1 because the laptop's MAC is already in the CAM table. Future communication between the laptop and the printer will now be unicast only on the specific ports.
Now suppose the laptop on port 1 sends another ping to the server on port 3. At this point, the CAM table has entries for the laptop (Fa0/1) and the printer (Fa0/2) but not the server because it hasn't sent any frames. The switch will flood the ping request to all ports except Fa0/1. The server receives it, sends a reply, and its MAC address is learned on Fa0/3. This scenario demonstrates how a switch builds its CAM table through actual traffic and how the first frame to a new destination always experiences flooding, then subsequent frames are unicast.
Common Mistakes
Thinking that the CAM table stores IP addresses instead of MAC addresses.
The CAM table operates at Layer 2 and only stores MAC addresses along with port and VLAN information. IP addresses are handled by the routing table at Layer 3.
Remember that the switch looks at the Ethernet header, not the IP header, when building the CAM table. MAC addresses are burned into network interfaces and are used for local network forwarding.
Believing that the switch learns the destination MAC address from a frame and immediately puts it in the CAM table.
The switch learns only the source MAC address from a frame. The destination MAC address is used for lookup, not learning. If the destination MAC is unknown, the frame is flooded.
Always focus on the source MAC for learning. The switch says: 'I see this MAC came in on this port, so that's where it lives.' It does not assume anything about the destination.
Assuming that clearing the CAM table will cause immediate connectivity loss for all devices.
Clearing the CAM table removes all dynamic entries, but the switch will immediately rebuild the table as soon as any device sends a frame. The only temporary effect is that the first frame to each new destination will be flooded.
Clearing the CAM table is a safe troubleshooting step that causes a brief learning period. It does not break connectivity permanently.
Confusing the CAM table with the ARP table on a router or host.
The ARP table maps IP addresses to MAC addresses and is used by hosts and routers to resolve Layer 3 to Layer 2 addresses. The CAM table maps MAC addresses to ports and is used exclusively by switches.
Switches do not use ARP. They only look at MAC addresses. If you think about IP addresses, you are thinking about the wrong layer.
Exam Trap — Don't Get Fooled
{"trap":"A question shows that a switch has a full CAM table and asks what happens when a new host sends a frame to an unknown unicast destination. Many learners think the switch drops the frame because the table is full, but the correct answer is that the switch floods the frame out of all ports except the source port.","why_learners_choose_it":"Learners often assume that if the CAM table is full of entries, the switch cannot add new entries to learn the destination, so it must drop the frame.
They forget that the CAM table is only needed for learning, not for flooding.","how_to_avoid_it":"Remember that flooding does not require a CAM table entry. The switch only needs to know the source port to avoid flooding back to the sender.
It can always flood to all other ports regardless of table fill status. The table being full only means the switch cannot learn any new MAC addresses, so it will continue flooding for any unknown destination until an entry ages out."
Step-by-Step Breakdown
Frame Arrival
An Ethernet frame arrives at a switch port. The switch extracts the source MAC address, destination MAC address, and VLAN ID from the frame's header. This is the starting point of the learning and forwarding process.
Source MAC Learning
The switch checks its CAM table for an entry matching the source MAC address and VLAN. If no entry exists, the switch creates a new dynamic entry associating that MAC with the ingress port and VLAN. If an entry already exists, the switch refreshes its aging timer. This ensures the switch always knows where a device is located.
Destination MAC Lookup
The switch looks up the destination MAC address in the CAM table. It uses both the destination MAC and the frame's VLAN ID as the lookup key. If a matching entry is found, the switch knows exactly which port the destination device is on. If not, the destination is unknown.
Forwarding Decision
If the destination is found in the CAM table, the switch forwards the frame only out of the specific port in the table entry. This is called unicast forwarding. If the destination is not found, the switch floods the frame out of all ports in the same VLAN except the ingress port. Broadcast frames (FF:FF:FF:FF:FF:FF) are always flooded.
Aging and Removal
Each dynamic CAM entry has an aging timer, typically 300 seconds by default on Cisco switches. If the switch does not receive a frame from that source MAC address before the timer expires, the entry is removed. This keeps the table current and prevents stale entries from causing misforwarding.
Practical Mini-Lesson
The CAM table is one of the most fundamental components of any Ethernet switch. As a network professional, you need to be comfortable inspecting and interpreting CAM table data in real-world environments. The primary command to view the CAM table on Cisco IOS is "show mac address-table". This command shows you all dynamic, static, and secure MAC addresses the switch has learned, along with their associated VLAN, port, and type (STATIC, DYNAMIC, or SECURE).
When you are troubleshooting a connectivity issue, the first thing to check is whether the switch has learned the MAC address of the source and destination devices. Suppose a user reports that they cannot reach the file server at 192.168.1.100. You can ping the server from the user's computer to generate traffic, then examine the CAM table on the switch. If the server's MAC address is not present, the server may not be sending frames (e.g., it is off, the cable is bad, or it is in a different VLAN). If the server's MAC shows up on an unexpected port, someone may have plugged the server into the wrong port, or there may be a bridging loop causing the MAC to flap between ports.
MAC address flapping occurs when the same MAC address is learned on multiple ports within a short time. This is usually a sign of a loop in the network, frames from the same source arriving via different paths. The switch will log a message like "%SW_MATM-4-MACFLAP_NOTIF: Host 00:11:22:33:44:55 in vlan 10 is flapping between port Gi0/1 and Gi0/2". Spanning Tree Protocol is designed to prevent loops, but flapping can still occur during topology changes or due to misconfiguration. As a professional, you should investigate the switch log and use "show spanning-tree" to check for blocked or forwarding ports.
Another common practical task is configuring static MAC addresses. You might want to guarantee that a critical server's traffic is never flooded and always goes out a specific port. You can use "mac address-table static [mac] vlan [vlan] interface [port]". This entry will never age out and cannot be overwritten by dynamic learning. This is also useful for connecting devices that do not send frames, such as network-based printers that only listen.
Finally, port security interacts directly with the CAM table. When you set "switchport port-security maximum 1", the switch will only learn one MAC address on that port. Any additional source MAC attempts trigger a violation (shutdown, protect, or restrict). The learned addresses show up in the CAM table with a type of "SECURE". You can view them with "show mac address-table secure" or "show port-security address". Understanding this relationship helps you design secure access-layer networks.
Memory Tip
Think 'CAM = Connection Address Map', the switch maps every MAC address to its connected port.
Covered in These Exams
Current Exam Context
Current exam versions that test this topic — use these objectives when studying.
Related Glossary Terms
802.1Q is the networking standard that allows multiple virtual LANs (VLANs) to share a single physical network link by tagging Ethernet frames with VLAN identification information.
802.1X is a network access control standard that authenticates devices before they are allowed to connect to a wired or wireless network.
AAA (Authentication, Authorization, and Accounting) is a security framework that controls who can access a network, what they are allowed to do, and tracks what they did.
Frequently Asked Questions
Can the CAM table be modified manually?
Yes, you can add static entries using the 'mac address-table static' command. Dynamic entries are learned automatically and cannot be directly created manually, but you can clear them with 'clear mac address-table dynamic'.
What is the default aging time for CAM entries on Cisco switches?
The default aging time is 300 seconds (5 minutes). You can change it with the 'mac address-table aging-time' command in global configuration mode.
Does the CAM table store entries for broadcast or multicast MAC addresses?
No, broadcast MAC addresses (FF:FF:FF:FF:FF:FF) are never stored because they are always flooded. Multicast MAC addresses are handled differently, often by the IGMP snooping feature and a separate multicast forwarding table.
What happens if two switches are connected to each other and both learn the same MAC address?
In a properly configured network with Spanning Tree Protocol, only one path should be active, so the MAC should appear on only one port. If it appears on multiple ports, it is called MAC flapping and indicates a loop.
Can I see the CAM table for a specific VLAN only?
Yes, use 'show mac address-table vlan [vlan-id]' to display entries belonging to a particular VLAN.
Does a router use a CAM table?
A typical router does not use a CAM table in the same way a switch does. Routers use a routing table for Layer 3 forwarding. However, a Layer 3 switch uses both a CAM table for Layer 2 forwarding and a routing table for Layer 3 forwarding.
Summary
The CAM table is the brain of an Ethernet switch, enabling it to intelligently forward frames directly to the correct port rather than broadcasting them everywhere. It stores mappings of MAC addresses to switch ports and VLANs, built dynamically by examining the source MAC addresses of incoming frames. When a destination MAC is known, the switch forwards unicast traffic only to the relevant port. When unknown, it floods the frame to all ports in the VLAN.
For IT certification candidates, understanding the CAM table is critical for the CCNA exam and for real-world networking. It appears in questions about switch operation, VLANs, port security, and troubleshooting. Knowing how to read and interpret the output of "show mac address-table" is a practical skill that every network engineer must have. Common mistakes include confusing the CAM table with ARP caches or routing tables, forgetting that only source MACs are learned, and misunderstanding what happens when the table is full.
The key exam takeaway is that the CAM table enables fast, efficient, and secure Layer 2 switching. Without it, networks would be limited to hubs with their inherent inefficiency and security flaws. Master the CAM table, and you lay a solid foundation for understanding all higher-layer networking concepts.