DHCP - IP Assignment Process (DORA) - Watch the Algorithm Execute, Step by Step
Watching the packet flow step-by-step reveals how DHCP dynamically assigns IP addresses, clarifying the roles of each message and the sequence of communication.
Step 1/10
·Active fill★Answer cell
Client sends DHCP Discover broadcast to locate DHCP servers.
Hop: 1
Client
DHCP Server
📦Packet
↗ fromclient
↘ toserver
📄 payloadDHCP Discover
🔌 protocolDHCP
🚩 flagsbroadcast
src→0.0.0.0:—
dst→255.255.255.255:67
data→DHCP Discover
flags→broadcast
DHCP Discover: client→server (broadcast)
Server receives and processes DHCP Discover from client.
Hop: 1
Client
DHCP Server
📦Packet
↗ fromclient
↘ toserver
📄 payloadDHCP Discover
🔌 protocolDHCP
🚩 flagsbroadcast
src→0.0.0.0:—
dst→255.255.255.255:67
data→DHCP Discover
flags→broadcast
DHCP Discover: client→server (broadcast)
Server sends DHCP Offer proposing IP 192.168.1.100 to client.
Hop: 2
Client
DHCP Server
📦Packet
↗ fromserver
↘ toclient
📄 payloadDHCP Offer (IP: 192.168.1.100)
🔌 protocolDHCP
🚩 flagsunicast
src→192.168.1.1:67
dst→255.255.255.255:68
data→DHCP Offer (IP: 192.168.1.100)
flags→unicast
DHCP Discover: client→server (broadcast)
DHCP Offer: server→client (unicast)
Client receives and processes DHCP Offer from server.
Hop: 2
Client
DHCP Server
📦Packet
↗ fromserver
↘ toclient
📄 payloadDHCP Offer (IP: 192.168.1.100)
🔌 protocolDHCP
🚩 flagsunicast
src→192.168.1.1:67
dst→255.255.255.255:68
data→DHCP Offer (IP: 192.168.1.100)
flags→unicast
DHCP Discover: client→server (broadcast)
DHCP Offer: server→client (unicast)
Client broadcasts DHCP Request to accept offered IP.
Hop: 3
Client
DHCP Server
📦Packet
↗ fromclient
↘ toserver
📄 payloadDHCP Request (IP: 192.168.1.100)
🔌 protocolDHCP
🚩 flagsbroadcast
src→0.0.0.0:—
dst→255.255.255.255:67
data→DHCP Request (IP: 192.168.1.100)
flags→broadcast
DHCP Discover: client→server (broadcast)
DHCP Offer: server→client (unicast)
DHCP Request: client→server (broadcast)
Server receives DHCP Request confirming client's acceptance.
Hop: 3
Client
DHCP Server
📦Packet
↗ fromclient
↘ toserver
📄 payloadDHCP Request (IP: 192.168.1.100)
🔌 protocolDHCP
🚩 flagsbroadcast
src→0.0.0.0:—
dst→255.255.255.255:67
data→DHCP Request (IP: 192.168.1.100)
flags→broadcast
DHCP Discover: client→server (broadcast)
DHCP Offer: server→client (unicast)
DHCP Request: client→server (broadcast)
Server sends DHCP Acknowledge to finalize IP lease.
Hop: 4
Client
DHCP Server
📦Packet
↗ fromserver
↘ toclient
📄 payloadDHCP Acknowledge (IP: 192.168.1.100)
🔌 protocolDHCP
🚩 flagsunicast
src→192.168.1.1:67
dst→192.168.1.100:68
data→DHCP Acknowledge (IP: 192.168.1.100)
flags→unicast
DHCP Offer: server→client (unicast)
DHCP Request: client→server (broadcast)
DHCP Acknowledge: server→client (unicast)
Client receives DHCP Acknowledge and configures IP.
Hop: 4
Client
DHCP Server
📦Packet
↗ fromserver
↘ toclient
📄 payloadDHCP Acknowledge (IP: 192.168.1.100)
🔌 protocolDHCP
🚩 flagsunicast
src→192.168.1.1:67
dst→192.168.1.100:68
data→DHCP Acknowledge (IP: 192.168.1.100)
flags→unicast
DHCP Offer: server→client (unicast)
DHCP Request: client→server (broadcast)
DHCP Acknowledge: server→client (unicast)
Client configures assigned IP and completes DHCP process.
Hop: 4
Client (IP: 192.168.1.100)
DHCP Server
DHCP Offer: server→client (unicast)
DHCP Request: client→server (broadcast)
DHCP Acknowledge: server→client (unicast)
DHCP IP assignment process completed successfully.
Hop: 4
Client (IP: 192.168.1.100)
DHCP Server
DHCP Offer: server→client (unicast)
DHCP Request: client→server (broadcast)
DHCP Acknowledge: server→client (unicast)
Key Takeaways
✓ DHCP uses a four-message DORA sequence to dynamically assign IP addresses.
This sequence is hard to grasp from code alone because it involves multiple message types and broadcast vs unicast nuances.
✓ Broadcast messages are used initially to discover servers and request IPs, ensuring all servers hear the client.
Visualizing broadcast vs unicast clarifies why some messages go to all and others directly to one node.
✓ The final DHCP Acknowledge confirms the lease, allowing the client to configure its IP address.
Seeing the Acknowledge message flow and client state change makes the lease finalization concrete.
Practice
(1/5)
1. You want to prevent unauthorized access to your internal network by filtering incoming and outgoing traffic based on IP addresses and ports. Which network component is best suited for this task?
easy
A. Proxy server acting as an intermediary for client requests
B. Firewall filtering traffic based on rules
C. Reverse proxy optimizing server load
D. Content Delivery Network (CDN) caching static content
Solution
Step 1: Identify the role of each component
Firewalls are designed to filter network traffic based on IP addresses, ports, and protocols, enforcing security policies.
Step 2: Understand Proxy and Reverse Proxy roles
Proxies forward client requests but do not primarily filter traffic at the network level; reverse proxies handle server-side requests and optimize load.
Step 3: CDN role
CDNs cache content to improve performance but do not filter traffic for security.
Final Answer:
Option B -> Option B
Quick Check:
Firewall is the component that filters traffic based on rules [OK]
Classful addressing allocates IP blocks in fixed sizes (Class A, B, C), often wasting many IP addresses.
Step 2: Recognize CIDR's flexibility
CIDR allows variable-length subnet masks, enabling allocation of IP blocks tailored to network size, reducing waste.
Step 3: Evaluate options
When you need to allocate IP addresses in fixed blocks of Class A, B, or C sizes describes classful allocation, not CIDR. When you want to separate the network and host portions strictly by the first octet is about classful fixed boundaries. When you want to assign IP addresses only within Class C networks restricts to Class C, which CIDR overcomes.
Final Answer:
Option A -> Option A
Quick Check:
CIDR is used for efficient IP allocation across variable network sizes [OK]
Hint: CIDR = flexible IP blocks, classful = fixed blocks
Common Mistakes:
Believing CIDR only applies to Class C networks
Thinking CIDR is just a different notation without functional difference
Assuming classful addressing is still standard for IP allocation
3. Why is it generally not advisable to set a fixed Retransmission Timeout (RTO) value in TCP instead of using an adaptive algorithm?
medium
A. Because fixed RTO values prevent the sender from using sequence numbers effectively
B. Because fixed RTO values increase the TCP header size, reducing throughput
C. Because fixed RTO values cause the receiver to drop out-of-order packets more frequently
D. Because a fixed RTO cannot adjust to varying network delays, leading to either premature retransmissions or long delays
Solution
Step 1: Understand RTO purpose
RTO determines when the sender retransmits unacknowledged segments, ideally matching network delay.
Step 2: Analyze fixed vs adaptive RTO
Fixed RTO cannot adapt to changing RTTs, causing retransmissions either too early (wasting bandwidth) or too late (increasing latency).
Step 3: Evaluate options
Because fixed RTO values prevent the sender from using sequence numbers effectively is incorrect; sequence number usage is unaffected by RTO. Because fixed RTO values increase the TCP header size, reducing throughput is false; RTO does not affect header size. Because fixed RTO values cause the receiver to drop out-of-order packets more frequently is unrelated to RTO. Because a fixed RTO cannot adjust to varying network delays, leading to either premature retransmissions or long delays correctly identifies the main drawback.
Final Answer:
Option D -> Option D
Quick Check:
Adaptive RTO improves efficiency by matching network conditions.
4. If a company wants to improve both security and performance for a public-facing web application, which combined deployment of firewall, proxy, and reverse proxy is most effective?
hard
A. Deploy a proxy server between backend servers and clients without a firewall
B. Use only a reverse proxy to handle all security filtering and caching
C. Rely solely on a firewall to filter traffic and improve performance
D. Deploy a firewall at the network edge, a forward proxy for client requests, and a reverse proxy in front of backend servers
Solution
Step 1: Firewall role
Firewall at network edge filters unauthorized traffic, providing security.
Step 2: Forward proxy role
Forward proxy manages client requests, can enforce policies and cache content.
Only reverse proxy (B) or only firewall (C) miss layered defense and performance optimization; no firewall (A) reduces security.
Final Answer:
Option D -> Option D
Quick Check:
Combined deployment leverages strengths of all components [OK]
Hint: Layered defense: firewall + proxies for security and performance.
Common Mistakes:
Assuming one component can handle all roles
Ignoring the need for firewall in security
5. If a new network protocol requires encryption and compression before data transmission, which TCP/IP model layer would be the best place to implement these features to maintain compatibility and efficiency?
hard
A. Network Interface Layer, since it deals with physical transmission
B. Transport Layer, because it manages data segmentation and reliability
C. Internet Layer, as it routes packets across networks
D. Application Layer, since it handles end-user protocols and data formatting
Solution
Step 1: Identify layer responsibilities relevant to encryption and compression
Encryption and compression are data transformations related to how data is presented and formatted for applications, which fits the Application Layer's role in TCP/IP (combining OSI's Application, Presentation, and Session layers).
Step 2: Why not other layers?
Transport Layer manages segmentation and reliability, not data formatting. Internet Layer handles routing, not data content. Network Interface Layer deals with physical transmission, not data processing.
Final Answer:
Option D -> Option D
Quick Check:
Application Layer is the correct place for encryption/compression to maintain compatibility [OK]
Hint: Encryption/compression belong at Application Layer in TCP/IP
Common Mistakes:
Placing encryption at Transport Layer (confusing with TLS)
Thinking Internet Layer handles data content
Assuming Network Interface Layer manages data transformations