VL
Initializing Lab Environment...

Switching, Routing, ARP & NAT

Switching, Routing, ARP & NAT Sandbox
Host A192.168.1.42L2 SwitchMAC TableNAT Router203.0.113.5:62001Server:443
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

2254
102465535

Switching, Routing, ARP & NAT

NAT/ARP

Inside 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.

LAN (192.168.1.X)โ†’NATPublic (203.0.113.5:Port)\text{LAN } (192.168.1.X) \xrightarrow{\text{NAT}} \text{Public } (203.0.113.5:\text{Port})

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.

MAC (Local Hop)โ€…โ€ŠโŸทโ€…โ€ŠIP (End-to-End)\text{MAC (Local Hop)} \;\longleftrightarrow\; \text{IP (End-to-End)}
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.

192.168.1.42:50100โ†’NAT203.0.113.5:62001192.168.1.42:50100 \xrightarrow{\text{NAT}} 203.0.113.5:62001