CN110086727B - Load sharing method and device between CGN boards - Google Patents

Load sharing method and device between CGN boards Download PDF

Info

Publication number
CN110086727B
CN110086727B CN201910361016.8A CN201910361016A CN110086727B CN 110086727 B CN110086727 B CN 110086727B CN 201910361016 A CN201910361016 A CN 201910361016A CN 110086727 B CN110086727 B CN 110086727B
Authority
CN
China
Prior art keywords
message
address
board
cgn
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910361016.8A
Other languages
Chinese (zh)
Other versions
CN110086727A (en
Inventor
章靠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Information Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201910361016.8A priority Critical patent/CN110086727B/en
Publication of CN110086727A publication Critical patent/CN110086727A/en
Application granted granted Critical
Publication of CN110086727B publication Critical patent/CN110086727B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • 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

Abstract

The disclosure provides a load sharing method and device between CGN boards. The method comprises the following steps: receiving a first message copied and sent by the network side service board, wherein the first message is copied and sent when the network side service board checks that a first IP address of the first message received by a network side interface is the same as a public network IP address of a local configured network address translation service NAT server, and the first IP address is a destination IP address of the first message; if the session table item matched with the first message does not exist locally, performing NAT (network Address translation) on the first IP address of the first message to obtain a second IP address, wherein the second IP address is the IP address of the user side equipment; determining a target CGN board of the first message according to the second IP address, judging whether the target CGN board is the target CGN board or not, and if not, discarding the first message; if yes, the first message is forwarded to a user side service board. Therefore, load sharing among the CGN boards can be more balanced.

Description

Load sharing method and device between CGN boards
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a method and an apparatus for sharing load between CGN boards.
Background
For a Network device deployed in an intranet, for example, a server, an Address of the Network device is an intranet Address, but it is desirable that a public Network device can access the server through one public Network Address, and at this time, a Network Address Translation (NAT) server may be configured on a Network device performing NAT processing, so that a message sent from the public Network to the intranet is converted between the public Network Address and the intranet Address through the Network device.
In the related art, when the network device includes a plurality of CGN boards, generally, one of the CGN boards is designated to perform NAT conversion on a message sent from a public network to an intranet, and in the process, only the designated CGN board participates in the work, and other CGN boards do not participate, so that load balancing among the CGN boards cannot be achieved.
Disclosure of Invention
In view of this, the present disclosure provides a method and an apparatus for load sharing among CGN boards, so as to achieve load sharing balance among CGN boards.
Specifically, the present disclosure is realized by the following technical solutions:
in a first aspect, an embodiment of the present disclosure provides a method for load sharing among CGN boards, where the method is applied to a CGN board participating in load sharing in a network device, where the network device includes a network side service board, a user side service board, and at least two CGN boards; the method comprises the following steps:
receiving a first message copied and sent by the network side service board, wherein the first message is copied and sent when the network side service board checks that a first IP address of the first message received by a network side interface is the same as a public network IP address of a local configured network address translation service NAT server, and the first IP address is a destination IP address of the first message;
if the session table item matched with the first message does not exist locally, performing NAT (network Address translation) on the first IP address of the first message to obtain a second IP address, wherein the second IP address is the IP address of the user side equipment;
determining a target CGN board of the first message according to the second IP address, judging whether the target CGN board is the target CGN board or not, and if not, discarding the first message; if yes, the first message is forwarded to a user side service board.
In a second aspect, an embodiment of the present disclosure provides a load sharing device between CGN boards, which is applied to a CGN board participating in load sharing in a network device, where the network device includes a network side service board, a user side service board, and at least two CGN boards; the device comprises:
a first receiving module, configured to receive a first packet copied and sent by the network side service board, where the first packet is copied and sent when the network side service board checks that a first IP address of the first packet received by the network side interface is the same as a public network IP address of a locally configured NAT server, and the first IP address is a destination IP address of the first packet;
the first conversion module is used for carrying out NAT conversion on a first IP address of the first message to obtain a second IP address if a session table item matched with the first message does not exist locally, wherein the second IP address is the IP address of the user side equipment;
the judging module is used for determining a target CGN board of the first message according to the second IP address, judging whether the board is the target CGN board or not, and if not, discarding the first message; if yes, the first message is forwarded to a user side service board.
In a third aspect, the disclosed embodiments provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the method according to the first aspect.
In a fourth aspect, this disclosed embodiment also provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the method according to the first aspect when executing the program
The method and the device for load sharing among CGN boards provided by the embodiment of the disclosure copy a first message hitting an external network IP address of a locally configured NAT (network Address translation) server to each CGN board participating in load sharing through a network side service board, if the CGN board does not have a session table item matched with the first message locally, perform NAT (network Address translation) conversion on the first IP address of the first message to obtain a second IP address, wherein the second IP address is an IP address of user side equipment, judge whether the board is a target CGN board of the first message according to the second IP address, and if not, discard the first message; if yes, the first message is forwarded to a user side service board; further, in the present disclosure, the first packet is copied to each CGN board participating in load sharing, the CGN board performs NAT conversion, and the target CGN member board determined by the second IP address after the NAT conversion is performed on the first packet forwards the first packet, and since the second IP addresses obtained after the NAT conversion of the first packet sent to different user-side devices are different, the target CGN member boards determined according to the second IP addresses are different, and thus compared with a mode in which a reverse packet is subjected to NAT conversion and forwarding by designating one CGN member board in the prior art, load sharing between CGN boards is more balanced to a certain extent.
Drawings
Fig. 1 is a schematic flowchart illustrating a method for sharing load between CGN boards according to an exemplary embodiment of the present disclosure;
fig. 2 is a schematic view of a scene of a method for sharing load between CGN boards according to an exemplary embodiment of the present disclosure;
fig. 3 is a flowchart illustrating a method for processing a reverse packet according to an exemplary embodiment of the present disclosure;
fig. 4 is a schematic structural diagram illustrating an apparatus for sharing load between CGN boards according to an exemplary embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a computer device according to an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the disclosure, as detailed in the appended claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, 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 the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In the prior art, when accessing a device in an intranet through an NAT server public network address, because there is only one public network address, when a network device performing NAT processing includes a plurality of CGN boards, a CGN member board is generally designated to perform NAT conversion and transmission on a message, and thus load balancing between the CGN boards cannot be achieved; based on this, the embodiment of the disclosure provides a method and a device for sharing load between CGN boards.
Referring to fig. 1, a method for load sharing among CGN boards provided in an embodiment of the present disclosure is applied to a network device, where the network device includes a network side service board, a user side service board, and at least two CGN boards, and the method includes the following steps:
s101, receiving a first message copied and sent by the network side service board, wherein the first message is copied and sent when the network side service board checks that a first IP address of the first message received by the network side interface is the same as a public network IP address of a locally configured network address translation service NAT server, and the first IP address is a destination IP address of the first message.
In this embodiment, the network side service board copies the first packet having the same first IP address as the locally configured public network IP address of the NAT server, and sends the copied first packets to the CGN board currently participating in load sharing. The first IP address is a destination IP address of the first packet before NAT conversion.
S102, if the session table item matched with the first message does not exist locally, carrying out NAT (network address translation) conversion on the first IP address of the first message to obtain a second IP address, wherein the second IP address is the IP address of the user side equipment.
After receiving the first message, the CGN board searches whether a session table item matched with the first message exists locally, and if not, NAT conversion is carried out on the first IP address of the first message to obtain a second IP address.
S103, determining a target CGN board of the first message according to the second IP address, judging whether the board is the target CGN board, and if not, discarding the first message; if yes, the first message is forwarded to a user side service board.
And after the NAT conversion is carried out on the first IP address of the first message to obtain a second IP address, determining a target CGN plate of the first message according to the second IP address.
For example, the determining of the target CGN board of the first packet according to the second IP address may be performed by performing hash operation according to the second IP address and the number of CGN boards currently participating in load sharing, and calculating to obtain a hash value; and selecting a target CGN plate from the plurality of CGN plates currently participating in load sharing according to the hash value.
For example, the method for calculating the hash value and selecting the target CGN board according to the hash value may be performed with reference to the prior art, and the disclosure does not limit this.
In the load sharing method between the CGN boards provided in the embodiment of the present disclosure, the first packet is copied to the CGN boards participating in load sharing, each CGN board performs NAT conversion on the first IP address of the first packet to obtain the second IP address, then determines the target CGN board of the first packet according to the second IP address, and determines whether the board is the target CGN board of the first packet, if so, forwards the first packet to the service board on the user side; in this embodiment, all CGN boards participating in load sharing perform NAT conversion, and the target CGN determined according to the second IP address forwards the packet, thereby achieving load balancing between CGN boards compared to the prior art.
Referring to the embodiment shown in fig. 2, a specific implementation scenario is given in the embodiment of the present disclosure, and the network device may be a NAT gateway or a router.
The network device of this embodiment includes a network side service board and a user side service board, and in this embodiment, the network device includes three CGN boards: CGN board A, CGN board B, CGN board C, and all three CGN boards participate in load sharing as an example; the network side service board comprises a network side interface, on the network side service board, a first message with a first IP address received by the network side interface and a public network IP address of a local configured NAT server is copied to obtain three first messages, the three first messages are respectively sent to a CGN board A, CGN board B and a CGN board C, the CGN board A, CGN board B and the CGN board C respectively search whether a session table item matched with the first message exists locally, if the session table item does not exist, NAT conversion is carried out on the received first message, a target CGN board is determined according to a second IP address obtained after conversion, the determined target CGN board is taken as the CGN board A, the CGN board A judges that the board is the determined target CGN board A, then the first message is sent to a user side service board, and the user side service board continues sending according to the prior art. After the CGN board B, CGN board C determines that the board is not the determined target CGN board, the CGN board B, CGN board C discards the first message.
In an optional embodiment of the present disclosure, the method further includes the following steps:
step a10, the CGN board generates a corresponding session entry for the received first message, where the session entry at least includes: generating the total quantity M2 of the CGN boards participating in load sharing, a first IP address, a second IP address and attribute information when the session table item is generated; the attribute information is used for indicating whether the CGN board is a target CGN board of the first message.
In this embodiment, after each CGN board determines whether the CGN board is a target CGN board of the first message, a session entry corresponding to the first message is generated on the CGN board. The first IP address is the IP address of the first message before NAT conversion, and the second IP address is the IP address of the message after NAT conversion.
In an optional embodiment of the present disclosure, the method further includes the following step B10:
step B10, when a session table item matched with the first message exists locally on the CGN board, processing the first message according to the attribute information in the session table item and the total quantity M2 of the CGN boards participating in load sharing currently; the attribute information is used for indicating whether the CGN board is a target CGN board of the first message.
Further, in the embodiment of the present disclosure, if each CGN board locally stores a session entry matching the first packet, the first packet is processed according to the attribute information in the session entry and the total number of CGN boards currently participating in load sharing.
Optionally, the processing the first packet according to the attribute information in the session entry and the total number of CGN boards currently participating in load sharing includes the following steps C10-C20:
step C10, when the attribute information indicates that the local board is a target CGN board of the first packet, if the total number M1 of the CGN boards currently participating in load sharing is the same as the total number M2 of the CGN boards in the session entry, or if M1 is different from M2 and the local board is determined to be the target CGN board according to M1 and the second IP address in the session entry, performing NAT processing on the first packet to convert the first IP address of the first packet into the second IP address in the session entry, and forwarding the processed first packet to the user side service board; and if the M1 is different from the M2 and the local board is determined not to be the target CGN board according to the M1 and the second IP address in the session table entry, discarding the first message.
And after the session record matched with the first message is found, acquiring attribute information in the session record and the total number of the CGN boards M2, and if the attribute information indicates that the CGN board is the target CGN board of the first message and the total number M1 of the CGN boards currently participating in load sharing is the same as the total number M2 of the CGN boards recorded in the session table item, performing NAT processing on the first message to convert the first IP address of the first message into the second IP address in the session table item, and forwarding the processed first message to a user side service board.
If the total number M1 of the CGN boards currently participating in load sharing is different from the total number M2 of the CGN boards recorded in the session entry, it is indicated that an operation of adding a CGN board or deleting a CGN board occurs, at this time, a target CGN board is re-determined according to the total number M1 of the CGN boards currently participating in load sharing and a second IP address in the session entry, and it is determined whether the board is the target CGN board, if so, NAT processing is performed on the first message to convert the first IP address of the first message into the second IP address in the session entry, and the processed first message is forwarded to the user side service board; if not, the first message is discarded.
The total number M1 of the CGN boards currently participating in load sharing may be obtained by the CGN boards by reading configuration information of the network device.
Step C20, when the attribute information indicates that the board is not the target CGN board of the first message, if M1 is the same as M2, or if M1 is different from M2 and the board is determined not to be the target CGN board according to M1 and the second IP address in the session entry, discarding the first message; if the M1 is different from the M2 and the local board is determined to be the target CGN board according to the M1 and the second IP address in the session table entry, the first message is subjected to NAT processing so that the first IP address of the first message is converted into the second IP address in the session table entry, the processed first message is forwarded to the user side service board, and the attribute information is updated to indicate that the local board is the target CGN board.
In this embodiment, after obtaining the attribute information and the total number M2 of the CGN boards in the session record, if the attribute information indicates that the local board is not the target CGN board of the first packet and the total number M1 of the CGN boards currently participating in load sharing is the same as M2, it indicates that the number of the CGN boards participating in load sharing has not changed, and at this time, the first packet is discarded; if the total number M1 of the CGN boards currently participating in load sharing is different from M2, it is indicated that an operation of adding a CGN board or deleting a CGN board occurs, at this time, the target CGN board of the first packet is re-determined according to the total number M1 of the CGN boards currently participating in load sharing and the second IP address in the session entry, and it is determined whether the board is the target CGN board of the first packet, if yes, NAT processing is performed on the first packet, so that the first IP address of the first packet is converted into the second IP address in the session entry, and if not, the first packet is discarded.
In the above embodiment, after re-determining the target CGN board of the first packet and determining whether the board is the target CGN board of the first packet, if the determined result is inconsistent with the attribute information in the original session entry, the attribute information in the session entry may be updated.
Fig. 3 is a schematic diagram illustrating a processing procedure of a reverse packet according to an embodiment of the present disclosure. Referring to fig. 3, in another embodiment of the present disclosure, the method further includes the following steps S301 to S302:
s301, the CGN board receives a second message sent by the user side service board, wherein the second message is sent when the user side service board receives the second message, the source IP address of the second message is a second IP address, and a target CGN board for performing NAT processing on the second message is determined to be the CGN board according to the second IP address.
In this embodiment, the user side service board may also be a target CGN board that performs NAT processing on the second packet according to the hash value obtained by performing hash operation on the second IP address and selecting the second packet.
S302, searching a session table item according to a second IP address of the second message, performing NAT processing on the second message according to the session table item so as to convert a destination IP address of the second message into a first IP address in the session table item, and sending the converted second message to the network side service board.
The first message is a message sent from the network side to the user side, and may be referred to as a reverse message; in this embodiment, for the forward packet, NAT processing may be performed by directly referring to the session table entry generated by the reverse packet.
Fig. 4 is a schematic structural diagram of a CGN inter-board load sharing device according to an embodiment of the present disclosure. The device is applied to CGN boards participating in load sharing in network equipment, wherein the network equipment comprises a network side service board, a user side service board and at least two CGN boards; referring to fig. 4, the apparatus includes:
a first receiving module 401, configured to receive a first packet copied and sent by the network side service board, where the first packet is copied and sent when the network side service board checks that a first IP address of the first packet received by the network side interface is the same as a public network IP address of a locally configured NAT server, and the first IP address is a destination IP address of the first packet;
a first conversion module 402, configured to perform NAT conversion on a first IP address of a first packet to obtain a second IP address if a session entry matching the first packet does not exist locally, where the second IP address is an IP address of a user side device;
a determining module 403, configured to determine a target CGN board of the first packet according to the second IP address, determine whether the board is the target CGN board, and if not, discard the first packet; if yes, the first message is forwarded to a user side service board.
Optionally, the apparatus further comprises:
a generating module, configured to generate a corresponding session entry for the received first packet, where the session entry at least includes: generating the total number M2 of the CGN boards participating in load sharing, a first IP address, a second IP address and attribute information when the session table item is generated; the attribute information is used for indicating whether the CGN board is a target CGN board of the first message.
Optionally, the apparatus further comprises:
the processing module is used for processing the first message according to the attribute information in the session table item and the total number M2 of the CGN boards currently participating in load sharing when the session table item matched with the first message exists locally; the attribute information is used for indicating whether the CGN board is a target CGN board of the first message.
Optionally, the processing module is specifically configured to:
when the attribute information indicates that the local board is the target CGN board of the first message, if the total number M1 of the CGN boards currently participating in load sharing is the same as the total number M2 of the CGN boards in the session entry, or if M1 is different from M2 and the local board is determined to be the target CGN board according to M1 and the second IP address in the session entry, performing NAT processing on the first message so as to convert the first IP address of the first message into the second IP address in the session entry, and forwarding the processed first message to the user side service board; if the M1 is different from the M2 and the local board is determined not to be the target CGN board according to the M1 and the second IP address in the session table entry, discarding the first message;
when the attribute information indicates that the local board is not the target CGN board of the first message, if the M1 is the same as the M2, or if the M1 is different from the M2 and the local board is determined not to be the target CGN board according to the M1 and the second IP address in the session entry, discarding the first message; if the M1 is different from the M2 and the local board is determined to be the target CGN board according to the M1 and the second IP address in the session table entry, the first message is subjected to NAT processing to convert the first IP address of the first message into the second IP address in the session table entry, and the processed first message is forwarded to the user side service board.
Optionally, the apparatus further comprises:
a second receiving module, configured to receive a second message sent by the user side service board, where the second message is sent when the user side service board receives the second message, and a source IP address of the second message is a second IP address, and a target CGN board for performing NAT processing on the second message is determined to be the CGN board according to the second IP address;
and the second conversion module is used for searching the session table item according to the second IP address of the second message, performing NAT processing on the second message according to the session table item so as to convert the target IP address of the second message into the first IP address in the session table item, and sending the converted second message to the network side service board.
An embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for load sharing between CGN boards described in any of the above embodiments.
Fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure. Referring to fig. 5, the computer device 500 includes at least a memory 502 and a processor 501; the memory 502 is connected to the processor 501 via a communication bus 503 for storing computer instructions executable by the processor 501; the processor 501 is configured to read computer instructions from the memory 502 to implement the steps of the CGN inter-board load sharing method according to any of the above embodiments.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. One of ordinary skill in the art can understand and implement it without inventive effort.
Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal magnetic disks or removable disks), magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.
While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. In other instances, features described in connection with one embodiment may be implemented as discrete components or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
Thus, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Further, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.
The above description is only exemplary of the present disclosure and should not be taken as limiting the disclosure, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (12)

