π Introduction
In computer networking, understanding how a switch learns MAC addresses is a fundamental concept, especially for students preparing for CCNP exam.
A network switch operates at Layer 2 (Data Link Layer) of the OSI model and makes forwarding decisions based on MAC (Media Access Control) addresses, and not IP addresses.
In this guide, we will understand how a switch learns MAC address, how the MAC address table works, and how ARP request and reply help in communication.
π§ How a Switch Learns MAC Addresses (CCNP Switch Guide)



βοΈ Step-by-Step: How a Switch Learns MAC Address
Letβs understand with an example:
π Device 1 (IP: 1.1) wants to communicate with Device 2 (IP: 1.4)
πΉ Step 1: ARP Request (Broadcast)
- Device 1 sends an ARP request
- Switch checks its MAC table β No entry found
- Switch broadcasts the request to all ports
π This is called flooding
πΉ Step 2: ARP Reply (Unicast)
- Only Device 2 (1.4) responds
- It sends its MAC address back to Device 1
π This response is unicast (one-to-one)
πΉ Step 3: MAC Table Learning
When the switch receives frames:
- It learns source MAC address
- Stores it in MAC table with port number
π Important:
Switch always learns from source MAC, NOT destination MAC
πΉ Step 4: Future Communication
- Now switch already knows MAC addresses
- No more broadcast needed
- Communication becomes unicast (direct)
π This improves network efficiency.
In real networks, this process happens in milliseconds, so users donβt notice it.
You can check MAC table using show mac address-table command in Cisco devices.
π MAC Address Table Explained
- Initially β Empty
- Entries are added dynamically
- Each entry includes:
- MAC address
- Port number
β±οΈ MAC Address Aging Time
- Default aging time = 300 seconds (5 minutes)
- If no traffic is seen:
- Entry is automatically removed
π This ensures the table stays updated
β οΈ Key Points to Remember
β Switch works on MAC address, not IP
β ARP is used to resolve IP to MAC
β Unknown destination β Broadcast (Flooding)
β Known destination β Unicast
β Learning is always from source MAC
β MAC table is dynamic
π§Ύ Conclusion
Understanding how a switch learns MAC addresses is essential for both real-world networking and CCNP exams.
By using ARP and MAC address tables, switches efficiently forward data within a network while minimizing unnecessary traffic.
π References / Further Reading
Some links related to this blog :
- Cisco Official Documentation on ARP
- Your blog: How ARP Works Step-by-Step
- Your blog: MAC Address Table Explained