Ethernet Switching
Ethernet Encapsulation
Ethernet (IEEE 802.3) is the dominant LAN technology — it handles the vast majority of all wired network traffic worldwide. The most common frame format is DIX Ethernet II (also called Ethernet Version 2), which uses an EtherType field to identify the upper-layer protocol. The original IEEE 802.3 format used a Length field and required 802.2 LLC headers — you'll still see references to both on the CCNA exam.
MAC Address Format
A MAC address (Media Access Control address) is a 48-bit hardware identifier assigned to every network interface. It is used for Layer 2 addressing within a network segment. MAC addresses are expressed as 12 hexadecimal digits in various formats.
! MAC address notation formats (all represent the same address): AA:BB:CC:DD:EE:FF ! Linux/macOS colon-separated AA-BB-CC-DD-EE-FF ! Windows hyphen-separated AABB.CCDD.EEFF ! Cisco IOS dot-separated (groups of 4) ! View MAC address in Windows C:\> ipconfig /all Physical Address. . : AA-BB-CC-11-22-33 ! View MAC on Cisco IOS SW1# show interfaces fastethernet 0/1 Hardware is Fast Ethernet, address is 0001.96a1.a41c (bia 0001.96a1.a41c) ! bia = burned-in address (the ROM address) ! Current address may differ if MAC was overridden in software ! View MAC address table on switch SW1# show mac address-table Mac Address Table ------------------------------------------- Vlan Mac Address Type Ports ---- ----------- -------- ----- 1 0001.97f1.8101 DYNAMIC Fa0/1 1 0004.9a00.0000 DYNAMIC Fa0/2 1 0060.3e1e.c7c0 DYNAMIC Fa0/3
The MAC address is split into two equal parts:
Unicast, Broadcast, and Multicast MAC Addresses
Not all MAC addresses represent a single device. The type of MAC address in the destination field tells the switch — and the receiving devices — who the frame is intended for.
01:00:5E, and the low-order 23 bits map to the multicast IP group address.How Switches Learn and Forward
Switches operate at Layer 2 and maintain a MAC Address Table (also called the CAM table — Content Addressable Memory). This table maps MAC addresses to switch ports, allowing the switch to make intelligent forwarding decisions rather than blindly flooding all traffic everywhere.
The four forwarding behaviors:
- Unicast, MAC known, different port: forward out only that specific port
- Unicast, MAC known, same port: filter (drop — device is on the same segment)
- Unicast, MAC unknown: FLOOD out all ports except the incoming port (unknown unicast)
- Broadcast (FF:FF:FF:FF:FF:FF): always FLOOD out all ports except incoming
MAC address aging: entries are removed from the table after 300 seconds (5 minutes) of inactivity by default. If a device goes offline, its MAC ages out so the table doesn't fill up with stale entries.
! Initially empty — switch just powered on SW1# show mac address-table dynamic ! (no entries) ! PC1 (MAC: 0001.0001.0001) pings PC2 (MAC: 0002.0002.0002) ! Switch learns PC1's MAC from the INCOMING frame source MAC SW1# show mac address-table dynamic Vlan Mac Address Type Ports 1 0001.0001.0001 DYNAMIC Fa0/1 ! PC1 learned ! ARP broadcast floods to all — switch learns nothing from broadcast dest ! PC2 replies with ARP reply (unicast) — switch learns PC2 1 0002.0002.0002 DYNAMIC Fa0/2 ! PC2 learned ! All future PC1 ↔ PC2 frames: direct forwarding, no more flooding ! Clear the MAC table SW1# clear mac address-table dynamic ! Default aging time: 300 seconds (5 minutes) SW1# show mac address-table aging-time
Switch Forwarding Methods
How fast a switch starts forwarding a frame depends on which forwarding method it uses. There is a fundamental trade-off between latency (how fast) and reliability (error checking). This is a direct CCNA exam topic.
Switch Memory Buffering and Auto-Negotiation
When frames arrive faster than they can be forwarded (e.g., from a 1G uplink to a 100M downlink), switches use memory buffers to hold frames temporarily. Two methods exist:
- Port-based memory: each port has its own dedicated buffer — frames queued per port. Simple but can waste memory if one port is idle.
- Shared memory: all ports share a common memory pool — frames allocated dynamically. More efficient, especially when traffic is uneven across ports. Used in modern switch ASICs.
Auto-negotiation (IEEE 802.3u) allows connected devices to automatically agree on speed (10/100/1000 Mbps) and duplex (half/full). Both devices advertise their capabilities and choose the best match. If one end has auto-negotiation disabled and manually set, mismatches can occur — the auto-negotiating end will default to half-duplex if it cannot detect the other end's settings.
Auto-MDIX (Automatic Medium-Dependent Interface Crossover) automatically detects whether a straight-through or crossover cable is connected and adjusts the port's TX/RX pins accordingly. Modern switches support Auto-MDIX, eliminating the need to worry about cable type for switch-to-switch or switch-to-PC connections.
Step 1: Access a Cisco switch (Packet Tracer topology or real hardware)
Step 2: Before connecting any devices:
show mac address-table — confirm it is emptyStep 3: Connect two PCs to the switch on Fa0/1 and Fa0/2
Step 4: From PC1, ping PC2:
ping 192.168.1.2Step 5: Check the MAC table:
show mac address-table dynamicStep 6: Note which MACs appear on which ports — does it match the physical connections?
Step 7: Clear the table:
clear mac address-table dynamicStep 8: Verify it's empty again, then watch it repopulate with another ping
Expected result: After the ping, both PCs' MAC addresses appear in the table mapped to their respective ports (Fa0/1 and Fa0/2).
💡 Show hints
- In Packet Tracer: drag a 2960 switch, two PCs, connect with straight-through cables
- Assign IPs: PC1 = 192.168.1.1/24, PC2 = 192.168.1.2/24
- Access switch CLI: click switch → CLI tab → press Enter
- Command:
show mac address-table dynamic(dynamic = learned, not static) - Why does PC1's MAC appear before PC2's? The ARP request (broadcast) teaches PC1's location; PC2 replies (unicast) teaching PC2's location