1. A load sharing method between CGN boards is characterized in that the method is applied to CGN boards participating in load sharing in network equipment, and the network equipment comprises a network side service board, a user side service board and at least two CGN boards; the method comprises the following steps:
receiving a first message copied and sent by the network side service board, wherein the first message is copied and sent when the network side service board checks that a first IP address of the first message received by a network side interface is the same as a public network IP address of a local configured network address translation service NAT server, and the first IP address is a destination IP address of the first message;
if the session table item matched with the first message does not exist locally, performing NAT (network Address translation) on the first IP address of the first message to obtain a second IP address, wherein the second IP address is the IP address of the user side equipment;
determining a target CGN board of the first message according to the second IP address, judging whether the target CGN board is the target CGN board or not, and if not, discarding the first message; if yes, the first message is forwarded to a user side service board.
2. The method of claim 1, further comprising:
the CGN board generates a corresponding session entry for the received first packet, where the session entry at least includes: generating the total quantity M2 of the CGN boards participating in load sharing, a first IP address, a second IP address and attribute information when the session table item is generated; the attribute information is used for indicating whether the CGN board is a target CGN board of the first message.
3. The method of claim 1, further comprising:
when a session table item matched with a first message locally exists on the CGN board, processing the first message according to attribute information in the session table item and the total number M2 of the CGN boards currently participating in load sharing; the attribute information is used for indicating whether the CGN board is a target CGN board of the first message.
4. The method of claim 3, wherein the processing the first packet according to the attribute information in the session entry and the total number of CGN boards currently participating in load sharing comprises:
when the attribute information indicates that the local board is the target CGN board of the first message, if the total number M1 of the CGN boards currently participating in load sharing is the same as the total number M2 of the CGN boards in the session entry, or if M1 is different from M2 and the local board is determined to be the target CGN board according to M1 and the second IP address in the session entry, performing NAT processing on the first message so as to convert the first IP address of the first message into the second IP address in the session entry, and forwarding the processed first message to the user side service board; if the M1 is different from the M2 and the local board is determined not to be the target CGN board according to the M1 and the second IP address in the session table entry, discarding the first message;
when the attribute information indicates that the local board is not the target CGN board of the first message, if the M1 is the same as the M2, or if the M1 is different from the M2 and the local board is determined not to be the target CGN board according to the M1 and the second IP address in the session entry, discarding the first message; if the M1 is different from the M2 and the local board is determined to be the target CGN board according to the M1 and the second IP address in the session table entry, the first message is subjected to NAT processing to convert the first IP address of the first message into the second IP address in the session table entry, and the processed first message is forwarded to the user side service board.
5. The method of claim 1, further comprising:
the CGN board receives a second message sent by the user side service board, wherein the source IP address of the second message is a second IP address when the user side service board receives the second message, and the CGN board determines that a target CGN board for performing NAT processing on the second message is the CGN board according to the second IP address;
and searching a session table item according to a second IP address of the second message, performing NAT processing on the second message according to the session table item so as to convert a target IP address of the second message into the first IP address in the session table item, and sending the converted second message to the network side service board.
6. A load sharing device between CGN boards is characterized in that the device is applied to CGN boards participating in load sharing in network equipment, and the network equipment comprises a network side service board, a user side service board and at least two CGN boards; the device comprises:
a first receiving module, configured to receive a first packet copied and sent by the network side service board, where the first packet is copied and sent when the network side service board checks that a first IP address of the first packet received by the network side interface is the same as a public network IP address of a locally configured NAT server, and the first IP address is a destination IP address of the first packet;
the first conversion module is used for carrying out NAT conversion on a first IP address of the first message to obtain a second IP address if a session table item matched with the first message does not exist locally, wherein the second IP address is the IP address of the user side equipment;
the judging module is used for determining a target CGN board of the first message according to the second IP address, judging whether the board is the target CGN board or not, and if not, discarding the first message; if yes, the first message is forwarded to a user side service board.
7. The apparatus of claim 6, further comprising:
a generating module, configured to generate a corresponding session entry for the received first packet, where the session entry at least includes: generating the total quantity M2 of the CGN boards participating in load sharing, a first IP address, a second IP address and attribute information when the session table item is generated; the attribute information is used for indicating whether the CGN board is a target CGN board of the first message.
8. The apparatus of claim 6, further comprising:
the processing module is used for processing the first message according to the attribute information in the session table item and the total number M2 of the CGN boards currently participating in load sharing when the session table item matched with the first message exists locally; the attribute information is used for indicating whether the CGN board is a target CGN board of the first message.
9. The apparatus of claim 8, wherein the processing module is specifically configured to:
when the attribute information indicates that the local board is the target CGN board of the first message, if the total number M1 of the CGN boards currently participating in load sharing is the same as the total number M2 of the CGN boards in the session entry, or if M1 is different from M2 and the local board is determined to be the target CGN board according to M1 and the second IP address in the session entry, performing NAT processing on the first message so as to convert the first IP address of the first message into the second IP address in the session entry, and forwarding the processed first message to the user side service board; if the M1 is different from the M2 and the local board is determined not to be the target CGN board according to the M1 and the second IP address in the session table entry, discarding the first message;
when the attribute information indicates that the local board is not the target CGN board of the first message, if the M1 is the same as the M2, or if the M1 is different from the M2 and the local board is determined not to be the target CGN board according to the M1 and the second IP address in the session entry, discarding the first message; if the M1 is different from the M2 and the local board is determined to be the target CGN board according to the M1 and the second IP address in the session table entry, the first message is subjected to NAT processing to convert the first IP address of the first message into the second IP address in the session table entry, and the processed first message is forwarded to the user side service board.
10. The apparatus of claim 6, further comprising:
a second receiving module, configured to receive a second message sent by the user side service board, where the second message is sent when the user side service board receives the second message, and a source IP address of the second message is a second IP address, and a target CGN board for performing NAT processing on the second message is determined to be the CGN board according to the second IP address;
and the second conversion module is used for searching the session table item according to the second IP address of the second message, performing NAT processing on the second message according to the session table item so as to convert the target IP address of the second message into the first IP address in the session table item, and sending the converted second message to the network side service board.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
12. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1-5 are implemented when the processor executes the program.
CN201910361016.8A 2019-04-30 2019-04-30 Load sharing method and device between CGN boards Active CN110086727B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910361016.8A CN110086727B (en) 2019-04-30 2019-04-30 Load sharing method and device between CGN boards

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910361016.8A CN110086727B (en) 2019-04-30 2019-04-30 Load sharing method and device between CGN boards

