Bird
Raised Fist0
Interview Prepcomputer-networkseasyAmazonTCSInfosysWiproMicrosoft

DHCP - IP Assignment Process (DORA)

Choose your preparation mode3 modes available
▶
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 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. When a host wants to send a packet to an IP address on the same subnet but does not have the MAC address cached, what sequence of events occurs in the ARP process?
easy
A. The host broadcasts an ARP request to all devices on the subnet and waits for the target to reply with its MAC address.
B. The host sends a broadcast DHCP request to obtain the MAC address.
C. The host sends a unicast ARP request to the target IP and waits for a unicast ARP reply.
D. The host consults its routing table to find the MAC address.

Solution

  1. Step 1: Understand ARP request nature

    ARP requests are broadcast to all devices on the local subnet because the sender does not know the MAC address of the target.
  2. Step 2: ARP reply is unicast

    The target device responds with a unicast ARP reply containing its MAC address.
  3. Step 3: Why not unicast request?

    Unicast ARP requests cannot be sent without knowing the MAC address, which is the problem ARP solves.
  4. Step 4: DHCP is unrelated

    DHCP is for IP address assignment, not MAC resolution.
  5. Step 5: Routing table does not store MAC addresses

    Routing tables map IP prefixes to next hops, not MAC addresses.
  6. Final Answer:

    Option A -> Option A
  7. Quick Check:

    ARP requests are broadcast; replies are unicast [OK]
Hint: ARP requests are always broadcast on local subnet [OK]
Common Mistakes:
  • Assuming ARP requests are unicast
  • Confusing DHCP with ARP
  • Thinking routing tables store MAC addresses
2. In which scenario is the TCP three-way handshake essential before data transmission begins?
easy
A. When broadcasting a message to multiple hosts on a local network
B. When establishing a reliable connection-oriented session between two hosts
C. When sending a single UDP datagram to a remote host
D. When encrypting data packets for secure transmission

Solution

  1. Step 1: Identify the purpose of the handshake

    The TCP three-way handshake is designed to establish a reliable, connection-oriented session between two hosts before data transfer.
  2. Step 2: Analyze each option

    Sending a single UDP datagram to a remote host is incorrect because UDP is connectionless and does not use a handshake. Broadcasting a message to multiple hosts on a local network is incorrect because broadcasting does not require connection establishment. Encrypting data packets for secure transmission is unrelated to connection setup; encryption is a separate process.
  3. Final Answer:

    Option B -> Option B
  4. Quick Check:

    Only TCP connections require this handshake to ensure reliability and synchronization.
Hint: TCP handshake = reliable connection setup, not for UDP or broadcast
Common Mistakes:
  • Confusing TCP handshake with UDP communication
  • Assuming handshake is needed for broadcast or encryption
3. In which scenario is WebSocket the most appropriate choice compared to HTTP Long Polling and Server-Sent Events (SSE)?
easy
A. When the application requires full-duplex communication with low latency and frequent bidirectional data exchange
B. When the client only needs to receive unidirectional real-time updates from the server with minimal overhead
C. When the server needs to push occasional updates but the client cannot maintain persistent connections
D. When the client wants to reduce server resource usage by opening a new HTTP request for each update

Solution

  1. Step 1: Analyze communication direction requirements

    WebSocket supports full-duplex communication, allowing simultaneous two-way data flow, unlike SSE and Long Polling which are unidirectional or half-duplex.
  2. Step 2: Consider latency and connection persistence

    WebSocket maintains a persistent connection with low latency, ideal for frequent bidirectional exchanges.
  3. Step 3: Evaluate other options

    When the client only needs to receive unidirectional real-time updates from the server with minimal overhead describes SSE, which is unidirectional from server to client. When the server needs to push occasional updates but the client cannot maintain persistent connections is inaccurate because SSE requires persistent connections. When the client wants to reduce server resource usage by opening a new HTTP request for each update describes naive Long Polling, which is resource-heavy.
  4. Final Answer:

    Option A -> Option A
  5. Quick Check:

    Full-duplex + low latency + frequent bidirectional data -> WebSocket
Hint: Full-duplex + frequent bidirectional updates -> WebSocket
Common Mistakes:
  • Confusing SSE as bidirectional
  • Assuming Long Polling is efficient for frequent updates
  • Believing WebSocket is only for server-to-client updates
4. Which of the following statements about ARP spoofing is INCORRECT?
medium
A. ARP spoofing can allow an attacker to intercept or modify traffic between two hosts on the same subnet.
B. ARP spoofing exploits the lack of authentication in the ARP protocol.
C. ARP spoofing relies on sending fake ARP replies to poison the ARP cache of target devices.
D. Using static ARP entries completely eliminates the risk of ARP spoofing in a network.

Solution

  1. Step 1: Understand ARP spoofing basics

    It involves sending forged ARP messages to associate the attacker's MAC with a legitimate IP.
  2. Step 2: Static ARP entries reduce risk but don't completely eliminate it

    Static entries prevent cache poisoning but are hard to manage and can be bypassed in some scenarios.
  3. Step 3: Why Using static ARP entries completely eliminates the risk of ARP spoofing in a network. is incorrect

    Static ARP entries help but do not guarantee complete protection, especially in large or dynamic networks.
  4. Step 4: Other options are correct

    They accurately describe ARP spoofing mechanisms and vulnerabilities.
  5. Final Answer:

    Option D -> Option D
  6. Quick Check:

    Static ARP entries mitigate but do not fully eliminate ARP spoofing risk [OK]
Hint: Static ARP entries help but are not foolproof against spoofing [OK]
Common Mistakes:
  • Assuming static ARP entries are a perfect solution
  • Underestimating ARP spoofing attack methods
5. Why might the TCP three-way handshake introduce latency, and when could this be a disadvantage?
medium
A. Because it requires multiple round-trip times before data transfer, causing delay in time-sensitive applications
B. Because it encrypts all packets during handshake, increasing processing time
C. Because it uses UDP packets which are slower than TCP packets
D. Because it requires the server to send data before the client can send any

Solution

  1. Step 1: Identify handshake latency cause

    The handshake requires at least one full round-trip time (RTT) before data can be sent, introducing delay.
  2. Step 2: Analyze options

    Because it requires multiple round-trip times before data transfer, causing delay in time-sensitive applications correctly states the latency due to multiple RTTs, which can be problematic for real-time or low-latency applications. Because it encrypts all packets during handshake, increasing processing time is incorrect; encryption is separate from handshake. Because it uses UDP packets which are slower than TCP packets is false; handshake uses TCP packets, not UDP. Because it requires the server to send data before the client can send any is incorrect; the client sends data after handshake completes.
  3. Final Answer:

    Option A -> Option A
  4. Quick Check:

    Handshake latency = multiple RTTs before data flow.
Hint: Handshake latency = waiting for multiple packet exchanges before data
Common Mistakes:
  • Confusing handshake with encryption overhead
  • Thinking handshake uses UDP packets
  • Believing server sends data first
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard