Switching, Routing, ARP & NAT
Host A (LAN)192.168.1.42:50100 โ 93.184.216.34:443Creates IP packet; ARP resolves Switch/Gateway MAC
L2 SwitchMAC AA:11 โ MAC FF:00 (Router)Forwards Ethernet frame by MAC address table
NAT Router203.0.113.5:62001 โ 93.184.216.34:443Rewrites private 192.168.1.42 โ public 203.0.113.5:62001
Web Server93.184.216.34:443 โ 203.0.113.5:62001Replies to Public IP; NAT translates back to Host A!
NAT Translation Table
Private LAN192.168.1.42:50100
Public WAN203.0.113.5:62001
Parameters
Switching, Routing, ARP & NAT
NAT/ARPInside a home or office LAN, devices use private IPs (192.168.x.x) and MAC addresses. Your NAT Router translates private IPs into one shared Public IP so packets can travel across the Internet.
Whiteboard Solver Steps
Step 1
1. Layer-2 Switching (MAC) vs Layer-3 Routing (IP)
Switches forward frames inside the LAN using MAC addresses; Routers forward packets across networks using IP addresses.
Step 2
2. Network Address Translation (NAT)
NAT lets thousands of private `192.168.x.x` home devices share one public IPv4 address using unique port numbers.