Publications (2)

Publication Number Publication Date
CN110086727A CN110086727A (en) 2019-08-02
CN110086727B true CN110086727B (en) 2022-07-01

Family

ID=67418233

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910361016.8A Active CN110086727B (en) 2019-04-30 2019-04-30 Load sharing method and device between CGN boards

Country Status (1)

Country Link
CN (1) CN110086727B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111654452B (en) * 2020-05-08 2024-02-27 杭州迪普科技股份有限公司 Message processing method and device
CN112738290B (en) * 2020-12-25 2022-08-26 杭州迪普科技股份有限公司 NAT (network Address translation) conversion method, device and equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009052668A1 (en) * 2007-10-22 2009-04-30 Zte Corporation A nat-pt device and a load-sharing method for nat-pt device
CN104954239A (en) * 2014-03-26 2015-09-30 中国电信股份有限公司 CGN broadband access gateway and implementation method thereof
CN106878386A (en) * 2016-12-30 2017-06-20 新华三技术有限公司 A kind of load-balancing method and device
CN107786459A (en) * 2014-09-02 2018-03-09 福建三元达网络技术有限公司 More board LTE gateway processes method and system based on load balancing
CN107864101A (en) * 2017-12-26 2018-03-30 杭州迪普科技股份有限公司 Load-balancing method and device
CN108390954A (en) * 2018-03-26 2018-08-10 新华三信息安全技术有限公司 A kind of message transmitting method and equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103117947B (en) * 2013-01-28 2016-06-29 中兴通讯股份有限公司 A kind of load sharing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009052668A1 (en) * 2007-10-22 2009-04-30 Zte Corporation A nat-pt device and a load-sharing method for nat-pt device
CN104954239A (en) * 2014-03-26 2015-09-30 中国电信股份有限公司 CGN broadband access gateway and implementation method thereof
CN107786459A (en) * 2014-09-02 2018-03-09 福建三元达网络技术有限公司 More board LTE gateway processes method and system based on load balancing
CN106878386A (en) * 2016-12-30 2017-06-20 新华三技术有限公司 A kind of load-balancing method and device
CN107864101A (en) * 2017-12-26 2018-03-30 杭州迪普科技股份有限公司 Load-balancing method and device
CN108390954A (en) * 2018-03-26 2018-08-10 新华三信息安全技术有限公司 A kind of message transmitting method and equipment

