# 5 Analyzing Ethernet LAN Switching
###### tags: `CCNA`
**The LAN switch has one primary job**
==to forward frames to the correct destination (MAC) address.==
**And to achieve that goal**, switches use logic—logic based on the source and destination MAC address in each frame’s Ethernet header.
**LAN switches receive Ethernet frames** and then **make a switching decision**: either **forward** the frame out some other ports or **ignore** the frame.
To accomplish this primary mission, switches perform three actions:
1. **Deciding when to forward a frame or when to filter (not forward) a frame**, based on the destination MAC address
2. Preparing to forward frames by learning MAC addresses by examining the source MAC address of each frame received by the switch
3. Preparing to forward only one copy of the frame to the destination by creating a (Layer 2) loop-free environment with other switches by using Spanning Tree Protocol (STP)

### Learning MAC Addresses

### Forwarding Known Unicast Frames



### Flooding Unknown Unicast and Broadcast Frames

### Avoiding Loops Using Spanning Tree Protocol
**lopping** the topology without STP or redundant protocol

### Verifying and Analyzing Ethernet Switching
A Cisco Catalyst switch comes from the factory ready to switch frames.
Cisco Catalyst switches come ready to get busy switching frames because of settings like these:
■ The interfaces are enabled by default, ready to start working once a cable is connected.
■ All interfaces are assigned to VLAN 1.
■ 10/100 and 10/100/1000 interfaces use autonegotiation by default.
■ The MAC learning, forwarding, flooding logic all works by default.
**■ STP is enabled by default.**
### Demo



### Finding Entries in the MAC Address Table



### Managing the MAC Address Table (Aging, Clearing)
The example shows a case with all defaults, with the global setting of 300 seconds, and no per-VLAN overrides.

### MAC Address Tables with Multiple Switches
參考這個拓樸,show兩台SW的mac table



