CN107547674B - Address allocation method and device - Google Patents

Address allocation method and device Download PDF

Info

Publication number
CN107547674B
CN107547674B CN201710339217.9A CN201710339217A CN107547674B CN 107547674 B CN107547674 B CN 107547674B CN 201710339217 A CN201710339217 A CN 201710339217A CN 107547674 B CN107547674 B CN 107547674B
Authority
CN
China
Prior art keywords
address
equipment
networking
link layer
determining
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
CN201710339217.9A
Other languages
Chinese (zh)
Other versions
CN107547674A (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.)
New H3C Information Technologies Co Ltd
Original Assignee
New H3C Information 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 New H3C Information Technologies Co Ltd filed Critical New H3C Information Technologies Co Ltd
Priority to CN201710339217.9A priority Critical patent/CN107547674B/en
Publication of CN107547674A publication Critical patent/CN107547674A/en
Application granted granted Critical
Publication of CN107547674B publication Critical patent/CN107547674B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides an address allocation method and device. In the application, the main device in the networking allocates the IP address to the source device of the link layer address request message based on the received link layer address request message to realize the allocation of the IP address to the network device deployed in the super-convergence management system, which is different from the existing IP address allocated based on the three-layer DHCP.

Description

Address allocation method and device
Technical Field
The present application relates to network communication technologies, and in particular, to an address assignment method and apparatus.
Background
The super-convergence management system integrates software and hardware infrastructures such as a server, a network, a storage platform and a virtualization platform, and is externally presented as a large server consisting of virtual computing resources, storage resources and network bandwidth. The super-convergence management device mainly comprises gateway management and monitoring, server hardware management and monitoring, switch hardware management and monitoring, network management and monitoring, storage management and monitoring, virtual machine management and monitoring, application management and monitoring and other functions at present. The super-fusion management is specifically realized by a unified management matrix (UISM) and the like.
Disclosure of Invention
The application provides an address allocation method and device, which are used for realizing allocation of an IP address for network equipment deployed in a super-convergence management system.
The technical scheme provided by the application comprises the following steps:
an address allocation method, applied to a network device, includes:
determining whether the equipment is a master equipment or not when accessing networking;
when the equipment is determined not to be the main equipment, if the equipment does not have the IP address applied to the networking, a link layer address request message is sent to the main equipment in the networking to request the IP address, the IP address distributed to the equipment by the main equipment is received, and the received IP address is configured to be the IP address applied to the networking by the equipment;
when the equipment is determined to be the main equipment, if a link layer address request message is received, an unoccupied IP address is selected from an IP address network segment where the equipment is located, and the selected IP address is sent to source equipment of the link layer address request message.
An address allocation apparatus, applied to a network device, includes:
the device comprises a determining unit, a judging unit and a judging unit, wherein the determining unit is used for determining whether the device is a master device when accessing networking;
an address requesting unit, configured to, when the determining unit determines that the device is not a master device, send a link layer address request packet to the master device in the networking to request an IP address if the device does not have the IP address applied to the networking, receive the IP address allocated by the master device to the device, and configure the received IP address as the IP address applied to the networking by the device;
and the address allocation unit is used for selecting an unoccupied IP address from the IP address network segment in which the equipment is positioned if a link layer address request message is received when the determining unit determines that the equipment is the main equipment, and sending the selected IP address to the source equipment of the link layer address request message.
According to the technical scheme, the IP address is distributed to the source equipment of the link layer address request message by the main equipment in the networking based on the received link layer address request message, which is different from the IP address distributed by the existing three-layer based DHCP.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart of a method provided herein;
FIG. 2 is a flow chart of step 101 provided herein;
fig. 3 is a flowchart illustrating a master device allocating an IP address to a standby device according to the present application;
FIG. 4 is a schematic view of an embodiment provided herein;
fig. 5 is a diagram illustrating the structure of the apparatus according to the present application.
Detailed Description
The super-convergence management system is an IP-based management system, when network equipment is deployed in the super-convergence management system, the network equipment needs to have an IP address, if the network equipment does not have the IP address, the network equipment needs to request a DHCP server to dynamically allocate the IP address based on DHCP, and then the network equipment can be deployed to the super-convergence management system.
DHCP is the most commonly used protocol for IP address assignment. The DHCP server allocates the IP address for the network equipment based on DHCP in a mode of dynamically allocating the IP address, however, the allocated IP address has survival time, and once the network equipment is restarted, the DHCP server allocates a new IP address for the network equipment again. That is, the same network device may experience a plurality of different IP addresses, and this dynamic change of the IP addresses of the same network device is not favorable for deploying services for the super convergence management system.
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in detail below with reference to the accompanying drawings and specific embodiments.
Referring to fig. 1, fig. 1 is a flow chart of a method provided by the present application. The method is applied to the network equipment. As shown in fig. 1, the method may include the steps of:
step 101, when the network device accesses the network, it determines whether the device is the master device, when it is determined that the device is not the master device, step 102 is executed, and when it is determined that the device is the master device, step 103 is executed.
As an embodiment, whether the network device is a master device may be specified based on the service requirement, and when the network device is specified as the master device, a flag indicating the master device may be configured on the network device, and when the network device is not specified as the master device, a flag indicating that the network device is not the master device may be configured on the network device, or no flag may be configured.
Based on this, when the network device is accessed to the network, it can determine whether the device is the master device according to whether the device is configured with the mark for indicating the master device, and when the device is configured with the mark for indicating the master device, it is determined that the device is the master device, otherwise, it is determined that the device is not the master device.
As another embodiment, when accessing networking, the network device may also determine whether the device is a master device according to the dynamic flow shown in fig. 2, which may be specifically described in the following text of the flow shown in fig. 2.
It should be noted that, in this application, when the network device determines that the device is not a master device, the network device may be a network device (also referred to as a standby device) having the same device type as the master device in the networking, or may be a network device (in this case, may not be referred to as a standby device) having a different device type from the master device in the networking.
Step 102, if the device does not have the IP address applied to the networking, sending a link layer address request message to the master device in the networking to request the IP address, receiving the IP address allocated by the master device to the device, and configuring the received IP address as the IP address applied to the networking by the device.
This step 102 is performed when it is determined that the network device is not the master device.
As an embodiment, in step 102, the absence of an IP address applied to the networking by the present device is determined through the following steps a1 to a 3:
step a1, judging whether the local device has recorded the address information of the main device, if yes, executing step a2, if no, determining that the device does not have the IP address applied to the networking.
In this application, when the MAC address of the master device is locally recorded, it means that the device has previously accessed the networking, but whether the previously accessed networking is the same as the currently accessed networking is not yet determined, and it needs to be determined through step a 2.
In this application, when the MAC address of the host device is not recorded locally, it means that the device has not previously accessed any networking, and therefore, it can be directly determined that there is no IP address applied to the networking.
Step a2, comparing whether the address information of the main device in the networking is the same as the address information of the main device which is locally recorded by the device, if not, determining that the device does not have the IP address applied to the networking, and if so, executing step a 3.
In step a2, once the address information, such as the MAC address, of the master device in the networking is compared to be different from the address information, such as the MAC address, of the master device that has been locally recorded by the device, it means that the current networking is a new network environment, and is different from the previously accessed networking, and for this case, the IP address applied to the current networking needs to be applied, that is, the IP address application operation in step 102.
Step a3, checking whether the state of the device is initialization completion state, if not, determining that the device does not have IP address applied to networking.
As an embodiment, when the state of the device is checked to be the initialization completion state in step a3, it is determined that the device has an IP address applied to networking, and in this case, the step of requesting the IP address in step 102 is omitted, so that the device is prevented from repeatedly applying for the IP address.
In this application, to avoid repeatedly applying for an IP address, in step 102, after configuring the received IP address as an IP address for the device to apply to the networking, the state of the device is further set to an initialization completion state, so as to prevent the device from repeatedly applying for an IP address after restarting.
Through the steps a1 to a3, it is determined whether the IP address applied to the networking exists in the device.
As an embodiment of the present application, the link layer address request message is a request message in a management protocol based on a link layer. Here, the management Protocol based on the link layer may be, for example, a hyper convergence management Transport Protocol (Transport Protocol), such as the UISM Transport Protocol, and the application is not particularly limited.
It can be seen from step 102 that, unlike the IP address of the DHCP request applied to the three layers (network layers), in this application, the network device requests the IP address to the master device in the located networking through the link layer address request message when the network device is not the master device, and the requested IP address does not define the lifetime as the DHCP, so in this step 102, after the network device configures the received IP address as the IP address applied to the networking by the device, in use, the configured IP address is the static IP address of the network device, and it is not invalid due to operations such as restart, and it is very convenient for the super convergence management system to deploy services.
Step 103, if receiving the link layer address request message, selecting an unoccupied IP address from the IP address network segment where the device is located, and sending the selected IP address to the source device of the link layer address request message.
Here, the source device of the link layer address request packet may be a standby device having the same device type as the source device, or may be a network device having a different device type from the source device.
As another embodiment of the present application, in step 103, the source device that sends the selected IP address to the link layer address request packet may specifically be: and carrying the IP address in a link layer address response message aiming at the link layer address request message, and sending the link layer address response message to the source equipment of the link layer address request message. As an embodiment, the link layer address response message is a response message in a management protocol based on a link layer. As described above, the link layer-based management Protocol may be, for example, a hyper convergence management Transport Protocol (Transport Protocol), such as the UISM Transport Protocol, and the like, and the present application is not particularly limited.
As to how to select an unoccupied IP address from the IP address network segment in which the device is located in step 103 to allocate to the second network device, the following text description of the flow shown in fig. 3 may be specifically referred to.
As can be seen from step 103, in the present application, the master device in the networking allocates an IP address to the source device of the link layer address request packet based on the link layer address request packet applied to the second layer (link layer), which is different from the IP address allocated by the DHCP applied to the third layer (network layer), and the IP address allocated by the master device in the present application does not need to set a lifetime like the DHCP, which is not invalid due to operations such as restart.
Thus, the flow shown in fig. 1 is completed.
As can be seen from the flow shown in fig. 1, in the present application, when a network device is not a master device, the network device requests the master device to allocate an IP address through a link layer address request message, and the master device allocates an IP address to a source device of the link layer address request message in a networking based on a two-layer (link layer), which is different from an existing IP address allocated by a DHCP based on a three-layer. In addition, in the application, the IP address allocated by the main device to the source device of the link layer address request packet does not need to set the lifetime as in the case of DHCP, and is not invalid due to operations such as restart, and the IP address allocated by the main device to the network device is a static IP address of the network device, which is convenient for deploying services when each network device is added to the super convergence management system.
Referring to fig. 2, fig. 2 is a flowchart of step 101 provided herein. As shown in fig. 2, the process may include:
step 201, when accessing networking, a network device judges whether the networking currently has a master device, if so, the device is determined not to be the master device; if not, step 202 is performed.
In the application, once the network device determines that the main device exists in the networking when accessing the networking, the main device is not elected dynamically, and the device is directly determined as the standby device, so that the stability of the networking can be maintained.
As an embodiment, in the present application, when it is determined that a master device currently exists in a networking, address information of the determined master device may be directly recorded to a local.
Step 202, determining that the device is a candidate master device, and sending a first type link layer advertisement message for indicating that the device is the candidate master device in networking. Step 203 is then performed.
Step 203, when receiving the first type link layer notification message sent by other candidate master devices within the first set time, electing the master device between the device and the other candidate master devices sending the first type link layer notification message, when the device is elected as the master device, determining that the device is the master device, otherwise, determining that the device is not the master device.
As an embodiment, the first type link layer advertisement packet described above may carry a priority, and as an embodiment, in this step 203, the election master device between the self device and the other candidate master devices that send the first type link layer advertisement packet may elect a device with the highest priority according to the priority. It should be noted that, when the number of devices with the highest elected priority is greater than 1, the device with the smallest MAC address in the devices with the highest elected priority is selected as the master device, and it is finally ensured that only one network device is selected as the master device in the network.
Thus, the flow shown in fig. 2 is completed.
In this application, for a network device determined as a master device, a second type link layer advertisement message for indicating that the device is the master device may be periodically sent in networking.
Based on this, as an embodiment, the step 201 of determining whether there is a master device currently in the networking includes: checking whether the equipment receives a second type link layer notification message within second set time; if yes, determining that the main equipment exists in the networking, wherein the network equipment for sending the second type link layer notification message is the main equipment of the networking, and if not, determining that the main equipment does not exist in the networking.
Referring to fig. 3, fig. 3 is a flowchart illustrating a master device allocating an IP address to a standby device according to the present application. As shown in fig. 3, the process may include the following steps:
step 301, the master device determines the device type carried by the link layer address request message from the received link layer address request message.
Step 302, the master device finds an IP address sub-network segment corresponding to the determined device type from the N IP address sub-network segments divided locally.
The N IP address sub-network segments are divided from the IP address network segment where the equipment is located, each IP address sub-network segment in the N IP address sub-network segments corresponds to more than one network equipment type, and N is less than or equal to the equipment type number M of all the network equipment in the networking.
Step 303, select an unoccupied IP address from the found IP address subnet fragment.
As an embodiment, step 303 specifically includes: the main device selects an idle IP address from the found IP address subnet section, carries the selected IP address in a Ping message and sends the IP address in the networking, the purpose of sending the Ping message is to prevent other devices, such as a host and the like, which are not allocated with the IP address by the main device in the networking from colliding with the selected IP address, if the response message of the Ping message is not received, the IP address is not occupied, and the IP address is allocated to the standby device.
So far, the description of the flow shown in fig. 3 is completed.
It should be noted that, as an embodiment in this application, in step 102, after configuring the received IP address as an IP address that the device applies to the networking, the method further includes: and sending a link layer notification message to the main equipment, wherein the link layer notification message is used for notifying the equipment that the IP address configuration is completed.
Correspondingly, in step 103, after sending the IP address to the source device of the link layer address request packet, the master device checks whether the source device of the device receives the link layer notification packet sent by the source device of the link layer address request packet within the third set time, if not, determines that the IP address is not occupied (it is still idle), and if so, determines that the IP address is occupied, and other devices will not reallocate the IP address. In this way, when the subsequent master device allocates IP addresses to other network devices, the determined occupied IP addresses can be excluded to prevent IP address conflicts.
As an embodiment, in order to facilitate the main device to exclude an occupied IP address when allocating an IP address, after the main device sends the IP address to the source device of the link layer address request packet, the main device may further record a corresponding relationship between the sent IP address and an MAC address carried in the link layer address request packet; and then, if a link layer notification message sent by the source equipment of the link layer address request message is received within a third set time, further determining that the IP address in the record is occupied, otherwise, determining that the IP address in the record is unoccupied, deleting the record, and subsequently, allocating the IP address to other network equipment.
As another embodiment, in order to facilitate the master device to exclude an occupied IP address when allocating an IP address, after receiving a link layer notification packet sent by a source device of a link layer address request packet within a third set time, the master device further records a correspondence between the IP address sent to the source device and the MAC address of the source device to identify that the IP address in the record is occupied, and then cannot allocate the IP address to another network device. The IP address of the source device and the MAC address of the source device may be carried in a link layer report message sent by the source device.
The flow shown in fig. 1 is described below by a specific embodiment:
referring to fig. 4, fig. 4 is a schematic diagram of an embodiment provided in the present application. In fig. 4, suppose a network device (denoted as device 4_1) accesses networking.
After the device 4_1 is accessed, it finds that the second type link layer advertisement message (denoted as message 4_1) is received within a second set time, for example, 1 second, and then considers that the master device currently exists in the networking, and determines the device sending the message 4_1 as the master device (denoted as device 4_ 2).
The device 4_1 checks the MAC address of the locally recorded master device of the device, but finds that the MAC address of the master device in the current networking, that is, the device 4_2, is different from the MAC address of the locally recorded master device, and determines that the device does not have an IP address applied to the current networking. At this time, the device 4_1 may mark the state of the device as a state to be initialized, and update the recorded MAC address of the master device to the MAC address of the master device in the current networking, that is, the device 4_ 2.
After the status flag is in the to-be-initialized status, the device 4_1 sends a link layer address request message to the device 4_2 every set time, for example, 5 seconds, until receiving a link layer address response message replied by the device 4_ 2.
The device 4_2 receives the link layer address request message sent by the device 4_1, and determines the device type of the device 4_1 carried by the link layer address request message.
The device 4_2 finds out IP address sub-network segments corresponding to the device types, such as 192.168.5.21-192.168.5.30, from local N IP address sub-network segments, where the N IP address sub-network segments are divided for the IP address network segment where the device 4_2 is located, each of the divided IP address sub-network segments corresponds to more than one device type, and N is less than or equal to the number M of network device types in the networking.
The device 4_2 selects an unoccupied IP address from the found IP address sub-segments, such as 192.168.5.21-192.168.5.30.
The device 4_2 carries the selected IP address in the Ping message, sends the Ping message in the current networking, determines that the IP address is not occupied by any device in the networking if the response message aiming at the Ping message is not received, otherwise, selects an unoccupied IP address from the found IP address sub-network segments such as 192.168.5.21-192.168.5.30 again, carries the selected IP address in the Ping message and sends the IP address in the current networking until the response message aiming at the Ping message is not received.
The device 4_2 carries the selected IP address in a link layer address response message and sends the link layer address response message to the device 4_1, and locally records the corresponding relationship between the IP address and the MAC address of the device 4_1 carried in the link layer address request message.
After receiving the link layer address response message, the device 4_1 modifies the state of the device from the state to be initialized to the state being initialized.
The device 4_1 acquires the IP address carried in the link layer address response packet from the link layer address response packet, and configures the acquired IP address as the IP address of the device for networking.
After the device 4_1 completes configuration, the state of the device is changed from the initialization state to the initialization completion state, and a link layer notification message is sent to the device 4_2, where the link layer notification message is used to notify the device 4_1 that IP address configuration is completed.
The device 4_2 receives the link layer notification message, determines that the IP address allocation to the device 4_1 is successful, and does not allocate the IP address allocated to the device 4_1 to other standby devices.
So far, the description of the embodiment shown in fig. 4 is completed.
The method provided by the present application is described above, and the device provided by the present application is described below:
referring to fig. 5, fig. 5 is a diagram illustrating a structure of the apparatus according to the present invention. The device is applied to network equipment and comprises:
the device comprises a determining unit, a judging unit and a judging unit, wherein the determining unit is used for determining whether the device is a master device when accessing networking;
an address requesting unit, configured to, when the determining unit determines that the device is not a master device, send a link layer address request packet to the master device in the networking to request an IP address if the device does not have the IP address applied to the networking, receive the IP address allocated by the master device to the device, and configure the received IP address as the IP address applied to the networking by the device;
and the address allocation unit is used for selecting an unoccupied IP address from the IP address network segment in which the equipment is positioned if a link layer address request message is received when the determining unit determines that the equipment is the main equipment, and sending the selected IP address to the source equipment of the link layer address request message.
In one embodiment, the determining unit determines whether the device is a master device, and includes:
judging whether a master device exists in the networking, if so, determining that the device is not the master device;
if the result is no, then,
determining that the equipment is candidate master equipment, sending a first-class link layer notification message for indicating the equipment as the candidate master equipment in networking, electing the master equipment between the equipment and other candidate master equipment sending the first-class link layer notification message when receiving the first-class link layer notification message sent by other candidate master equipment within a first set time, determining that the equipment is the master equipment when the equipment is elected as the master equipment, and otherwise, determining that the equipment is not the master equipment.
In one embodiment, the determining whether there is a master device in the networking includes: checking whether the equipment receives a second type link layer notification message for indicating the main equipment within second set time; if so, determining that the main equipment exists in the networking, determining that the determined main equipment is the network equipment which sends the second type link layer notification message and is the main equipment of the networking, and if not, determining that the main equipment does not exist in the networking.
When the device is determined to be the main device, the method further comprises the following steps: and periodically sending a second type link layer notification message for indicating the equipment as the main equipment in networking.
In one embodiment, the address requesting unit determines that the IP address applied to the networking does not exist in the present device by: judging whether the local equipment locally records the address information of the main equipment, if not, determining that the equipment does not have an IP address applied to the networking; if yes, comparing whether the address information of the main equipment in the networking is the same as the address information of the main equipment which is locally recorded by the equipment, if not, determining that the equipment does not have the IP address applied to the networking, and if the equipment is the same, determining that the equipment does not have the IP address applied to the networking when the state of the equipment is not the initialization completion state;
after the address requesting unit configures the received IP address as the IP address that the device applies to the networking, the method further includes: and setting the state of the equipment as an initialization completion state.
Preferably, the selecting, by the address allocating unit, an unoccupied IP address from an IP address network segment in which the device is located includes:
determining the equipment type carried by the link layer address request message from the received link layer address request message;
finding an IP address sub-network segment corresponding to the determined equipment type from N IP address sub-network segments divided locally, and selecting an unoccupied IP address from the found IP address sub-network segments;
the N IP address sub-network segments are divided from the IP address network segment where the equipment is located, each IP address sub-network segment in the N IP address sub-network segments corresponds to more than one network equipment type, and N is less than or equal to the equipment type number M of all the network equipment in the networking.
In one embodiment, after sending the selected IP address to the source device of the link layer address request packet, the address allocating unit further includes: recording the corresponding relation between the selected IP address and the MAC address carried by the link layer address request message, checking whether the equipment receives the link layer notification message sent by the source equipment of the link layer address request message within a third set time, if so, determining that the IP address is occupied, and if not, determining that the IP address is not occupied, and deleting the record;
the address requesting unit, after configuring the received IP address as an IP address that the device applies to the networking, further includes: and sending a link layer notification message to the main equipment, wherein the link layer notification message is used for notifying the equipment that the IP address configuration is completed.
Thus, the apparatus configuration diagram shown in fig. 5 is completed.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (11)

