DHCP service detection method and device, electronic equipment and storage medium

By simulating real network requests to detect the DHCP service status, the network anomaly caused by DHCP service failure was resolved, enabling normal device connection and improved network performance.

CN119835193BActive Publication Date: 2025-11-04CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411731214.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-11-04
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

In existing technologies, DHCP service failures cause abnormal network operation, which is difficult to detect and resolve in a timely manner.

Method used

By sending probe messages to the local area network, receiving the first response message, constructing and sending a request message, parsing the second response message, constructing a verification data packet, and receiving the target response message to determine the response status of the target server, the system simulates a real network request and monitors the status of the DHCP service.

Benefits of technology

Promptly identify and resolve potential network issues to ensure proper device connectivity, improve network performance and stability, simplify network settings, and enhance user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835193B_ABST
    Figure CN119835193B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of network communication, and discloses a detection method and device of a DHCP service, an electronic device and a storage medium, which comprise the following steps: sending a detection message to a local area network and receiving a first response message; sending a request message to a first server based on the first response message and receiving a second response message generated by the first server in response to the request message; constructing a verification data packet based on the second response message and sending the verification data packet to a target server; receiving a target response message sent by the target server and determining a response state of the target server based on the target response message. The method simulates a real network request, and detects the response state of the target server to be detected by sending a verification data packet and corresponding target response information. By monitoring the response state of the server, relevant technical personnel can discover and solve potential network problems in time, so that all devices can be normally connected to the network and communicate.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network communication, and in particular to a detection method and device for DHCP service, an electronic device and a storage medium. BACKGROUND

[0002] DHCP (Dynamic Host Configuration Protocol) is a network protocol for a local area network, allowing network devices to automatically obtain network configuration information such as IP addresses (Internet Protocol Address), subnet masks, default gateways, DNS (Domain Name System) servers, etc. when connecting to the network. The DHCP service is usually provided by one or more servers in the network. If there is a device failure or abnormal network problem, it will affect the normal operation and management of the network. Therefore, it is currently an urgent problem to detect whether the DHCP service has a fault. SUMMARY

[0003] Therefore, the present application provides a detection method and device for DHCP service, an electronic device and a storage medium to solve the problem of detecting whether the DHCP service has a fault.

[0004] In a first aspect, the present application provides a detection method for DHCP service, applied to a detection terminal, comprising:

[0005] sending a detection message to a local area network and receiving a first response message, wherein the detection message at least contains address information of the detection terminal, and the first response message is generated by a first server in response to the detection message;

[0006] sending a request message to the first server based on the first response message and receiving a second response message generated by the first server in response to the request message, wherein the request message at least includes an available protocol address, address information of the detection terminal and a lease period;

[0007] constructing a verification data packet based on the second response message and sending the verification data packet to a target server, wherein the verification data packet is used for communication verification of the target server;

[0008] receiving a target response message sent by the target server and determining a response state of the target server based on the target response message, wherein the target response message is generated by the target server in response to the verification data packet.

[0009] In an optional embodiment, the step of sending a detection message to a local area network and receiving a first response message comprises:

[0010] constructing a probe message based on network transmission protocol layer information;

[0011] broadcasting the probe message to the local area network and receiving the first response message.

[0012] In an optional implementation, the sending of the request message to the first server based on the first response message comprises:

[0013] message extraction on the first response message;

[0014] generating a request message based on the message extraction result and sending the request message to the first server.

[0015] In an optional implementation, the generating of the request message based on the message extraction result comprises:

[0016] determining available protocol addresses and network configuration information based on the message extraction result;

[0017] generating the request message based on address information of the probe terminal, the available protocol addresses and the network configuration information, the available protocol addresses being determined from a preset database by the first server in response to the probe message.

[0018] In an optional implementation, the constructing of the verification data packet based on the second response message comprises:

[0019] matching the second response message to determine whether the second response message is valid based on a matching result;

