Multi-address allocation method, system and equipment based on DHCP (Dynamic Host Configuration Protocol) and storage medium
By introducing an address pool linkage unit in the DHCP server and establishing a strong association between address pools in different network segments, the problem that the traditional DHCP protocol cannot allocate multiple IP addresses in different network segments to the same client is solved, and the synchronous management of multiple IP addresses of the client and network redundancy are achieved, thereby improving the efficiency of network resource utilization.
Patent Information
- Application Number
- CN202510810718.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-09-16
AI Technical Summary
The traditional DHCP protocol cannot simultaneously allocate and manage multiple IP addresses in different network segments for the same client, resulting in the client being able to use only one operator's line resources and unable to achieve network redundancy and load balancing.
An address pool linkage unit is introduced into the DHCP server to establish a strong association between address pools in different network segments. The address pool linkage unit selects available IP addresses from multiple address pools and manages them synchronously, ensuring the consistency of the address lifecycle and supporting clients to obtain IP addresses from multiple different network segments at the same time.
This enables the same client to use line resources from multiple operators simultaneously, improving the diversity and redundancy of network connections, avoiding network interruptions, and reducing technical implementation costs.
Smart Images

Figure CN120658710A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of Internet protocols, and in particular to a multi-address allocation method, system, device and storage medium based on the DHCP protocol. Background Art
[0002] As a basic Internet service, DHCP provides terminal devices with the ability to automatically assign IP addresses, enabling network devices to interconnect. To facilitate network management and communication, the DHCP server will assign the client an IP address on the same network segment as its own. Typically, the client will only request a single address. By configuring technologies such as the DHCP relay agent in the network, the DHCP server can also assign IP addresses to clients on different network segments. In this case, the DHCP relay agent will forward DHCP requests from clients on different network segments to the DHCP server. The server then assigns IP addresses on different network segments to the clients based on the corresponding configuration to meet the special needs of complex network environments.
[0003] The client itself supports configuring multiple IP addresses on the same network card, which can be in the same network segment or different network segments. Combined with the corresponding firewall or routing rules, the client can flexibly switch and communicate between different networks.
[0004] When DHCP assigns an IP address to a client, it can only assign an address within the same network segment as the client or relay server. When the lease of an IP address assigned to a client expires, it can only be renewed within the same network segment. Although clients can configure multiple IP addresses on the same network segment using the same network card, the DHCP server's address allocation mechanism is limited and does not effectively support clients having multiple IP addresses on different network segments simultaneously. Because clients typically only request a single address, the server will only assign one, even if the address is within the same network segment.
[0005] Many schools and businesses have outbound links from multiple carriers. If clients can only be assigned IP addresses from the same carrier within a single network segment, they can only use the line resources of one carrier, resulting in insufficient utilization of other lines. A single carrier network failure can cause network outages, making line redundancy impossible even if other lines are functioning properly. If a carrier link experiences congestion, network load cannot be distributed across multiple carrier network links. Summary of the Invention
[0006] To this end, embodiments of the present invention provide a multi-address allocation method, system, device, and storage medium based on the DHCP protocol to solve the technical problem that the traditional DHCP protocol cannot synchronously allocate and manage multiple IP addresses in different network segments for the same client.
[0007] In order to achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0008] According to a first aspect of an embodiment of the present invention, a method for allocating multiple addresses based on the DHCP protocol is provided, the method being applied to a DHCP server and specifically comprising:
[0009] Establish a strong association between at least two address pools in different network segments and configure an address pool linkage unit.
[0010] receiving an IP address application request from a client, and detecting whether a target address pool is associated with the address pool linkage unit;
[0011] If so, the address pool linkage unit selects available IP addresses from all associated address pools and sends the available IP addresses to the client through the DHCP server.
[0012] The client detects whether there are any conflicting IP addresses among the multiple IP addresses received. The client sends a DECLINE message to the DHCP server for each conflicting address. The DHCP server marks the conflicting address as unavailable and receives the request from the client again. It responds to the client with an Advertise message carrying multiple IP addresses.
[0013] Furthermore, a strong association relationship is established between at least two address pools of different network segments, and an address pool linkage unit is configured, including:
[0014] The life cycle of the strong association relationship is kept in strong synchronization, including address validation, update and release.
[0015] Furthermore, upon receiving an IP address application request from a client, the following steps are further included:
[0016] If the client requests an IP address through the relay server, the relay server selects a suitable address pool based on the client address carried;
[0017] If the address pool has been associated with the address pool linkage unit, the allocation policy is the same.
[0018] Furthermore, when the client sends a solicit request, the server replies with multiple IP addresses in the IA_NA field of the advertise message.
[0019] Furthermore, when the client sends a request / rebind / renew request, the server replies with multiple IP addresses in the IA_NA field of the reply message.
[0020] Furthermore, the method further comprises:
[0021] Detect whether the address pool associated with the address pool linkage unit has changed. If so, the DHCP server sends a reconfigure message to the client to notify it. When the client reapplies for an address, it selects an address according to the latest change to respond.
[0022] Furthermore, when the client sends a RELEASE message to the server, the server simultaneously releases all addresses associated with the address pool linkage unit record.
[0023] According to a second aspect of an embodiment of the present invention, a multi-address allocation system based on the DHCP protocol is provided, the system comprising:
[0024] An address pool linkage unit configuration module is used to establish a strong association relationship between at least two address pools of different network segments and configure the address pool linkage unit;
[0025] An address allocation module, configured to receive an IP address application request from a client and detect whether a target address pool is associated with the address pool linkage unit; if so, the address pool linkage unit selects available IP addresses from all associated address pools and sends the available IP addresses to the client through the DHCP server;
[0026] The conflicting address detection module is used to detect whether there are conflicting addresses among the multiple IP addresses received by the client. The client sends a DECLINE message to the DHCP server for each conflicting address. The DHCP server marks the conflicting address as unavailable and re-receives the request request from the client, and responds to the client through an Advertise message carrying multiple IP addresses.
[0027] According to a third aspect of an embodiment of the present invention, a multi-address allocation device based on the DHCP protocol is provided, the device comprising: a processor and a memory;
[0028] The memory is used to store one or more program instructions;
[0029] The processor is configured to run one or more program instructions to execute the steps of the multi-address allocation method based on the DHCP protocol as described in any one of the above items.
[0030] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of a multi-address allocation method based on the DHCP protocol as described in any one of the above items are implemented.
[0031] The embodiments of the present invention have the following advantages:
[0032] The embodiment of the present invention introduces an address pool linkage unit to establish an effective association between the IPv6 address pools of multiple different network segments allocated by DHCP, ensure that the addresses allocated in the same batch remain synchronized in their life cycle, and reasonably modify the original DHCP message response mechanism so that it can accurately respond to various requests from the client in combination with the strategy of the address pool linkage unit. The DHCP server in the embodiment of the present invention can simultaneously allocate multiple IP addresses of different network segments to the client based on the policy configuration of the address pool linkage unit, thereby improving the diversity of network connections. There is no need to modify the client, and the existing protocol can be used to complete the allocation of multiple IP addresses to the client by DHCP, thereby reducing the cost of technical implementation and facilitating promotion and application. The same client can obtain IP addresses of different operator line segments to achieve multi-export redundancy. When the IP address lease expires, the IP addresses of different operator line segments can be renewed to achieve automatic maintenance of the client's IP address. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other implementation drawings based on the provided drawings without inventive effort.
[0034] The structures, proportions, sizes, etc. illustrated in this specification are intended solely to complement the contents disclosed herein and to facilitate understanding and reading by persons skilled in the art. They are not intended to limit the conditions under which the present invention may be implemented and therefore have no substantive technical significance. Any structural modifications, changes in proportions, or adjustments in sizes, without affecting the efficacy and objectives of the present invention, shall remain within the scope of the technical contents disclosed herein.
[0035] Figure 1 A schematic diagram of the logical structure of a multi-address allocation system based on the DHCP protocol provided in an embodiment of the present invention;
[0036] Figure 2 A schematic diagram of a flow chart of a multi-address allocation method based on the DHCP protocol provided in an embodiment of the present invention;
[0037] Figure 3 The following is an interactive diagram of a multi-address allocation method based on the DHCP protocol provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The following describes the implementation of the present invention using specific embodiments. Those skilled in the art will readily understand the other advantages and benefits of the present invention from the disclosure herein. Obviously, the embodiments described are only a portion of the present invention, not all of it. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are intended to fall within the scope of protection of the present invention.
[0039] In order to solve the technical problem that the traditional DHCP protocol cannot simultaneously allocate and manage multiple IP addresses in different network segments for the same client.
[0040] refer to Figure 1 The embodiment of the present invention discloses a multi-address allocation system based on the DHCP protocol, which includes: an address pool linkage unit configuration module 1; an address allocation module 2; and a conflicting address detection module 3.
[0041] Corresponding to the above-disclosed multi-address allocation system based on the DHCP protocol, an embodiment of the present invention further discloses a multi-address allocation method based on the DHCP protocol. The following describes in detail the multi-address allocation method based on the DHCP protocol disclosed in an embodiment of the present invention in conjunction with the above-described multi-address allocation system based on the DHCP protocol.
[0042] In this embodiment of the present invention, a newly designed address pool linkage module is introduced to link address pools of multiple different network segments. When allocating addresses from a particular address pool, it can be linked to other associated address pools. Furthermore, the address allocation mechanism of the existing DHCP server needs to be modified to support the allocation of multiple addresses based on the configuration of the address pool linkage module, regardless of whether the client is applying for a single or multiple IP addresses.
[0043] refer to Figures 2 to 3 , the present invention discloses a multi-address allocation method based on the DHCP protocol, which is applied to a DHCP server and specifically includes: establishing a strong association relationship between at least two address pools of different network segments and configuring an address pool linkage unit; receiving an IP address application request from a client, detecting whether the target address pool is associated with the address pool linkage unit; if so, the address pool linkage unit selects available IP addresses from all associated address pools and sends each available IP address to the client through the DHCP server; detecting whether there are conflicting addresses among the multiple IP addresses received by the client, the client sending a DECLINE message to the DHCP server for each conflicting address, the DHCP marking the conflicting address as unavailable, re-receiving the request request from the client, and responding to the client through an Advertise message carrying multiple IP addresses.
[0044] If a conflicting IP address exists among the multiple IP addresses received by the client, the normally assigned non-conflicting address can be used normally. The client sends a DECLINE message to the server for each conflicting address. The server marks the conflicting address as unusable and receives the request from the client again. The DHCP server responds to the client with an Advertise message carrying multiple IP addresses (this behavior varies slightly depending on the client type).
[0045] The DHCP server integrates an address pool linkage module, which forcibly associates multiple address pools in different network segments. The associated address pools allocate multiple IP addresses to clients, maintaining a strong synchronization of their lifecycles, including address validation, renewal, and release.
[0046] Furthermore, a strong association relationship is established between at least two address pools of different network segments, and an address pool linkage unit is configured, including: maintaining strong synchronization of the life cycle of the strong association relationship, including address validation, update, and release.
[0047] When a client requests an IP address, if the address pool containing the requested address is associated with the address pool linkage module, the module selects a suitable IP address from all other associated address pools and passes it to the server, which then responds with multiple IP addresses to the client. If the client requests an IP address through a relay server, the relay server selects a suitable address pool based on the client address. If the address pool is associated with the address pool linkage module, the multiple IP address allocation strategy is the same as for the direct application method described above.
[0048] Furthermore, receiving an IP address application request from a client also includes: if the client requests an IP address through a relay server, the relay server selects a suitable address pool according to the carried client address; if the address pool has been associated with the address pool linkage unit, the allocation strategy is the same.
[0049] Furthermore, when the client sends a solicit request, the server replies with multiple IP addresses in the IA_NA field of the advertise message.
[0050] Furthermore, when the client sends a request / rebind / renew request, the server replies with multiple IP addresses in the IA_NA field of the reply message.
[0051] Furthermore, the method further includes: detecting whether the address pool associated with the address pool linkage unit has changed; if so, the DHCP server sends a reconfigure message to the client for notification; when the client reapplies for an address, the address is selected according to the latest change for response.
[0052] Furthermore, when the client sends a RELEASE message to the server, the server simultaneously releases all addresses associated with the address pool linkage unit record.
[0053] In addition, an embodiment of the present invention further provides a multi-address allocation device based on the DHCP protocol, the device comprising: a processor and a memory; the memory is used to store one or more program instructions; the processor is used to run the one or more program instructions to execute the steps of a multi-address allocation method based on the DHCP protocol as described in any one of the above items.
[0054] In addition, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the multi-address allocation method based on the DHCP protocol as described in any one of the above items are implemented.
[0055] In the embodiments of the present invention, the processor may be an integrated circuit chip having signal processing capabilities. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0056] The methods, steps, and logic diagrams disclosed in the embodiments of the present invention can be implemented or executed. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules within the decoding processor. The software modules can be located in a storage medium well-established in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. The processor reads the information from the storage medium and, in conjunction with its hardware, completes the steps of the aforementioned methods.
[0057] The storage medium may be a memory and may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.
[0058] Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
[0059] Volatile memory may be random access memory (RAM), which is used as an external cache memory. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM).
[0060] The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.
[0061] Those skilled in the art will appreciate that in one or more of the above examples, the functions described herein can be implemented using a combination of hardware and software. When software is used, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media includes any medium that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0062] Although the present invention has been described in detail above using general descriptions and specific embodiments, it will be apparent to those skilled in the art that modifications and improvements may be made thereto. Therefore, such modifications and improvements, without departing from the spirit of the present invention, are intended to be within the scope of protection claimed herein.
Claims
1. A multi-address allocation method based on DHCP protocol, characterized in that: The method is applied to a DHCP server and specifically includes: Establish a strong association between at least two address pools in different network segments and configure an address pool linkage unit. receiving an IP address application request from a client, and detecting whether a target address pool is associated with the address pool linkage unit; If so, the address pool linkage unit selects available IP addresses from all associated address pools and allocates each available IP address to the client through the DHCP server; The client detects whether there are any conflicting IP addresses among the multiple IP addresses received. The client sends a DECLINE message to the DHCP server for each conflicting address. The DHCP server marks the conflicting address as unavailable, receives the request from the client again, and responds to the client with an Advertise message carrying multiple IP addresses.
2. The multi-address allocation method based on the DHCP protocol according to claim 1, wherein: Establish a strong association between at least two address pools in different network segments and configure the address pool linkage unit, including: The life cycle of the strong association relationship is kept in strong synchronization, including address validation, update and release.
3. The multi-address allocation method based on DHCP protocol according to claim 1, characterized in that: Receive an IP address request from a client, including: If the client requests an IP address through the relay server, the relay server selects an appropriate address pool based on the client address carried; If the address pool has been associated with the address pool linkage unit, the allocation policy is the same.
4. The multi-address allocation method based on DHCP protocol according to claim 1, wherein: When the client sends a solicit request, the server replies with multiple IP addresses in the IA_NA field of the advertise message.
5. The multi-address allocation method based on DHCP protocol according to claim 4, characterized in that: When the client sends a request / rebind / renew request, the server replies with multiple IP addresses in the IA_NA field of the reply message.
6. The multi-address allocation method based on DHCP protocol according to claim 1, characterized in that: The method further comprises: Detect whether the address pool associated with the address pool linkage unit has changed. If so, the DHCP server sends a reconfigure message to the client to notify it. When the client reapplies for an address, it selects an address according to the latest change to respond.
7. The multi-address allocation method based on DHCP protocol according to claim 1, characterized in that: When the client sends a RELEASE message to the server, the server simultaneously releases all addresses associated with the address pool linkage unit record.
8. A multi-address allocation system based on DHCP protocol, characterized in that: The system comprises: An address pool linkage unit configuration module is used to establish a strong association relationship between at least two address pools of different network segments and configure the address pool linkage unit; An address allocation module, configured to receive an IP address application request from a client and detect whether a target address pool is associated with the address pool linkage unit; if so, the address pool linkage unit selects available IP addresses from all associated address pools and sends the available IP addresses to the client through the DHCP server; The conflicting address detection module is used to detect whether there are conflicting addresses among the multiple IP addresses received by the client. The client sends a DECLINE message to the DHCP server for each conflicting address. The DHCP server marks the conflicting address as unavailable and re-receives the request request from the client, and responds to the client through an Advertise message carrying multiple IP addresses.
9. A multi-address allocation device based on the DHCP protocol, characterized in that: The device includes: a processor and a memory; The memory is used to store one or more program instructions; The processor is configured to run one or more program instructions to execute the steps of the multi-address allocation method based on the DHCP protocol as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the multi-address allocation method based on the DHCP protocol as claimed in any one of claims 1 to 7.