CN114598681A - Address allocation processing method and equipment - Google Patents

Address allocation processing method and equipment Download PDF

Info

Publication number
CN114598681A
CN114598681A CN202011381499.7A CN202011381499A CN114598681A CN 114598681 A CN114598681 A CN 114598681A CN 202011381499 A CN202011381499 A CN 202011381499A CN 114598681 A CN114598681 A CN 114598681A
Authority
CN
China
Prior art keywords
address
network device
request
address pool
pool
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011381499.7A
Other languages
Chinese (zh)
Inventor
胡家林
周立伟
朱筠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202011381499.7A priority Critical patent/CN114598681A/en
Publication of CN114598681A publication Critical patent/CN114598681A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application discloses a processing method for address allocation, which is used for an address allocation scene. The method in the embodiment of the application comprises the following steps: the first network equipment receives a first address request message sent by the first terminal equipment, wherein the first address request message comprises information of the first terminal equipment, the first network equipment judges whether the first address pool statistic number is equal to the address number in the first address pool or not according to the first address statistic information, the first address pool statistic number is the number of addresses in the first address pool requested by the first network equipment statistic, if yes, the first network equipment sends a first request to the second network equipment according to the first address request information, and the first request is used for requesting the second network equipment to allocate addresses in the second address pool. In the embodiment of the application, the first network device avoids a request failure result caused by continuing to send the address request to the first address pool after the address allocation of the first address pool is completed through the first address statistical information.

Description

