Switching is the Layer 2 process switches use to forward Ethernet frames to their proper destinations within a LAN. A switch examines the Ethernet header, learns device MAC addresses, and uses its MAC address table to choose where a frame should go. This differs from routing: routers use Layer 3 IP-header information to forward packets between networks. section 6.0 section 9.0
Follow the forwarding process across a network:
- Use ARP when a host needs the MAC address associated with a local destination or its default gateway. section 6.0
- Let switches learn connected MAC addresses and forward or flood frames as appropriate. section 6.0
- Let routers select the best route between networks, then encapsulate the packet in a new frame for the next hop. section 10.0
PC1 sends a packet to PC3
PC1 prepares a packet addressed to PC3 and uses ARP to learn R1's default-gateway MAC address. It sends the packet in a frame to that MAC address. The switches forward or flood the frame according to their learned MAC information. At each routed hop, the IP packet remains addressed to PC3 while the Layer 2 frame is replaced and addressed to the next hop. section 10.0
