[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN117376317A - Address conflict detection method, equipment and medium based on DHCP server - Google Patents

Address conflict detection method, equipment and medium based on DHCP server Download PDF

Info

Publication number
CN117376317A
CN117376317A CN202310745501.1A CN202310745501A CN117376317A CN 117376317 A CN117376317 A CN 117376317A CN 202310745501 A CN202310745501 A CN 202310745501A CN 117376317 A CN117376317 A CN 117376317A
Authority
CN
China
Prior art keywords
address
new client
client
network
dhcp server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310745501.1A
Other languages
Chinese (zh)
Inventor
王佳成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Cisco Networking Technology Co Ltd
Original Assignee
Inspur Cisco Networking Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Cisco Networking Technology Co Ltd filed Critical Inspur Cisco Networking Technology Co Ltd
Priority to CN202310745501.1A priority Critical patent/CN117376317A/en
Publication of CN117376317A publication Critical patent/CN117376317A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/103Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5046Resolving address allocation conflicts; Testing of addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Small-Scale Networks (AREA)

Abstract

The application discloses an address conflict detection method, equipment and medium based on a DHCP server, which are used for solving the problem of network conflict caused by the fact that different clients use the same IP address when a plurality of DHCP servers in the prior art simultaneously provide the same assignable address for the clients. The method comprises the following steps: starting a DHCP server and receiving an address request initiated by a new client based on the DHCP server; determining the MAC address corresponding to the new client and the requested IP address according to the address request, and broadcasting ARP request information to the network; receiving a plurality of MAC addresses returned by each client in a network, and comparing the plurality of MAC addresses with the MAC addresses corresponding to the new client; and determining whether address conflict exists between the new client and each client in the network, if so, reallocating the IP address for the new client and sending an OFFER message to the new client. Therefore, address conflict can be timely detected and avoided, and network security is guaranteed.

Description

Address conflict detection method, equipment and medium based on DHCP server
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method, an apparatus, and a medium for detecting address collision based on a DHCP server.
Background
The dynamic host configuration protocol (Dynamic Host Configuration Protocol, DHCP) is a standard protocol defined by RFC 541 (which has been replaced by RFC 2131) that allows servers to automatically dynamically allocate IP addresses and configuration information to clients. However, in some specific scenarios, there may be cases where multiple DHCP servers serve the same pool of IP addresses at the same time.
Currently, in order to avoid collision of IP addresses of different clients, in the prior art, a collision detection mechanism built in a DHCP protocol is generally used to perform collision detection on the IP addresses of different clients, but because information between DHCP servers cannot be updated synchronously, different DHCP servers may allocate different IP addresses to the same client, thereby causing network collision. In addition, a client will only request a DHCP server when it first acquires a network configuration, and if the client is started simultaneously with another client and the request is broadcast to all DHCP servers, it will cause a network collision problem that different clients use the same IP address.
Disclosure of Invention
The embodiment of the application provides an address conflict detection method, equipment and medium based on a DHCP server, which are used for solving the technical problem of network conflict caused by the fact that different clients use the same IP address when a plurality of DHCP servers in the prior art simultaneously provide the same assignable address for the clients.
In one aspect, an embodiment of the present application provides a method for detecting address collision based on a DHCP server, including:
starting a DHCP server, and receiving an address request initiated by a new client based on the DHCP server;
according to the address request, determining the MAC address corresponding to the new client and the requested IP address, and broadcasting ARP request information to a network;
receiving a plurality of MAC addresses returned by each client in a network, and comparing the plurality of MAC addresses with the MAC addresses corresponding to the new client;
and determining whether address conflict exists between the new client and each client in the network according to the comparison result, if so, reallocating the IP address for the new client, and sending an OFFER message to the new client.
In one implementation manner of the present application, if yes, the IP address is reassigned to the new client, and an OFFER message is sent to the new client, which specifically includes:
under the condition that the IP address requested by the new client collides with the address of the client existing in the network, a reapplication message of the IP address is sent to the new client, and the reapplied IP address of the new client is received based on the reapplication message;
and distributing the reapplied IP address to the new client, and sending a corresponding OFFER message to the new client so as to inform the new client that the reapplied IP address is distributed successfully.
In one implementation manner of the present application, the receiving a plurality of MAC addresses returned by each client in the network and comparing the plurality of MAC addresses with MAC addresses corresponding to the new client specifically includes:
under the condition that ARP responses of the clients are received, a plurality of MAC addresses returned in the network are received, and the MAC address corresponding to each client in the network is determined respectively;
and comparing the MAC address corresponding to the new client with the MAC address corresponding to each client in the network respectively, and determining whether the MAC addresses which are the same as the MAC address corresponding to the new client exist in the plurality of MAC addresses.
In one implementation manner of the present application, the broadcasting ARP request information to the network specifically includes:
PING the IP address requested by the new client in the network, and broadcasting corresponding ARP request information to the network;
and respectively returning the MAC addresses corresponding to the clients to all the clients in the request network through the ARP request information.
In one implementation manner of the present application, the determining, according to the comparison result, whether the address conflict exists between the new client and each client in the network specifically includes:
determining that address conflict exists between the new client and the existing client in the network under the condition that the comparison result is that the MAC address which is the same as the MAC address corresponding to the new client exists in the plurality of MAC addresses;
and under the condition that the comparison result is that the MAC addresses which are the same as the MAC addresses corresponding to the new client do not exist in the plurality of MAC addresses, determining that the new client does not have address conflict with the existing client in the network.
In one implementation of the present application, in a case where it is determined that the new client does not have an address conflict with an existing client in the network, the method further includes:
determining that the IP address requested by the new client has no address conflict, and sending an ACK message to the new client;
and distributing the requested IP address to the new client based on the ACK message.
In one implementation manner of the present application, after determining, according to the address request, the MAC address corresponding to the new client and the requested IP address, the method further includes:
binding the MAC address corresponding to the new client and the IP address requested by the new client, and storing the bound MAC address and IP address into a binding table.
In one implementation manner of the present application, after the DHCP server receives an address request initiated by a new client, the method further includes:
inquiring in a binding table pre-stored with the corresponding relation between the MAC address and the IP address according to the address request of the new client, and obtaining a corresponding inquiring result;
determining whether the new client has requested an IP address from other DHCP servers based on the query result of the binding table;
if yes, the address request of the new client is ignored, and if not, the address request of the new client is processed.
On the other hand, the embodiment of the application also provides an address conflict detection device based on a DHCP server, which comprises:
at least one processor;
and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a DHCP server-based address conflict detection method as described above.
In another aspect, embodiments of the present application also provide a non-volatile computer storage medium storing computer-executable instructions configured to:
the address conflict detection method based on the DHCP server.
The embodiment of the application provides an address conflict detection method, equipment and medium based on a DHCP server, which at least comprise the following beneficial effects:
the MAC addresses of all existing clients in the network can be received by receiving the address request initiated by the new client, determining the corresponding MAC address of the new client and the requested IP address, broadcasting ARP request information corresponding to the IP address requested by the new client to the network, comparing the corresponding MAC address of the new client with a plurality of MAC addresses of the existing clients acquired in the network, determining whether address conflict exists between the new client and the existing clients in the network, and when the address conflict exists, reassigning the IP address to the new client and notifying the corresponding new client, so that the address conflict between the clients can be detected and avoided in time, network attack behaviors are effectively prevented, and network security is ensured.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
fig. 1 is a flow chart of an address conflict detection method based on a DHCP server according to an embodiment of the present application;
fig. 2 is a schematic diagram of an internal structure of address conflict detection device based on a DHCP server according to an embodiment of the present application.
Detailed Description
For the purposes, technical solutions and advantages of the present application, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The embodiment of the application provides an address conflict detection method, equipment and medium based on a DHCP server, which can determine an MAC address corresponding to a new client and a requested IP address by receiving an address request initiated by the new client, and can receive the MAC addresses of all existing clients in a network by broadcasting ARP request information corresponding to the IP address requested by the new client to the network, so that the MAC addresses corresponding to the new client are compared with a plurality of MAC addresses of the existing clients acquired in the network, thereby determining whether address conflicts exist between the new client and the existing clients in the network, and when the address conflicts exist in time, the IP address is allocated to the new client again, and the corresponding new client is informed, so that the address conflicts of the clients can be detected and avoided in time, network attack behaviors are effectively prevented, and network security is ensured. The technical problem of network conflict caused by the fact that different clients use the same IP address when a plurality of DHCP servers in the prior art provide the same assignable address for the clients simultaneously is solved.
The following describes in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a flow chart of an address conflict detection method based on a DHCP server according to an embodiment of the present application. As shown in fig. 1, the address conflict detection method based on the DHCP server provided in the embodiment of the present application includes:
101. starting a DHCP server, and receiving an address request initiated by a new client based on the DHCP server.
In order to solve the problem that address conflict easily occurs to the IP address requested by the client under the condition that a plurality of DHCP servers serve the same IP address pool simultaneously in the prior art, the application firstly starts the service of the DHCP server, and when a new client is connected to a network and requests the IP address to the server through DHCP, the DHCP server can receive the address request initiated by the new client.
In one embodiment of the application, after receiving an address request initiated by a new client based on a DHCP server, the DHCP server queries a binding table pre-stored with a correspondence between a MAC address and an IP address according to the address request of the new client, and obtains a query result corresponding to the address request of the new client, and further based on the query result of the binding table, it can be determined whether the new client has requested an IP address to other DHCP servers, if so, the DHCP server ignores the address request of the new client, and if not, the DHCP server processes the address request of the new client. Therefore, different DHCP servers can be prevented from distributing different IP addresses to the same client, network conflict is caused, and network safety is guaranteed.
102. And determining the MAC address corresponding to the new client and the requested IP address according to the address request, and broadcasting ARP request information to the network.
The DHCP server can determine the MAC address corresponding to the new client and the IP address requested by the new client according to the address request initiated by the new client, thereby broadcasting ARP request information corresponding to the address request of the new client to the network.
Specifically, the DHCP server sends an IP address requested by a PING new client in the network, and broadcasts corresponding ARP request information to the network, so that all clients in the network are requested to return MAC addresses corresponding to the clients respectively through the ARP request information.
In one embodiment of the present application, after determining, according to an address request, a MAC address corresponding to a new client and a requested IP address, a DHCP server binds the MAC address corresponding to the new client and the IP address requested by the new client, and stores the bound MAC address and IP address in a binding table.
103. And receiving a plurality of MAC addresses returned by each client in the network, and comparing the plurality of MAC addresses with the MAC addresses corresponding to the new client.
And the DHCP server receives the corresponding MAC addresses returned by all the existing clients in the network based on the ARP request information, and then compares the MAC addresses corresponding to the new clients with the received MAC addresses corresponding to all the clients.
Specifically, the DHCP server receives a plurality of returned MAC addresses in the network and determines the MAC address corresponding to each client in the network when receiving the ARP reply of the client, and then compares the MAC address corresponding to the new client with the MAC address corresponding to each client in the network, thereby determining whether there is a MAC address identical to the MAC address corresponding to the new client in the plurality of MAC addresses.
104. And determining whether address conflict exists between the new client and each client in the network according to the comparison result, if so, reallocating the IP address for the new client, and sending an OFFER message to the new client.
The DHCP server can determine whether address conflict exists between the new client and the client existing in the network according to the comparison result between the MAC address corresponding to the new client and the plurality of MAC addresses. Under the condition that the address conflict exists between the new client and the existing client in the network, the DHCP server needs to allocate the corresponding IP address for the new client again and send the corresponding OFFER message to the new client.
Specifically, when the comparison result is that the MAC address which is the same as the MAC address corresponding to the new client exists in the plurality of MAC addresses, the DHCP server determines that the new client has address conflict with the existing client in the network, and when the comparison result is that the MAC address which is the same as the MAC address corresponding to the new client does not exist in the plurality of MAC addresses, the DHCP server can determine that the new client does not have address conflict with the existing client in the network.
In one embodiment of the present application, the DHCP server determines that an address conflict does not exist for an IP address requested by a new client and sends an ACK message to the new client when determining that the new client does not have an address conflict with an existing client in the network, and further assigns the requested IP address to the new client based on the ACK message.
The DHCP server sends a reapplication message of the IP address to the new client under the condition that the IP address requested by the new client conflicts with the address of the client existing in the network, receives the reapplied IP address of the new client based on the reapplication message, distributes the reapplied IP address to the new client, and sends a corresponding OFFER message to the new client, so that the new client is informed of successful distribution of the reapplied IP address through the sent OFFER message.
The foregoing is a method embodiment presented herein. Based on the same inventive concept, the embodiment of the application also provides address conflict detection equipment based on the DHCP server, and the structure of the equipment is shown in figure 2.
Fig. 2 is a schematic diagram of an internal structure of address conflict detection device based on a DHCP server according to an embodiment of the present application. As shown in fig. 2, the apparatus includes:
at least one processor;
and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to:
starting a DHCP server, and receiving an address request initiated by a new client based on the DHCP server;
according to the address request, determining the MAC address corresponding to the new client and the requested IP address, and broadcasting ARP request information to the network;
receiving a plurality of MAC addresses returned by each client in a network, and comparing the plurality of MAC addresses with the MAC addresses corresponding to the new clients;
and determining whether address conflict exists between the new client and each client in the network according to the comparison result, if so, reallocating the IP address for the new client, and sending an OFFER message to the new client.
The embodiments of the present application also provide a nonvolatile computer storage medium storing computer executable instructions configured to:
starting a DHCP server, and receiving an address request initiated by a new client based on the DHCP server;
according to the address request, determining the MAC address corresponding to the new client and the requested IP address, and broadcasting ARP request information to the network;
receiving a plurality of MAC addresses returned by each client in a network, and comparing the plurality of MAC addresses with the MAC addresses corresponding to the new clients;
and determining whether address conflict exists between the new client and each client in the network according to the comparison result, if so, reallocating the IP address for the new client, and sending an OFFER message to the new client.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable Gate Array, FPGA)) is an integrated circuit whose logic function is determined by the programming of the device by a user. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), lava, lola, myHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present specification.
It will be appreciated by those skilled in the art that the present description may be provided as a method, system, or computer program product. Accordingly, the present specification embodiments may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description embodiments may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present description is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for apparatus, devices, non-volatile computer storage medium embodiments, the description is relatively simple, as it is substantially similar to method embodiments, with reference to the section of the method embodiments being relevant.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The foregoing is merely one or more embodiments of the present description and is not intended to limit the present description. Various modifications and alterations to one or more embodiments of this description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, or the like, which is within the spirit and principles of one or more embodiments of the present description, is intended to be included within the scope of the claims of the present description.