Address allocation processing method and equipment
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a processing method and equipment for address allocation.
Background
In a broadband access server (BRAS) scenario, in order to enhance reliability of users and services, a dual-computer cluster system (HA) mechanism is deployed more and more widely, and in a hot standby or multi-computer backup scenario, allocation of BRAS user addresses often causes address conflict due to repeated online and offline of large-size users, and a multi-computer backup address deployment and allocation mode greatly reduces the problem of address conflict of dual computers, and is also the most extensive address allocation scheme of the current BRAS hot standby.
In a multi-machine backup scene, a plurality of pairs of address pools are arranged between hot standby main and standby machines, when a user is online, the address pools with high priority are online, and when the address pools with high priority are exhausted, the address pools with second highest priority are switched to be online. In the on-line process of the user, the user applies for an address from the standby machine, the standby machine acquires the address allocated by the host machine through interaction with the host machine, and the standby machine gives the address to the user.
When the host high-priority address pool has the last address, the standby machine receives the online requests of a plurality of users successively, the standby machine still sends a plurality of address requests to the host, the host can only allocate the last address in the high-priority address pool to the earliest received request, the subsequent address requests cannot be allocated to the addresses, the online failure of the users is caused, and the standby machine is switched to the next high-priority address pool to allocate the subsequent addresses again after receiving the message fed back by the host. Therefore, in the process of switching the address pool, a large number of users fail to be online, and a large number of clients need to dial again, so that the user experience of poor internet access is caused, and the operation and maintenance burden of the system is increased.
Disclosure of Invention
The embodiment of the application provides a processing method for address allocation, wherein a first network device judges whether the counted number of a first address pool is equal to the number of the first address pool or not through first address statistical information, and if the counted number of the first address pool is equal to the number of the first address pool, a first request for requesting allocation of an address in a second address pool is sent to a second network device, so that the result of request failure caused by the fact that the address request is continuously sent to the first address pool after the address allocation of the first address pool is completed is avoided, the internet surfing experience of a user is improved, and the operation and maintenance burden of a system is reduced.
The first aspect of the embodiments of the present application provides a processing method for address allocation.
The first network equipment receives a first address request message sent by the first terminal equipment, wherein the first address request message comprises information of the first terminal equipment, the first network equipment judges whether the first address pool statistic number is equal to the address number in the first address pool or not according to the first address statistic information, the first address pool statistic number is the number of addresses in the first address pool requested by the first network equipment statistic, if yes, the first network equipment sends a first request to the second network equipment according to the first address request information, and the first request is used for requesting the second network equipment to allocate addresses in the second address pool.
In the embodiment of the application, the first network device judges whether the counted number of the first address pool is equal to the number in the first address pool or not through the first address statistical information, and if so, sends a first request for requesting allocation of an address in the second address pool to the second network device, so that a request failure result caused by continuing sending an address request to the first address pool after the address allocation of the first address pool is finished is avoided, the internet surfing experience of a user is improved, and the operation and maintenance burden of a system is reduced.
Based on the method of the first aspect of the embodiment of the present application, in a possible implementation manner, if not, the first network device sends a second request to the second network device according to the first address request information, where the second request is used to request the second network device to allocate an address in the first address pool, the first network device starts a timer, a duration of the timer is a preset threshold, if the timer is overtime, the first network device does not receive a first address allocation message sent by the second network device, the first network device sends a third request to the second network device according to the first address request information, the third request is used to request the second network device to allocate an address in the second address pool, and the first address allocation message includes an address in the first address pool.
In the embodiment of the application, the first network device sends the second request to the second network device and then starts the timer, and if the timer is overtime, the third request is directly sent to the second address pool with the second priority, so that the condition that multiple times of address allocation is unsuccessful due to link oscillation and the like is avoided, the address allocation efficiency is improved, the internet surfing experience of a user is further improved, and the operation and maintenance burden of the system is reduced.
Based on the method of the first aspect of the embodiment of the present application, in a possible implementation manner, a first network device receives a second address request packet sent by a second terminal device, where the second address request packet includes information of the second terminal device, and if a first address pool statistical number in the first address statistical information is smaller than an address number in a first address pool, the first network device sends a fourth request to the second network device, where the fourth request is used to request the second network device to allocate an address in the first address pool.
In the embodiment of the application, when the first address pool statistical number in the first address statistical information is smaller than the address number in the first address pool, the first network device sends a fourth request for requesting an address in the first address pool to the second network device according to the second address request message, so that the flexibility of address allocation is improved.
Based on the method of the first aspect of the embodiment of the present application, in a possible implementation manner, a first network device starts a timer, where a duration of the timer is a preset threshold, and if the first network device receives an assignment rejection message sent by a second network device before the timer expires, the first network device sends a fifth request to the second network device according to first address request information, where the fifth request is used to request the second network device to assign an address in a second address pool, and the assignment rejection message indicates that the second network device cannot assign an address in the first address pool.
In the embodiment of the application, the first network device sends the second request to the second network device and then starts the timer, and if the first network device receives the allocation refusing message before the timer is overtime, the first network device directly sends the fifth request to the second address pool with the suboptimal priority, so that the address allocation efficiency is improved, the internet surfing experience of a user is further improved, and the operation and maintenance burden of the system is reduced.
In a possible implementation manner, based on the method of the first aspect of the embodiment of the present application, after the timer expires or the first network device receives an allocation rejection message sent by the second network device, the method further includes: the first network device updates the first address statistics.
In the embodiment of the application, the first network device updates the first address statistical information, so that the accuracy of the first address statistical information is improved.
In a possible implementation manner of the method according to the first aspect of the embodiment of the present application, the updating, by the first network device, the first address statistics information includes: the first network device reduces the first address pool statistics.
In the embodiment of the application, the first network device updates the first address statistical information by reducing the statistical number of the first address pool, so that the accuracy of the first address statistical information is improved.
Based on the method of the first aspect of the embodiment of the present application, in a possible implementation manner, after the first network device sends the first request to the second network device according to the first address request information, the method further includes: the first network equipment generates second address statistical information, the second address statistical information comprises a second address pool statistical number, and the second address pool statistical number is the number of addresses in the second address pool requested by the first network equipment in a statistical manner.
In the embodiment of the application, the address allocation efficiency is improved by generating the second address statistical information, so that the internet surfing experience of a user is improved, and the operation and maintenance burden of a system is reduced.
In a possible implementation manner, based on the method in the first aspect of the embodiment of the present application, the first network device is a standby device of the second network device, and the first address pool on the first network device and the first address pool on the second network device keep synchronous.
In the embodiment of the application, the first address pool on the first network device and the first address pool on the second network device are kept synchronous, so that the realizability of the scheme is improved.
In a possible implementation manner, based on the method of the first aspect of the embodiment of the present application, the priority of the first address pool is higher than the priority of the second address pool.
In the embodiment of the application, the priority of the first address pool is higher than that of the second address pool, so that the realizability of the scheme is improved.
Based on the method of the first aspect of the embodiment of the present application, in a possible implementation manner, the second request carries gateway information of the first address pool.
In the embodiment of the application, the second request carries the gateway information of the first address pool, so that the realizability of the scheme is improved.
Based on the method of the first aspect of the embodiment of the present application, in a possible implementation manner, the first request carries gateway information of the second address pool.
In the embodiment of the application, the first request carries the gateway information of the first address pool, so that the realizability of the scheme is improved.
A second aspect of the embodiments of the present application provides a network device.
A network device, comprising:
the receiving unit is used for receiving a first address request message sent by first terminal equipment, wherein the first address request message comprises information of the first terminal equipment;
the judging unit is used for judging whether the first address pool statistic number is equal to the number of the addresses in the first address pool or not according to the first address statistic information, wherein the first address pool statistic number is the number of the addresses in the first address pool requested by the first network equipment statistics;
and if so, sending a first request to the second network device according to the first address request information, wherein the first request is used for requesting the second network device to allocate an address in the second address pool.
Based on the network device in the second aspect of the embodiment of the present application, in a possible implementation manner, the sending unit is further configured to send, if not, a second request to the second network device according to the first address request information, where the second request is used to request the second network device to allocate an address in the first address pool;
the network device further includes:
the starting unit is used for starting a timer, and the duration of the timer is a preset threshold;
if the timer is overtime and the receiving unit does not receive the first address assignment message sent by the second network device, the sending unit is further configured to send a third request to the second network device according to the first address request information, where the third request is used to request the second network device to assign an address in the second address pool, and the first address assignment message includes an address in the first address pool.
Based on the network device in the second aspect of the embodiment of the present application, in a possible implementation manner, the receiving unit is further configured to receive a second address request packet sent by the second terminal device, where the second address request packet includes information of the second terminal device;
if the first address pool statistical number in the first address statistical information is smaller than the address number in the first address pool, the sending unit is further configured to send a fourth request to the second network device, where the fourth request is used to request the second network device to allocate an address in the first address pool.
In a possible implementation manner of the network device according to the second aspect of the embodiment of the present application, the network device further includes:
the starting unit is used for starting a timer, and the duration of the timer is a preset threshold;
if the receiving unit receives an assignment refusing message sent by the second network device before the timer is overtime, the sending unit is further configured to send a fifth request to the second network device according to the first address request information, where the fifth request is used to request the second network device to assign an address in the second address pool, and the assignment refusing message indicates that the second network device cannot assign an address in the first address pool.
In a possible implementation manner of the network device according to the second aspect of the embodiment of the present application, the network device further includes:
and the updating unit is used for updating the first address statistical information.
Based on the network device in the second aspect of the embodiment of the present application, in a possible implementation manner, the updating unit is specifically configured to reduce the statistical number of the first address pool.
In a possible implementation manner of the network device according to the second aspect of the embodiment of the present application, the network device further includes:
and the generating unit is used for generating second address statistical information, wherein the second address statistical information comprises a second address pool statistical number, and the second address pool statistical number is the number of addresses in a second address pool requested by the network equipment statistics.
Based on the network device in the second aspect of the embodiment of the present application, in a possible implementation manner, the network device is a standby device of a second network device, and a first address pool on the network device and a first address pool on the second network device keep synchronous.
In a possible implementation manner of the network device according to the second aspect of the embodiment of the present application, the priority of the first address pool is higher than the priority of the second address pool.
Based on the network device in the second aspect of the embodiment of the present application, in a possible implementation manner, the second request carries gateway information of the first address pool.
Based on the network device in the second aspect of the embodiment of the present application, in a possible implementation manner, the first request carries gateway information of the second address pool.
A third aspect of the present application provides a computer storage medium having stored thereon instructions that, when executed on a computer, cause the computer to perform a method as embodied in the first aspect of the present application.
A fourth aspect of the present application provides a computer program product which, when executed on a computer, causes the computer to perform the method as embodied in the first aspect of the present application.
In a fifth aspect of the present application, there is provided a network device, including a processor, coupled to a memory, where at least one program instruction or code is stored, and the at least one program instruction or code is loaded and executed by the processor, so as to enable the network device to implement the address allocation processing method of the first aspect.
According to the technical scheme, the embodiment of the application has the following advantages:
in the embodiment of the application, the first network device judges whether the counted number of the first address pool is equal to the number of the first address pool or not through the first address statistical information, and if so, sends the first request for requesting to allocate the address in the second address pool to the second network device, so that the result of request failure caused by continuing to send the address request to the first address pool after the address allocation of the first address pool is finished is avoided, the internet surfing experience of a user is improved, and the operation and maintenance burden of a system is reduced.
Drawings
Fig. 1 is a diagram of a data transmission network architecture according to an embodiment of the present application;
fig. 2 is another architecture diagram of a data transmission network according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a processing method for address allocation according to an embodiment of the present application;
fig. 4 is another schematic flow chart of a processing method for address allocation according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 7 is another schematic structural diagram of a network device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 9 is another schematic structural diagram of a network device according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a processing method for address allocation, whether the number of times of address requests is equal to the number in a first address pool is judged through first address statistical information, if the number of times of address requests is equal to the number in the first address pool, a second address request for requesting allocation of a second address in a second address pool is sent to second network equipment, in the process, the address requests cannot be continuously sent to the first address pool after the address allocation of the first address pool is finished, the result of request failure caused by the fact is avoided, internet surfing experience of a user is improved, and operation and maintenance burden of a system is reduced.
The technical solutions in the embodiments of the present application will be 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.
Please refer to fig. 1, which is a diagram of a data transmission network architecture according to an embodiment of the present application.
As shown in fig. 1, the data transmission networking architecture includes a routing device 101, a first network device 102, and a second network device 103, where the routing device 101 is connected to the first network device 102 and the second network device 103 respectively, and the routing device 101 is connected to a core network, and is configured to perform data interaction between data of the first network device 102 and the second network device 103 and data of the core network.
Specifically, the data transmission networking architecture may further include a switch 104 and a client terminal device 105, the first network device 102 and the second network device 103 are connected to the interactive machine 104, the switch 104 and the client terminal device 105 are connected to the first network device 102 and the second network device 103, and data transmission is performed between the switch 104 and the client terminal device 105.
The routing device 101 may be a router, a switch, or other devices, and in an actual application process, the routing device 101 may also be other network devices with a routing function, such as a server, and the like, which is not limited herein.
The first network device 102 and the second network device 103 are edge nodes of a core network, and may be, for example, Broadband Network Gateway (BNG) devices, or other edge node devices having a gateway control function, which is not limited herein.
The first network device 102 and the second network device 103 are hot standby hosts, and the host and the standby roles are elected through a Virtual Router Redundancy Protocol (VRRP). The hot-standby relationship is deployed between the first network device 102 and the second network device 103, and a hot-standby address pool is created. As shown in fig. 2, a routing device 101 is connected to a first network device 102 and a second network device 103, where the first network device 102 includes address pools a0, B0, C0, etc., and the second network device 103 includes address pools a1, B1, C1, etc., where a0 and a1 are corresponding hot-standby groups, B0 and B1 are another corresponding hot-standby group, and have different priorities, and each hot-standby group deploys 1 gateway, and the gateways of different hot-standby groups are different. In this embodiment of the present application, no limitation is made on the number of groups of the hot standby group, and in an actual application process, more hot standby groups may be set before the first network device 102 and the second network device 103, which is not specifically limited herein.
In the process of getting online by the client terminal device 105, the client terminal device 105 preferentially gets online from the high-priority address pool, and when the high-priority address pool is exhausted, the client terminal device 105 switches to the next high-priority address pool to get online. For example, a0 and a1 are address pools of the same hot-standby group, and when the address pools of a0 and a1 are consumed, the client terminal device 105 switches to B0 and B1 with the second highest priority to go online.
The data transmission networking architecture in the embodiment of the present application is described above, and the data processing method in the embodiment of the present application is described below with reference to the data transmission networking architecture. Please refer to fig. 3, which is a flowchart illustrating a data processing method according to an embodiment of the present disclosure.
In this embodiment, a description will be given by taking a client terminal device as a first terminal device and a second terminal device as an example.
In step 301, a first terminal device sends a first address request packet to a first network device.
When a first terminal device needs to access a first network device to be on-line, the first terminal device sends a first address request message to the first network device, wherein the first address request message comprises information of the first terminal device.
Specifically, the first terminal device initiates dialing, and generates a first address request message, where the first address request message may carry a physical address of the first terminal device, vlan information of a virtual local area network, and other options, for example, the first address request message further includes basic information such as a memory size of the first terminal device and a central processing unit, and the information of the first terminal device carried in the first address request message is not limited here. It should be noted that, in the embodiment of the present application, no specific limitation is made on the format of the first address request message.
In step 302, the first network device determines whether the first address pool statistic number is equal to the number of addresses in the first address pool according to the first address pool statistic information.
After the first network device receives the first address request message, the first network device judges whether the first address pool statistical number is equal to the number of the addresses in the first address pool or not according to the first address statistical information, wherein the first address pool statistical number is the number of the addresses in the first address pool requested by the first network device in a statistical manner.
It should be noted that, because the first network device and the second network device are hot standby host and standby machine for each other, the first network device has a standby address pool, and the number of addresses in the standby address pool is synchronous with the number of addresses in the master address pool in the second network device, so that the first network device can accurately obtain the number of addresses in the corresponding address pool in the second network device, that is, the first network device can obtain the number of addresses in the first address pool in the second network device.
In this embodiment of the present application, the first address statistical information is generated by the first network device. Specifically, when the first network device receives the first address request packet, the first network device preferably selects the address pool with high priority to request the address according to the priority of the address pool. After generating a request message, the first network device sends the request message to the second network device, wherein the request message carries gateway information of the address pool with high priority. For example, when a first network device receives a first address request message sent by a first terminal device, if the first address request message is a first address request message received by the first network device, the first network device sends an address request of a first address pool to a second network device according to information of the first terminal device in the first address request message, where the first address pool is a highest-priority address pool in the second network device. After sending the address request of the first address pool, the first network device generates first address statistical information, wherein the first address pool statistical number in the first address statistical information is 1, which indicates that the first network device requests 1 address of the first address pool from the second network device.
In a possible implementation manner, the first address statistics information includes a first address pool statistics number and a number statistics number of allocated first address pools. When the first network device requests the second network device for addresses of 1 address pool, the first network device adds 1 to the first address pool statistics number, and when the second network device allocates an address in the first address pool to the first network device, the first network device adds 1 to the first address pool allocated statistics number. And when the number of the allocated first address pools reaches the upper limit of the number of the addresses of the first address pools, and the first network equipment receives the address requests again, the address requests of the address pools are sent to the address pools with the second priority. For example, when the first network device receives an address request message sent by an 11 th terminal device, and the upper limit of the number of addresses in the first address pool is 10, and at this time, the number statistic of the allocated first address pools in the first address statistic information is also 10, it indicates that the number statistic of the allocated first address pools reaches the upper limit of the number of addresses in the first address pool, and then the first network device sends an address request of a second address pool to the second network device, where the priority of the second address pool is lower than that of the first address pool.
Or, when the statistical number of the first address pool in the first network device reaches the upper limit of the number of addresses of the first address pool, the first network device may also send the address request of the address pool to the address pool of the next lower priority when receiving a new address request. For example, the upper limit of the number of addresses in the first address pool is 10, at this time, the number of allocated first address pools in the first address statistics information is statistically 9, and the statistical number of first address pools is 10, that is, it indicates that the first network device has sent an address request of the 10 th first address pool to the second network device, but the first network device has not received an address allocation message of the first address pool sent by the second network device. At this time, if the first network device receives the address request of the first address pool sent by the 11 th terminal device, the first network device sends the address request of the second address pool to the second network device according to the fact that the statistical number of the first address pool has reached the upper limit of the address number of the first address pool, and therefore the situation that address allocation is unsuccessful due to the fact that the first address pool does not have allocable addresses can be avoided, internet surfing experience of a user is improved, and operation and maintenance burden of a system is reduced.
In this embodiment of the application, the first address statistical information may also only include the first address pool statistical number, that is, the first network device determines whether the first address pool is equal to the first address pool only by the first address pool statistical number, so as to determine whether to send an address request to the first address pool or send an address request to the second address pool subsequently. The embodiment of the present application does not specifically limit the information included in the first address statistical information.
In a possible implementation manner, when the first address request packet is not the first address request packet received by the first network device, the first network device obtains the first address statistical information, and determines whether the number of the first address is equal to the number of the addresses in the first address pool according to the statistical number of the first address pool in the first address statistical information.
In step 303, if the counted number of address pools is equal to the number of addresses in the first address pool, the first network device sends a first request to the second network device.
When the first network device determines that the statistical number of the address pool is equal to the number of the addresses in the first address pool according to the first address statistical information, it indicates that the addresses of the first address pool are in a saturated state at this time, that is, there is no allocatable address in the first address pool, and at this time, it is necessary to switch to the address pool of the second priority for address request. Therefore, when the first network device determines that the statistical number of the address pools is equal to the number of addresses in the first address pool, the first network device generates a first request, and the first request carries gateway information of the second address pool, and sends the first request to the second network device.
After sending the first request to the second network device, the first network device generates second address statistical information, where a format of the second address statistical information is similar to a format of the first address statistical information, and details are not described here again.
In an actual application process, the first request may be carried in a message sent by the first network device to the second network device, and a specific format of the message is not limited here.
In step 304, the first network device starts a timer.
After the first network device sends the first request to the second network device, the first network device starts a timer, and the duration of the timer is a preset threshold, which may be adjusted according to an actual situation, and is not limited herein.
Specifically, after the first network device starts the timer, the first network device stores the information of the first terminal device in the first address request message.
In a possible implementation manner, if the timer is overtime, and the first network device has not received the address assignment message of the second address pool sent by the second network device, the first network device updates the second address statistical information, specifically, the statistical number of the second address pool in the second address statistical information may be reduced by 1, and the information of the first terminal device is obtained, an address request for requesting the third address pool is generated according to the information of the first terminal device, the address request for requesting the third address pool is sent to the second network device, the priority of the third address pool is lower than that of the second address pool, and the address request for requesting the third address pool carries gateway information of the third address pool.
In a possible implementation manner, if before the timer times out, when the first network device receives a message sent by the second network device and rejecting assignment of an address of the second address pool, the first network device updates second address statistical information, specifically, the statistical number of the second address pool in the second address statistical information is reduced by 1, the information of the first terminal device is obtained, an address request for requesting a third address pool is generated according to the information of the first terminal device, the address request for requesting the third address pool is sent to the second network device, the priority of the third address pool is lower than that of the second address pool, and the address request for requesting the third address pool carries gateway information of the third address pool. The message for denying assignment of the address of the second address pool may be a response message carrying a NAK sent by the second network device, or may also be a message carrying no address available, and the format of the message for denying assignment of the address of the second address pool is not limited here.
In a possible implementation manner, if the first network device receives an address assignment message of the second address pool sent by the second network device before the timer expires, the first network device deletes the information of the first terminal device. And if the second address statistical information contains the number statistics of the allocated second address pools, the first network equipment updates the second address statistical information, namely the first network equipment adds 1 to the number of the allocated second address pools. The address assignment message of the second address pool may be a response message carrying an ACK sent by the second network device, or may also be a message carrying an assigned address, and a format of the address assignment message of the second address pool is not limited herein.
In this embodiment, step 304 is an optional step, and when the first network device does not start the timer, the first network device may wait until receiving a message that the second network device sends an address assignment message of the second address pool or refuses to assign an address of the second address pool. Or when the first network device does not start the timer, the first network device continues to repeatedly send the first request to the second network device after a certain time interval.
In the embodiment of the application, the first network device judges whether the counted number of the first address pool is equal to the number in the first address pool or not through the first address statistical information, and if so, sends a first request for requesting allocation of an address in the second address pool to the second network device, so that a request failure result caused by continuing sending an address request to the first address pool after the address allocation of the first address pool is finished is avoided, the internet surfing experience of a user is improved, and the operation and maintenance burden of a system is reduced.
Please refer to fig. 4, which is a schematic flow chart illustrating a processing method for address allocation according to an embodiment of the present application.
In step 401, a first network device receives a first address request packet sent by a first terminal device.
In step 402, the first network device determines whether the address pool statistic number is equal to the address number in the first address pool according to the first address statistic information.
In this embodiment, step 401 and step 402 are similar to the method executed in step 301 and step 302 in the embodiment shown in fig. 3, and detailed description thereof is omitted here.
In step 403, if the counted number of address pools is smaller than the number of addresses in the first address pool, the first network device sends a second request to the second network device.
When the first network device determines that the statistical number of the address pool is smaller than the address number in the first address pool according to the first address statistical information, the first network device indicates that the first address pool still has allocable addresses at the moment, and the first address pool with high priority is preferred to send the address request at the moment. Therefore, when the first network device determines that the statistical number of the address pools is smaller than the number of the addresses in the first address pool, the first network device generates a second request, and the second request carries the gateway information of the first address pool and sends the second request to the second network device.
In an actual application process, the second request may be carried in a message sent by the first network device to the second network device, and a specific format of the message is not limited here.
In step 404, the first network device starts a timer.
After the first network device sends the second request to the second network device, the first network device starts a timer, and the duration of the timer is a preset threshold, which may be adjusted according to an actual situation, and is not limited herein.
Specifically, after the first network device starts the timer, the first network device stores the information of the first terminal device in the first address request message.
In a possible implementation manner, if the timer is overtime, the first network device does not receive the first address assignment message sent by the second network device, where the first address assignment message includes an address in the first address pool, and the first network device updates the first address statistics information, specifically, the first address statistics information in the first address statistics information may be subtracted by 1, the information of the first terminal device is obtained, a third request is generated according to the information of the first terminal device, and the third request is used to request the second network device to assign an address in the second address pool, and the third request is sent to the second network device. The priority of the second address pool is lower than that of the first address pool, and the third request carries gateway information of the second address pool.
In a possible implementation manner, if before the timer times out, when the first network device receives an assignment rejection message sent by the second network device, where the assignment rejection message indicates that the second network device cannot assign an address in the first address pool, the first network device updates the first address statistics information, specifically, the first address statistics information is decremented by 1, the information of the first terminal device is obtained, a fifth request is generated according to the information of the first terminal device, the fifth request is used to request the second network device to assign an address in the second address pool, and the fifth request is sent to the second network device, where the priority of the second address pool is lower than that of the first address pool, and the fifth request carries gateway information of the second address pool. The allocation denying message may be a response message carrying a NAK sent by the second network device, or may also be a message carrying no address assignable class, and the format of the allocation denying message is not limited here.
In a possible implementation manner, if the first network device receives the first address assignment message sent by the second network device before the timer expires, the first network device deletes the information of the first terminal device. And if the first address statistical information contains the number statistical information of the allocated first address pools, the first network equipment updates the first address statistical information, namely the first network equipment adds 1 to the number of the allocated first address pools. The first address assignment message may be a response message carrying an ACK and sent by the second network device, or may also be a message carrying an assignment address, and a format of the first address assignment message is not limited here.
In step 405, the first network device receives a second address request packet sent by the second terminal device.
After the first network device sends the third request or the fifth request to the second network device, the first network device receives a second address request message sent by the second terminal device, where the second address request message includes information of the second terminal device.
Specifically, the second terminal device initiates dialing, and generates a second address request packet, where the second address request packet may carry a physical address of the second terminal device, vlan information of a virtual local area network, and other options, for example, the second address request packet further includes basic information such as a memory size of the second terminal device and a central processing unit, and the information of the second terminal device carried in the second address request packet is not limited here. It should be noted that, in the embodiment of the present application, a format of the second address request packet is not specifically limited.
In step 406, the first network device sends a fourth request to the second network device according to the second address request message.
After the first network device receives the second address request message, the first network device determines that the first address pool statistical number is smaller than the address number in the first address pool according to the first address pool statistical information, and then the first network device sends a fourth request to the second network device according to the information of the second terminal device in the second address request message, wherein the fourth request is used for requesting the second network device to allocate the address in the first address pool.
Specifically, after receiving the second address request message, the first network device first obtains the first address pool statistical information, and checks whether the first address pool statistical number in the first address pool statistical information has reached the upper limit of the number of addresses in the first address pool, and if not, that is, the first address pool statistical number is smaller than the number of addresses in the first address pool, even if the first network device has previously sent a third request or a fifth request for requesting an address in the second address pool to the second network device, the first network device still selects the first address pool with high priority to send an address request. Therefore, the first network device generates a fourth request according to the information of the second terminal device, and sends the fourth request to the second network device.
It should be noted that, after the first network device sends the fourth request, the first network device may also start a timer, and when the timer times out and does not receive the message for assigning the address or receives the message for rejecting assigning the address, the first network device may send the address request to the address pool with the next lower priority according to the information of the second terminal device.
In this embodiment, step 404 is an optional step, and when the first network device does not start the timer, the first network device may wait until receiving a message that the second network device sends an address assignment message of the first address pool or refuses to assign an address of the first address pool. Or, when the first network device does not start the timer, the first network device continues to repeatedly send the second request to the second network device after a certain time interval.
In this embodiment, steps 405 and 406 are optional steps, that is, when the second terminal device does not send the second address request, steps 405 and 406 are not executed.
In the embodiment of the application, the first network device sends the second request to the second network device and then starts the timer, and if the timer is overtime, the third request is directly sent to the second address pool with the second priority, so that the condition that multiple times of address allocation is unsuccessful due to link oscillation and the like is avoided, the address allocation efficiency is improved, the internet surfing experience of a user is further improved, and the operation and maintenance burden of the system is reduced.
The above describes the processing method for address allocation in the embodiment of the present application, and the following describes the network device in the embodiment of the present application, please refer to fig. 5, which is a schematic structural diagram of the network device provided in the present application.
A network device, comprising:
a receiving unit 501, configured to receive a first address request message sent by a first terminal device, where the first address request message includes information of the first terminal device;
a determining unit 502, configured to determine, according to the first address statistics information, whether the first address pool statistics number is equal to the number of addresses in the first address pool, where the first address pool statistics number is the number of addresses in the first address pool requested by the first network device statistics;
a sending unit 503, configured to send, if yes, a first request to the second network device according to the first address request information, where the first request is used to request the second network device to allocate an address in the second address pool.
In this embodiment, operations performed by each unit of the network device are similar to the steps performed by the first network device in the embodiment shown in fig. 3 or fig. 4, and details thereof are not repeated here.
Please refer to fig. 6, which is a schematic structural diagram of a network device according to the present application.
A network device, comprising:
a receiving unit 601, configured to receive a first address request packet sent by a first terminal device, where the first address request packet includes information of the first terminal device;
a determining unit 602, configured to determine, according to the first address statistics information, whether the first address pool statistics number is equal to the number of addresses in the first address pool, where the first address pool statistics number is the number of addresses in the first address pool requested by the first network device statistics;
a sending unit 603, configured to send, if yes, a first request to the second network device according to the first address request information, where the first request is used to request the second network device to allocate an address in the second address pool.
Optionally, the sending unit 63 is further configured to send, if not, a second request to the second network device according to the first address request information, where the second request is used to request the second network device to allocate an address in the first address pool;
the network device further includes:
a starting unit 604, configured to start a timer, where a duration of the timer is a preset threshold;
if the timer is out of time and the receiving unit 601 does not receive the first address assignment message sent by the second network device, the sending unit 603 is further configured to send a third request to the second network device according to the first address request information, where the third request is used to request the second network device to assign an address in the second address pool, and the first address assignment message includes an address in the first address pool.
Optionally, the receiving unit 601 is further configured to receive a second address request packet sent by the second terminal device, where the second address request packet includes information of the second terminal device;
if the first address pool statistical number in the first address statistical information is smaller than the address number in the first address pool, the sending unit 603 is further configured to send a fourth request to the second network device, where the fourth request is used to request the second network device to allocate an address in the first address pool.
Optionally, the network device further includes:
a starting unit 604, configured to start a timer, where a duration of the timer is a preset threshold;
if the receiving unit 601 receives an assignment refusing message sent by the second network device before the timer expires, the sending unit 603 is further configured to send a fifth request to the second network device according to the first address request information, where the fifth request is used to request the second network device to assign an address in the second address pool, and the assignment refusing message indicates that the second network device cannot assign an address in the first address pool.
Optionally, the network device further includes:
the updating unit 605 is configured to update the first address statistics.
Optionally, the updating unit 605 is specifically configured to reduce the first address pool statistic.
Optionally, the network device further includes:
a generating unit 606, configured to generate second address statistics information, where the second address statistics information includes a second address pool statistics number, and the second address pool statistics number is a number of addresses in a second address pool requested by the network device statistics.
Optionally, the network device is a standby device of the second network device, and the first address pool on the network device and the first address pool on the second network device are kept synchronized.
Optionally, the priority of the first address pool is higher than the priority of the second address pool.
Optionally, the second request carries gateway information of the first address pool.
Optionally, the first request carries gateway information of the second address pool.
In this embodiment, operations performed by each unit of the network device are similar to the steps performed by the first network device in the embodiment shown in fig. 3 or fig. 4, and details thereof are not repeated here.
Referring to fig. 7, fig. 7 shows a schematic structural diagram of a network device 700 according to another exemplary embodiment of the present application. The network device 700 shown in fig. 7 is configured to perform all or part of the operations involved in the address assignment processing methods shown in fig. 3 and 4. The network device 700 is, for example, a switch, a router, etc., and the network device 700 may be implemented by a generic bus architecture.
As shown in fig. 7, the network device 700 includes: a main control board 710 and an interface board 730.
The main control board is also called a Main Processing Unit (MPU) or a route processor card (route processor card), and the main control board 710 is used for controlling and managing each component in the network device 700, including routing computation, device management, device maintenance, and protocol processing functions. The main control board 710 includes: a central processor 711 and a memory 712.
The interface board 730 is also referred to as a Line Processing Unit (LPU), a line card (line card), or a service board. The interface board 730 is used for providing various service interfaces and forwarding packets. The service interfaces include, but are not limited to, Ethernet interfaces, such as Flexible Ethernet services interfaces (FlexE Ethernet Clients), POS (Packet over SONET/SDH) interfaces, and the like. The interface board 730 includes: central processor 731 network processor 732, forwarding table entry storage 734, and Physical Interface Card (PIC) 733.
The central processor 731 on the interface board 730 is used for controlling and managing the interface board 730 and communicating with the central processor 711 on the main control board 710.
The network processor 732 is configured to implement a sending process of the message. The network processor 732 may take the form of a forwarding chip. The forwarding chip may be a Network Processor (NP). In some embodiments, the forwarding chip may be implemented by an application-specific integrated circuit (ASIC) or a Field Programmable Gate Array (FPGA). Specifically, the network processor 732 is configured to forward the received message based on the forwarding table stored in the forwarding table entry storage 734, and if the destination address of the message is the address of the network device 700, send the message to a CPU (e.g., the central processing unit 731) for processing; if the destination address of the message is not the address of the network device 700, the next hop and the outgoing interface corresponding to the destination address are found from the forwarding table according to the destination address, and the message is forwarded to the outgoing interface corresponding to the destination address. Wherein, the processing of the uplink message may include: processing a message input interface and searching a forwarding table; the processing of the downlink message may include: forwarding table lookups, and the like. In some embodiments, the central processing unit may also perform the functions of a forwarding chip, such as implementing software forwarding based on a general purpose CPU, so that no forwarding chip is needed in the interface board.
The physical interface card 733 is used to implement the interfacing function of the physical layer, from which the original traffic enters the interface board 730, and the processed messages are sent out from the physical interface card 733. The physical interface card 733, also called a daughter card, may be installed on the interface board 730 and is responsible for converting the optical signal into a message, performing validity check on the message, and forwarding the message to the network processor 732 for processing. In some embodiments, central processor 731 may also perform the functions of network processor 732, such as implementing software forwarding based on a general purpose CPU, so that network processor 732 is not required in physical interface card 733.
Optionally, the network device 700 includes a plurality of interface boards, for example, the network device 700 further includes an interface board 740, and the interface board 740 includes: central processor 741, network processor 742, forwarding table entry store 744, and physical interface card 743. The functions and implementations of the components of the interface board 740 are the same as or similar to those of the interface board 730, and are not described in detail herein.
Optionally, the network device 700 further comprises a switch screen 720. The switch board 720 may also be called a Switch Fabric Unit (SFU). In the case of a network device having a plurality of interface boards, the switch board 720 is used to complete data exchange between the interface boards. For example, interface board 730 and interface board 740 can communicate with each other through switch board 720.
The main control board 710 is coupled to the interface board. For example. The main control board 710, the interface board 730, the interface board 740, and the switch board 720 are connected to the system backplane through a system bus to implement intercommunication. In a possible implementation manner, an inter-process communication (IPC) channel is established between the main control board 710 and the interface board 730 and the interface board 740, and the main control board 710, the interface board 730 and the interface board 740 communicate with each other through the IPC channel.
Logically, network device 700 includes a control plane including a main control board 710 and a central processor 711, and a forwarding plane including various components that perform forwarding, such as a forwarding entry memory 734, a physical interface card 733, and a network processor 732. The control plane performs functions such as a router, generating a forwarding table, processing signaling and protocol messages, and configuring and maintaining the state of the network device, and issues the generated forwarding table to the forwarding plane, and in the forwarding plane, the network processor 732 performs table lookup and forwarding on the message received by the physical interface card 733 based on the forwarding table issued by the control plane. The forwarding table issued by the control plane may be stored in a forwarding table entry storage 734. In some embodiments, the control plane and the forwarding plane may be completely separate and not on the same network device.
It should be noted that there may be one or more main control boards, and when there are more main control boards, the main control boards may include a main control board and a standby main control board. The interface board may have one or more blocks, and the stronger the data processing capability of the network device, the more interface boards are provided. There may also be one or more physical interface cards on an interface board. The exchange network board may not have one or more blocks, and when there are more blocks, the load sharing redundancy backup can be realized together. Under the centralized forwarding architecture, the network device does not need a switching network board, and the interface board undertakes the processing function of the service data of the whole system. Under the distributed forwarding architecture, the network device can have at least one switching network board, and the data exchange among a plurality of interface boards is realized through the switching network board, so that the high-capacity data exchange and processing capacity is provided. Therefore, the data access and processing capabilities of the network devices in the distributed architecture are greater than those of the network devices in the centralized architecture. Optionally, the network device may also be in a form of only one board card, that is, there is no switching network board, and the functions of the interface board and the main control board are integrated on the one board card, and at this time, the central processing unit on the interface board and the central processing unit on the main control board may be combined into one central processing unit on the one board card to perform a function of superimposing the two, where the data switching and processing capability of the network device is low (for example, network devices such as a low-end switch or a router). Which architecture is specifically adopted depends on a specific networking deployment scenario, and is not limited herein.
In a particular embodiment, the network device 700 corresponds to any of the implementations shown in fig. 5-6 described above as applied to a network device. In some embodiments, receiving unit 501 and sending unit 503 in the network devices shown in fig. 5-6 correspond to physical interface card 733 in network device 700. The determination unit 502, the activation unit 604, the update unit 605, and the generation unit 606 of the network device shown in fig. 5 to 6 correspond to at least one of the central processor 711, the network processor 732, and the network processor 742 in the network device 700.
The specific hardware structure of the network device in the above embodiment is the network device 800 shown in fig. 8, which includes a transceiver 801, a processor 802, and a memory 803. The transceiver 801, the processor 802 and the memory 803 are connected by a bus 804. The transceiver 801 is configured to receive and transmit a message, the memory 803 is configured to store instructions or program codes, and the processor 802 is configured to call the instructions or program codes in the memory 803 to enable the network device to perform the relevant processing steps of the network device in the above method embodiments. In a specific embodiment, the network device 800 of the present application may correspond to the network device in the above-described method embodiments, and the processor 802 in the network device 800 reads instructions or program codes in the memory 803, so that the network device 800 shown in fig. 9 can perform all or part of the operations performed by the network device.
In a specific embodiment, the network device 800 of the present application may correspond to the network device in the above-described method embodiments, and the processor 802 in the network device 800 reads instructions or program codes in the memory 803, so that the network device 800 shown in fig. 9 can perform all or part of the operations performed by the network device.
The network device 800 may also correspond to any one of the network devices shown in fig. 5 to 6, and for example, the receiving unit 501 and the transmitting unit 503 in fig. 5 to 6 correspond to the transceiver 801, and the determining unit 502, the activating unit 604, the updating unit 605, and the generating unit 606 correspond to the processor 802.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a network device 900 according to an exemplary embodiment of the present application. The network device 900 shown in fig. 9 is configured to perform the operations involved in the address assignment processing methods shown in fig. 3 and 4. The network device 900 is, for example, a switch, a router, etc.
As shown in fig. 9, network device 900 includes at least one processor 901, memory 903, and at least one communication interface 904.
The processor 901 is, for example, a Central Processing Unit (CPU), a Digital Signal Processor (DSP), a Network Processor (NP), a Graphics Processing Unit (GPU), a neural-Network Processing Unit (NPU), a Data Processing Unit (DPU), a microprocessor, or one or more integrated circuits for implementing the present disclosure. For example, the processor 901 may include an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. PLDs are, for example, Complex Programmable Logic Devices (CPLDs), field-programmable gate arrays (FPGAs), General Array Logic (GAL), or any combination thereof. Which may implement or execute the various logical blocks, modules, and circuits described in connection with the disclosure of embodiments of the invention. The processor may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and microprocessors, among others.
Optionally, network device 900 also includes a bus. The bus is used to transfer information between the components of network device 900. The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 9, but this does not indicate only one bus or one type of bus. In fig. 9, components of the network device 900 may be connected by using a bus, and may also be connected by using other methods, and the connection method of the components is not limited in the embodiment of the present invention.
The Memory 903 is, for example, a read-only Memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only Memory (EEPROM), a compact disk read-only Memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these. The memory 903 is, for example, independent and connected to the processor 901 via a bus. The memory 903 may also be integrated with the processor 901.
Communication interface 904 may use any transceiver or the like for communicating with other devices or a communication network, such as an ethernet, a Radio Access Network (RAN), or a Wireless Local Area Network (WLAN). Communication interface 904 may include a wired communication interface and may also include a wireless communication interface. Specifically, the communication interface 904 may be an Ethernet (Ethernet) interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a Wireless Local Area Network (WLAN) interface, a cellular network communication interface, or a combination thereof. The ethernet interface may be an optical interface, an electrical interface, or a combination thereof. In an embodiment of the present application, communication interface 904 may be used for network device 900 to communicate with other devices.
In particular implementations, processor 901 may include one or more CPUs such as CPU0 and CPU1 shown in fig. 9 as an example. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In particular implementations, network device 900 may include multiple processors, such as processor 901 and processor 905 shown in fig. 9, for one embodiment. Each of these processors may be a single-Core Processor (CPU) or a multi-Core Processor (CPU). A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In particular implementations, network device 900 may also include an output device and an input device, as one embodiment. An output device, which is in communication with the processor 901, may display information in a variety of ways. For example, the output device may be a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display device, a Cathode Ray Tube (CRT) display device, a projector (projector), or the like. The input device, which is in communication with the processor 901, may receive user input in a variety of ways. For example, the input device may be a mouse, a keyboard, a touch screen device, or a sensing device, among others.
In some embodiments, the memory 903 is used to store program code 910 for implementing aspects of the present application, and the processor 901 may execute the program code 910 stored in the memory 903. That is, the network device 900 may implement the message processing method provided in the method embodiment through the processor 901 and the program code 910 in the memory 903. One or more software modules may be included in program code 910. Alternatively, the processor 901 itself may also store program codes or instructions for executing the scheme of the present application.
In a specific embodiment, the network device 900 of the present embodiment may correspond to the network device in the above-described method embodiments, and the processor 901 in the network device 900 reads the program code 910 in the memory 903 or the program code or the instructions stored by the processor 901 itself, so that the network device 900 shown in fig. 9 can perform all or part of the operations performed by the network device.
The network device 900 may also correspond to the apparatuses shown in fig. 5-6 described above, and each functional module in the apparatuses shown in fig. 5-6 is implemented by software of the network device 900. In other words, the apparatus shown in fig. 5-6 includes functional modules that are generated by the processor 901 of the network device 900 after reading the program code 910 stored in the memory 903. For example, receiving section 501 and transmitting section 503 in fig. 5 to 6 correspond to communication interface 904, and determining section 502, activating section 604, updating section 605, and generating section 606 correspond to processor 901 and/or processor 905.
The steps of the processing method for address assignment shown in fig. 3 and 4 are performed by integrated logic circuits of hardware or instructions in the form of software in the processor of the network device 900. The steps of a method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in a processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and performs the steps of the above method in combination with hardware thereof, which are not described in detail herein to avoid repetition.
It should be understood that the processor mentioned in the network device in the above embodiments of the present application, or provided in the above embodiments of the present application, may be a Central Processing Unit (CPU), or may also be other general purpose processors, Digital Signal Processors (DSPs), application-specific integrated circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and so on. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It should also be understood that the number of processors in the network device in the above embodiments in the present application may be one or multiple, and may be adjusted according to the actual application scenario, and this is merely an exemplary illustration and is not limited. The number of the memories in the embodiment of the present application may be one or multiple, and may be adjusted according to an actual application scenario, and this is merely an exemplary illustration and is not limited.
It should be further noted that, when the network device includes a processor (or a processing unit) and a memory, the processor in this application may be integrated with the memory, or the processor and the memory are connected through an interface, and may be adjusted according to an actual application scenario, and is not limited.
The present application provides a chip system comprising a processor for supporting a network device to implement the functionality of the controller involved in the above method, e.g. to process data and/or information involved in the above method. In one possible design, the system-on-chip further includes a memory, the memory being used to hold the necessary program instructions and data. The chip system may be formed by a chip, or may include a chip and other discrete devices.
In another possible design, when the chip system is a chip in a user equipment or an access network, the chip includes: a processing unit, which may be, for example, a processor, and a communication unit, which may be, for example, an input/output interface, a pin or a circuit, etc. The processing unit may execute computer-executable instructions stored by the storage unit to cause a chip within the network device or the like to perform the steps performed by the first network device in any of the embodiments of fig. 3 or fig. 4 described above. Alternatively, the storage unit may be a storage unit in a chip, such as a register, a cache, and the like, and the storage unit may also be a storage unit located outside the chip in a network device and the like, such as a read-only memory (ROM) or another type of static storage device that can store static information and instructions, a Random Access Memory (RAM), and the like.
The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a computer, implements the method flows executed by the controller of the network device in any of the above method embodiments. Correspondingly, the computer can be the network equipment.
It should be understood that the controller or processor mentioned in the above embodiments of the present application may be a Central Processing Unit (CPU), and may also be one or a combination of various other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It should also be understood that the number of the processors or controllers in the network device or the chip system in the above embodiments in the present application may be one or more, and may be adjusted according to the actual application scenario, and this is merely an exemplary illustration and is not limited. The number of the memories in the embodiment of the present application may be one or multiple, and may be adjusted according to an actual application scenario, and this is merely an exemplary illustration and is not limited.
It should also be understood that the memory or the readable storage medium and the like mentioned in the network device and the like in the above embodiments in the present application may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), double data rate SDRAM, enhanced SDRAM, SLDRAM, Synchronous Link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
Those of ordinary skill in the art will appreciate that the steps performed by the network device or the processor to implement all or part of the above embodiments may be performed by hardware or a program to instruct associated hardware. The program may be stored in a computer readable storage medium, which may be read only memory, random access memory, etc. Specifically, for example: the processing unit or processor may be a central processing unit, a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
When implemented in software, the method steps described in the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the present application are all or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The available media may be magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., DVDs), or semiconductor media, among others.
The terms "first," "second," and the like in the description and in the claims of the present application and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances and are merely descriptive of the various embodiments of the application and how objects of the same nature can be distinguished. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of elements is not necessarily limited to those elements, but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the embodiments of the present application, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that in the description of the present application, unless otherwise indicated, "/" indicates a relationship where the objects associated before and after are an "or", e.g., a/B may indicate a or B; in the present application, "and/or" is only an association relationship describing an association object, and means that there may be three relationships, for example, a and/or B, and may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural.
The word "if" or "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and these modifications or substitutions do not depart from the scope of the technical solutions of the embodiments of the present application.