1. An address allocation method, applied to a network device, includes:
determining whether the equipment is a master equipment or not when accessing networking;
when the equipment is determined not to be the main equipment, if the equipment does not have the IP address applied to the networking, a link layer address request message is sent to the main equipment in the networking to request the IP address, the IP address allocated to the equipment by the main equipment is received, and the received IP address is configured to be the static IP address applied to the networking by the equipment;
when the equipment is determined to be the main equipment, if a link layer address request message is received, an unoccupied IP address is selected from an IP address network segment where the equipment is located, and the selected IP address is sent to source equipment of the link layer address request message.
2. The method of claim 1, wherein the determining whether the device is a master device comprises:
judging whether a master device exists in the networking, if so, determining that the device is not the master device;
if the result is no, then,
determining that the equipment is candidate master equipment, sending a first-class link layer notification message for indicating the equipment as the candidate master equipment in networking, electing the master equipment between the equipment and other candidate master equipment sending the first-class link layer notification message when receiving the first-class link layer notification message sent by other candidate master equipment within a first set time, determining that the equipment is the master equipment when the equipment is elected as the master equipment, and otherwise, determining that the equipment is not the master equipment.
3. The method of claim 2, wherein the determining whether there is a master device in the networking comprises: checking whether the equipment receives a second type link layer notification message for indicating the main equipment within second set time; if yes, determining that the main equipment exists in the networking, wherein the determined main equipment is the network equipment for sending the second type link layer notification message, and if not, determining that the main equipment does not exist in the networking;
when the device is determined to be the main device, the method further comprises the following steps: and periodically sending a second type link layer notification message for indicating the equipment as the main equipment in networking.
4. The method according to claim 1, wherein the absence of an IP address applied to the networking by the present device is determined by: judging whether the local equipment locally records the address information of the main equipment, if not, determining that the equipment does not have an IP address applied to the networking; if yes, comparing whether the address information of the main equipment in the networking is the same as the address information of the main equipment which is locally recorded by the equipment, if not, determining that the equipment does not have the IP address applied to the networking, and if the equipment is the same, determining that the equipment does not have the IP address applied to the networking when the state of the equipment is not the initialization completion state;
after the configuring the received IP address as the IP address applied by the device to the networking, the method further includes: and setting the state of the equipment as an initialization completion state.
5. The method of claim 1, wherein selecting an unoccupied IP address from the IP address segment in which the device is located comprises:
determining the equipment type carried by the link layer address request message from the received link layer address request message;
finding an IP address sub-network segment corresponding to the determined equipment type from N IP address sub-network segments divided locally, and selecting an unoccupied IP address from the found IP address sub-network segments;
the N IP address sub-network segments are divided from the IP address network segment where the equipment is located, each IP address sub-network segment in the N IP address sub-network segments corresponds to more than one network equipment type, and N is less than or equal to the equipment type number M of the network equipment in the networking.
6. The method according to claim 1, wherein after sending the selected IP address to the source device of the link layer address request message, checking whether the device receives a link layer notification message sent by the source device of the link layer address request message within a third set time, if yes, determining that the IP address is occupied, and if not, determining that the IP address is unoccupied;
after configuring the received IP address as the IP address applied by the device to the networking, the method further comprises the following steps: and sending a link layer notification message to the main equipment, wherein the link layer notification message is used for notifying the equipment that the IP address configuration is completed.
7. An address allocation apparatus, applied to a network device, includes:
the device comprises a determining unit, a judging unit and a judging unit, wherein the determining unit is used for determining whether the device is a master device when accessing networking;
an address requesting unit, configured to, when the determining unit determines that the device is not a master device, send a link layer address request packet to the master device in the networking to request an IP address if the device does not have the IP address applied to the networking, receive the IP address allocated by the master device to the device, and configure the received IP address as a static IP address applied to the networking by the device;
and the address allocation unit is used for selecting an unoccupied IP address from the IP address network segment in which the equipment is positioned if a link layer address request message is received when the determining unit determines that the equipment is the main equipment, and sending the selected IP address to the source equipment of the link layer address request message.
8. The apparatus according to claim 7, wherein the determining unit determines whether the own device is a master device includes:
judging whether a master device exists in the networking, if so, determining that the device is not the master device;
if the result is no, then,
determining that the equipment is candidate master equipment, sending a first-class link layer notification message for indicating the equipment as the candidate master equipment in networking, electing the master equipment between the equipment and other candidate master equipment sending the first-class link layer notification message when receiving the first-class link layer notification message sent by other candidate master equipment within a first set time, determining that the equipment is the master equipment when the equipment is elected as the master equipment, and otherwise, determining that the equipment is not the master equipment.
9. The apparatus of claim 8, wherein the determining whether there is a master device in the networking comprises: checking whether the equipment receives a second type link layer notification message for indicating the main equipment within second set time; if yes, determining that the main equipment exists in the networking, wherein the determined main equipment is the network equipment for sending the second type link layer notification message, and if not, determining that the main equipment does not exist in the networking;
when the device is determined to be the main device, the method further comprises the following steps: and periodically sending a second type link layer notification message for indicating the equipment as the main equipment in networking.
10. The apparatus according to claim 7, wherein the address requesting unit determines that the device does not have an IP address applied to the networking by: judging whether the local equipment locally records the address information of the main equipment, if not, determining that the equipment does not have an IP address applied to the networking; if yes, comparing whether the address information of the main equipment in the networking is the same as the address information of the main equipment which is locally recorded by the equipment, if not, determining that the equipment does not have the IP address applied to the networking, and if the equipment is the same, determining that the equipment does not have the IP address applied to the networking when the state of the equipment is not the initialization completion state;
after the address requesting unit configures the received IP address as the IP address that the device applies to the networking, the method further includes: and setting the state of the equipment as an initialization completion state.
11. The apparatus of claim 7, wherein the address allocating unit selects an unoccupied IP address from the IP address segment in which the device is located, comprises:
determining the equipment type carried by the link layer address request message from the received link layer address request message;
finding an IP address sub-network segment corresponding to the determined equipment type from N IP address sub-network segments divided locally, and selecting an unoccupied IP address from the found IP address sub-network segments;
the N IP address sub-network segments are divided from the IP address network segment where the equipment is located, each IP address sub-network segment in the N IP address sub-network segments corresponds to more than one network equipment type, and N is less than or equal to the equipment type number M of all the network equipment in the networking.
CN201710339217.9A 2017-05-15 2017-05-15 Address allocation method and device Active CN107547674B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710339217.9A CN107547674B (en) 2017-05-15 2017-05-15 Address allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710339217.9A CN107547674B (en) 2017-05-15 2017-05-15 Address allocation method and device

