WO2014114097A1 - 一种负载分担方法及装置 - Google Patents

一种负载分担方法及装置 Download PDF

Info

Publication number
WO2014114097A1
WO2014114097A1 PCT/CN2013/083587 CN2013083587W WO2014114097A1 WO 2014114097 A1 WO2014114097 A1 WO 2014114097A1 CN 2013083587 W CN2013083587 W CN 2013083587W WO 2014114097 A1 WO2014114097 A1 WO 2014114097A1
Authority
WO
WIPO (PCT)
Prior art keywords
public network
cpu
user
address
network address
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.)
Ceased
Application number
PCT/CN2013/083587
Other languages
English (en)
French (fr)
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to US14/763,276 priority Critical patent/US9332067B2/en
Priority to BR112015017876-6A priority patent/BR112015017876B1/pt
Priority to EP13872335.8A priority patent/EP2942914B1/en
Priority to RU2015133461A priority patent/RU2613528C2/ru
Priority to AU2013375618A priority patent/AU2013375618B2/en
Publication of WO2014114097A1 publication Critical patent/WO2014114097A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5061Pools of addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/256NAT traversal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2514Translation of Internet protocol [IP] addresses between local and global IP addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2521Translation architectures other than single NAT servers
    • H04L61/2532Clique of NAT servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload

Definitions

  • the present invention relates to load sharing technologies in network communications, and in particular, to a load sharing method and apparatus. Background technique
  • NAT Network Address Translation
  • IP Internet Protocol
  • Carrier Grade NAT is a device deployed in operators to improve Internet Protocol version 4 (IPv4, Internet Protocol) by integrating various evolution mechanisms including tunneling and NAT. Version 4) and the smooth transition and advancement of the Internet Protocol Version 6 (IPv6, Internet Protocol Version 6).
  • the conversion modes of CGN are: private network IPv4 to public network IPv4 address, private network IPv4 to IPv6 address, IPv6 to public network IPv4 address, and so on.
  • the processing unit can be a single-core processing unit or a multi-core processing unit.
  • the multi-core processing unit is currently in the form of load sharing, so that the central processing unit of the multi-core processing unit (CPU, Central Processing) Unit) performance is optimal.
  • the load balancing includes the load balancing of the public network address resource and the load balancing of the user equipment.
  • the public network address can be hashed. Random hashing of resources to different CPUs, but if hashing with a single public address resource, performance of the forwarding unit and processing unit of the CGN If the number of processing units is different, and the number of CPUs included in each processing unit is different, the performance difference of CGN for address translation is large. And there is a problem of poor load sharing. Summary of the invention
  • the main purpose of the embodiments of the present invention is to provide a load balancing method and device, which can solve the problem of uneven load sharing of NAT on multiple CPUs.
  • the embodiment of the invention provides a load sharing method, and the method includes:
  • the user equipment After receiving the traffic sent by the user equipment, the user equipment is grouped according to the traffic model sent by the user equipment, and each CPU allocates a public network address to the user equipment, and is the private network address of the user equipment.
  • Network address translation
  • Each address pool includes multiple address blocks, and each address block corresponds to one CPU; each user group includes multiple user blocks, and each user block corresponds to one CPU.
  • the method further includes:
  • the address resource data chain is generated according to the configured address pool;
  • the user data chain is generated according to the configured user group;
  • the load sharing control information generated by the public network address resource load sharing tag table and the client device load sharing tag table is sent to the CPU;
  • the CPU allocates a public network address to the user equipment, and translates the public network address of the private network address of the user equipment to:
  • the CPU allocates a public network address to the user equipment according to the received load sharing control information, and converts the private network address of the user equipment to a public network address.
  • the number of corresponding public network addresses in each address pool is substantially the same in each of the CPUs;
  • the number of user equipments shared by the CPUs is basically the same;
  • the total number of client devices of the current user group is divided by the product of the integer value of the square of the CPU and the number of CPUs.
  • the client device is assigned to each CPU; if there are remaining client devices, the remaining client devices are divided by the number of CPUs.
  • the integer value of the client device is allocated to each CPU; if there is still the client device remaining, the remaining client devices in each user group are allocated as a whole to the client device, so that the number of client devices allocated by each CPU is basically the same.
  • each address pool corresponds to a public network address resource data link
  • the number of nodes in the public network address resource data link is the number of CPUs, and each node corresponds to one CPU; each node is divided into a block label and a tail. Mark yourself.
  • each user group corresponds to one user data chain
  • the number of nodes in the user data chain is the number of CPUs
  • each node corresponds to one CPU; each node includes a block mark and a tail mark.
  • the embodiment of the present invention further provides a load sharing device, where the device includes a load sharing configuration module, a load sharing control module, and a CPU;
  • the load balancing configuration module is configured to configure a public network address in an address pool manner; and group the user equipment according to the traffic model sent by the user equipment;
  • Each address pool includes multiple address blocks, and each address block corresponds to one CPU; each user group includes multiple user blocks, and each user block corresponds to one CPU;
  • the load sharing control module is configured to send the load sharing control information to the CPU.
  • the CPU is configured to allocate a public network address to the user equipment according to the received load sharing control information, and is a private network address of the user equipment. Do public network address translation.
  • the load sharing control module is configured to generate a public network address resource load sharing tag table according to the public network address resource data link; and generate a user equipment load balancing tag table according to the user data link;
  • the load sharing control information generated by the network address resource load sharing tag table and the client device load sharing tag table is sent to the CPU.
  • each address pool corresponds to a public network address resource data link
  • the number of nodes in the public network address resource data link is the number of CPUs, and each node corresponds to one CPU; each node is divided into a block label and a tail.
  • Each user group corresponds to a user data chain.
  • the number of nodes in the user data chain is the number of CPUs, and each node corresponds to one CPU; each node includes a block tag and a tail tag.
  • the load sharing configuration module and the load sharing control module are disposed in the CGN device.
  • the load balancing method and device configured the public network address in the form of an address pool, so that the number of corresponding public network addresses of each CPU in each address pool is substantially the same; After the traffic is configured, the user equipments are grouped according to the traffic model sent by the user equipment, so that the number of user equipments shared by the CPUs is basically the same; and each CPU allocates a public network address to the user equipment, and is a user terminal.
  • the private network address of the device is used for public address translation. In this way, the problem of the uneven sharing of the public network address resources and the user equipment of the NAT on different CPUs is solved, and the influence of the addition and deletion of some public network address resources and the user equipment on the overall performance of the CGN is also reduced.
  • the technical solution provided by the embodiment of the invention can not only improve the speed of processing the address conversion by the CPU, but also achieve the effect of load balancing on different CPUs.
  • 1 is a schematic flowchart of an implementation process of a load sharing method according to an embodiment of the present invention
  • 2 is a schematic structural diagram of a public network address resource data link according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a user data link according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a load sharing device according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of load sharing of a CGN according to an embodiment of the present invention. detailed description
  • FIG. 1 is a schematic flowchart of a load balancing method according to an embodiment of the present invention. As shown in FIG. 1 , the method includes the following steps:
  • Step 101 Configure a public network address in the form of an address pool.
  • Each address pool includes multiple address blocks, and each address block corresponds to one CPU
  • each address pool includes several public network addresses, and the number of public network addresses included in each address pool can be the same.
  • Each address pool includes a public network address corresponding to each CPU.
  • Each CPU has the same number of public network addresses in each address pool. For example, there is an address pool A and an address pool.
  • B Three address pools of address pool C, two CPUs of CPU1 and CPU2, and twelve public network addresses.
  • the number of public network addresses contained in address pools A, B, and C can be flexibly configured, that is, the address pool.
  • A. Address pool B and address pool C contain different public network addresses.
  • address pool A contains eight public network addresses
  • address pool B contains three public network addresses
  • address pool C contains a public network address.
  • address pool A, address pool B, and address pool C each include four public network addresses, and two public network addresses in each address pool correspond to CPU 1. Two public network addresses correspond to CPU2.
  • Step 102 After receiving the traffic sent by the user equipment, the user equipment is grouped according to the traffic model sent by the user equipment, and each CPU allocates a public network address to the user equipment, and is a private network of the user equipment.
  • the address is a public network address translation
  • Each user group includes a plurality of user blocks, and each user block corresponds to one CPU;
  • the traffic model can be the traffic model used in existing transmission technologies.
  • the number of client devices shared by the CPUs is substantially the same to ensure the load balancing of the CPU;
  • the public network address allocated by the CPU for the client device is from the address pool corresponding to itself. Public network address;
  • the CPU allocates a public network address to the user equipment according to the load sharing control information
  • the load sharing control information includes: a public network address resource load sharing token table generated according to the public network address resource data link, according to the user The user equipment load distribution tag table generated by the data link; where the public network address resource data link refers to a linked list structure for recording the public network address allocated by each CPU in each address pool; the user data link refers to Used for linked list structure including client device load conditions.
  • the public network address is configured in the address pool. As shown in Figure 2, all the public network addresses are configured in the address pool.
  • the total number of public network addresses in each address pool can be the same. It can also be different; however, each CPU corresponds to multiple address pools, and the number of corresponding public network addresses of each CPU in each address pool is basically the same.
  • the method for realizing the same number of public network addresses corresponding to each CPU is:
  • the first public network address allocation is performed.
  • the total number of public network addresses in the current address pool is divided by the number of squares of the number of CPUs and the number of CPUs.
  • the public network address is assigned to each CPU. If there is a public network address remaining, then two The secondary public network address is allocated, and the remaining public network addresses are divided by the number of CPUs and the number of public network addresses are assigned to the respective CPUs; if there is still a public network address remaining, the remaining public network addresses are separately processed;
  • Each CPU allocates at most one public network address during the allocation process, that is, the number of public network addresses allocated by each CPU during the third public address allocation process is 0 or 1.
  • the processing of the remaining public network addresses is performed as follows:
  • the public network addresses are allocated as the whole of the remaining public network addresses in the respective address pools, so that the public network corresponding to each CPU is used.
  • the number of addresses is basically the same;
  • the reason why the remaining public network addresses are processed as a whole is because if the number of public network addresses remaining in the address entry, the address pool B, and the address pool C is 1, if each address pool has the remaining 1 public network address number is assigned to CPU A; then, CPU A bears a heavy load. If the remaining public network address is used as a whole for public network address allocation, then address pool A can put the remaining one in the address pool. The network address is assigned to the CPU A.
  • the address pool B can allocate the remaining public network address of the address pool to the CPU B.
  • the address pool C can allocate the remaining public network address of the address pool to the CPU C.
  • the number of public network addresses allocated by the CPU is more balanced.
  • each address pool corresponds to a public network address resource data link.
  • the number of nodes in the public network address resource data link is the number of CPUs, and the nodes of each public network address resource data chain are associated with one CPU.
  • each node includes a block mark and a tail mark, wherein the block mark is used for recording the address block and the number of address blocks allocated by the CPU corresponding to the current node, and is used for recording the CPU corresponding to the node.
  • the tail mark is used to record the number of public network addresses obtained by the CPU corresponding to the current node from the third allocation, and the number of public network addresses obtained from the third allocation is 0 or 1, that is, each The tail of each node is marked as 0 or 1.
  • the address pool is in an address block unit, and the address block size is variable; the address block size indicates the number of public network addresses included in each address block; the first allocated address block size and secondary allocation The address block size is different;
  • the first allocation is: dividing the total number of public network addresses of the current address pool by the product of the integer value of the square of the CPU and the number of CPUs, and assigning a public network address to each CPU; wherein, the address block size allocated for the first time is CPU
  • the number of address blocks per CPU is the total number of public network addresses in the address pool divided by the square of the number of CPUs, so that each CPU contains the same number of address blocks; here, it is necessary to indicate that
  • the size of the allocated address block is related to the number of CPUs and the total number of public network addresses in the address pool. Therefore, the address block size allocated for the first time can be set. As a function variable, the first allocated address block size may have multiple workarounds.
  • the secondary allocation is: if the public network address remains after the first allocation, the remaining public network address is divided by the integer number of the CPU number and the public network address is assigned to each CPU; wherein, the secondary allocated address block is first The total number of public network addresses remaining after the secondary allocation is divided by the integer value of the number of CPUs, and the number of secondary allocated address blocks per CPU is 1;
  • the remaining public network addresses are separately processed; the remaining public network addresses are separately processed as:
  • the remaining public network addresses in the respective address pools are used as The public network address allocation is performed as a whole, so that the number of public network addresses corresponding to each CPU is basically the same; each CPU allocates at most one public network address in the allocation process, that is, the public network allocated by each CPU during the allocation process.
  • the number of addresses is 0 or 1.
  • all address pools can be maintained by a data link table
  • each linked list node corresponds to all address pools, and corresponds to one CPU
  • the number of linked list nodes is the number of CPUs
  • each linked list node includes a block spear to indicate itself, and y3 ⁇ 4 spears f already;
  • each linked list node is used to record the sum of the total number of public network addresses of the first allocation and the secondary allocation corresponding to the CPU in each address pool; that is, it is used to record each address pool.
  • the sum of the product of the number of address blocks allocated by the corresponding CPU for the first time and the address block, and the sum of the number of the number of address blocks of the secondary allocation of the CPU corresponding to the address block and the address block; the tail and the mark of each linked list node And used to record the sum of the tail tags corresponding to the CPU in each address pool.
  • the data link table is used to determine on which CPU the public network address is added or deleted. If the public network address is to be added, the CPU corresponding to the tail and the small tag is preferentially added. If the public network address is to be deleted, Deleting the CPU corresponding to the tail and the node with the large mark to ensure the balance of the public network address and the CPU load.
  • the CPU corresponding to the node whose tail tag is 0 is preferentially added. If the public network address is to be randomly deleted, the corresponding tail tag is corresponding to 1.
  • the CPU deletes including:
  • the address pool is added to the public network address, the public network address remaining after the secondary allocation is merged with the added public network address, and the merged public network address is re-allocated for the first time and the second time is allocated; If the number of public network addresses is 1, search for the node where the pre-delete public network address is located, and check whether the tail tag of the node is 1. If 1, delete the public network address, and mark the tail of the node. 1 is updated to 0; if the tail tag of the node is not 1, the operation when the number of public network addresses deleted by the address pool > the first allocated address block is performed;
  • the pre-delete public network addresses are distributed on different nodes, and the tail labels of the nodes that distribute the pre-delete public network address are all 1, Deleting the pre-delete public network address, and updating the tail tag of the node that distributes the pre-delete public network address from 1 to 0; if the pre-delete public network address is not completely distributed on different nodes, or distributed If the tail tag of the node of the pre-delete public network address is not all 1, the operation when the address of the public network address deleted by the address pool > the first allocated address block is performed;
  • the public network address is re-allocated according to the difference between the total number of public network addresses in the address pool and the number of pre-delete public addresses.
  • the address block size is 97, the number of address blocks is 1; the tail of the public address resource data chain is marked as 0;
  • the address block size is 2, and the nodes corresponding to the two CPUs are A and B; then the node corresponding to CPU A includes block mark A and tail mark A; CPU B includes block mark B and Tail mark B;
  • the address block size allocated by each CPU is 2, the number of address blocks is 24; the remaining 1 address is allocated twice.
  • the block block size of the block mark A and the block mark B are both 2, the number of address blocks is 24, the tail mark A is 1, and the tail mark B is 0.
  • a public network address is deleted If the pre-delete public network address is in CPU A, delete the public network address and change the trailing mark A to 0.
  • the two public network addresses that are pre-delete are in CPU A.
  • the public network address is re-allocated, that is, the new address block size is 2.
  • the address block size of CPU A and CPU B is 2, and the number of address blocks is 23; when it is allocated, CPU A
  • the address block size of CPU B is 1, the number of address blocks is 1; the tail mark A is 1, and the tail mark B is 0.
  • the public network address resource is load-balanced on different CPUs, and the number of addresses differs by a maximum of 1, and is not affected by the number of processing units; here, each processing unit can contain a different number of CPUs, users
  • the generation and update of the data link are similar and will not be described again.
  • the user equipment is grouped, as shown in FIG. 3, all the client devices that send traffic in a certain time interval, and the user equipments are grouped according to the traffic model sent by the user equipment;
  • the total number of user devices included in each user group may be different.
  • each CPU corresponds to multiple user groups, and the number of corresponding user devices in each user group is basically the same.
  • the number of client devices corresponding to each CPU is basically the same:
  • the first allocation is performed, and the total number of client devices of the current user group is divided by the product of the integer value of the square of the CPU and the number of CPUs, and the client device is allocated to each CPU; if there is remaining user equipment, the second allocation is performed.
  • the remaining client devices are divided by the integer number of CPUs and the client devices are allocated to the respective CPUs; if there are remaining client devices, the separate processing is performed; the remaining client devices are separately processed as:
  • the remaining client devices in the user group are allocated as a whole for the client device, so that the number of client devices allocated by each CPU is basically the same; each CPU allocates at most one client device during the allocation process, namely: each CPU
  • the number of client devices allocated during the third allocation process is 0 or 1.
  • the user group is divided in units of a certain time interval.
  • FIG. 3 is a schematic diagram of user data according to an embodiment of the present invention. As shown in FIG. 3, a user terminal that sends traffic within a certain time interval is divided into multiple user groups; each user group corresponds to a user data chain, and the user data chain The number of nodes is the number of CPUs; the nodes of the user data chain and each
  • each node includes a block mark and a tail mark, wherein
  • the block flag is used to record the first allocated user block and the number of user blocks of the CPU corresponding to the node, and the number of user blocks and user blocks used for recording the secondary allocation of the CPU corresponding to the node;
  • the tail tag is used to record the number of user devices obtained by the CPU corresponding to the node from the third allocation, and the number of client devices obtained from the third allocation is 0 or 1.
  • the user group is in units of user blocks, and the user block size is variable; the user block size indicates the number of client devices included in each user block; the first allocated user block size and secondary allocation User block size is different;
  • the first allocation is: dividing the total number of client devices of the current user group by the product of the integer value of the square of the CPU and the number of CPUs, and all the client devices are allocated to the respective CPUs; wherein, the size of the user block allocated for the first time is CPU
  • the number of user blocks per CPU is the integer value of the total number of user devices in the user group divided by the square of the number of CPUs, so that the number of user blocks allocated by each CPU is the same;
  • the secondary allocation is: if there is a remaining user equipment after the first allocation, the remaining user equipment is divided by the integer value of the number of CPUs, and the user equipment is allocated to each CPU; wherein, the secondary allocated user block is the first
  • the total number of client devices remaining after the secondary allocation is divided by the integer value of the number of CPUs, and the number of user blocks allocated twice per CPU is 1.
  • the processing is performed separately; the remaining user equipments are separately processed as: the remaining user equipments in each user group are taken as one
  • the client device allocation is performed as a whole, so that the number of client devices allocated by each CPU is basically the same; each CPU allocates at most one client device during the allocation process, that is, each CPU is allocated in the third allocation process.
  • the number of client devices is 0 or 1.
  • all user groups can be maintained by a user group data link table, each linked list node corresponds to all user groups, and corresponds to one CPU, the number of linked list nodes is the number of CPUs, and each linked list node includes blocks and tags, tails, and tags; If the user equipment is to be added, the pre-added user equipment will be divided into new user groups in units of a certain time; if the user equipment is to be deleted, the CPU corresponding to the tail and the marked node are preferentially Delete it.
  • a block and a tag of each linked list node used to record the sum of the total number of user equipments of the first allocation and the second allocation corresponding to the CPU in each user group; that is, used to record corresponding addresses in each address pool.
  • the CPU first allocates the sum of the product of the number of user blocks and the user block, and the sum of the number of user blocks for the secondary allocation of the CPU corresponding thereto and the user block.
  • each linked list node is used to record the sum of the tail tags corresponding to the CPU in each user group. If you want to delete the client device, delete the CPU corresponding to the tail and the node with the big mark. Specifically, when performing maintenance on a single user group, if the user device is to be randomly deleted, the corresponding tail tag is 1 The CPU is deleted.
  • the number of the user equipments deleted by the user group is 1, search for the node where the pre-deleted client device is located, check whether the tail tag of the node is 1, and if it is 1, delete the user equipment, and The tail tag of the node is updated from 1 to 0; if the tail tag of the node is not 1, the operation of the number of the client devices deleted by the user group > the first allocated user block is performed;
  • the client device is distributed on different nodes, and the tail tag of the node that distributes the pre-deleted client device is 1, the pre-deleted client device is deleted, and the pre-deleted client device is distributed.
  • the tail tag of the node is updated from 1 to 0; if the pre-deleted client device is not distributed on a different node, or the tail tag of the node that distributes the pre-deleted client device is not all
  • the user equipment is re-allocated according to the difference between the total number of the original user equipments and the number of pre-delete user equipments.
  • the user equipment resources are load-balanced on different CPUs, and the number of user equipments is different.
  • the generation and update of the user data link are similar to the generation and update of the public network address resource data link, and are not described here.
  • FIG. 4 is a schematic structural diagram of a load sharing device according to the present invention; as shown in FIG. 4, the device includes a load sharing configuration module 41, a load sharing control module 42, and a CPU 43;
  • the load balancing configuration module 41 is configured to configure a public network address in the form of an address pool; and configured to group the user equipment according to the traffic model sent by the user equipment;
  • Each address pool includes multiple address blocks, and each address block corresponds to one CPU; each user group includes multiple user blocks, and each user block corresponds to one CPU;
  • the load sharing control module 42 is configured to send load sharing control information to the CPU 43 to control the CPU to perform load sharing;
  • the load sharing control module 42 is configured to generate a public network address resource load sharing tag table according to the public network address resource data link, and generate a user equipment load balancing tag table according to the user data link; and load sharing according to the public network address resource
  • the load sharing control information generated by the tag table and the client device load sharing tag table is sent to the CPU 43;
  • the CPU 43 is configured to allocate a public network address to the user equipment according to the received load sharing control information, and perform public network address translation for the private network address of the user equipment.
  • each address pool corresponds to a public network address resource data link, and the number of nodes in the public network address resource data link is the number of CPUs, and each node corresponds to one CPU; each node is divided into blocks to indicate the spears. Show yourself
  • Each user group corresponds to a user data chain.
  • the number of nodes in the user data chain is the number of CPUs, and each node corresponds to one CPU; each node includes a block tag and a tail tag.
  • the load sharing configuration module 41 and the load sharing control module 42 may be disposed in a CGN device.
  • the load sharing device may be disposed in the CGN device; the load sharing configuration module 41 and the load sharing control module 42 may be configured by a CGN device CPU, a digital signal processor (DSP, or a digital signal processor) or programmable. Gate array (FPGA, Field Programmable Gate Array) implementation.
  • DSP digital signal processor
  • FPGA Field Programmable Gate Array
  • CGN 5 is a schematic diagram of load sharing of a CGN according to an embodiment of the present invention.
  • the type of the CGN device may be Ds-lite CGN, NAT44, Bras nat44, NAT64, etc. Private network IPv4, IPv6, etc.;
  • CGN devices are multi-service processing units, and each processing unit contains multiple CPUs.
  • the load balancing configuration module configures the public network address in the address pool format and allocates the public network address resources to the CPUs of different processing units in the CGN device.
  • the number of address pools can be based on actual needs. Make settings.
  • the type of the user can be configured, and the type of the user is a private network address type corresponding to the user equipment; the user equipment is also distributed in a dynamic load sharing manner, that is, the user equipment is shared to different CPUs;
  • the load sharing control module generates a load sharing tag table, and sends the tag table information to the corresponding CPU.
  • the number of public network addresses shared by each CPU is basically balanced; the client device processed by each CPU The number is also basically balanced.
  • the public network address is configured in the form of an address pool; after receiving the traffic sent by the user equipment, the user equipment is grouped according to the traffic model sent by the user equipment, and each CPU allocates the user equipment.
  • the public network address, and the private network address of the user equipment is a public network address translation; wherein each address pool includes multiple address blocks, each of which corresponds to one CPU; each user group includes multiple user blocks, each Each user block corresponds to one CPU.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)
  • Multi Processors (AREA)

