Got it

DHCP Server I

Latest reply: Jun 26, 2021 19:14:40 1009 17 7 0 0

I want to dedicate a series of publications to the DHCP protocol, I hope it is instructive for you.

The DHCP server is responsible for assigning IP addresses to clients. A client sends a packet to the server for configurations such as the IP address, subnet mask, and default gateway. After receiving the packet, the server replies with a packet carrying the corresponding configurations according to policies. Both the request and reply messages are encapsulated in UDP packets.

Three Modes for the Interaction Between the DHCP Client and Server

To obtain a valid dynamic IP address, a DHCP client exchanges different information with a server at different stages. Generally, the DHCP client and server interact in the following modes (defined in RFC 2131):

  • The DHCP client accesses the network for the      first time.

When a DHCP client accesses a network for the first time, the DHCP client undergoes the following stages to set up a connection with the DHCP server:


    • Discovering stage: indicates the stage at which       the DHCP client searches for a DHCP server. The client broadcasts a       DHCPDISCOVER packet and only DHCP servers replies to the packet.

    • Offering stage: indicates the stage at which       each DHCP server offers an IP address to the DHCP client. After receiving       the DHCP DISCOVER packet from the client, each DHCP server selects an       unassigned IP address from the IP address pool, and then sends a DHCP       OFFER packet with information about the leased IP address and other       settings to the client.

    • Selecting stage: indicates the stage at which       the DHCP client selects an IP address. If multiple DHCP servers send DHCP       OFFER packets to the client, the client accepts the first received DHCP       OFFER packet, and then broadcasts a DHCP REQUEST packet carrying       information about the selected IP address.

    • Acknowledging stage: indicates the stage at       which the DHCP server confirms the IP address that is offered. After       receiving the DHCP REQUEST packet, the DHCP server sends a DHCP ACK       packet to the client. The DHCP ACK packet contains the offered IP address       and other settings. Then, the DHCP client binds its TCP/IP protocol suite       to the network interface card.

Except the IP address selected by the client, the IP addresses offered by other DHCP servers are available for other clients.

  • The DHCP client accesses the network for the      second time.

When a DHCP client attempts to access a network for the second time, the DHCP client undergoes the following stages to set up a connection with the DHCP server:


    • If the client has correctly accessed the network,       it directly broadcasts a DHCP REQUEST packet that carries the       previously-assigned IP address rather than a DHCP DISCOVER packet when it       accesses the network again.

    • After receiving the DHCP REQUEST packet, the       DHCP server responds with a DHCP ACK packet if the IP address is not       assigned, notifying the client that it can continue to use the original       IP address.

    • If the IP address cannot be assigned to the       client (for example, it has been assigned to another client), the DHCP       server responds with a DHCP NAK packet to the client. After receiving the       DHCP NAK packet, the client sends a DHCP DISCOVER packet to apply for an       IP address.

  • The DHCP client extends the IP address lease.

Generally, there is a valid period for the IP address dynamically assigned to the client. The server withdraws the IP address after the valid period expires. If the client intends to continue to use this IP address, it needs to extend the IP address lease.

In practice, the DHCP client sends a DHCP REQUEST to the server automatically to update the IP address lease when the DHCP client is started or a half of the lease has passed. If the IP address is valid, the server replies with a DHCP ACK packet to inform the client of the new IP address lease.


Thanks for sharing
View more
  • x
  • convention:

lucian2003
lucian2003 Created Apr 2, 2021 16:48:13 (0) (0)
Your welcome  
Good
View more
  • x
  • convention:

lucian2003
lucian2003 Created Apr 2, 2021 16:47:53 (0) (0)
Your welcome  
Thanks
View more
  • x
  • convention:

lucian2003
lucian2003 Created Apr 2, 2021 16:47:30 (0) (0)
Your welcome  
Well done my friend
View more
  • x
  • convention:

Thanks for sharing
View more
  • x
  • convention:

lucian2003
lucian2003 Created Apr 4, 2021 00:59:37 (0) (0)
 
Thanks for sharing
View more
  • x
  • convention:

lucian2003
lucian2003 Created Apr 9, 2021 01:12:33 (0) (0)
 
awsome
View more
  • x
  • convention:

lucian2003
lucian2003 Created Apr 9, 2021 01:12:14 (0) (0)
 
Thanks
View more
  • x
  • convention:

lucian2003
lucian2003 Created Apr 9, 2021 01:11:55 (0) (0)
 
Very well written Mr Lucian. Thank you.
View more
  • x
  • convention:

12
Back to list

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.