Claims (24)

1. A method for processing address allocation, comprising:
a first network device receives a first address request message sent by a first terminal device, wherein the first address request message comprises information of the first terminal device;
the first network equipment judges whether the first address pool statistic number is equal to the number of addresses in a first address pool or not according to first address statistic information, wherein the first address pool statistic number is the number of addresses in a first address pool requested by the first network equipment in a statistic manner;
if so, the first network device sends a first request to the second network device according to the first address request information, wherein the first request is used for requesting the second network device to allocate an address in a second address pool.
2. The method of claim 1, further comprising:
if not, the first network device sends a second request to the second network device according to the first address request information, wherein the second request is used for requesting the second network device to allocate an address in a first address pool;
the first network equipment starts a timer, and the duration of the timer is a preset threshold value;
if the timer is overtime, the first network device does not receive a first address allocation message sent by the second network device, and the first network device sends a third request to the second network device according to the first address request information, where the third request is used to request the second network device to allocate an address in the second address pool, and the first address allocation message includes an address in the first address pool.
3. The method of claim 2, wherein after the first network device sends a third request to the second network device according to the first address request information, the method further comprises:
the first network equipment receives a second address request message sent by second terminal equipment, wherein the second address request message comprises information of the second terminal equipment;
if the first address pool statistical number in the first address statistical information is smaller than the address number in the first address pool, the first network device sends a fourth request to the second network device, where the fourth request is used to request the second network device to allocate an address in the first address pool.
4. The method of claim 2, wherein after the first network device sends a second request to a second network device according to the first address request information, the method further comprises:
the first network equipment starts a timer, and the duration of the timer is a preset threshold value;
if the first network device receives an assignment refusing message sent by the second network device before the timer is overtime, the first network device sends a fifth request to the second network device according to the first address request information, the fifth request is used for requesting the second network device to assign the address in the second address pool, and the assignment refusing message indicates that the second network device cannot assign the address in the first address pool.
5. The method according to any of claims 2 to 4, wherein after the timer expires or the first network device receives an assignment reject message sent by the second network device, the method further comprises:
and the first network equipment updates the first address statistical information.
6. The method of claim 5, wherein the first network device updating the first address statistics comprises:
the first network device reduces the first address pool statistics.
7. The method according to any of claims 1 to 5, wherein after the first network device sends a first request to the second network device according to the first address request information, the method further comprises:
the first network equipment generates second address statistical information, wherein the second address statistical information comprises a second address pool statistical number, and the second address pool statistical number is the number of addresses in a second address pool requested by the first network equipment in a statistical manner.
8. The method of any of claims 1 to 7, wherein the first network device is a standby of the second network device, and wherein the first address pool on the first network device and the first address pool on the second network device are synchronized.
9. The method of any of claims 1-8, wherein the first address pool has a higher priority than the second address pool.
10. The method according to any of claims 2 to 9, wherein the second request carries gateway information of the first address pool.
11. The method according to any of claims 1 to 10, wherein the first request carries gateway information for the second address pool.
12. A network device, comprising:
a receiving unit, configured to receive a first address request packet sent by a first terminal device, where the first address request packet includes information of the first terminal device;
a judging unit, configured to judge whether a first address pool statistic number is equal to a number of addresses in a first address pool according to first address statistic information, where the first address pool statistic number is a number of addresses in a first address pool requested by the first network device for statistics;
and if so, sending a first request to the second network device according to the first address request information, where the first request is used to request the second network device to allocate an address in a second address pool.
13. The network device according to claim 12, wherein the sending unit is further configured to send, if not, a second request to the second network device according to the first address request information, where the second request is used to request the second network device to allocate an address in a first address pool;
the network device further includes:
the starting unit is used for starting a timer, and the duration of the timer is a preset threshold;
if the timer is overtime, the receiving unit does not receive a first address assignment message sent by the second network device, the sending unit is further configured to send a third request to the second network device according to the first address request information, where the third request is used to request the second network device to assign an address in the second address pool, and the first address assignment message includes an address in the first address pool.
14. The network device according to claim 13, wherein the receiving unit is further configured to receive a second address request packet sent by a second terminal device, where the second address request packet includes information of the second terminal device;
if the first address pool statistical number in the first address statistical information is smaller than the address number in the first address pool, the sending unit is further configured to send a fourth request to the second network device, where the fourth request is used to request the second network device to allocate an address in the first address pool.
15. The network device of claim 12, wherein the network device further comprises:
the starting unit is used for starting a timer, and the duration of the timer is a preset threshold;
if the receiving unit receives an assignment rejection message sent by the second network device before the timer expires, the sending unit is further configured to send a fifth request to the second network device according to the first address request information, where the fifth request is used to request the second network device to assign an address in the second address pool, and the assignment rejection message indicates that the second network device cannot assign an address in the first address pool.
16. The network device of any of claims 13 to 15, wherein the network device further comprises:
and the updating unit is used for updating the first address statistical information.
17. The network device of claim 16, wherein the update unit is specifically configured to reduce the first address pool statistics.
18. The network device of any of claims 12 to 17, wherein the network device further comprises:
the generating unit is configured to generate second address statistical information, where the second address statistical information includes a second address pool statistical number, and the second address pool statistical number is a number of addresses in a second address pool requested by the network device statistics.
19. The network device of any of claims 12-18, wherein the network device is a standby of the second network device, and wherein the first address pool on the network device and the first address pool on the second network device are synchronized.
20. The network device of any of claims 12-19, wherein the first address pool has a higher priority than the second address pool.
21. Network device according to any of claims 13 to 20, wherein said second request carries gateway information of said first address pool.
22. The network device of any of claims 14 to 21, wherein the first request carries gateway information for the second address pool.
23. A network device, characterized in that the network device comprises: a processor coupled to a memory, the memory having stored therein at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to cause the network device to implement the method of address assignment processing of any of claims 1-11.
24. A readable storage medium storing instructions that, when executed, cause the method of any of claims 1-11 to be implemented.
CN202011381499.7A 2020-11-30 2020-11-30 Address allocation processing method and equipment Pending CN114598681A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011381499.7A CN114598681A (en) 2020-11-30 2020-11-30 Address allocation processing method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011381499.7A CN114598681A (en) 2020-11-30 2020-11-30 Address allocation processing method and equipment

