Discussion 9
1
CS 168, Summer 2025 @ UC Berkeley
Slides credit: Sylvia Ratnasamy, Rob Shakir, Peyrin Kao, Iuniana Oprescu
DHCP, ARP, NAT 🚚
Logistics
Addressing
Transport
Network
Datalink
Physical
Application
Addressing
Transport
Network
Datalink
Physical
Application
DHCP - Dynamic Host Configuration Protocol
INTERNET
?
?
?
?
?
?
?
DHCP Discovery
Local Network
DHCP Server
IP Address: ???
Subnet Mask: ???
First-hop Router IP Address: ???
DNS IP Address: ???
DHCP Offer
Local Network
DHCP Server
IP Address: 212.0.0.0 (tentative)
Subnet Mask: /8 (tentative)
First-hop Router IP Address: 212.2.3.0 (tentative)
DNS IP Address: 212.4.7.8 (tentative)
IP Address: ???
Subnet Mask: ???
First-hop Router IP Address: ???
DNS IP Address: ???
DHCP Request
Local Network
DHCP Server
IP Address: 212.0.0.0 (tentative)
Subnet Mask: /8 (tentative)
First-hop Router IP Address: 212.2.3.0 (tentative)
DNS IP Address: 212.4.7.8 (tentative)
DHCP Acknowledgement
Local Network
IP Address: 212.0.0.0 (tentative)
Subnet Mask: /8 (tentative)
First-hop Router IP Address: 212.2.3.0 (tentative)
DNS IP Address: 212.4.7.8 (tentative)
IP Address: 212.0.0.0 (confirmed!)
Subnet Mask: /8 (confirmed!)
First-hop Router IP Address: 212.2.3.0 (confirmed!)
DNS IP Address: 212.4.7.8 (confirmed!)
DHCP Server
DHCP Summary
source: lecture 18 slide 20
A Couple Questions…
1. Dealing with failures?
2. Why do we need the first-hop router’s IP address and the subnet mask?
Addressing
Transport
Network
Datalink
Physical
Application
ARP (Overview)
Local Network
Dest Host
IP: a.b.c.d
Ethernet address: 40:11:11:11:11:11
IP Addr. | Ethernet Addr. |
a.b.c.d | 40:11:11:11:11:11 |
a.b.c.a | 50:37:11:11:11:11 |
ARP Table
ARP (Within local network)
Destination is in the same local network
Local Network
Dest Host
IP: a.b.c.d
Ethernet address: 40:11:11:11:11:11
IP Addr. | Ethernet Addr. |
a.b.c.d | 40:11:11:11:11:11 |
a.b.c.a | 50:37:11:11:11:11 |
ARP Table
Src Host
ARP (Across local networks)
Destination is NOT in the same local network
Local Network 1
Dest Host
IP: a.b.c.d
Ethernet address: 40:11:11:11:11:11
Src Host
Local Network 1
Src’s First Hop Router
IP: d.c.b.a
Ethernet address: 50:11:11:11:11:11
IP Addr. | Ethernet Addr. |
d.c.b.a | 50:11:11:11:11:11 |
d.c.b.c | 60:37:11:11:11:11 |
ARP Table
Router 2
ARP (Across local networks)
Local Network 1
Dest Host
IP: a.b.c.d
Ethernet address: 40:11:11:11:11:11
Src Host
Local Network 1
Src’s First Hop Router
IP: d.c.b.a
Ethernet address: 50:11:11:11:11:11
IP Addr. | Ethernet Addr. |
d.c.b.a | 50:11:11:11:11:11 |
d.c.b.c | 60:37:11:11:11:11 |
ARP Table
Router 2
ARP (Across local networks)
Local Network 1
Dest Host
IP: a.b.c.d
Ethernet address: 40:11:11:11:11:11
Src Host
Local Network 1
Src’s First Hop Router
IP: d.c.b.a
Ethernet address: 50:11:11:11:11:11
IP Addr. | Ethernet Addr. |
d.c.b.a | 50:11:11:11:11:11 |
d.c.b.c | 60:37:11:11:11:11 |
ARP Table
Router 2
ARP (Across local networks)
Local Network 1
Dest Host
IP: a.b.c.d
Ethernet address: 40:11:11:11:11:11
Src Host
Local Network 1
Src’s First Hop Router
IP: d.c.b.a
Ethernet address: 50:11:11:11:11:11
IP Addr. | Ethernet Addr. |
d.c.b.a | 50:11:11:11:11:11 |
d.c.b.c | 60:37:11:11:11:11 |
ARP Table
IP Addr. | Ethernet Addr. |
a.b.c.d | 40:11:11:11:11:11 |
a.b.c.c | 70:33:33:33:11:11 |
ARP Table
Router 2
Putting everything together
Laptop
DHCP
server
DNS
Server
Gateway
Router
Server
DHCP: get IPlaptop
UDP: port 67, 68
IP: broadcast
Ethernet: ..
DNS: resolve google.com
UDP: port 53
IP: IPDNS_server
Ethernet,ARP: ..
IP: IPlaptop ↔ IPgoogle
Ethernet, ARP: ..
The realm of routing protocols..
OSPF, BGP..
HTTP: GET “cat”
IP, NAT: IPGW ↔ IPgoogle
Ethernet: ..
..in the Datacenter!
HTTP: OK “=^.^=”
TCP
*Gateway router: the first- and last-hop router of the laptop, e.g., a router at home
Addressing
Transport
Network
Datalink
Physical
Application
Network Address Translation (NAT)
Network Address Translation (NAT)
Network Address Translation (NAT)
Worksheet
Question 1: Multiple Choice
Question 1: Multiple Choice
Question 1: Multiple Choice
Worksheet
Question 2: Host-to-Host
Question 2: Host-to-Host
Question 2: Host-to-Host
Question 2: Host-to-Host
Question 2: Host-to-Host
Worksheet
Question 3: Network Address Translation
Questions?
Feedback Form: https://tinyurl.com/cs168-su25-disc-feedback