[0020] if the second response message is valid, constructing a verification data packet based on a target available protocol address of a target server.

[0021] In an optional implementation, the matching of the second response message to determine whether the second response message is valid based on a matching result comprises:

[0022] field extraction on the second response message and analysis on the extracted fields;

[0023] judging whether information in the second response message is consistent with parameters in the request message, and if the information in the second response message is consistent with the parameters in the request message, determining that the second response message is valid.

[0024] In an optional implementation, the determination of the response state of the target server based on the target response message comprises:

[0025] parsing the target response message to determine corresponding first configuration information;

[0026] If the first configuration information is consistent with the network configuration information of the target server, it is determined that the target server responds correctly.

[0027] The DHCP service detection method provided by the embodiment includes sending a detection message to a local area network and receiving a first response message; sending a request message to a first server based on the first response message and receiving a second response message generated by the first server in response to the request message; constructing a verification packet based on the second response message and sending the verification packet to a target server; receiving a target response message sent by the target server and determining a response state of the target server based on the target response message. The method simulates a real network request and detects the response state of the target server to be detected by sending a verification packet and corresponding target response information. By monitoring the response state of the server, relevant technical personnel can discover and solve potential network problems in a timely manner, thereby ensuring that all devices can normally connect to the network and communicate.

[0028] In a second aspect, the application provides a DHCP service detection device, which includes:

[0029] A detection message sending module is configured to send a detection message to a local area network and receive a first response message, wherein the detection message at least contains address information of the detection terminal, and the first response message is generated by a first server in response to the detection message;

[0030] A request message sending module is configured to send a request message to the first server based on the first response message and receive a second response message generated by the first server in response to the request message, wherein the request message at least includes an available protocol address, address information of the detection terminal and a lease period;

[0031] A verification packet sending module is configured to construct a verification packet based on the second response message and send the verification packet to a target server, wherein the verification packet is used for communication verification of the target server;

[0032] A state determining module is configured to receive a target response message sent by the target server and determine a response state of the target server based on the target response message, wherein the target response message is generated by the target server in response to the verification packet.

[0033] In a third aspect, the present application provides an electronic device, comprising: a memory and a processor, which are connected to each other in communication, and the memory stores computer instructions, and the processor executes the computer instructions to perform the method of the first aspect or any of the corresponding embodiments.

[0034] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer instructions for making a computer execute the method of the first aspect or any of the corresponding embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0035] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the specific embodiments or the prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0036] Figure 1 is a flow diagram of a detection method of a DHCP service according to an embodiment of the present application;

[0037] Figure 2 is a structural block diagram of a detection device of a DHCP service according to an embodiment of the present application;

[0038] Figure 3 is a hardware structure diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to make the purposes, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0040] DHCP service is a key service in a local area network environment, and is also responsible for allocating IP address, subnet mask, gateway, DNS and the like for devices on the network. In order to ensure normal operation and management of the network, the DHCP service in the local area network needs to be monitored in time. Based on this, an embodiment of the application provides a detection method of DHCP service, applied to a detection terminal, comprising: sending a detection message to a local area network, and receiving a first response message, wherein the detection message at least contains address information of the detection terminal, and the first response message is generated by a first server in response to the detection message; sending a request message to the first server based on the first response message, and receiving a second response message generated by the first server in response to the request message, wherein the request message at least includes an available protocol address, address information of the detection terminal and a lease period; constructing a verification data packet based on the second response message, and sending the verification data packet; receiving a target response message sent by a target server, and analyzing the target response message, so as to determine a response state of the target server based on an analysis result, wherein the target response message is generated by the target server in response to the verification data packet.

[0041] According to the embodiment of the application, a detection method of DHCP service is provided. It should be noted that the steps shown in the flowchart can be executed in a computer system such as a group of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.

[0042] In this embodiment, a detection method of DHCP service is provided, which can be used for a detection terminal, Figure 1 is a flowchart of the detection method of DHCP service according to the embodiment of the application, as Figure 1 shown, the flow includes the following steps:

[0043] Step S101, a detection message is sent to a local area network, and a first response message is received.

[0044] The detection message at least contains address information of the detection terminal, and the first response message is generated by a first server in response to the detection message.

[0045] The detection terminal is a detection device, which uses a terminal device connectable to a local area network as a detection terminal, such as a mobile phone, a computer, etc. A detection message is broadcast to the local area network, and the detection message contains relevant information of the detection terminal. Exemplarily, the detection message includes address information of the detection terminal, an operation code, a hardware type, a hardware address length, a hop count, a transaction ID, etc., wherein the address information can include an IP address of the detection terminal. The message is propagated in the local area network to all first servers connected to the network, and the first servers refer to all DHCP servers in the local area network, including router, switch and other devices.

[0046] After receiving the detection message, the first server replies to a first response message to provide an available IP address (an available protocol address) and network configuration information for the detection terminal. The network configuration information includes a subnet mask, a default gateway, a DNS server address, etc.

[0047] In step S102, a request message is sent to the first server based on the first response message, and a second response message generated by the first server in response to the request message is received.

[0048] After receiving the first response message, the detection terminal constructs a request message, wherein the request message at least includes the available protocol address, address information of the detection terminal and a lease period. The address information of the detection terminal includes a MAC address (physical address) of the detection terminal itself. In addition, the network configuration information can also be included in the request message, and the available protocol address and the network configuration information are extracted from the first response message. The lease period represents a lease period of the available protocol address that the detection terminal hopes to obtain.

[0049] After generating the request message, the detection terminal broadcasts the request message to all first servers. The request message can be transmitted using the UDP (User Datagram Protocol) protocol, and the detection message is encapsulated in a UDP data packet, and the data packet is sent to a specific port of the first server. After receiving the request message, the first server verifies the legality of the request and replies to a second response message to confirm the allocation of the available protocol address and other network configurations.

[0050] In step S103, a verification data packet is constructed based on the second response message, and the verification data packet is sent to the target server.

[0051] The detection terminal constructs a verification data packet by analyzing the second response message, and the verification data packet is used for communication verification of the target server. First, after receiving the second response message, the detection terminal needs to confirm whether the configuration parameters obtained by the detection terminal match the required configuration parameters by analyzing the second response message, so as to avoid configuration errors or conflicts. If it is judged that the configuration parameters match, it is determined that the available protocol address allocated by which first server needs to be used, and the first server is the target server. The verification data packet constructed includes Ethernet frame, IP message, UDP message and other information, and the verification data packet is sent to the first server. Exemplarily, the verification data packet can be sent by using Python and Scapy (a Python program) library.

[0052] In step S104, the target response message sent by the target server is received, and the response state of the target server is determined based on the target response message.

[0053] The target response message is generated by the target server in response to the verification data packet.

[0054] After receiving the verification data packet, the target server generates a target response message, and the format of the target response message is consistent with that of the first response message. The response state of the target server is determined according to the received target response message, and the response state can include whether the target server responds and whether the target server responds correctly.

[0055] After receiving the target response message, the detection terminal can analyze the target response message, and determine whether the target server responds correctly according to the parameters obtained by the analysis. If the target response message is not received, it can be indicated that the target server is in an unresponsive state, and troubleshooting can be performed in time.

[0056] The DHCP service detection method provided in the embodiment includes sending a detection message to a local area network and receiving a first response message; sending a request message to a first server based on the first response message and receiving a second response message generated by the first server in response to the request message; constructing a verification data packet based on the second response message and sending the verification data packet to a target server; receiving a target response message sent by the target server, and determining a response state of the target server based on the target response message. The method simulates a real network request, and detects the response state of the target server to be detected by sending a verification data packet and corresponding target response information. By monitoring the response state of the server, a related technical person can discover and solve potential network problems in time, so as to ensure that all devices can normally connect to the network and communicate.