Publications (1)

Publication Number Publication Date
CN114598681A true CN114598681A (en) 2022-06-07

Family

ID=81813471

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011381499.7A Pending CN114598681A (en) 2020-11-30 2020-11-30 Address allocation processing method and equipment

Country Status (1)

Country Link
CN (1) CN114598681A (en)

Similar Documents

Publication Publication Date Title
CN109275160B (en) Data distribution method, device and system
CN110167003B (en) Session management method, device and system
US10320683B2 (en) Reliable load-balancer using segment routing and real-time application monitoring
US11558346B2 (en) Address management method and system, and device
CN110113441B (en) Computer equipment, system and method for realizing load balance
US10855682B2 (en) Virtual address for controller in a controller cluster
JPH0530152A (en) Protocol parallel processor
US20030165144A1 (en) Systems and methods for implementing virtual router
US10374875B2 (en) Resource management device, resource management system, and computer-readable recording medium
US20240048477A1 (en) Packet forwarding method, apparatus, and system, and computer-readable storage medium
CN117544941A (en) Session management method, device and system
US20230291684A1 (en) Packet transmission method and apparatus, device, and computer-readable storage medium
CN114172753B (en) Address reservation method, network equipment and system
CN108271149B (en) Method, equipment and system for migrating user data anchor points
CN114157600A (en) Method, equipment and system for forwarding message
CN113973022A (en) Communication method, CP equipment and NAT equipment
CN114598681A (en) Address allocation processing method and equipment
JP2009278297A (en) Gateway device, communication system including the same, and communication method
CN114390629B (en) Control method and system for backhaul route of 5G network terminal
EP4203427A1 (en) Traffic processing method, apparatus, and network device
CN112751766B (en) Message forwarding method and system, related equipment and chip
CN114531320A (en) Communication method, device, equipment, system and computer readable storage medium
US11996993B2 (en) Packet transmission method, apparatus, and system, and storage medium
CN115208783A (en) Method, device, equipment, system and storage medium for detecting server state
EP2939382B1 (en) Distributed data processing system

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