Publications (2)

Publication Number Publication Date
CN107547674A CN107547674A (en) 2018-01-05
CN107547674B true CN107547674B (en) 2020-12-29

Family

ID=60966913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710339217.9A Active CN107547674B (en) 2017-05-15 2017-05-15 Address allocation method and device

Country Status (1)

Country Link
CN (1) CN107547674B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111431774B (en) * 2020-03-10 2021-07-16 华为技术有限公司 Communication method and communication system based on master router and slave router networking
CN111654444A (en) * 2020-06-10 2020-09-11 展讯通信(上海)有限公司 IPv6 prefix obtaining method, equipment and storage medium
CN113660354A (en) * 2021-08-12 2021-11-16 深圳市德为思科技有限公司 Link layer address allocation method of network equipment, network equipment and network system
CN116436755B (en) * 2023-06-12 2023-08-25 新华三技术有限公司 Network management method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1937572A (en) * 2005-09-23 2007-03-28 中兴通讯股份有限公司 Method for realizing access device long-distance identification-dialing user service proxy authentication
CN102123181A (en) * 2010-12-09 2011-07-13 广东高新兴通信股份有限公司 Method for automatically configuring IP address to network device
CN102882989A (en) * 2012-09-05 2013-01-16 浙江宇视科技有限公司 Method and device for distributing internet protocol (IP) address to multi-network video recorder (NVR) by monitoring network
CN103763632A (en) * 2014-01-10 2014-04-30 济南中维世纪科技有限公司 Method for identifying self-adaption network of network equipment
CN104639409A (en) * 2015-02-13 2015-05-20 广东欧珀移动通信有限公司 Method and device for automatically adding sound box to sound box ad-hoc network

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7643449B2 (en) * 2005-01-18 2010-01-05 Airwalk Communications, Inc. Combined base transceiver station and base station controller data call and quality of service
US9184987B2 (en) * 2011-02-23 2015-11-10 Tyco Fire & Security Gmbh System and method for automatic configuration of master/slave devices on a network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1937572A (en) * 2005-09-23 2007-03-28 中兴通讯股份有限公司 Method for realizing access device long-distance identification-dialing user service proxy authentication
CN102123181A (en) * 2010-12-09 2011-07-13 广东高新兴通信股份有限公司 Method for automatically configuring IP address to network device
CN102882989A (en) * 2012-09-05 2013-01-16 浙江宇视科技有限公司 Method and device for distributing internet protocol (IP) address to multi-network video recorder (NVR) by monitoring network
CN103763632A (en) * 2014-01-10 2014-04-30 济南中维世纪科技有限公司 Method for identifying self-adaption network of network equipment
CN104639409A (en) * 2015-02-13 2015-05-20 广东欧珀移动通信有限公司 Method and device for automatically adding sound box to sound box ad-hoc network

