Bird
Raised Fist0
Interview Prepcomputer-networkseasyAmazonTCSInfosysWiproMicrosoft

DHCP - IP Assignment Process (DORA)

Choose your preparation mode3 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Steps
setup

Client broadcasts DHCP Discover

The client starts without an IP and broadcasts a DHCP Discover message to find available DHCP servers.

💡 This initial broadcast is how the client announces it needs an IP address.
Line:send_dhcp_discover() # Client broadcasts Discover
💡 DHCP Discover is a broadcast message sent by the client to locate DHCP servers.
📊
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 fillAnswer cell
Client sends DHCP Discover broadcast to locate DHCP servers.
Hop: 1
Client
DHCP Server
📦Packet
fromclient
toserver
📄 payloadDHCP Discover
🔌 protocolDHCP
🚩 flagsbroadcast
src0.0.0.0:—
dst255.255.255.255:67
dataDHCP Discover
flagsbroadcast
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
src0.0.0.0:—
dst255.255.255.255:67
dataDHCP Discover
flagsbroadcast
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
src192.168.1.1:67
dst255.255.255.255:68
dataDHCP Offer (IP: 192.168.1.100)
flagsunicast
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
src192.168.1.1:67
dst255.255.255.255:68
dataDHCP Offer (IP: 192.168.1.100)
flagsunicast
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
src0.0.0.0:—
dst255.255.255.255:67
dataDHCP Request (IP: 192.168.1.100)
flagsbroadcast
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
src0.0.0.0:—
dst255.255.255.255:67
dataDHCP Request (IP: 192.168.1.100)
flagsbroadcast
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
src192.168.1.1:67
dst192.168.1.100:68
dataDHCP Acknowledge (IP: 192.168.1.100)
flagsunicast
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
src192.168.1.1:67
dst192.168.1.100:68
dataDHCP Acknowledge (IP: 192.168.1.100)
flagsunicast
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

  1. 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.
  2. 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.
  3. Step 3: CDN role

    CDNs cache content to improve performance but do not filter traffic for security.
  4. Final Answer:

    Option B -> Option B
  5. Quick Check:

    Firewall is the component that filters traffic based on rules [OK]
Hint: Firewall filters traffic; proxies forward requests.
Common Mistakes:
  • Confusing proxy with firewall as a security filter
  • Assuming reverse proxy filters traffic like a firewall
2. In which scenario would you most likely use CIDR notation instead of traditional classful addressing?
easy
A. When you want to efficiently allocate IP addresses to networks of varying sizes without wasting addresses
B. When you want to separate the network and host portions strictly by the first octet
C. When you need to allocate IP addresses in fixed blocks of Class A, B, or C sizes
D. When you want to assign IP addresses only within Class C networks

Solution

  1. Step 1: Understand classful addressing limitations

    Classful addressing allocates IP blocks in fixed sizes (Class A, B, C), often wasting many IP addresses.
  2. Step 2: Recognize CIDR's flexibility

    CIDR allows variable-length subnet masks, enabling allocation of IP blocks tailored to network size, reducing waste.
  3. 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.
  4. Final Answer:

    Option A -> Option A
  5. 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

  1. Step 1: Understand RTO purpose

    RTO determines when the sender retransmits unacknowledged segments, ideally matching network delay.
  2. 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).
  3. 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.
  4. Final Answer:

    Option D -> Option D
  5. Quick Check:

    Adaptive RTO improves efficiency by matching network conditions.
Hint: Adaptive RTO matches RTT; fixed RTO causes inefficiency.
Common Mistakes:
  • Believing fixed RTO affects TCP header size
  • Confusing RTO with receiver packet handling
  • Assuming RTO impacts sequence number usage
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

  1. Step 1: Firewall role

    Firewall at network edge filters unauthorized traffic, providing security.
  2. Step 2: Forward proxy role

    Forward proxy manages client requests, can enforce policies and cache content.
  3. Step 3: Reverse proxy role

    Reverse proxy protects backend servers, performs load balancing, SSL termination, and caching.
  4. Step 4: Evaluate other options

    Only reverse proxy (B) or only firewall (C) miss layered defense and performance optimization; no firewall (A) reduces security.
  5. Final Answer:

    Option D -> Option D
  6. 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

  1. 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).
  2. 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.
  3. Final Answer:

    Option D -> Option D
  4. 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