Illustrates the packet capture process of the DHCP Project (1)

Source: Internet
Author: User

We have been learning DHCP for some time. Here we will explain some content of packet capture in the DHCP project. Here, the main DHCP (Dynamic Host Configuration Protocol) is a Dynamic Protocol for providing Configuration parameters to Internet terminals. After applying by the terminal, DHCP can provide IP addresses, gateways, and DNS server addresses to the terminal.

It works like this:

1. DHCP discover is required first. The client drcom) broadcasts the DHCPdiscover packet in this segment to discover the DHCP server (T64G) in the network. The DHCP Relay can broadcast the packet to other network segments.

If the client does not log on to the network for the first time, it encapsulates the ip address he used last time in option50windows xp). If the ip address is not assigned, the DHCP server must first assign the ip address to the client.

2. When the DHCP server listens to the DHCP discover broadcast sent by the client, it selects the first vacant IP address from the address range that has not been rented out, together with other TCP/IP settings, a DHCP offer packet is returned to the client.

At this time, the DHCP server will ping the pre-allocated address to ensure that the address is not used. Otherwise, another address will be changed to the client. Other TCP/IP settings will be included in the DHCP offer, but the client determines whether to use these settings. (192.168.131.254 is the DHCP gateway address)

3. If multiple DHCPoffer messages are received, DHCPclient selects one of them for the response based on the message content. At this time, the client will also send a free arp packet again to check whether there is a conflicting address in the network,

In case of any conflict, a DHCP decline packet is sent to reject the DHCP server and the DHCP process is restarted. Otherwise, a DHCP request message is sent to the DHCP server to accept the IP address.

4. When the DHCP server receives the client's DHCP request, it sends a DHCPack response to the client to confirm that the IP lease takes effect.

At this time, the client will perform the last free arp check. If there is no conflict, a complete DHCP process will be completed.

Before learning about packet capture, let's analyze the following content. If the DHCP server cannot meet the requirements of the DHCP request packet, a DHCP nak packet must be sent to the client to re-execute the DHCP process. Once the client obtains the lease from the DHCP server, it can be used before the lease expires 50%. When the lease reaches 87.5%, the client uses the DHCP request message to renew the contract, and the DHCP server uses the DHCP ack message to confirm. If you do not receive the ack packet from the DHCP server, the client must use the DHCP request message to renew the packet when the lease expires at 85%. The DHCP server uses the DHCP ack to confirm the packet; otherwise, the client must discard the IP address. When the client wants to cancel the contract, it directly uses the DHCP release message to notify the DHCP server. The DHCP server recycles the address for future use. Therefore, if the lease time is too short, the client will frequently want to renew the DHCP server, when the DHCP server is too late to respond to the client's renewal request, it will need to re-request the DHCP address due to address aging, resulting in network interruption, for more information about network interruptions caused by too short lease times, see my report.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.