[0057] In the embodiment, a DHCP service detection method is provided, which is applied to a detection terminal and the like, Figure 2is a flow chart of a probing method of a DHCP service according to an embodiment of the present application, as shown in the figure, the flow comprises the following steps: Figure 2

[0058] Step S201, sending a probing message to a local area network and receiving a first response message.

[0059] Specifically, the above step S201 comprises:

[0060] Step S2011, constructing a probing message based on network transmission protocol layer information.

[0061] The probing message constructed by the probing terminal is a message containing relevant information of the probing device, so that the first server can identify and respond, which includes network transmission protocol layer information, network transmission protocol layer address including Ethernet frame header, IP header and UDP header and other information. Among them, the Ethernet frame header contains source MAC address and destination MAC address, which is used to broadcast messages in the local area network. Since the device has not obtained the IP address at this time, the source IP address in the IP header may be empty, and the destination IP address may also be a broadcast address. The UDP header contains source port number and destination port number.

[0062] Step S2012, broadcasting the probing message to the local area network and receiving the first response message.

[0063] The probing message is sent through the broadcast address in the local area network, ensuring that all first servers connected to the local area network can receive the message, and the message propagates in the local area network and reaches all devices connected to the network. The device receiving the probing message replies the message, providing available protocol addresses (available IP addresses), network configuration information, etc.

[0064] When the probing terminal requests an IP address, the first server quickly finds and allocates a response IP address and network configuration information, thereby generating a first response message and sending it to the probing terminal.

[0065] Step S202, sending a request message to the first server based on the first response message and receiving a second response message generated by the first server in response to the request message.

[0066] Specifically, the above step S202 of sending a request message to the first server based on the first response message comprises:

[0067] Step S2021, message extraction is performed on the first response message.

[0068] After receiving the first response message, the probing terminal performs message extraction, extracts key information such as subnet mask, default gateway, DNS server address, etc. from the message, and records it locally or on the DHCP server. ​

[0069] Step S2022, generating a request message based on the message extraction result, and sending the request message to the first server.

[0070] The request message is constructed according to the extracted message, and the detection terminal sends the request message to the corresponding first server according to the extracted IP address of the first server. The request message is encapsulated in a UDP data packet and transmitted using the UDP protocol, so as to be sent to a specific port of the first server.

[0071] In some optional embodiments, the above step S2022 comprises:

[0072] Step a1, determining available protocol addresses and network configuration information based on the message extraction result.

[0073] Through the message extraction operation, the available protocol addresses and network configuration information can be determined from the first response message, wherein the available protocol addresses are determined by the first server from a preset database in response to the detection message. When the detection terminal requests an IP address, the first server quickly looks up and assigns available protocol addresses and network configuration information from the preset database.

[0074] Step a2, generating a request message based on the address information of the detection terminal, the available protocol addresses and the network configuration information.

[0075] The generated request information at least contains the physical address of the detection terminal, the assigned available protocol addresses and the network configuration information.

[0076] Step S203, constructing a verification data packet based on the second response message, and sending the verification data packet to the target server;

[0077] Specifically, the above step S203 of constructing a verification data packet based on the second response message comprises:

[0078] Step S2031, matching the second response message to determine whether the second response message is valid based on the matching result.

[0079] The second response message is parsed to extract the fields and parameters contained in the second response message, and the fields and parameters in the second response message are compared with the parameters in the request message to obtain a comparison result, and it is judged whether the second response message is valid according to the comparison result.

[0080] In some optional embodiments, step S2031 comprises:

[0081] Step b1, field extraction is performed on the second response message, and the extracted fields are parsed.

[0082] Since the second response message can be transmitted in binary format, it can be converted into a string format for processing, and the values of fields and options can be extracted using string splitting, regular expressions, etc. According to the field length and offset of the DHCP protocol specification, the corresponding part is cut from the string, and the value of the field is parsed. The field types include but are not limited to subnet mask, MAC address, default gateway, DNS server, IP address of NTP (Network Time Protocol) server, domain name search list, etc.

