Switching Basics

Understanding MAC Learning and Frame Forwarding

A Network Switch is a Layer 2 device that connects devices within a Local Area Network (LAN) and uses MAC addresses to forward data efficiently.

Intelligence vs. Hubs

Unlike a hub, which broadcasts data to everyone, a switch intelligently directs traffic based on the destination device's hardware address.

The MAC Address Table (CAM)

The core of switching logic is the MAC Address Table. This table maps MAC addresses to specific switch ports.

How it Works:

  1. Learning (Source MAC): When a frame enters, the switch records the source MAC address and port.
  2. Forwarding (Dest MAC): The switch looks up the destination MAC. If found, it sends the frame to that specific port (Unicast).
  3. Flooding: If the destination is unknown or broadcast, the switch "floods" it out all ports in the same VLAN.
Aging Timer

Entries stay in the table for a default of 300 seconds (5 minutes) before being removed if no new traffic is seen.

Frame Processing Methods

Method Description Pros/Cons
Store-and-Forward Receives THE WHOLE frame and checks CRC for errors first. Highly reliable, higher latency.
Cut-Through Forwards as soon as the destination MAC is read. Fastest, but forwards corrupted frames.
Fragment-Free Reads the first 64 bytes (collision window) before forwarding. Balance of speed and reliability.
Switch# show mac address-table
Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
   1    0001.42a1.3e01    DYNAMIC     Fa0/1
  10    0002.1b2c.4d02    DYNAMIC     Fa0/2
Key Rule

Switches learn from Source MACs and forward based on Destination MACs.

Go to VLAN Configuration Lab →