Claims (10)

1. An address conflict detection method based on a DHCP server, which is characterized by comprising the following steps:
starting a DHCP server, and receiving an address request initiated by a new client based on the DHCP server;
according to the address request, determining the MAC address corresponding to the new client and the requested IP address, and broadcasting ARP request information to a network;
receiving a plurality of MAC addresses returned by each client in a network, and comparing the plurality of MAC addresses with the MAC addresses corresponding to the new client;
and determining whether address conflict exists between the new client and each client in the network according to the comparison result, if so, reallocating the IP address for the new client, and sending an OFFER message to the new client.
2. The method for detecting address collision based on the DHCP server according to claim 1, wherein if yes, reassigning an IP address to the new client and sending an OFFER message to the new client, specifically comprising:
under the condition that the IP address requested by the new client collides with the address of the client existing in the network, a reapplication message of the IP address is sent to the new client, and the reapplied IP address of the new client is received based on the reapplication message;
and distributing the reapplied IP address to the new client, and sending a corresponding OFFER message to the new client so as to inform the new client that the reapplied IP address is distributed successfully.
3. The method for detecting address collision based on DHCP server according to claim 1, wherein the receiving a plurality of MAC addresses returned by each client in the network and comparing the plurality of MAC addresses with the MAC address corresponding to the new client specifically includes:
under the condition that ARP responses of the clients are received, a plurality of MAC addresses returned in the network are received, and the MAC address corresponding to each client in the network is determined respectively;
and comparing the MAC address corresponding to the new client with the MAC address corresponding to each client in the network respectively, and determining whether the MAC addresses which are the same as the MAC address corresponding to the new client exist in the plurality of MAC addresses.
4. The address conflict detection method based on the DHCP server according to claim 1, wherein broadcasting ARP request information to a network specifically includes:
PING the IP address requested by the new client in the network, and broadcasting corresponding ARP request information to the network;
and respectively returning the MAC addresses corresponding to the clients to all the clients in the request network through the ARP request information.
5. The method for detecting address collision based on DHCP server according to claim 1, wherein said determining whether address collision exists between the new client and each of the clients in the network according to the comparison result specifically comprises:
determining that address conflict exists between the new client and the existing client in the network under the condition that the comparison result is that the MAC address which is the same as the MAC address corresponding to the new client exists in the plurality of MAC addresses;
and under the condition that the comparison result is that the MAC addresses which are the same as the MAC addresses corresponding to the new client do not exist in the plurality of MAC addresses, determining that the new client does not have address conflict with the existing client in the network.
6. The DHCP server-based address conflict detection method according to claim 5, wherein in the case where it is determined that there is no address conflict between the new client and an existing client in the network, the method further comprises:
determining that the IP address requested by the new client has no address conflict, and sending an ACK message to the new client;
and distributing the requested IP address to the new client based on the ACK message.
7. The method for detecting address collision based on DHCP server according to claim 1, wherein after determining the MAC address corresponding to the new client and the requested IP address according to the address request, the method further comprises:
binding the MAC address corresponding to the new client and the IP address requested by the new client, and storing the bound MAC address and IP address into a binding table.
8. The method for detecting address collision based on DHCP server according to claim 1, wherein after receiving an address request initiated by a new client, the method further comprises:
inquiring in a binding table pre-stored with the corresponding relation between the MAC address and the IP address according to the address request of the new client, and obtaining a corresponding inquiring result;
determining whether the new client has requested an IP address from other DHCP servers based on the query result of the binding table;
if yes, the address request of the new client is ignored, and if not, the address request of the new client is processed.
9. An address collision detection apparatus based on a DHCP server, the apparatus comprising:
at least one processor;
and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a DHCP server-based address conflict detection method according to any one of claims 1-8.
10. A non-transitory computer storage medium storing computer-executable instructions, the computer-executable instructions configured to:
a DHCP server-based address conflict detection method according to any one of claims 1-8.
CN202310745501.1A 2023-06-21 2023-06-21 Address conflict detection method, equipment and medium based on DHCP server Pending CN117376317A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310745501.1A CN117376317A (en) 2023-06-21 2023-06-21 Address conflict detection method, equipment and medium based on DHCP server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310745501.1A CN117376317A (en) 2023-06-21 2023-06-21 Address conflict detection method, equipment and medium based on DHCP server