Also Published As

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

Similar Documents

Publication Publication Date Title
US10187459B2 (en) Distributed load balancing system, health check method, and service node
KR102439559B1 (en) Alarm method and device
CN102025798B (en) Address allocation processing method, device and system
CN107547674B (en) Address allocation method and device
CN109995641B (en) Information processing method, computing node and storage medium
KR102580499B1 (en) Communication methods and communication devices
EP3742785B1 (en) Session management method and device
CN108347343B (en) Policy management method, device and system
CN108429824B (en) Address allocation method and device
WO2015074396A1 (en) Automatic configuration method, device and system of software defined network
US11153173B1 (en) Dynamically updating compute node location information in a distributed computing environment
CN106878480B (en) DHCP service process sharing method and device
CN113037522A (en) Container unit management method and related equipment
WO2016184317A1 (en) Method, device and system for allocating ap
CN114070822B (en) Kubernetes Overlay IP address management method
US11917001B2 (en) Efficient virtual IP address management for service clusters
CN105704042A (en) Message processing method, BNG and BNG cluster system
CN107517150B (en) Intranet resource access method and device based on virtual private network VPN
JP7483059B2 (en) DEFAULT GATEWAY MANAGEMENT METHOD, GATEWAY MANAGER, SERVER AND STORAGE MEDIUM
CN109005071B (en) Decision deployment method and scheduling equipment
CN115499414A (en) Address allocation method and device
JP2017027166A (en) Operation management unit, operation management program, and information processing system
US20230146880A1 (en) Management system and management method
KR101592865B1 (en) Network assigning system and method thereof
CN111586153B (en) Communication method and device for cloud platform

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Xinhua Sanxin Information Technology Co., Ltd.

Address before: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: Huashan Information Technology Co., Ltd.

GR01 Patent grant
GR01 Patent grant