Also Published As

Publication number Publication date
CN110086727A (en) 2019-08-02

Similar Documents

Publication Publication Date Title
CN108259347B (en) Message transmission method and device
CN108111432B (en) Message forwarding method and device
CN106878194B (en) Message processing method and device
CN110417657B (en) Method and device for processing multicast data message
WO2018099394A1 (en) Packet transmission
CN107222408B (en) Shunting method and device
CN108259328B (en) Message forwarding method and device
CN109379241B (en) Path information determination method and device
CN110620727A (en) Gateway automatic routing method and related equipment in multi-environment
CN110086727B (en) Load sharing method and device between CGN boards
CN107547346B (en) Message transmission method and device
CN109194525A (en) A kind of network node configuration method and management node
CN104243631A (en) Method and device for stateful conversion between IPv4 address and IPv6 address
CN106031104A (en) Data packet forwarding method, apparatus and device
CN111131539B (en) Message forwarding method and device
US20160164952A1 (en) Systems and Methods For Information Centric Networking
CN111049947B (en) Message forwarding method and device, electronic equipment and storage medium
CN107547400B (en) Virtual machine migration method and device
US9049140B2 (en) Backbone network with policy driven routing
CN109728972B (en) Network connection detection method and device
JP2020521388A (en) Packet transmission method and apparatus
CN112738290B (en) NAT (network Address translation) conversion method, device and equipment
CN110381159B (en) Task processing method and system
EP3026862B1 (en) Routing loop determining method
CN110166375A (en) A kind of message forwarding method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230621

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

Patentee after: H3C INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 310052 Changhe Road, Binjiang District, Hangzhou, Zhejiang Province, No. 466

Patentee before: NEW H3C TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right