Abstract

本发明公开了一种负载分担方法,以地址池形式配置公网地址;接收到用户端设备发送的流量后,根据所述用户端设备发送的流量模型对用户端设备进行分组,由各个中央处理器CPU为用户端设备分配公网地址,并为用户端设备的私网地址做公网地址转换;其中,每个地址池包括多个地址块,每个地址块对应一个CPU;每个用户组包括多个用户块,每个用户块对应一个CPU。本发明还同时公开了一种负载分担装置。采用本发明所述方法及装置,能够解决在多个CPU上的公网地址资源以及用户端设备负载分担不均问题,既能提高CPU处理地址转换的速度,又能实现较好的负载分担效果。

Description

一种负载分担方法及装置 技术领域
本发明涉及网络通信中的负载分担技术, 尤其涉及一种负载分担方法 及装置。 背景技术
网络地址转换 ( NAT, Network Address Translation )是一种将私有地址 转化为合法因特网协议( IP, Internet Protocol )地址的转换技术, 它被广泛 应用于各种类型的国际互联网 (Internet )接入方式和各种类型的网络中。 NAT可以使多台私网计算机共享 Internet连接, 很好地解决公共 IP地址资 源紧缺的问题。
运营商级网络地址转换( CGN, Carrier Grade NAT )是一种在运营商中 部署的设备, 通过集成包括隧道和 NAT在内的多种演进机制, 来改善互联 网协议第 4版( IPv4, Internet Protocol Version 4 )和互联网协议第 6版( IPv6, Internet Protocol Version 6 ) 的平滑过渡和推进演进过程。 CGN的转换形式 有: 私网 IPv4到公网 IPv4地址、私网 IPv4到 IPv6地址、 IPv6到公网 IPv4 地址等。 为了提高 CGN的性能, 目前多采用独立的处理单元, 处理单元可 以为单核处理单元或多核处理单元, 多核处理单元目前采用负载分担的形 式, 使得多核处理单元的中央处理器( CPU, Central Processing Unit )性能 达到最优。
负载分担包括公网地址资源的负载分担和用户端设备的负载分担, 为 了使公网地址资源和用户端设备的分配达到均衡负载分担的效果, 可以采 用哈希 (HASH ) 的方式把公网地址资源随机的散列到不同 CPU, 但是, 如果以单个公网地址资源进行散列,对 CGN的转发单元和处理单元的性能 要求较高; 如果以固定公网地址块进行散列, 随着 CGN的处理单元个数的 不同, 以及各个处理单元中包含的 CPU的个数的不同, CGN进行地址转换 的性能差距较大, 且存在负载分担较差的问题。 发明内容
有鉴于此, 本发明实施例的主要目的在于提供一种负载分担方法及装 置, 能解决 NAT在多个 CPU上负载分担不均的问题。
为达到上述目的, 本发明实施例的技术方案是这样实现的:
本发明实施例提供了一种负载分担方法, 所述方法包括:
以地址池形式配置公网地址;
接收到用户端设备发送的流量后, 根据所述用户端设备发送的流量模 型对用户端设备进行分组, 由各个 CPU为用户端设备分配公网地址, 并为 用户端设备的私网地址故公网地址转换;
其中, 每个地址池包括多个地址块, 每个地址块对应一个 CPU; 每个 用户组包括多个用户块, 每个用户块对应一个 CPU。
上述方案中, 所述方法还包括:
根据地址池对应的地址资源数据链生成公网地址资源负载分担标记 表, 根据用户组对应的用户数据链生成用户端设备负载分担标记表; 所述 地址资源数据链根据配置的地址池生成; 所述用户数据链根据配置的用户 组生成;
根据公网地址资源负载分担标记表和用户端设备负载分担标记表生成 的负载分担控制信息发送给 CPU;
相应的, 所述 CPU为用户端设备分配公网地址, 并为用户端设备的私 网地址做公网地址转换为:
所述 CPU根据收到的负载分担控制信息为用户端设备分配公网地址, 并为用户端设备的私网地址係公网地址转换。 上述方案中, 所述各个 CPU在每个地址池中对应的公网地址数基本相 同; 具体实现方法为:
将当前地址池的公网地址总数除以 CPU数平方的整数值与 CPU数的乘 积个公网地址分配给各个 CPU; 若还有公网地址剩余, 则将剩余的公网地 址除以 CPU数的整数值个公网地址分配给各个 CPU;若还有公网地址剩余, 则将各个地址池中所述剩余的公网地址作为一个整体进行公网地址分配, 使各个 CPU对应的公网地址数基本相同。
上述方案中, 所述各个 CPU分担的用户端设备数基本相同; 具体实现 方法为:
将当前用户组的用户端设备总数除以 CPU数平方的整数值与 CPU数的 乘积个用户端设备分配给各个 CPU; 若还有用户端设备剩余, 则将剩余的 用户端设备除以 CPU数的整数值个用户端设备分配给各个 CPU; 若还有用 户端设备剩余, 则将各个用户组中剩余的用户端设备作为一个整体进行用 户端设备分配, 使各个 CPU分配的用户端设备数基本相同。
上述方案中, 每个地址池对应一个公网地址资源数据链, 所述公网地 址资源数据链的节点数为 CPU数, 且每个节点对应一个 CPU; 每个节点分 为块标己和尾标己。
上述方案中, 每个用户组对应一个用户数据链, 所述用户数据链的节 点数为 CPU数,且每个节点对应一个 CPU;每个节点包括块标记、尾标记。
本发明实施例还提供了一种负载分担装置, 所述装置包括负载分担配 置模块、 负载分担控制模块、 CPU; 其中,
所述负载分担配置模块, 配置为以地址池形式配置对公网地址; 根据 所述用户端设备发送的流量模型对用户端设备进行分组;
其中, 每个地址池包括多个地址块, 每个地址块对应一个 CPU; 每个 用户组包括多个用户块, 每个用户块对应一个 CPU; 所述负载分担控制模块, 配置为将负载分担控制信息发送给 CPU; 所述 CPU, 配置为根据收到的负载分担控制信息为用户端设备分配公 网地址, 并为用户端设备的私网地址做公网地址转换。
上述方案中, 所述负载分担控制模块, 具体配置为根据公网地址资源 数据链生成公网地址资源负载分担标记表; 以及, 根据用户数据链生成用 户端设备负载分担标记表; 并将根据公网地址资源负载分担标记表和用户 端设备负载分担标记表生成的负载分担控制信息下发到 CPU。
上述方案中, 每个地址池对应一个公网地址资源数据链, 所述公网地 址资源数据链的节点数为 CPU数, 且每个节点对应一个 CPU; 每个节点分 为块标己和尾标己;
每个用户组对应一个用户数据链,所述用户数据链的节点数为 CPU数, 且每个节点对应一个 CPU; 每个节点包括块标记、 尾标记。
上述方案中, 所述负载分担配置模块、 负载分担控制模块设置于 CGN 设备中。
本发明实施例所提供的负载分担方法及装置, 对公网地址以地址池的 形式进行配置,以使各个 CPU在每个地址池中对应的公网地址数基本相同; 接收到用户端设备发送的流量后, 根据所述用户端设备发送的流量模型对 用户端设备进行分组, 使各个 CPU分担的用户端设备数基本相同; 并由各 个 CPU为用户端设备分配公网地址, 并为用户端设备的私网地址做公网地 址转换。如此,解决了 NAT在不同 CPU上的公网地址资源和用户端设备负 载分担不均问题, 同时也减小了部分公网地址资源和用户端设备的增删对 CGN整体性能的影响问题。本发明实施例所提供的技术方案,既能提高 CPU 处理地址转换的速度, 又能实现在不同 CPU负载均衡的效果。 附图说明
图 1为本发明实施例负载分担方法的实现流程示意图; 图 2为本发明实施例公网地址资源数据链结构示意图;
图 3为本发明实施例用户数据链示意图;
图 4为本发明实施例负载分担装置的组成结构示意图;
图 5为本发明实施例 CGN的负载分担的示意图。 具体实施方式
下面结合附图及具体实施例对本发明再作进一步详细的说明。
图 1为本发明实施例负载分担方法的实现流程示意图, 如图 1所示, 该包括以下步骤:
步骤 101 : 以地址池形式配置公网地址;
其中, 每个地址池包括多个地址块, 每个地址块对应一个 CPU;
本发明实施例中, 设置有多个地址池, 地址池的数目可以根据实际需 要确定; 每个地址池中包括若干个公网地址, 每个地址池中含有的公网地 址数可以相同, 也可以不同; 且每个地址池中均包括对应每个 CPU的公网 地址, 各个 CPU在每个地址池中对应的公网地址数基本相同; 举个例子来 说, 有地址池 A、 地址池 B、 地址池 C三个地址池, CPU1和 CPU2两个 CPU, 十二个公网地址, 这里, 地址池 A、 B、 C中含有的公网地址数可灵 活配置, 也就是说, 地址池 A、 地址池 B、 地址池 C中含有的公网地址数 可不一样, 比如: 地址池 A含有八个公网地址, 地址池 B含有三个公网地 址, 地址池 C含有一个公网地址; 理想情况下, 地址池 A、 地址池 B、 地 址池 C 各自会包括四个公网地址, 且每个地址池中有两个公网地址对应 CPU 1、 两个公网地址对应 CPU2。
步骤 102: 接收到用户端设备发送的流量后,根据所述用户端设备发送 的流量模型对用户端设备进行分组,由各 CPU为用户端设备分配公网地址, 并为用户端设备的私网地址係公网地址转换;
其中, 每个用户组包括多个用户块, 每个用户块对应一个 CPU; 所述 流量模型可以是现有传输技术中所采用的流量模型。
这里, 在对用户端设备分组时, 尽量使各个 CPU分担的用户端设备数 基本相同, 以保证 CPU的负载均衡; CPU为用户端设备分配的公网地址来 自于各地址池中与自身对应的公网地址;
具体的,所述 CPU根据负载分担控制信息为用户端设备分配公网地址; 其中, 所述负载分担控制信息包括: 根据公网地址资源数据链生成的公网 地址资源负载分担标记表, 根据用户数据链生成的用户端设备负载分担标 记表; 这里, 所述公网地址资源数据链是指用于记录各个 CPU在各地址池 中分配到的公网地址情况的链表结构; 用户数据链是指用于包括用户端设 备负载情况的链表结构。
在实际应用中, 以地址池形式配置公网地址如图 2所示, 将预配置的 所有公网地址以地址池的形式进行划分; 这里, 各个地址池中包含的公网 地址总数可以相同, 也可以不同; 但是, 每个 CPU对应多个地址池, 各个 CPU在每个地址池中对应的公网地址数要基本相同。 具体的, 对于每个地 址池, 选择一个地址池后, 实现各个 CPU对应的公网地址数基本相同的方 法为:
先进行首次公网地址分配, 将当前地址池的公网地址总数除以 CPU数 平方的整数值与 CPU数的乘积个公网地址分配给各个 CPU; 若还有公网地 址剩余, 再进行二次公网地址分配, 将剩余的公网地址除以 CPU数的整数 值个公网地址分配给各个 CPU; 若还有公网地址剩余, 则将所述剩余的公 网地址进行单独处理; 但是, 每个 CPU在分配过程中最多分配一个公网地 址, 即: 每个 CPU在第三次公网地址分配过程中分配到的公网地址数为 0 或 1。
所述将剩余的公网地地址进行单独处理为: 将各个地址池中所述剩余 的公网地址作为一个整体进行公网地址分配, 以使各个 CPU对应的公网地 址数基本相同;
这里, 之所以对所述剩余的公网地址按整体来处理, 是因为, 如果地 址入、 地址池 B、 地址池 C中剩余的公网地址数为 1, 若每个地址池均把剩 余的 1个公网地址数分配给 CPU A; 那么, CPU A承担的负荷较重, 若把 剩余的公网地址作为一个整体进行公网地址分配, 那么地址池 A可以把该 地址池剩余的一个公网地址分配给 CPU A, 地址池 B可以把该地址池剩余 的一个公网地址分配给 CPU B, 地址池 C可以 4巴该地址池剩余的一个公网 地址分配给 CPUC; 如此, 能够使各个 CPU分配的公网地址数更加均衡。
如图 2所示, 每个地址池都对应一个公网地址资源数据链, 所述公网 地址资源数据链的节点数为 CPU数, 且每个公网地址资源数据链的节点与 一个 CPU相对应; 每个节点包括块标记和尾标记, 其中, 所述块标记, 用 于记录与本节点对应的 CPU首次分配的地址块及地址块数, 以及, 用于记 录与本节点对应的 CPU二次分配的地址块及地址块数;
所述尾标记, 用于记录与本节点对应的 CPU从第三次分配中获得的公 网地址数, 且从第三次分配中获得的公网地址数为 0或 1, 也就是说, 每个 节点的尾标记为 0或 1。
这里, 所述地址池以地址块为单位, 且所述地址块大小可变; 所述地 址块大小表示每个地址块中包含的公网地址的数量; 首次分配的地址块大 小与二次分配的地址块大小不同;
其中, 所述首次分配为: 将当前地址池的公网地址总数除以 CPU数平 方的整数值与 CPU数的乘积个公网地址分配给各个 CPU; 其中, 首次分配 的地址块大小为 CPU的个数,每个 CPU含有的地址块数为地址池内公网地 址总数除以 CPU数平方的整数值,以使每个 CPU含有的地址块的个数相同; 这里需要指明的是, 此处首次分配的地址块大小, 与 CPU个数、 地址 池内公网地址总数等多个变量相关, 因此, 可将首次分配的地址块大小设 为一个函数变量, 所述首次分配的地址块大小可有多种变通方式。
所述二次分配为: 若首次分配后还有公网地址剩余, 则将剩余的公网 地址除以 CPU数的整数值个公网地址分配给各个 CPU; 其中, 二次分配的 地址块为首次分配后剩余的公网地址总数整除 CPU数的整数值,每个 CPU 含有的二次分配的地址块的个数均为 1 ;
若二次分配后还有公网地址剩余, 则将剩余的公网地址进行单独处理; 所述将剩余的公网地地址进行单独处理为: 将各个地址池中所述剩余的公 网地址作为一个整体进行公网地址分配, 使各个 CPU对应的公网地址数基 本相同; 每个 CPU在分配过程中最多分配一个公网地址, 即: 每个 CPU 在此次分配过程中分配到的公网地址数为 0或 1。
具体的, 所有地址池可以由一个数据链表维护, 每个链表节点对应所 有地址池、 且对应一个 CPU, 链表节点数为 CPU数, 每个链表节点包含块 矛口才示 己、 y¾矛口 f示 己;
这里, 每个链表节点的块和标记, 用于记录各个地址池中与所述 CPU 相对应的首次分配与二次分配的公网地址总数之和; 即: 用于记录各个地 址池中与其相对应的 CPU首次分配地址块数与地址块的乘积之和, 以及, 用于记录与其相对应的 CPU的二次分配的地址块数与地址块的乘积之和; 每个链表节点的尾和标记, 用于记录各个地址池中与所述 CPU相对应 的尾标记之和。
所述数据链表, 用于对在哪个 CPU上增加或删除公网地址进行判断, 如果要增加公网地址, 优先对尾和标记小的节点所对应的 CPU进行增加, 如果要删除公网地址, 优先对尾和标记大的节点所对应的 CPU进行删除, 以保证公网地址分配以及 CPU负载的均衡;
具体的, 对单个地址池进行维护时, 如果要增加公网地址, 优先对尾 标记为 0的节点所对应的 CPU进行增加, 如果要随机删除公网地址, 优先 对尾标记为 1的所对应的 CPU进行删除;
所述对单个地址池进行维护时, 如果要增加公网地址, 优先对尾标记 为 0的节点所对应的 CPU进行增加, 如果要随机删除公网地址, 优先对尾 标记为 1的所对应的 CPU进行删除, 包括:
若地址池增加公网地址, 则将所述二次分配后剩余的公网地址与增加 的公网地址合并, 将合并后的公网地址重新进行首次分配和二次分配; 若地址池删除的公网地址数为 1, 则搜索预删除的公网地址所在的节 点, 检查该节点的尾标记是否为 1, 如果为 1, 则删除所述公网地址, 并将 所述节点的尾标记由 1更新为 0; 如果该节点的尾标记不为 1, 则执行若地 址池删除的公网地址数 >首次分配的地址块时的操作;
若 1<地址池删除的公网地址数 首次分配的地址块, 如果预删除的公 网地址分布在不同的节点, 且分布所述预删除的公网地址的节点的尾标记 均为 1, 则删除所述预删除的公网地址, 并将分布所述预删除的公网地址的 节点的尾标记由 1更新为 0;如果预删除的公网地址未完全分布在不同的节 点上, 或者分布所述预删除的公网地址的节点的尾标记不全为 1, 则执行若 地址池删除的公网地址数 >首次分配的地址块时的操作;
若地址池删除的公网地址数 >首次分配的地址块, 则根据地址池原来的 公网地址总数与预删除的公网地址数的差值, 重新对公网地址进行分配。
举例来说: 如果只配置一个地址池, 且该地址池所对应的公网地址总 数为 97, 下面分别给出只有一个 CPU或有两个 CPU—CPU A、 CPU B情况 下, 公网地址资源数据链的生成和更新情况。
只有一个 CPU时, 地址块大小为 97, 地址块数为 1 ; 公网地址资源数 据链的尾标记为 0;
两个 CPU时,地址块大小为 2,设所述两个 CPU所对应的节点为 A和 B;则 CPU A对应的节点包括块标记 A和尾标记 A; CPU B包括块标记 B和 尾标记 B; 首次分配时, 每个 CPU所分配的地址块大小为 2、 地址块数为 24; 剩余 1个地址, 二次分配。 公网地址分配完后, 块标记 A和块标记 B的地址块大小都为 2, 地址块数都为 24, 尾标记 A为 1, 尾标记 B为 0; 此时, 如果删除一个公网地址, 且预删除的公网地址在 CPU A中, 那 么删除该公网地址, 且将尾标记 A修改为 0; 如果删除两个公网地址, 但 预删除的两个公网地址都在 CPU A上, 则重新进行公网地址分配, 即新的 地址块大小为 2, 首次分配时, CPU A 、 CPU B的地址块大小均为 2, 地 址块数均为 23; 二次分配时, CPU A 、 CPU B的地址块大小均为 1, 地址 块数均为 1 ; 尾标记 A为 1, 尾标记 B为 0。
由上可知, 公网地址资源在不同的 CPU上是负载均衡的, 地址数相差 最大为 1, 且不受处理单元个数的影响; 这里, 每个处理单元可以包含不同 个数的 CPU, 用户数据链的生成和更新类似, 不再赘述。
在实际应用中, 对用户端设备进行分组, 如图 3 所示, 将一定时间间 隔内发送流量的所有用户端设备, 根据所述用户端设备发送的流量模型对 用户端设备进行分组; 这里, 各个用户组中包含的用户端设备总数可以不 同,但是, 每个 CPU对应多个用户组, 各个 CPU在每个用户组中对应的用 户端设备数基本相同。对于每个用户组,选择一个用户组后, 实现各个 CPU 对应的用户端设备数基本相同的方法为:
先进行首次分配, 将当前用户组的用户端设备总数除以 CPU数平方的 整数值与 CPU数的乘积个用户端设备分配给各个 CPU; 若还有用户端设备 剩余, 再进行二次分配, 将剩余的用户端设备除以 CPU数的整数值个用户 端设备分配给各个 CPU; 若还有用户端设备剩余, 则进行单独处理; 所述 将剩余的用户端设备进行单独处理为: 将各个用户组中剩余的用户端设备 作为一个整体进行用户端设备分配, 使各个 CPU分配的用户端设备数基本 相同; 每个 CPU在分配过程中最多分配 1 个用户端设备, 即: 每个 CPU 在第三次分配过程中分配到的用户端设备数为 0或 1。
这里, 所述用户组以一定时间间隔为单位进行划分。
图 3为本发明实施例用户数据示意图; 如图 3所示, 将一定时间间隔 内发送流量的用户终端分成多个用户组; 每一个用户组都对应一个用户数 据链, 所述用户数据链的节点数为 CPU数; 所述用户数据链的节点与各个
CPU相对应; 每一个节点包括块标记和尾标记, 其中,
所述块标记, 用于记录与本节点对应的 CPU的首次分配的用户块及用 户块数, 以及, 用于记录与本节点对应的 CPU的二次分配的用户块及用户 块数;
所述尾标记, 用于记录与本节点对应的 CPU从第三次分配中获得的用 户端设备数, 且从第三次分配中获得的用户端设备数为 0或 1。
这里, 所述用户组以用户块为单位, 且所述用户块大小可变; 所述用 户块大小表示每个用户块中包含的用户端设备数; 首次分配的用户块大小 与二次分配的用户块大小不同;
其中, 所述首次分配为: 将当前用户组的用户端设备总数除以 CPU数 平方的整数值与 CPU数的乘积个用户端设备分配给各个 CPU; 其中, 首次 分配的用户块大小为 CPU的个数,每个 CPU含有的用户块数为用户组内用 户端设备总数除以 CPU数平方的整数值,以使每个 CPU分配的用户块的个 数相同;
所述二次分配为: 若首次分配后还有用户端设备剩余, 则将剩余的用 户端设备除以 CPU数的整数值个用户端设备分配给各个 CPU; 其中, 二次 分配的用户块为首次分配后剩余的用户端设备总数整除 CPU数的整数值, 每个 CPU二次分配的用户块的个数均为 1。
若二次分配后还有用户端设备剩余, 则进行单独处理; 所述将剩余的 用户端设备进行单独处理为: 将各个用户组中剩余的用户端设备作为一个 整体进行用户端设备分配, 使各个 CPU分配的用户端设备数基本相同; 每 个 CPU在分配过程中最多分配一个用户端设备,也就是说,每个 CPU在第 三次分配过程中分配到的用户端设备数为 0或 1。
具体的, 所有用户组可以由一个用户组数据链表维护, 每个链表节点 对应所有用户组、 且对应一个 CPU, 链表节点数为 CPU数, 每个链表节点 包含块和标记、 尾和标记; 其中, 如果要增加用户端设备, 则将以一定时 间为单位为所述预增加的用户端设备划分为新的用户组; 如果要删除用户 端设备, 优先对尾和标记大的节点所对应的 CPU进行删除。
每个链表节点的块和标记, 用于记录各个用户组中与所述 CPU相对应 的首次分配与二次分配的用户端设备总数之和; 即: 用于记录各个地址池 中与其相对应的 CPU首次分配用户块数与用户块的乘积之和, 以及, 用于 记录与其相对应的 CPU的二次分配的用户块数与用户块的乘积之和。
每个链表节点的尾和标记, 用于记录各个用户组中与所述 CPU相对应 的尾标记之和。 如果要删除用户端设备,优先对尾和标记大的节点所对应的 CPU进行删除; 具体的, 对单个用户组进行维护时, 如果要随机删除用户端设备, 优先对 尾标记为 1的所对应的 CPU进行删除。
所述对单个地址池进行维护时, 如果要随机删除用户端设备, 优先对 尾标记为 1的所对应的 CPU进行删除, 包括:
若用户组删除的用户端设备数为 1,则搜索预删除的用户端设备所在的 节点, 检查该节点的尾标记是否为 1, 如果为 1, 则删除所述用户端设备, 并将所述节点的尾标记由 1更新为 0; 如果该节点的尾标记不为 1, 则执行 用户组删除的户端设备数 >首次分配的用户块时的操作;
若 1<用户组删除的户端设备数 首次分配的用户块, 如果预删除的用 户端设备分布在不同的节点, 且分布所述预删除的用户端设备的节点的尾 标记均为 1, 则删除所述预删除的用户端设备, 并将分布所述预删除的用户 端设备的节点的尾标记由 1更新为 0;如果预删除的用户端设备没有分布在 不同的节点上, 或者分布所述预删除的用户端设备的节点的尾标记不全为
1, 则执行用户组删除的户端设备数 >首次分配的用户块时的操作;
若用户组删除的户端设备数 >首次分配的用户块, 则根据用户组原来的 用户端设备总数与预删除的用户端设备数的差值, 重新对用户端设备进行 分配。
由上可知, 用户端设备资源在不同的 CPU是负载均衡的, 用户端设备 数相差最大为 1,用户数据链的生成和更新与公网地址资源数据链的生成和 更新类似, 不再赘述。
图 4为本发明负载分担装置的组成结构示意图; 如图 4所示, 所述装 置包括负载分担配置模块 41、 负载分担控制模块 42、 CPU 43; 其中,
所述负载分担配置模块 41, 配置为以地址池形式配置公网地址; 还配 置为根据所述用户端设备发送的流量模型对用户端设备进行分组;
其中, 每个地址池包括多个地址块, 每个地址块对应一个 CPU; 每个 用户组包括多个用户块, 每个用户块对应一个 CPU;
所述负载分担控制模块 42,配置为将负载分担控制信息发送给 CPU43 , 以控制 CPU进行负载分担;
所述负载分担控制模块 42, 具体配置为根据公网地址资源数据链生成 公网地址资源负载分担标记表, 根据用户数据链生成用户端设备负载分担 标记表; 并将根据公网地址资源负载分担标记表和用户端设备负载分担标 记表生成的负载分担控制信息下发到 CPU43;
所述 CPU43, 配置为根据收到的负载分担控制信息为用户端设备分配 公网地址, 并为用户端设备的私网地址做公网地址转换。 具体的, 每个地址池对应一个公网地址资源数据链, 所述公网地址资 源数据链的节点数为 CPU数, 且每个节点对应一个 CPU; 每个节点分为块 才示 己矛口 才示 己;
每个用户组对应一个用户数据链,所述用户数据链的节点数为 CPU数, 且每个节点对应一个 CPU; 每个节点包括块标记、 尾标记。
实际应用中, 所述负载分担配置模块 41、 负载分担控制模块 42可以设 置于 CGN设备中。
实际应用中, 所述负载分担装置可设置于 CGN设备中; 上述负载分担 配置模块 41、 负载分担控制模块 42, 均可由 CGN设备的 CPU、 数字信号 处理器 (DSP, Digital Signal Processor ) 或可编程门阵列 (FPGA, Field Programmable Gate Array ) 实现。
图 5 为本发明实施例 CGN的负载分担的示意图, 本实施例中, 所述 CGN设备的类型可以为 Ds-lite CGN、 NAT44、 Bras nat44、 NAT64等; 用 户端设备对应的私网地址可以为私网 IPv4、 IPv6等; CGN设备为多业务处 理单元, 每个处理单元包含多个 CPU。
如图 5 所示, 首先, 负载分担配置模块以地址池形式配置公网地址, 并将公网地址资源分担到 CGN设备中不同处理单元的 CPU上; 其中, 地 址池的个数可根据实际需要进行设置。 同时, 可以配置用户的类型, 所述 用户的类型为用户端设备对应的私网地址类型; 用户端设备也是采用动态 的负载分担的形式分流, 即: 将用户端设备分担到不同的 CPU上; 由负载 分担控制模块生成负载分担标记表, 并将标记表信息发送到相应 CPU; 经 过上述处理后, 每个 CPU分担的公网地址数, 是基本均衡的; 每个 CPU 所处理的用户端设备的数目, 也是基本均衡的。
以上所述, 仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围。 因此, 凡按照本发明原理所作的任何修改、 等同替换和改进等, 均包含在本发明的保护范围之内。 工业实用性
本发明实施例中, 以地址池形式配置公网地址; 接收到用户端设备发 送的流量后, 根据所述用户端设备发送的流量模型对用户端设备进行分组, 由各个 CPU为用户端设备分配公网地址, 并为用户端设备的私网地址係公 网地址转换;其中,每个地址池包括多个地址块,每个地址块对应一个 CPU; 每个用户组包括多个用户块, 每个用户块对应一个 CPU。 如此, 能够解决 在多个 CPU上的公网地址资源以及用户端设备负载分担不均问题, 既能提 高 CPU处理地址转换的速度, 又能实现较好的负载分担效果。