Publications (1)

Publication Number Publication Date
CN117376317A true CN117376317A (en) 2024-01-09

Family

ID=89401053

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310745501.1A Pending CN117376317A (en) 2023-06-21 2023-06-21 Address conflict detection method, equipment and medium based on DHCP server

Country Status (1)

Country Link
CN (1) CN117376317A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118200290A (en) * 2024-03-21 2024-06-14 北京泰岳天成科技有限公司 Method and device for detecting network address conflict

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118200290A (en) * 2024-03-21 2024-06-14 北京泰岳天成科技有限公司 Method and device for detecting network address conflict

Similar Documents

Publication Publication Date Title
US11388274B2 (en) Method for implementing high availability of bare metal node based on OpenStack and electronic device using the same
CN115002143B (en) Node election method and device, storage medium and electronic equipment
CN112749023B (en) Information processing method, device, equipment and system
CN106802939B (en) Method and system for solving data conflict
US20170052979A1 (en) Input/Output (IO) Request Processing Method and File Server
US10599436B2 (en) Data processing method and apparatus, and system
CN107528885B (en) Service request processing method and device
CN117376317A (en) Address conflict detection method, equipment and medium based on DHCP server
US20240107647A1 (en) Control method, control device and lighting system
CN116737345A (en) Distributed task processing system and method, device, storage medium and equipment
CN106940712B (en) Sequence generation method and device
CN114745133B (en) Method and device for identifying equipment uniqueness
CN113794764A (en) Request processing method and medium for server cluster and electronic device
CN108989072B (en) Method and device for deploying, managing and calling assembly
CN114513492A (en) Method and device for configuring IP address
CN111400032B (en) Resource allocation method and device
CN111355672A (en) Message forwarding method and device
CN109558249B (en) Control method and device for concurrent operation
CN112600765B (en) Method and device for scheduling configuration resources
CN110891033A (en) Network resource processing method, device, gateway, controller and storage medium
CN111090520B (en) User allocation method and device for exclusive resources, electronic equipment and storage medium
CN115599845B (en) Service execution method, device, storage medium and electronic equipment
CN108255820B (en) Method and device for data storage in distributed system and electronic equipment
CN116206300B (en) Multi-manufacturer identification camera integration compatible method, equipment and storage medium
CN114615234A (en) Address allocation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination