CN107547678B - Address allocation method and device - Google Patents

Address allocation method and device Download PDF

Info

Publication number
CN107547678B
CN107547678B CN201710474303.0A CN201710474303A CN107547678B CN 107547678 B CN107547678 B CN 107547678B CN 201710474303 A CN201710474303 A CN 201710474303A CN 107547678 B CN107547678 B CN 107547678B
Authority
CN
China
Prior art keywords
private network
aggregation system
network address
client
message
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.)
Active
Application number
CN201710474303.0A
Other languages
Chinese (zh)
Other versions
CN107547678A (en
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.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201710474303.0A priority Critical patent/CN107547678B/en
Publication of CN107547678A publication Critical patent/CN107547678A/en
Application granted granted Critical
Publication of CN107547678B publication Critical patent/CN107547678B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the application provides an address allocation method and an address allocation device, which are applied to first equipment in an aggregation system, wherein the equipment in the aggregation system enables a DHCP function and is configured with an address pool, and the method comprises the following steps: receiving a Request message sent by a first client; according to the Request message, selecting a first private network address from an address pool configured by first equipment, and distributing the first private network address to a first client; sending a first Decline message to other equipment in the aggregation system; the first Decline message comprises a first private network address and an identifier of the first device; in this way, when the other device determines that the first device belongs to the aggregation system according to the identifier of the first device, the other device sets the first private network address contained in the locally configured address pool as unavailable. By applying the embodiment of the application, the waste of resources is reduced.

Description

Address allocation method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to an address allocation method and apparatus.
Background
In order to improve the reliability of the link, the ports of a plurality of devices are often aggregated together to form an aggregation system.
When address allocation is performed based on the aggregation system, that is, when the aggregation system enables a DHCP (Dynamic Host Configuration Protocol) function, request messages for requesting addresses sent by each client are load-shared to different devices of the aggregation system, but after receiving the address request messages, the different devices forward the address request messages to the same device, and the device allocates private network addresses to the clients in a unified manner, so as to avoid the situation that the private network addresses are repeatedly allocated and the private network addresses are allocated in a disordered manner.
Based on the above situation, when the aggregation system performs address allocation, only one device in the aggregation system is responsible for allocating a private network address, and other devices in the aggregation system cannot allocate the private network address, which will cause waste of resources.
Disclosure of Invention
An object of the embodiments of the present invention is to provide an address allocation method and apparatus, so as to reduce waste of resources. The specific technical scheme is as follows:
in one aspect, an embodiment of the present application discloses a dynamic address processing method, which is applied to a first device in an aggregation system, where all devices in the aggregation system have enabled a DHCP function and are configured with an address pool, and the method includes:
receiving a Request message sent by a first client;
according to the Request message, selecting a first private network address from an address pool configured by the first equipment, and distributing the first private network address to the first client;
sending a first Decline message to other equipment in the aggregation system; the first Decline message includes a first private network address and an identifier of the first device, so that when the other devices determine that the first device belongs to the aggregation system according to the identifier of the first device, the other devices set the first private network address included in a locally configured address pool as unavailable.
In a second aspect, an embodiment of the present application discloses an address allocation apparatus, which is applied to a first device in an aggregation system, where all devices in the aggregation system have enabled a DHCP function and are configured with an address pool, and the apparatus includes:
the receiving unit is used for receiving a Request message sent by a first client;
the allocation unit is used for selecting a first private network address from an address pool configured by the first equipment according to the Request message and allocating the first private network address to the first client;
a sending unit, configured to send a first Decline message to other devices in the aggregation system; the first Decline message includes a first private network address and an identifier of the first device, so that when the other devices determine that the first device belongs to the aggregation system according to the identifier of the first device, the other devices set the first private network address included in a locally configured address pool as unavailable.
In one aspect, an embodiment of the present application discloses a gateway device, including a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: the steps of the address assignment method described above are implemented.
In a fourth aspect, embodiments of the present application disclose a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: the steps of the address assignment method described above are implemented.
In the embodiment of the application, all devices in the aggregation system enable a DHCP function and are configured with an address pool, when a first device in the aggregation system receives a Request message sent by a first client, a first private network address is selected from the address pool configured by the first device according to the Request message, the first private network address is distributed to the first client, and in addition, a first Decline message is sent to other devices in the aggregation system, wherein the first Decline message comprises the first private network address and an identifier of a device for distributing the first private network address to the first client, namely the identifier of the first device; therefore, after receiving the first Decline message, the other devices determine that the first device belongs to the aggregation system according to the identifier of the first device included in the first Decline message, that is, determine that the device which allocates the first private network address to the first client belongs to the aggregation system, and then set the first private network address configured locally as unavailable.
Therefore, in the embodiment of the application, the private network addresses allocated to the client are set to be unavailable among the devices in the aggregation system through the Decline message, so that the situations of repeated allocation of the private network addresses and disordered allocation of the private network addresses are avoided, and the devices in the aggregation system can allocate the private network addresses to the client at the same time, so that the waste of resources is reduced. Of course, it is not necessary for any product or method of the present application to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a networking;
fig. 2 is a schematic flowchart of an address allocation method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of an address release method according to an embodiment of the present application;
fig. 4 is a schematic flow chart of a method for adding equipment to a polymerization system according to an embodiment of the present disclosure;
fig. 5 is a flowchart illustrating an address renewal method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an address allocation apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a gateway device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
When the DHCP function is implemented in the aggregation system of cross-device aggregation, a message sent by a client is shared among multiple devices, and one device cannot know the private network address allocated to the client by another device, which may cause resource waste if only one device in the designated aggregation system implements the DHCP function. The embodiment of the application provides an address allocation method and device for reducing resource waste.
The aggregation system includes at least two devices, the number of the specific devices may be deployed according to actual requirements, and taking fig. 1 as an example, two devices 100 and 101 are deployed in the aggregation system, where the devices 100 and 101 may be gateway devices or other devices capable of implementing a DHCP function.
Referring to fig. 2, fig. 2 is a schematic flowchart of an address allocation method provided in this embodiment, which is applied to any device in an aggregation system, and for convenience of description, the following description takes a first device as an example.
The devices in the aggregation system are enabled with DHCP function and configured with an address pool, and the address pool comprises a plurality of private network addresses. It should be noted that the address pools configured on each device in the aggregation system may be the same or different, and this is not limited in this embodiment of the present application.
In this case, the address assignment method applied to the first device includes:
s201: receiving a Request message sent by a first client;
here, the Request message is a message requesting a private network address when the first client is online.
S202: according to the Request message, selecting a first private network address from an address pool configured by first equipment, and distributing the first private network address to a first client;
in an embodiment of the application, if an address pool is not configured in the first device, in order to ensure that the first client can obtain a private network address, a Request message sent by the first client is forwarded to other devices in the aggregation system, and the private network address is allocated to the first client by the other devices;
if the first device is configured with an address pool, a private network address, such as a first private network address, is selected from the address pool configured locally in the first device according to the Request message, and the first private network address is allocated to the first client, at this time, the first client is on line on the first device, and the first device is an on-line device of the first client.
S203: and sending the first Decline message to other equipment in the aggregation system.
The first Decline message includes a first private network address, and when other devices receive the first Decline message, the first private network address carried by the first Decline message is processed, for example, set as unavailable, on the basis of the first private network address in the first Decline message.
In addition, as the equipment in the network may have attacks, the private network addresses in the aggregation system are all occupied, and the private network addresses cannot be allocated to the clients which really need to be on-line, so that the security is low. Then, in order to improve the security of the aggregation system, the first Decline message further includes an identifier of a first device that allocates a first private network address to the first client; in addition, when forming the aggregation system, a server group enabling the DHCP function may be recorded in each device of the aggregation system, and the device enabling the DHCP function in the aggregation system may join in this server group.
In this case, when the other device determines, according to the identifier of the first device included in the first Decline message, that the first device belongs to the aggregation system from the recorded server group, that is, when the first device is determined to be in the server group, it is determined that the device that allocates the first private network address to the first client belongs to the aggregation system, and the other device sets the first private network address included in the locally configured address pool as unavailable;
if the other devices determine that the first device does not belong to the aggregation system, the first Decline message is not processed, that is, the first private network address contained in the address pool configured locally by the other devices is still available.
It is worth mentioning that the first device sends the first Decline message to other devices in the aggregation system under the condition that the first private network address is determined to be allocated to the first client; and if the first equipment fails to distribute the first private network address to the first client, not sending the first Decline message to other equipment in the aggregation system.
In addition, in an embodiment of the present application, the Decline message may include a server address field, where an identifier of a device that allocates a private network address to the client is placed in the server address field, such as the identifier of the first device is placed in the server address field of the first Decline message.
In an embodiment of the application, address pools configured on each device in an aggregation system may be different, in this case, other devices receive a first delete message, and when it is determined that the first device belongs to the aggregation system according to an identifier of the first device, first detect whether a first private network address is included in the locally configured address pool; if yes, setting the first private network address configured locally as unavailable; if not, no processing is performed.
It should be noted that, if the first private network address locally configured by the other device is already allocated, the other device does not perform processing after receiving the first delete message. This situation can be avoided by the client sending an ARP (Address Resolution Protocol) message, that is, the client broadcasts an ARP message carrying a private network Address to other clients, determines which physical Address the client is using, if a certain client is determined, informs the first device to re-allocate, and if no client is determined to use, uses the private network Address.
Referring to fig. 3, fig. 3 is a schematic flowchart of an address release method provided in this embodiment, and the method is applied to a first device in an aggregation system, and the method includes:
s301: receiving a Release message sent by a first client;
after the first Decline message is sent to other devices in the aggregation system, it can also be understood that the first client is online on the first device after the first device allocates the first private network address to the first client; in this case, when the first client goes offline, that is, when the first client no longer needs to use the first private network address, a Release message is sent to the online device (that is, the first device) of the first client, so that the first device recovers the first private network address, and subsequent allocation of the first private network address is ensured. Here, the Release message may carry the first private network address.
S302: according to the Release message, a first private network address distributed for the first client side is recovered from an address pool configured for the first equipment;
after receiving the Release message, the first device sets a first private network address in an address pool configured by the first device as available and recovers the first private network address distributed to the first client.
S303: forwarding the Release message to other equipment in the aggregation system;
the Release message contains a first private network address, and when other equipment receives the Release message, the private network address in the local address pool is processed, for example, set to be available, based on the first private network address carried by the Release message.
In addition, in order to improve the security of the aggregation system, the Release message further includes an identifier of the first device that recovers the first private network address. Specifically, the processing manner for the identifier of the first device is similar to that of the identifier of the first device carried in the first Decline message, and is not described herein again.
Referring to fig. 4, fig. 4 is a schematic flowchart of a method for adding a device to an aggregation system, where the method is applied to a first device, and the method includes:
s401: receiving an Inform message sent by second equipment added into the aggregation system;
the Inform message is used for informing the second device of joining the aggregation system.
In an embodiment of the present application, the Inform message may include an identifier of the second device, so that the first device determines the identifier of the device added to the aggregation system, records the second device in a server group enabling a DHCP function, and further facilitates the first device to process the received Decline message.
In an embodiment of the present application, the Inform message may include a client address field, where an identifier of a device that is recycled to join the aggregation system is placed in the client address field, such as placing an identifier of a second device in the client address field of the above-mentioned Inform message.
S402: sending a second Decline message to the second equipment according to the Inform message;
the second Decline message includes a private network address (such as the first private network address) that the first device has been allocated to the client, and an identifier of the first device. The specific processing manner is similar to that of the first Decline packet, and is not described herein again.
Referring to fig. 5, fig. 5 is a schematic flowchart of an address renewal method provided in an embodiment of the present application, applied to a first device, the method including:
s501: receiving a Renew message sent by a first client;
the Renew message includes a first private network address used by the first client, a duration, and an identifier of an online device of the first client, that is, an identifier of the first device.
In practical application, after the device allocates the private network address to the client, a use duration (such as an effective lifetime) is set for the allocated private network address, when the allocated private network address reaches the use duration, the device will recycle the allocated private network address, and the client can not use the allocated private network address any more. In this case, if the client continues to use the allocated private network address, the Renew message is sent to the device to prolong the use duration.
Optionally, if the first client needs to extend the time length for using the first private network address, the Renew message may be sent to the first device when the initial preset time length reaches half of the time length, so as to ensure that the device can extend the time length for using the private network address in time.
S502: according to the Renew message, prolonging the duration of the first client using the first private network address by a duration;
the first equipment receives the Renew message, acquires the duration from the Renew message, and prolongs the duration of the first client using the first private network address by the duration.
S503: and forwarding the Renew message to other equipment in the aggregation system.
In this case, when the other device determines that the first device belongs to the aggregation system according to the identifier of the first device, that is, when the other device determines that the device continuing to offer the private network address belongs to the aggregation system, the other device keeps the first private network address contained in the locally configured address pool as unavailable, and the unavailable duration of the first private network address is prolonged by the duration of the first private network address;
if the other equipment determines that the first equipment does not belong to the aggregation system according to the identifier of the first equipment included in the Renew message, the Renew message is not processed, and the time length of the unavailable first private network address is not prolonged.
The embodiments of the present application will be described in detail with reference to the networking shown in fig. 1. For example, in fig. 1, the address of the device 100 in the aggregation system is IP 1, and the address of the device 101 is IP 2; in addition, the device 100 and the device 101 both enable a DHCP function and are configured with an address pool;
a1, when the device 101 joins the aggregation system, the device 101 fills the Inform message with the IP 2 as the client address, and sends the Inform message to the device 100;
a2, after receiving the Inform message, the device 100 determines that the client address carried in the Inform message is IP 2, the device 101 corresponding to the IP 2 enables the DHCP function, and adds the device 101 into a server group, wherein the server group also comprises the device 100;
in addition, a Decline message 1 is sent to the device 101, where the Decline message 1 includes: the private network address (e.g., IP 01, IP 02, IP 03) that the device 100 has assigned to the client, and the identification of the device that assigned the private network address (here, IP 1);
a3, after receiving a Decline message 1, the device 101 acquires the identifier of the device for distributing the private network address from the Decline message 1 as IP 1, the IP 1 is the address of the device 100, the device 100 belongs to a server group, and then the device 100 is determined to belong to an aggregation system, and when the device 101 detects that the IP 01, the IP 02 and the IP03 are configured locally, the locally configured IP 01, the IP 02 and the IP03 are all set as unavailable;
in this way, a redistribution of the device 101 to the clients IP 01, IP 02, IP03 is effectively avoided,
b1, when the client 103 is on line, the client 103 sends a Request message to the device 100 through the switch 102;
in an embodiment of the present application, the client 103 may also send a Request message to the device 101 through the switch 102, and the sending of the Request message to the device 100 is only described here.
B2, after receiving the Request message, the device 100 selects a private network address, such as IP 04, from the locally configured address pool according to the Request message, allocates the IP 04 to the client 103, and sets the use duration of the IP 4, such as 10 days, at which time the client 103 is on line on the device 100; in addition, the device 100 sends a Decline message 2 to the device 101, where the Decline message 2 includes: the private network address IP 04 that the device 100 has assigned to the client 103, and the identity of the device to which IP 04 is assigned (here IP 1);
b3, after receiving the Decline message 2, the device 101 obtains the identifier of the device for allocating the IP 04 from the Decline message 2, where the IP 1 is the address of the device 100, the device 100 belongs to the server group, and further determines that the device 100 belongs to the aggregation system, and when detecting that the device 101 is locally configured with the IP 04, the device 101 sets the locally configured IP 04 as unavailable;
at this time, the device 100 and the device 101 do not allocate the private network address of IP 04 to other clients any more, and the private network address setting allocated to the client is set as unavailable by modifying the private network address setting through the Decline message, so that the device 100 and the device 101 can allocate the private network address to the client at the same time, and the waste of resources is reduced.
C1, when the client 103 needs to continue the service time of the IP 04, the client 103 sends a Renew message to the online device (i.e. the device 100) of the client 103 through the switch 102; the Renew message includes IP 04, an offer duration (e.g., 5 days), and an identifier (here, IP 1) of an online device of the client 103;
c2, after receiving the Renew message, the device 100 prolongs the service life of the IP 04 by 5 days according to the Renew message, that is, the service life of the IP 04 is changed to 15 days; in addition, the device 100 sends a Renew message to the device 101;
c3, after receiving the Renew message, the device 101 detects that the identifier of the online device of the client 103 included in the Renew message is IP 1, the IP 1 is the address of the device 100, the device 100 belongs to the server group, and further determines that the device 100 belongs to the aggregation system, and when detecting that the device 101 is locally configured with the IP 04, the device 101 keeps the locally configured IP 04 as unavailable;
d1, when the client 103 goes offline, the client 103 sends a Release message to the online device (i.e. the device 100) of the client 103 through the switch 300;
d2, after receiving the Release message, the device 100 sets the locally configured IP 04 as available according to the Release message; in addition, the device 100 forwards a Release message to the device 101, where the Release message includes the IP 04 and an identifier (here, IP 1) of the device that recovers the IP 04;
d3, after receiving the Release message, the device 101 detects that the identifier of the device that recovers the IP 04 included in the Release message is IP 1, and IP 1 is the address of the device 100, and the device 100 belongs to the server group, thereby determining that the device 100 belongs to the aggregation system, and when detecting that the device 101 is locally configured with the IP 04, setting the locally configured IP 04 as available.
Thus, when there is a further client requesting a private network address, device 100 or device 101 may assign IP 04 to that client.
By applying the embodiment, the private network addresses allocated to the client are set to be unavailable among the devices in the aggregation system through the Decline message, so that the situations of repeated allocation of the private network addresses and disordered allocation of the private network addresses are avoided, and the devices in the aggregation system can allocate the private network addresses to the client at the same time, thereby reducing the waste of resources.
Corresponding to the embodiment of the mode, the embodiment of the application also provides an address distribution device.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an address allocation apparatus provided in this embodiment, which is applied to a first device in an aggregation system, where all devices in the aggregation system have enabled a DHCP function and are configured with an address pool, and the apparatus includes:
a receiving unit 601, configured to receive a Request message sent by a first client;
an allocating unit 602, configured to select a first private network address from an address pool configured by the first device according to the Request message, and allocate the first private network address to the first client;
a sending unit 603, configured to send a first Decline message to other devices in the aggregation system; the first Decline message includes a first private network address and an identifier of the first device, so that when the other device determines that the first device belongs to the aggregation system according to the identifier of the first device, the other device sets the first private network address included in the locally configured address pool as unavailable.
In an embodiment of the application, the address allocating apparatus may further include: a recovery unit (not shown in fig. 6);
the receiving unit 601 may also be configured to receive a Release message sent by a first client after sending the first delete message to other devices in the aggregation system;
the recovery unit is used for recovering a first private network address distributed for the first client in an address pool configured by the first device according to the Release message;
the sending unit 603 may be further configured to forward the Release message to other devices in the aggregation system, so that when the other devices determine that the first device belongs to the aggregation system according to the identifier of the first device, the other devices set the first private network address included in the locally configured address pool as available.
In an embodiment of the present application, the receiving unit 601 may be further configured to receive an Inform message sent by a second device added to the aggregation system;
the sending unit 603 may be further configured to send a second Decline message to the second device according to the Inform message; the second Decline message includes a private network address allocated to the client by the first device and an identifier of the first device, so that when the second device determines that the first device belongs to the aggregation system according to the identifier of the first device, the second device sets the private network address allocated to the client by the first device in the locally configured address pool as unavailable.
In an embodiment of the application, the address allocating apparatus may further include: a delay unit (not shown in fig. 6);
the receiving unit 601 may also be configured to receive a Renew message sent by a first client after sending the first delete message to other devices in the aggregation system; the Renew message comprises a first private network address, an offer duration and an identifier of first equipment;
the time delay unit is used for prolonging the duration of using the first private network address by the first client by the duration according to the Renew message;
the sending unit 603 may be further configured to forward the Renew packet to other devices in the aggregation system, so that when the other devices determine that the first device belongs to the aggregation system according to the identifier of the first device, the other devices keep the first private network address included in the locally configured address pool as unavailable.
By applying the embodiment, the private network addresses allocated to the client are set to be unavailable among the devices in the aggregation system through the Decline message, so that the situations of repeated allocation of the private network addresses and disordered allocation of the private network addresses are avoided, and the devices in the aggregation system can allocate the private network addresses to the client at the same time, thereby reducing the waste of resources.
An embodiment of the present application further provides a gateway device, as shown in fig. 7, including a processor 701 and a machine-readable storage medium 702, where the machine-readable storage medium 702 stores machine-executable instructions that can be executed by the processor 701;
the gateway device may serve as a first device in the aggregation system, and all devices in the aggregation system enable a DHCP function and are configured with an address pool:
the processor 701 is caused by machine executable instructions to implement the steps of:
receiving a Request message sent by a first client;
selecting a first private network address from an address pool configured by first equipment according to a Request message, and distributing the first private network address to a first client;
sending a first Decline message to other equipment in the aggregation system; the first Decline message includes a first private network address and an identifier of the first device, so that when the other device determines that the first device belongs to the aggregation system according to the identifier of the first device, the other device sets the first private network address included in the locally configured address pool as unavailable.
In one embodiment of the application, the processor 701 is caused by machine executable instructions to also implement the steps of:
after a first Decline message is sent to other equipment in the aggregation system, a Release message sent by a first client side is received; the Release message comprises a first private network address and an identifier of first equipment;
according to the Release message, a first private network address distributed for the first client side is recovered from an address pool configured for the first equipment;
and forwarding the Release message to other equipment in the aggregation system, so that when the other equipment determines that the first equipment belongs to the aggregation system according to the identifier of the first equipment, the other equipment sets the first private network address contained in the locally configured address pool as available.
In one embodiment of the application, the processor 701 is caused by machine executable instructions to also implement the steps of:
receiving an Inform message sent by second equipment added into the aggregation system;
sending a second Decline message to the second equipment according to the Inform message; the second Decline message includes a private network address allocated to the client by the first device and an identifier of the first device, so that when the second device determines that the first device belongs to the aggregation system according to the identifier of the first device, the second device sets the private network address allocated to the client by the first device in the locally configured address pool as unavailable.
In one embodiment of the application, the processor 701 is caused by machine executable instructions to also implement the steps of:
receiving a Renew message sent by a first client; the Renew message comprises a first private network address, an offer duration and an identifier of first equipment;
according to the Renew message, prolonging the duration of the first client using the first private network address by a duration;
and forwarding the Renew message to other equipment in the aggregation system, so that when the other equipment determines that the first equipment belongs to the aggregation system according to the identification of the first equipment, the other equipment keeps the first private network address contained in the locally configured address pool as unavailable.
By applying the embodiment, the private network addresses allocated to the client are set to be unavailable among the devices in the aggregation system through the Decline message, so that the situations of repeated allocation of the private network addresses and disordered allocation of the private network addresses are avoided, and the devices in the aggregation system can allocate the private network addresses to the client at the same time, thereby reducing the waste of resources.
The machine-readable storage medium may include a RAM (Random Access Memory) and may also include a NVM (Non-Volatile Memory), such as at least one disk Memory. Additionally, the machine-readable storage medium may be at least one memory device located remotely from the aforementioned processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
Embodiments of the present application also provide a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to perform the steps of:
receiving a Request message sent by a first client;
selecting a first private network address from an address pool configured by first equipment in the aggregation system according to the Request message, and distributing the first private network address to a first client; the devices in the aggregation system are all enabled with DHCP function;
sending a first Decline message to other equipment in the aggregation system; the first Decline message includes a first private network address and an identifier of the first device, so that when the other device determines that the first device belongs to the aggregation system according to the identifier of the first device, the other device sets the first private network address included in the locally configured address pool as unavailable.
In one embodiment of the application, the machine executable instructions cause the processor to further perform the steps of:
after a first Decline message is sent to other equipment in the aggregation system, a Release message sent by a first client side is received; the Release message comprises a first private network address and an identifier of first equipment;
according to the Release message, a first private network address distributed for the first client side is recovered from an address pool configured for the first equipment;
and forwarding the Release message to other equipment in the aggregation system, so that when the other equipment determines that the first equipment belongs to the aggregation system according to the identifier of the first equipment, the other equipment sets the first private network address contained in the locally configured address pool as available.
In one embodiment of the application, the machine executable instructions cause the processor to further perform the steps of:
receiving an Inform message sent by second equipment added into the aggregation system;
sending a second Decline message to the second equipment according to the Inform message; the second Decline message includes a private network address allocated to the client by the first device and an identifier of the first device, so that when the second device determines that the first device belongs to the aggregation system according to the identifier of the first device, the second device sets the private network address allocated to the client by the first device in the locally configured address pool as unavailable.
In one embodiment of the application, the machine executable instructions cause the processor to further perform the steps of:
receiving a Renew message sent by a first client; the Renew message comprises a first private network address, an offer duration and an identifier of first equipment;
according to the Renew message, prolonging the duration of the first client using the first private network address by a duration;
and forwarding the Renew message to other equipment in the aggregation system, so that when the other equipment determines that the first equipment belongs to the aggregation system according to the identification of the first equipment, the other equipment keeps the first private network address contained in the locally configured address pool as unavailable.
By applying the embodiment, the private network addresses allocated to the client are set to be unavailable among the devices in the aggregation system through the Decline message, so that the situations of repeated allocation of the private network addresses and disordered allocation of the private network addresses are avoided, and the devices in the aggregation system can allocate the private network addresses to the client at the same time, thereby reducing the waste of resources.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus, the gateway device, and the machine-readable storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to the description, reference may be made to part of the description of the method embodiments.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (10)

1. An address allocation method, applied to a first device in an aggregation system, wherein the devices in the aggregation system are all enabled with a Dynamic Host Configuration Protocol (DHCP) function and configured with an address pool, the method comprising:
receiving a Request message sent by a first client;
selecting a first private network address from an address pool configured by the first device according to the Request message, and distributing the first private network address to the first client;
sending a first Decline message to other equipment in the aggregation system; the first Decline message includes a first private network address and an identifier of the first device, so that when the other devices determine that the first device belongs to the aggregation system according to the identifier of the first device, the other devices set the first private network address included in a locally configured address pool as unavailable.
2. The method according to claim 1, wherein after sending the first Decline packet to other devices in the aggregation system, the method further comprises:
receiving a Release message sent by the first client; wherein, the Release message contains the first private network address and the identifier of the first device;
according to the Release message, the first private network address distributed to the first client side is recovered in an address pool configured by the first equipment;
and forwarding the Release message to other equipment in the aggregation system, so that when the other equipment determines that the first equipment belongs to the aggregation system according to the identifier of the first equipment, the other equipment sets the first private network address contained in a locally configured address pool as available.
3. The method of claim 1, further comprising:
receiving a notification Inform message sent by second equipment added into the aggregation system;
sending a second Decline message to the second equipment according to the Inform message; the second Decline message includes a private network address allocated to the client by the first device and an identifier of the first device, so that when the second device determines that the first device belongs to the aggregation system according to the identifier of the first device, the second device sets the private network address allocated to the client by the first device, which is included in a locally configured address pool, as unavailable.
4. The method according to claim 1, wherein after sending the first Decline packet to other devices in the aggregation system, the method further comprises:
receiving a Renew Renew message sent by the first client; wherein the Renew message includes the first private network address, a duration and an identifier of the first device;
according to the Renew message, prolonging the duration of the first client side using the first private network address by the duration;
and forwarding the Renew message to other equipment in the aggregation system, so that when the other equipment determines that the first equipment belongs to the aggregation system according to the identifier of the first equipment, the other equipment keeps the first private network address contained in a locally configured address pool as unavailable.
5. An address allocation apparatus applied to a first device in an aggregation system, the devices in the aggregation system each having enabled a Dynamic Host Configuration Protocol (DHCP) function and configured with an address pool, the apparatus comprising:
the receiving unit is used for receiving a Request message sent by a first client;
the allocation unit is used for selecting a first private network address from an address pool configured by the first equipment according to the Request message and allocating the first private network address to the first client;
a sending unit, configured to send a first Decline message to other devices in the aggregation system; the first Decline message includes a first private network address and an identifier of the first device, so that when the other devices determine that the first device belongs to the aggregation system according to the identifier of the first device, the other devices set the first private network address included in a locally configured address pool as unavailable.
6. The apparatus of claim 5, further comprising: a recovery unit;
the receiving unit is further configured to receive a Release message sent by the first client after sending the first delete message to other devices in the aggregation system; wherein, the Release message contains the first private network address and the identifier of the first device;
the recovery unit is configured to recover, according to the Release packet, the first private network address allocated to the first client from an address pool configured by the first device;
the sending unit is further configured to forward the Release packet to other devices in the aggregation system, so that when the other devices determine that the first device belongs to the aggregation system according to the identifier of the first device, the other devices set the first private network address included in the locally configured address pool as available.
7. The apparatus according to claim 5, wherein the receiving unit is further configured to receive an Inform message sent by a second device joining the aggregation system;
the sending unit is further configured to send a second Decline message to the second device according to the Inform message; the second Decline message includes a private network address allocated to the client by the first device and an identifier of the first device, so that when the second device determines that the first device belongs to the aggregation system according to the identifier of the first device, the second device sets the private network address allocated to the client by the first device, which is included in a locally configured address pool, as unavailable.
8. The apparatus of claim 5, further comprising: a delay unit;
the receiving unit is further configured to receive a Renew message sent by the first client after sending the first delete message to other devices in the aggregation system; wherein the Renew message includes the first private network address, a duration and an identifier of the first device;
the delay unit is configured to extend, according to the Renew packet, the duration for which the first client uses the first private network address by the duration;
the sending unit is further configured to forward the Renew packet to other devices in the aggregation system, so that when the other devices determine that the first device belongs to the aggregation system according to the identifier of the first device, the other devices keep the first private network address included in the locally configured address pool as unavailable.
9. A gateway device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: carrying out the method steps of any one of claims 1 to 4.
10. A machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to: carrying out the method steps of any one of claims 1 to 4.
CN201710474303.0A 2017-06-21 2017-06-21 Address allocation method and device Active CN107547678B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710474303.0A CN107547678B (en) 2017-06-21 2017-06-21 Address allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710474303.0A CN107547678B (en) 2017-06-21 2017-06-21 Address allocation method and device

Publications (2)

Publication Number Publication Date
CN107547678A CN107547678A (en) 2018-01-05
CN107547678B true CN107547678B (en) 2021-01-15

Family

ID=60970561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710474303.0A Active CN107547678B (en) 2017-06-21 2017-06-21 Address allocation method and device

Country Status (1)

Country Link
CN (1) CN107547678B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116192801B (en) * 2023-02-17 2024-03-26 浪潮思科网络科技有限公司 DHCP (dynamic host configuration protocol) table entry synchronization method, equipment and medium based on MLAG (media-based access control) environment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101656763A (en) * 2009-09-11 2010-02-24 华为技术有限公司 IP address automatic distribution method, client and server
CN102523316A (en) * 2011-12-23 2012-06-27 杭州华三通信技术有限公司 Address distribution method and address distribution device
CN102811262A (en) * 2011-05-31 2012-12-05 巴比禄股份有限公司 Dynamic host configuration protocol server,ip address assignment system and method of assigning an ip address
CN104378455A (en) * 2014-11-13 2015-02-25 杭州华三通信技术有限公司 IP address distribution method and device
CN106302854A (en) * 2016-08-12 2017-01-04 徐州华讯科技有限公司 A kind of method that many DHCP of control Server dynamically distributes host address

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9634948B2 (en) * 2013-11-07 2017-04-25 International Business Machines Corporation Management of addresses in virtual machines

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101656763A (en) * 2009-09-11 2010-02-24 华为技术有限公司 IP address automatic distribution method, client and server
CN102811262A (en) * 2011-05-31 2012-12-05 巴比禄股份有限公司 Dynamic host configuration protocol server,ip address assignment system and method of assigning an ip address
CN102523316A (en) * 2011-12-23 2012-06-27 杭州华三通信技术有限公司 Address distribution method and address distribution device
CN104378455A (en) * 2014-11-13 2015-02-25 杭州华三通信技术有限公司 IP address distribution method and device
CN106302854A (en) * 2016-08-12 2017-01-04 徐州华讯科技有限公司 A kind of method that many DHCP of control Server dynamically distributes host address

Also Published As

Publication number Publication date
CN107547678A (en) 2018-01-05

Similar Documents

Publication Publication Date Title
JP5663549B2 (en) Method, apparatus and system for assigning public IP addresses
EP2154867B1 (en) A configuration method, system and device of cryptographically generated address
CN107733808B (en) Flow transmission method and device
WO2020001045A1 (en) Address management method and device
CN108429824B (en) Address allocation method and device
JP2016529579A5 (en)
CN101582888B (en) Method for creating neighbor discovery table item and server
WO2017114124A1 (en) Address allocation method, gateway and system
CN107547665B (en) Method, equipment and system for allocating DHCP (dynamic host configuration protocol) address
JP4806728B2 (en) Improved method and apparatus for reducing congestion in a DHCP network system
CN111935335A (en) DHCP address allocation method and device
CN109120741B (en) Duplicate address detection method and device and computer readable storage medium
WO2017185851A1 (en) Video storage system, and video data transmission method for same
CN110798546A (en) DUID-based DHCP client access authentication method
CN101018193A (en) Load distribution method and system and device for allocating the backup packet and virtual IP address
CN107547678B (en) Address allocation method and device
CN109561004B (en) Message forwarding method and device and switch
CN108667957B (en) IP address allocation method, first electronic device and first server
WO2018006684A1 (en) Message processing method and device, and router
CN102624627A (en) Message transmission method and equipment
CN102752414B (en) Method and equipment for releasing Internet protocol (IP)v6 address
CN108429822B (en) Communication system, IPv6 address allocation method and device and distributed gateway
CN105723687A (en) Methods for configuring and managing an IP network, corresponding devices and computer programs
CN115499414A (en) Address allocation method and device
CN103414800A (en) Allocation and selection method and system of distributed relay servers in NAT traversal

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
GR01 Patent grant
GR01 Patent grant