Claims

权利要求书
1、 一种负载分担方法, 所述方法包括:
以地址池形式配置公网地址;
接收到用户端设备发送的流量后, 根据所述用户端设备发送的流量模 型对用户端设备进行分组, 由各个中央处理器 CPU为用户端设备分配公网 地址, 并为用户端设备的私网地址做公网地址转换;
其中, 每个地址池包括多个地址块, 每个地址块对应一个 CPU; 每个 用户组包括多个用户块, 每个用户块对应一个 CPU。
2、 根据权利要求 1所述的方法, 其中, 所述方法还包括:
根据地址池对应的地址资源数据链生成公网地址资源负载分担标记 表, 根据用户组对应的用户数据链生成用户端设备负载分担标记表; 所述 地址资源数据链根据配置的地址池生成; 所述用户数据链根据配置的用户 组生成;
根据公网地址资源负载分担标记表和用户端设备负载分担标记表生成 的负载分担控制信息发送给 CPU;
相应的, 所述 CPU为用户端设备分配公网地址, 并为用户端设备的私 网地址做公网地址转换为:
所述 CPU根据收到的负载分担控制信息为用户端设备分配公网地址, 并为用户端设备的私网地址係公网地址转换。
3、 根据权利要求 1所述的方法, 其中, 所述各个 CPU在每个地址池 中对应的公网地址数基本相同; 具体实现方法为:
将当前地址池的公网地址总数除以 CPU数平方的整数值与 CPU数的乘 积个公网地址分配给各个 CPU; 若还有公网地址剩余, 则将剩余的公网地 址除以 CPU数的整数值个公网地址分配给各个 CPU;若还有公网地址剩余, 则将各个地址池中所述剩余的公网地址作为一个整体进行公网地址分配, 使各个 CPU对应的公网地址数基本相同。
4、 根据权利要求 1所述的方法, 其中, 所述各个 CPU分担的用户端 设备数基本相同; 具体实现方法为:
将当前用户组的用户端设备总数除以 CPU数平方的整数值与 CPU数的 乘积个用户端设备分配给各个 CPU; 若还有用户端设备剩余, 则将剩余的 用户端设备除以 CPU数的整数值个用户端设备分配给各个 CPU; 若还有用 户端设备剩余, 则将各个用户组中剩余的用户端设备作为一个整体进行用 户端设备分配, 使各个 CPU分配的用户端设备数基本相同。
5、 根据权利要求 1至 4任一项所述的方法, 其中, 每个地址池对应一 个公网地址资源数据链, 所述公网地址资源数据链的节点数为 CPU数, 且 每个节点对应一个 CPU; 每个节点分为块标记和尾标记。
6、 根据权利要求 1至 4任一项所述的方法, 其中, 每个用户组对应一 个用户数据链, 所述用户数据链的节点数为 CPU数, 且每个节点对应一个 CPU; 每个节点包括块标记、 尾标记。
7、 一种负载分担装置, 所述装置包括负载分担配置模块、 负载分担控 制模块、 CPU; 其中,
所述负载分担配置模块, 配置为以地址池形式配置对公网地址; 根据 所述用户端设备发送的流量模型对用户端设备进行分组;
其中, 每个地址池包括多个地址块, 每个地址块对应一个 CPU; 每个 用户组包括多个用户块, 每个用户块对应一个 CPU;
所述负载分担控制模块, 配置为将负载分担控制信息发送给 CPU; 所述 CPU, 配置为根据收到的负载分担控制信息为用户端设备分配公 网地址, 并为用户端设备的私网地址做公网地址转换。
8、 根据权利要求 7所述的装置, 其中, 所述负载分担控制模块, 具体 配置为根据公网地址资源数据链生成公网地址资源负载分担标记表; 以及, 根据用户数据链生成用户端设备负载分担标记表; 并将根据公网地址资源 负载分担标记表和用户端设备负载分担标记表生成的负载分担控制信息下 发到 CPU。
9、 根据权利要求 7或 8所述的装置, 其中, 每个地址池对应一个公网 地址资源数据链, 所述公网地址资源数据链的节点数为 CPU数, 且每个节 点对应一个 CPU; 每个节点分为块标记和尾标记;
每个用户组对应一个用户数据链,所述用户数据链的节点数为 CPU数, 且每个节点对应一个 CPU; 每个节点包括块标记、 尾标记。
10、 根据权利要求 7或 8所述的装置, 其中, 所述负载分担配置模块、 负载分担控制模块设置于 CGN设备中。
PCT/CN2013/083587 2013-01-28 2013-09-16 一种负载分担方法及装置 Ceased WO2014114097A1 (zh)