[0083] Step b2, judging whether the information in the second response message is consistent with the parameters in the request message, if the information in the second response message is consistent with the parameters in the request message, it is determined that the second response message is valid.

[0084] After parsing, it is judged whether the parameters such as available protocol address and physical address of the probe terminal provided in the second response message are consistent with the parameters in the request message, if they are consistent, it means that the second response message is valid.

[0085] Step S2032, if the second response message is valid, constructing a verification packet based on the target available protocol address of the target server.

[0086] When it is determined that the second response message is valid through judgment, the probe terminal will configure its network connection with the allocated available protocol address and network configuration information, and construct a corresponding verification packet. The verification packet can include Ethernet frame, IP message and UDP message, wherein the Ethernet frame includes source MAC address and target MAC address, etc. The IP message is the protocol header for transmitting data in the network, including source IP address and target IP address. The UDP message is the protocol header for data report-oriented communication, including source port number and target port number.

[0087] Step S204, receiving the target response message sent by the target server, and determining the response state of the target server based on the target response message.

[0088] Specifically, the above step S204 includes:

[0089] Step S2041, parsing the target response message to determine the corresponding first configuration information.

[0090] All data in the target response message are traversed to parse the DHCP options therein, which are the first configuration information provided by the target server in the target response message, and can specifically include subnet mask, DNS server, DNS domain, etc.

[0091] Step S2042, if the first configuration information is consistent with the network configuration information of the target server, it is determined that the target server responds correctly.

[0092] In the foregoing, the target configuration information of the target server has been received, and if it is determined through comparison that the first configuration information is consistent with the target configuration information, it indicates that the response of the target server is not a problem.

[0093] In some optional embodiments, the above-mentioned probe message is a DHCP Discover packet, the first response message is a DHCP Offer packet, the request message is a DHCP Request packet, and the second response message is a DHCP Acknowledge packet.

[0094] Among them, DHCP Discover is a network message type used in Dynamic Host Configuration Protocol (DHCP). It is broadcasted and sent by the probe terminal in the network, used to discover available DHCP servers, and request to obtain network configuration information.

[0095] DHCP Offer is a network message type used in Dynamic Host Configuration Protocol (DHCP). It is a message sent by the DHCP server to the probe terminal as a response to the DHCP Discover message.

[0096] DHCP Request is a network message type used in Dynamic Host Configuration Protocol (DHCP). It is a message sent by the probe terminal to the DHCP server after receiving the DHCP Offer message, used to request specific network configuration.

[0097] DHCP Acknowledge is a network message type used in Dynamic Host Configuration Protocol (DHCP). It is a message sent by the DHCP server as a response to the DHCP Request message sent by the probe terminal. The DHCP Acknowledge message is used to confirm and inform the probe terminal that its requested network configuration has been accepted and completed.

[0098] In this solution, the status of the DHCP service can be periodically monitored and detected by sending probe messages. By quickly and reliably detecting the active DHCP server in the local area network, the efficiency of network configuration can be improved. Devices can obtain the correct IP address and other network configuration parameters more quickly, reducing the network connection time and the possibility of configuration errors, and improving the overall performance and stability of the network. On the other hand, it improves the user experience when using DHCP services in the local area network. Users do not need to manually configure network parameters, but can automatically detect and obtain configuration information provided by the DHCP server, simplifying the network setup process and providing a more convenient user experience. By recording the IP address and related information of the active DHCP server, network administrators can better understand and manage the DHCP service in the local area network. This helps to troubleshoot, monitor network performance, and make appropriate configuration and optimization, improving the efficiency and accuracy of network management.

[0099] In this embodiment, a DHCP service detection device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible and contemplated.

[0100] This embodiment provides a DHCP service detection device, as shown in Figure 2 , comprising:

[0101] The probe message sending module 301 is configured to send a probe message to the local area network and receive a first response message, wherein the probe message at least contains address information of the probe terminal, and the first response message is generated by the first server in response to the probe message;

[0102] The request message sending module 302 is configured to send a request message to the first server based on the first response message and receive a second response message generated by the first server in response to the request message, wherein the request message at least includes an available protocol address, address information of the probe terminal, and a lease period;

[0103] The verification data packet sending module 303 is configured to construct a verification data packet based on the second response message and send the verification data packet to the target server, wherein the verification data packet is used for communication verification of the target server;

[0104] The state determining module 304 is configured to receive a target response message sent by the target server, and determine a response state of the target server based on the target response message, wherein the target response message is generated by the target server in response to the verification data packet.

[0105] In some optional embodiments, the probe message sending module 301 comprises:

[0106] A probe message constructing unit configured to construct a probe message based on network transmission protocol layer information.

[0107] A message broadcasting unit configured to broadcast the probe message to the local area network, and receive the first response message.

[0108] In some optional embodiments, the request message sending module 302 comprises:

[0109] A message extracting unit configured to extract a message from the first response message.

[0110] A message sending unit configured to generate a request message based on the message extraction result, and send the request message to the first server.

[0111] In some optional embodiments, the message sending unit comprises:

[0112] An information determining subunit configured to determine available protocol addresses and network configuration information based on the message extraction result.

[0113] A request message generating subunit configured to generate the request message based on address information of the probe terminal, the available protocol addresses and the network configuration information, wherein the available protocol addresses are determined from a preset database by the first server in response to the probe message.

[0114] In some optional embodiments, the verification data packet sending module 303 comprises:

[0115] A message matching unit configured to match the second response message, to determine whether the second response message is valid based on a matching result.

[0116] A data packet constructing unit configured to construct a verification data packet based on target available protocol addresses of the target server, if the second response message is valid.

[0117] In some optional embodiments, the message matching unit comprises:

[0118] A field extracting subunit configured to extract fields from the second response message, and parse the extracted fields.

[0119] The parameter judgment subunit is used to determine whether the information in the second response message is consistent with the parameters in the request message. If the information in the second response message is consistent with the parameters in the request message, then the second response message is determined to be valid.

[0120] In some alternative implementations, the state determination module 304 includes:

[0121] The message parsing unit is used to parse the target response message and determine the corresponding first configuration information;

[0122] The status determination unit is used to determine that the target server's response is correct if the first configuration information is consistent with the network configuration information of the target server.

[0123] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0124] In this embodiment, the DHCP service detection device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0125] This invention also provides an electronic device having the above-described features. Figure 2 The device shown is a DHCP service detection device.

[0126] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in an optional embodiment of the present invention, such as... Figure 3 As shown, the electronic device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise as required. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 3 Take a processor 10 as an example.

[0127] The processor 10 can be a central processor, a network processor, or a combination thereof. The processor 10 can further include hardware chips. The hardware chips can be application specific integrated circuits, programmable logic devices, or a combination thereof. The programmable logic devices can be complex programmable logic devices, field programmable logic gate arrays, general array logic, or any combination thereof.

[0128] The memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the methods illustrated in the above embodiments.

[0129] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system, application programs required by at least one function, and the like. The data storage area can store data created according to the use of the electronic device, and the like. In addition, the memory 20 can include a high-speed random access memory, and can further include a non-transitory memory such as at least one of a magnetic disk storage device, a flash memory device, or other non-transitory solid state storage device. In some alternative embodiments, the memory 20 can optionally include a memory disposed remotely from the processor 10, and these remote memories can be connected to the electronic device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0130] The memory 20 can include a volatile memory such as a random access memory, and can further include a non-volatile memory such as a flash memory, a hard disk, or a solid state disk. The memory 20 can further include a combination of the above-mentioned types of memories.

[0131] The electronic device further includes a communication interface 30 for communication of the electronic device with other devices or communication networks.

[0132] The embodiments of the present application also provide a computer readable storage medium. The above-mentioned methods according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or stored in a remote storage medium or a non-transitory machine readable storage medium originally through network downloading and then stored in a local storage medium, so that the methods described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid state disk, etc. Further, the storage medium can further include a combination of the above-mentioned types of memories. It can be understood that the computer, the processor, the microprocessor controller, or the programmable hardware includes a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the methods illustrated in the above embodiments are implemented.

[0133] While embodiments of the present application have been described in conjunction with the appended drawings, various modifications and changes can be suggested by persons skilled in the art, and all such modifications and changes are believed to fall within the scope of the present application.

Claims

1. A method for detecting DHCP service, characterized in that, Applied to a detection terminal, the method includes: Send a probe message to the local area network and receive a first response message, wherein the probe message contains at least the address information of the probe terminal, and the first response message is generated by the first server in response to the probe message; Based on the first response message, a request message is sent to the first server, and a second response message generated by the first server in response to the request message is received. The request message includes at least the available protocol address, the address information of the probe terminal, and the lease term. A verification data packet is constructed based on the second response message and sent to the target server. The verification data packet is used to perform communication verification on the target server. Receive a target response message sent by the target server, and determine the response status of the target server based on the target response message, wherein the target response message is generated by the target server in response to the verification data packet.

2. The method according to claim 1, characterized in that, The step of sending a probe message to the local area network and receiving a first response message includes: Construct probe messages based on network transport protocol layer information; Broadcast the probe message to the local area network and receive the first response message.

3. The method according to claim 1, characterized in that, Sending a request message to the first server based on the first response message includes: Message extraction is performed on the first response message; A request message is generated based on the message extraction results and sent to the first server.

4. The method according to claim 3, characterized in that, The generation of the request message based on the message extraction results includes: Based on the message extraction results, available protocol addresses and network configuration information are determined; The request message is generated based on the address information of the probe terminal, the available protocol address, and the network configuration information. The available protocol address is determined by the first server from a preset database in response to the probe message.

5. The method according to claim 1, characterized in that, The construction of the verification data packet based on the second response message includes: The second response message is matched to determine whether the second response message is valid based on the matching result; If the second response message is valid, a verification packet is constructed based on the target available protocol address of the target server.

6. The method according to claim 5, characterized in that, The step of matching the second response message to determine whether the second response message is valid based on the matching result includes: The second response message is processed by extracting fields, and the extracted fields are then parsed. Determine whether the information in the second response message is consistent with the parameters in the request message. If the information in the second response message is consistent with the parameters in the request message, then the second response message is determined to be valid.

7. The method according to claim 1, characterized in that, Determining the response status of the target server based on the target response message includes: Parse the target response message to determine the corresponding first configuration information; If the first configuration information is consistent with the network configuration information of the target server, then the target server's response is determined to be correct.

8. A DHCP service detection device, characterized in that, The device includes: The probe message sending module is used to send probe messages to the local area network and receive a first response message. The probe message contains at least the address information of the probe terminal, and the first response message is generated by the first server in response to the probe message. The request message sending module is used to send a request message to the first server based on the first response message, and to receive a second response message generated by the first server in response to the request message. The request message includes at least an available protocol address, the address information of the probe terminal, and the lease term. The verification data packet sending module is used to construct a verification data packet based on the second response message and send the verification data packet to the target server. The verification data packet is used to perform communication verification on the target server. The status determination module is used to receive a target response message sent by the target server and determine the response status of the target server based on the target response message, wherein the target response message is generated by the target server in response to the verification data packet.

9. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the DHCP service detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the DHCP service detection method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method, system and device for determining network link quality

    CN118075160A

  • Method and system for monitoring dynamic host configuration protocol (DHCP) service in an internet protocol network

    EP1073244A1