Priority Applications (5)

Application Number Priority Date Filing Date Title
US14/763,276 US9332067B2 (en) 2013-01-28 2013-09-16 Load sharing method and apparatus
BR112015017876-6A BR112015017876B1 (pt) 2013-01-28 2013-09-16 Método de partilha de carga e dispositivo de partilha de carga
EP13872335.8A EP2942914B1 (en) 2013-01-28 2013-09-16 Load sharing method and apparatus
RU2015133461A RU2613528C2 (ru) 2013-01-28 2013-09-16 Способ и устройство для разделения нагрузки
AU2013375618A AU2013375618B2 (en) 2013-01-28 2013-09-16 Load sharing method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310032141.7 2013-01-28
CN201310032141.7A CN103117947B (zh) 2013-01-28 2013-01-28 一种负载分担方法及装置

Publications (1)

Publication Number Publication Date
WO2014114097A1 true WO2014114097A1 (zh) 2014-07-31

Family

ID=48416225

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/083587 Ceased WO2014114097A1 (zh) 2013-01-28 2013-09-16 一种负载分担方法及装置

Country Status (7)

Country Link
US (1) US9332067B2 (zh)
EP (1) EP2942914B1 (zh)
CN (1) CN103117947B (zh)
AU (1) AU2013375618B2 (zh)
BR (1) BR112015017876B1 (zh)
RU (1) RU2613528C2 (zh)
WO (1) WO2014114097A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3189681A4 (en) * 2014-09-02 2017-07-19 Telefonaktiebolaget LM Ericsson (publ) Method and system for handling a traffic flow between local service clouds

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103117947B (zh) * 2013-01-28 2016-06-29 中兴通讯股份有限公司 一种负载分担方法及装置
CN104426794B (zh) * 2013-08-23 2018-06-26 华为技术有限公司 一种报文转发方法及装置
CN105791448B (zh) * 2014-12-18 2019-10-25 华为技术有限公司 一种地址分配方法、cgn设备及cgn双主系统
CN108259632B (zh) * 2017-05-24 2020-02-11 新华三技术有限公司 一种cgn实现方法及装置
CN109067667B (zh) * 2018-07-13 2022-03-18 哈尔滨工程大学 一种基于报文分类的动态负载均衡方法
CN109218219A (zh) * 2018-10-15 2019-01-15 迈普通信技术股份有限公司 一种负载均衡方法、装置、网络设备及存储介质
CN109639580B (zh) * 2019-02-03 2021-05-14 新华三信息安全技术有限公司 一种报文转发方法及装置
CN109787914B (zh) * 2019-03-28 2022-07-01 新华三技术有限公司 负载分担方法、装置及网络设备
CN110086727B (zh) * 2019-04-30 2022-07-01 新华三技术有限公司 一种cgn板间负载分担方法及装置
CN113472676B (zh) * 2020-03-31 2024-09-06 华为技术有限公司 一种网络接入控制方法、sdf、cp、up以及网络系统
CN112104565B (zh) * 2020-09-15 2024-03-29 东软集团股份有限公司 一种实现报文转发的方法、系统及设备
CN115766652A (zh) * 2021-09-01 2023-03-07 华为技术有限公司 网络地址转换的方法和装置
CN116192806A (zh) * 2023-01-13 2023-05-30 北京信而泰科技股份有限公司 一种基于测试仪的ip分配方法、系统、终端及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005050897A2 (en) * 2003-11-18 2005-06-02 Air Broadband Communications, Inc. Dhcp pool sharing mechanism in mobile environment
CN102202104A (zh) * 2010-03-23 2011-09-28 丛林网络公司 管理网络设备内的分布式地址池
CN102821165A (zh) * 2012-04-13 2012-12-12 中兴通讯股份有限公司 Ip地址转换方法及装置
CN103117947A (zh) * 2013-01-28 2013-05-22 中兴通讯股份有限公司 一种负载分担方法及装置

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6888836B1 (en) * 1999-05-26 2005-05-03 Hewlett-Packard Development Company, L.P. Method for allocating web sites on a web hosting cluster
US7127504B2 (en) * 2002-11-21 2006-10-24 Sun Microsystems, Inc. System and method of applying power laws in optimizing network traffic
CN100365591C (zh) * 2003-06-08 2008-01-30 华为技术有限公司 基于客户端的网络地址分配方法
RU2387002C2 (ru) * 2003-06-30 2010-04-20 Майкрософт Корпорейшн Выравнивание сетевой нагрузки с помощью управления соединением
US7430614B2 (en) * 2003-10-31 2008-09-30 Redback Networks, Inc. Use of IP address blocks with default interfaces in a router
KR100929914B1 (ko) * 2007-12-18 2009-12-04 한국전자통신연구원 애드 혹 네트워크를 위한 동적 주소 할당 방법
CN101227398B (zh) * 2008-01-31 2010-08-18 中兴通讯股份有限公司 网络地址转换的自动调整应用的系统及方法
US20100223466A1 (en) * 2009-02-27 2010-09-02 Third Iris Corp Shared scalable server to control confidental event traffic among recordation terminals, analysis engines, and a storage farm coupled via a public network
US20110235788A1 (en) * 2010-03-01 2011-09-29 Mary Jesse Method and system for efficient use of address resources within an automated communications system
US8289968B1 (en) * 2010-10-27 2012-10-16 Juniper Networks, Inc. Distributed network address translation in computer networks
US8429257B2 (en) * 2011-03-03 2013-04-23 Verizon Patent And Licensing Inc. Optimizing use of internet protocol addresses
CN102694873B (zh) * 2011-03-22 2016-02-10 中兴通讯股份有限公司 一种地址池分配系统及方法
CN102158569A (zh) * 2011-06-02 2011-08-17 杭州华三通信技术有限公司 一种基于地址转换的数据传输方法及其设备
US9137198B2 (en) * 2011-10-21 2015-09-15 Hewlett-Packard Development Company, L.P. Centralized configuration with dynamic distributed address management
CN102594933B (zh) 2011-12-20 2015-04-08 华为技术有限公司 一种公网地址分配的方法、装置及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005050897A2 (en) * 2003-11-18 2005-06-02 Air Broadband Communications, Inc. Dhcp pool sharing mechanism in mobile environment
CN102202104A (zh) * 2010-03-23 2011-09-28 丛林网络公司 管理网络设备内的分布式地址池
CN102821165A (zh) * 2012-04-13 2012-12-12 中兴通讯股份有限公司 Ip地址转换方法及装置
CN103117947A (zh) * 2013-01-28 2013-05-22 中兴通讯股份有限公司 一种负载分担方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2942914A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3189681A4 (en) * 2014-09-02 2017-07-19 Telefonaktiebolaget LM Ericsson (publ) Method and system for handling a traffic flow between local service clouds
US10219184B2 (en) 2014-09-02 2019-02-26 Telefonaktiebolaget Lm Ericsson (Publ) Method and system for handling a traffic flow between local service clouds

Also Published As

Publication number Publication date
BR112015017876B1 (pt) 2022-09-27
US9332067B2 (en) 2016-05-03
EP2942914B1 (en) 2019-01-02
EP2942914A1 (en) 2015-11-11
AU2013375618A1 (en) 2015-08-13
RU2015133461A (ru) 2017-03-06
EP2942914A4 (en) 2016-03-02
CN103117947A (zh) 2013-05-22
US20150373094A1 (en) 2015-12-24
CN103117947B (zh) 2016-06-29
AU2013375618B2 (en) 2016-05-05
BR112015017876A2 (pt) 2017-07-11
RU2613528C2 (ru) 2017-03-16

Similar Documents

Publication Publication Date Title
WO2014114097A1 (zh) 一种负载分担方法及装置
CN108924268B (zh) 一种容器云服务系统及pod创建方法、装置
JP6014254B2 (ja) 通信の方法及びシステム
KR102146476B1 (ko) 애니캐스트 데이터 트래픽을 로드 밸런싱하기 위한 방법 및 시스템
JP6087922B2 (ja) 通信制御方法及びゲートウェイ
ES2663410T3 (es) Un controlador de red y un método informático implementado para definir automáticamente reglas de reenvío para configurar un dispositivo de interconexión de red informático
CN105577723B (zh) 虚拟化网络中实现负载分担的方法和装置
CN105791448B (zh) 一种地址分配方法、cgn设备及cgn双主系统
CN104780088A (zh) 一种业务报文的传输方法和设备
CN106487695A (zh) 一种数据传输方法、虚拟网络管理装置及数据传输系统
KR101320962B1 (ko) 네트워크 어드레스 변환을 위한 관리 방법 및 관리 장치
CN104579898A (zh) 一种租户隔离方法及系统
CN104580505A (zh) 一种租户隔离方法及系统
CN103607432A (zh) 一种网络创建的方法和系统及网络控制中心
CN105099950A (zh) 一种资源分配方法、报文通信方法及装置
CN108737591B (zh) 一种服务配置的方法及装置
CN117792995A (zh) 租户通信方法、装置、电子设备及存储介质
CN107809386A (zh) Ip地址转换方法、路由设备和通信系统
CN103051544B (zh) 实现IPv4私网接入IPv6网络的方法及接入设备
CA2974353A1 (en) System and method for identifying a communication for routing purposes using internet protocol addresses that are allocated by and shared amongst internet service provider networks
CN102752199A (zh) 一种虚拟路由器的数据转发平面的构建方法与系统
CN101674337B (zh) 虚拟专用网互联网协议地址分配方法和网管系统
JP5587254B2 (ja) 割当装置、割当プログラム、割当方法、及び割当システム
US10791088B1 (en) Methods for disaggregating subscribers via DHCP address translation and devices thereof
CN103944831A (zh) 负载均衡方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13872335

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14763276

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2013872335

Country of ref document: EP

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112015017876

Country of ref document: BR

ENP Entry into the national phase

Ref document number: 2013375618

Country of ref document: AU

Date of ref document: 20130916

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2015133461

Country of ref document: RU

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 112015017876

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20150727