WO2023179786A1 - 网络地址转换网关的扩容方法、设备及存储介质 - Google Patents

网络地址转换网关的扩容方法、设备及存储介质 Download PDF

Info

Publication number
WO2023179786A1
WO2023179786A1 PCT/CN2023/083878 CN2023083878W WO2023179786A1 WO 2023179786 A1 WO2023179786 A1 WO 2023179786A1 CN 2023083878 W CN2023083878 W CN 2023083878W WO 2023179786 A1 WO2023179786 A1 WO 2023179786A1
Authority
WO
WIPO (PCT)
Prior art keywords
forwarding path
link request
forwarding
link
target
Prior art date
Application number
PCT/CN2023/083878
Other languages
English (en)
French (fr)
Inventor
任霄元
Original Assignee
阿里云计算有限公司
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 阿里云计算有限公司 filed Critical 阿里云计算有限公司
Publication of WO2023179786A1 publication Critical patent/WO2023179786A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings

Definitions

  • the present invention relates to the field of communication technology, and in particular, to a capacity expansion method, equipment and storage medium for a network address translation gateway.
  • NAT gateway can convert the private IP address into a public IP address when a host using a private IP address communicates with the outside world, so that the public network can be accessed.
  • NAT gateways due to the limited physical resources of traditional networks, it is impossible to achieve flexible elastic expansion of the performance indicators of the NAT gateway.
  • Embodiments of the present invention provide an expansion method, equipment and storage medium for a network address translation gateway, which can flexibly realize elastic expansion and contraction operations on performance indicators such as the number of concurrent links and the link creation rate, and further improve the address translation of the gateway. Quality and efficiency.
  • an embodiment of the present invention provides a method for expanding the capacity of a network address translation gateway, including:
  • the operating status includes at least one of the following: the number of concurrent link requests and the rate of new link requests;
  • the first forwarding path in the NAT gateway is expanded to obtain a target gateway
  • the first forwarding path is used to maintain session control information corresponding to the link request, and generate forwarding rules corresponding to the link request, so as to process the link request based on the forwarding rules.
  • an embodiment of the present invention provides a capacity expansion device for a network address translation gateway, including:
  • the first acquisition module is used to acquire the operating status of the network address translation NAT gateway.
  • the operating status includes at least one of the following: the number of concurrent link requests and the new link request rate;
  • a first processing module configured to expand the first forwarding path in the NAT gateway to obtain a target gateway when the operating status meets the preset expansion conditions
  • the first processing module is also configured to reduce the capacity of the first forwarding path in the NAT gateway to obtain a target gateway when the running state meets the preset reduction conditions;
  • the first forwarding path is used to maintain session control information corresponding to the link request, and generate forwarding rules corresponding to the link request, so as to process the link request based on the forwarding rules.
  • an embodiment of the present invention provides an electronic device, including: a memory and a processor; wherein the memory The memory is used to store one or more computer instructions, wherein when the one or more computer instructions are executed by the processor, the expansion method of the network address translation gateway in the first aspect is implemented.
  • embodiments of the present invention provide a computer storage medium for storing a computer program.
  • the computer program enables the computer to implement the network address translation gateway capacity expansion method in the first aspect when executed by a computer.
  • embodiments of the present invention provide a computer program product, including: a computer-readable storage medium storing computer instructions, which when executed by one or more processors causes the one or more processors to A processor executes the steps in the capacity expansion method of a network address translation gateway shown in the first aspect.
  • the technical solution provided by this embodiment is to obtain the operating status of the network address translation NAT gateway.
  • the operating status meets the preset expansion conditions, the first forwarding path in the NAT gateway is expanded to obtain the target gateway; This effectively enables flexible expansion and contraction of NAT gateway performance such as the number of concurrent links and link creation rate, further improving the address translation quality and efficiency of the NAT gateway.
  • Figure 1 is a functional block diagram 1 of a network address translation gateway provided by embodiments in the related art
  • Figure 2 is a functional block diagram 2 of a network address translation gateway provided by embodiments in the related art
  • Figure 3 is a schematic diagram of the principle of a network address translation gateway expansion method provided by an embodiment of the present invention.
  • Figure 4 is a schematic flow chart of a network address translation gateway expansion method provided by an embodiment of the present invention.
  • Figure 5 is a schematic flow chart of another network address translation gateway expansion method provided by an embodiment of the present invention.
  • Figure 6 is a schematic diagram of using the target forwarding path group to process the link request provided by an embodiment of the present invention
  • Figure 7 is a schematic flowchart of expanding the first forwarding path in the NAT gateway provided by an embodiment of the present invention.
  • Figure 8 is a schematic diagram 1 of expanding the first forwarding path in the NAT gateway provided by an embodiment of the present invention.
  • Figure 9 is a schematic diagram 2 of expanding the first forwarding path in the NAT gateway provided by an embodiment of the present invention.
  • Figure 10 is a schematic diagram of grouping the plurality of first forwarding paths provided by an embodiment of the present invention.
  • Figure 11 is a schematic flowchart of reducing the capacity of the first forwarding path in the NAT gateway provided by an embodiment of the present invention
  • Figure 12 is a schematic diagram 1 of reducing the capacity of the first forwarding path in the NAT gateway provided by an embodiment of the present invention
  • Figure 13 is a schematic diagram 2 of reducing the capacity of the first forwarding path in the NAT gateway provided by an embodiment of the present invention
  • Figure 14 is a schematic structural diagram of a capacity expansion device for a network address translation gateway provided by an embodiment of the present invention.
  • FIG. 15 is a schematic structural diagram of an electronic device corresponding to the capacity expansion device of a network address translation gateway provided by the embodiment shown in FIG. 14 .
  • the words “if” or “if” as used herein may be interpreted as “when” or “when” or “in response to determination” or “in response to detection.”
  • the phrase “if determined” or “if (stated condition or event) is detected” may be interpreted as “when determined” or “in response to determining” or “when (stated condition or event) is detected )” or “in response to detecting (a stated condition or event)”.
  • Network Function Vitrulazition is a concept of network architecture, which uses virtualization technology to divide network node-level functions into several functional blocks, each using software. Implementation methods are no longer limited to hardware architecture.
  • NAT Network Address Translation
  • Slow forwarding path/slow forwarding plane (Slow Path, referred to as SP) is used to maintain the session control information corresponding to the link request, generate forwarding rules corresponding to the link request, and can send the forwarding rules to fast forwarding path, so that the fast forwarding path can process the link request based on the forwarding rule.
  • SP Slow forwarding path/slow forwarding plane
  • Fast forwarding path/fast forwarding plane (Fast Path, FP for short) is used to parse the packets corresponding to the link request and forward the packets according to the forwarding rules.
  • NAT gateway can convert the private IP address into a public IP address when a host using a private IP address communicates with the outside world, so that the public network can be accessed.
  • network bandwidth, number of concurrent links, and link creation rate are the three main performance indicators of NAT gateways.
  • the NAT gateway implemented based on the network function virtualization NFV architecture includes: two slow forwarding paths and Multiple fast forwarding paths communicate with the slow forwarding path.
  • the slow forwarding path is used to maintain session control information corresponding to the link request, generate forwarding rules corresponding to the link request, and can send the forwarding rules to the fast forwarding path.
  • Forwarding path after the fast forwarding path obtains the forwarding rules, the link request can be processed based on the forwarding rules to parse the message corresponding to the link request, and forward the message according to the forwarding rules.
  • the fast forwarding path can be accessed through load sharing.
  • the forwarding bandwidth can be elastically expanded by expanding the number of load sharing members.
  • fast forwarding can be The number of paths is expanded from 4 to 5, thus effectively realizing the elastic expansion of network bandwidth according to demand; similarly, when the user traffic far exceeds the required traffic, the number of load sharing members can be reduced by reducing the number of paths.
  • the number of fast forwarding paths can be reduced from 4 to 3, thus effectively realizing the elastic reduction of network bandwidth according to demand.
  • the above-mentioned NAT gateway based on the NFV architecture only implements the bandwidth operation of increasing/lowering the NAT gateway through elastic expansion/reduction of the number of fast forwarding paths.
  • a set of fast forwarding paths in the NAT gateway can only correspond to a set of slow forwarding paths, and the slow forwarding paths are responsible for maintaining the session control information corresponding to the link request, the number of fast forwarding paths can be flexibly changed.
  • the number of slow forwarding paths does not change flexibly. Therefore, the number of new session control information and the concurrency capability are still fixed, that is, elastic expansion and contraction operations cannot be achieved.
  • the slow forwarding path is responsible for the allocation operation of NAT ports, and the allocation operation of NAT ports cannot be achieved through simple load balancing rules, that is, packets cannot be simply and randomly sent to different slow forwarding paths. fast forwarding path, otherwise port allocation conflicts may occur.
  • the slow forwarding path includes slow forwarding path group 1 and slow forwarding path group 2.
  • Message 1 sent by device A is obtained in slow forwarding path group 1
  • packet 1 sent by device A is obtained in slow forwarding path group 2.
  • B sends message 2 if the access purpose corresponding to message 1 is the same as the access purpose corresponding to message 2, the slow forwarding path assigned to message 1 (for example: slow forwarding path group 1 ) is different from the slow forwarding path assigned to message 2 (for example: slow forwarding path group 2), the above two slow forwarding path groups can allocate NAT ports to the above message 1 and message 2 at the same time. , at this time, if the same NAT port is assigned to message 1 and message 2, NAT port allocation conflicts are likely to occur.
  • the session control information corresponding to the currently existing link requests may be assigned to any fast forwarding path or slow forwarding path. , if the newly added fast forwarding path or slow forwarding path does not have the session control information of the currently existing link request, this may cause the processing of the ongoing link request to be interrupted.
  • this embodiment provides a network address translation gateway expansion method, equipment and storage medium.
  • the execution subject of the network address translation gateway expansion method can be network address translation NAT.
  • the expansion device of the gateway and the expansion device of the NAT gateway can be communicated and connected with the NAT gateway to flexibly adjust and control the various performances of the NAT gateway.
  • the NAT gateway may include a first forwarding path and a second forwarding path that is communicatively connected to the first forwarding path.
  • the first forwarding path is used to maintain session control information corresponding to the link request and generate forwarding rules corresponding to the link request, And forwarding rules can be sent to the fast forwarding path so that the fast forwarding path can pair the link based on the forwarding rules. Therefore, the first forwarding path can also be called a slow forwarding path.
  • the second forwarding path is used to parse the message corresponding to the link request and forward the message according to the forwarding rules. Therefore, the second forwarding path
  • the forwarding path may also be called the fast forwarding path. It should be noted that the number of first forwarding paths and the number of second forwarding paths in this embodiment can be flexibly adjusted and set based on the operating status of the NAT gateway.
  • the expansion device of the NAT gateway may refer to a device that can provide computing processing services in a network virtual environment. It usually refers to a device that uses the network to plan information and control the NAT gateway.
  • the expansion device of the NAT gateway can be any device that can provide computing services, respond to service requests, and perform processing. For example, it can be a cluster server, a conventional server, a cloud server, a cloud host, a virtual center, etc.
  • the expansion device of the NAT gateway mainly consists of a processor, hard disk, memory, system bus, etc., which is similar to a general computer architecture.
  • the expansion device of the NAT gateway is used to obtain the operating status of the network address translation NAT gateway.
  • the operating status includes at least one of the following: the number of concurrent link requests and the rate of new link requests.
  • the running status can be analyzed and processed based on the preset expansion conditions and preset reduction conditions respectively.
  • the first forwarding path in the NAT gateway can be expanded to obtain the target gateway. For example, when the NAT gateway includes 2 forwarding path groups and 3 second forwarding paths, if the data processing performance of the NAT gateway cannot meet user needs, the forwarding path groups in the NAT gateway can be expanded from 2 to 2. 3, wherein each forwarding path group includes 2 or other number of first forwarding paths.
  • the NAT gateway When the running status meets the preset shrinking conditions, it means that the NAT gateway at this time needs to perform a shrinking operation, and then the first forwarding path in the NAT gateway can be shrunk to obtain the target gateway.
  • the forwarding path group in the NAT gateway can be reduced from 2 to 1, where each forwarding path group includes 2 or other number of first forwarding paths, because more first forwarding paths
  • the path can handle a larger number of link requests and has a higher link creation rate.
  • the fewer first forwarding paths can handle a smaller number of link requests and has a lower link creation rate, thus effectively realizing the ability to flexibly Perform elastic expansion and contraction operations on the number of concurrent links and/or the rate of new link creation.
  • the technical solution provided by this embodiment is to obtain the operating status of the network address translation NAT gateway.
  • the first forwarding path in the NAT gateway is expanded to obtain the target gateway; when the operating status meets the preset expansion conditions, the target gateway is obtained.
  • the shrinkage conditions are preset, the first forwarding path in the NAT gateway is reduced to obtain the target gateway, thereby effectively realizing the flexibility to flexibly adjust the number of concurrent links and the link creation rate by adjusting the number of first forwarding paths.
  • the expansion and contraction operations further improve the address translation quality and efficiency of the NAT gateway.
  • Figure 4 is a schematic flow chart of a network address translation gateway expansion method provided by an embodiment of the present invention; with reference to Figure 4, this embodiment provides a network address translation gateway expansion method, and the execution subject of the method is
  • the expansion device of the network address translation gateway can be implemented as software or a combination of software and hardware.
  • the expansion device of the network address translation gateway can be configured in the network address translation On the gateway, the expansion method of the network address translation gateway can include:
  • Step S401 Obtain the running status of the network address translation NAT gateway.
  • the running status includes at least one of the following: The number of concurrent link requests and the rate of new link requests.
  • Step S402 When the running status meets the preset expansion conditions, expand the first forwarding path in the NAT gateway.
  • the first forwarding path is used to maintain session control information corresponding to the link request, and generate forwarding rules corresponding to the link request, so as to process the link request based on the forwarding rules.
  • the method in this embodiment may also include:
  • Step S403 When the running state meets the preset shrinkage conditions, shrink the first forwarding path in the NAT gateway.
  • Step S401 Obtain the running status of the network address translation NAT gateway.
  • the running status includes at least one of the following: the number of concurrent link requests and the new link request rate.
  • the NAT gateway when using the network address translation NAT gateway to perform data processing operations, has different operating states used to identify the NAT gateway with different data processing performance.
  • the above operating states include at least one of the following: the number of concurrent link requests, the number of new links Request rate.
  • the number of concurrent link requests may refer to the number of concurrent link requests established by the user through the NAT gateway within a preset time period or at the same time.
  • the link requests are used to implement network access operations. For example, users can establish 10 concurrent link requests through the NAT gateway and send 10 concurrent link requests to the cloud server through the NAT gateway to access the cloud server at the same time.
  • the number of concurrent link requests is related to the data processing requirements of the NAT gateway. Generally speaking, the greater the number of concurrent link requests, the higher the data processing performance required by the NAT gateway; if the number of concurrent link requests is greater, Small, the data processing performance required by the NAT gateway is low.
  • the new link request rate may refer to the rate at which new link requests are established through the NAT gateway.
  • the new link request rate is related to the data processing performance of the NAT gateway. When the new link request rate is greater, then It means that the better the data processing performance of the NAT gateway is, the lower the new link request rate is, the worse the data processing performance of the NAT gateway is.
  • this embodiment does not limit the method of obtaining the running status of the NAT gateway.
  • Those skilled in the art can configure it according to specific application scenarios or application requirements. For example, configure a stateful detector in the NAT gateway, and use the state detector to The running status of the NAT gateway can be obtained; or, the expansion device of the network address translation gateway can send status detection data to the NAT gateway, and then obtain the data detection results corresponding to the status detection data through the NAT gateway, and determine the relationship with the NAT based on the data detection results. The corresponding operating status of the gateway.
  • Step S402 When the running status meets the preset expansion conditions, expand the first forwarding path in the NAT gateway.
  • the first forwarding path is used to maintain session control information corresponding to the link request, and generate forwarding rules corresponding to the link request, so as to process the link request based on the forwarding rules.
  • the NAT gateway may include a first forwarding path and a second forwarding path that is communicatively connected to the first forwarding path.
  • the first forwarding path is used to maintain session control information corresponding to the link request and generate forwarding rules corresponding to the link request, And the forwarding rules can be sent to the fast forwarding path, so that the fast forwarding path can process the link request based on the forwarding rules. Therefore, the first forwarding path can also be called the slow forwarding path, and the second forwarding path is used to parse the link request.
  • the corresponding message can be forwarded according to the forwarding rules. Therefore, the second forwarding path can also be called a fast forwarding path.
  • preset expansion conditions for analyzing and processing the operating status of the NAT gateway are pre-configured.
  • the operating status of the NAT gateway may include at least one of the following: the number of concurrent link requests and the rate of new link requests. Therefore, in order to accurately control the NAT gateway, different operating statuses may correspond to different predictions. Set expansion conditions.
  • the preset expansion conditions used to analyze and process the number of concurrent link requests may include: when the number of concurrent link requests is greater than or equal to the preset expansion threshold, determine the concurrent link request The number meets the preset expansion conditions; when the number of concurrent link requests is less than the preset expansion threshold, it is determined that the number of concurrent link requests does not meet the preset expansion conditions.
  • the preset expansion conditions used to analyze and process the new link request rate may include: when the new link request rate is greater than or equal to the preset expansion rate, determine the new link request The rate meets the preset expansion conditions; when the new link request rate is less than the preset expansion rate, it is determined that the new link request rate does not meet the preset expansion conditions.
  • Example 3 When the running status includes the number of concurrent link requests and the rate of new link requests, after obtaining the running status of the network address translation NAT gateway, the method in this embodiment may also include: obtaining a method for analyzing and processing the running status.
  • the preset expansion threshold of The preset expansion conditions for analyzing and processing the number of concurrent link requests and the rate of new link requests may include: when the number of concurrent link requests is greater than or equal to the preset expansion threshold, and/or the rate of new link requests is greater than or equal to the preset expansion rate.
  • the preset expansion conditions for analyzing and processing the running status can be obtained, and then the running status can be modified based on the preset expansion conditions.
  • the running status meets the preset expansion conditions, it means that the processing performance corresponding to the NAT gateway at this time does not meet the current data processing needs, so expansion operations are needed, and then the first forwarding path in the NAT gateway can be Expansion means that the number of first forwarding paths included in the NAT gateway can be increased, so that the target gateway can be obtained after the expansion operation.
  • Step S403 When the running state meets the preset shrinkage conditions, shrink the first forwarding path in the NAT gateway.
  • preset shrinkage conditions for analyzing and processing the running status of the NAT gateway are pre-configured. Since the running status of the NAT gateway can include at least one of the following: the number of concurrent link requests and the rate of new link requests, in order to be able to The NAT gateway performs accurate control operations and can correspond to different preset shrinking conditions for different operating states.
  • the preset shrinkage conditions used to analyze and process the number of concurrent link requests may include: when the number of concurrent link requests is less than the preset shrinkage threshold, determine the concurrent link requests The number meets the preset shrinkage conditions; when the number of concurrent link requests is greater than or equal to the preset shrinkage threshold, it is determined that the number of concurrent link requests does not meet the preset shrinkage conditions.
  • the preset reduction conditions used to analyze and process the new link request rate may include: when the new link request rate is less than the preset reduction rate, then determine the new link request The rate meets the preset shrinkage conditions; when the new link request rate is greater than or equal to the preset shrinkage rate , it is determined that the new link request rate does not meet the preset scaling conditions.
  • Example 3 When the running status includes the number of concurrent link requests and the rate of new link requests, after obtaining the running status of the network address translation NAT gateway, the method in this embodiment may also include: obtaining the data used to analyze and process the running status. Preset shrinkage threshold; when all running states are less than the preset shrinkage threshold, it is determined that the running state meets the preset shrinkage conditions, that is, when the running state includes the number of concurrent link requests and the rate of new link requests, it is used to
  • the preset shrinkage conditions for analysis and processing of the number of concurrent link requests and the rate of new link requests may include: when the number of concurrent link requests is less than the preset shrinkage threshold, and the rate of new link requests is less than the preset shrinkage rate, the running status is determined The preset shrinkage conditions are met; when the number of concurrent link requests is greater than or equal to the preset shrinkage threshold, and/or the new link request rate is greater than or equal to the preset shrinkage rate, it is determined that the running status does not meet the preset shrinkage conditions.
  • the preset shrinking conditions for analyzing and processing the running status can be obtained, and then the running status can be analyzed and processed based on the preset shrinking conditions.
  • the running status meets the preset shrinking conditions, It means that the processing performance of the NAT gateway at this time is higher than the current data processing demand.
  • a reduction operation is required, and then the third node in the NAT gateway can be Once the forwarding path is reduced, the number of first forwarding paths included in the NAT gateway can be reduced, so that the target gateway after the reduction operation can be obtained.
  • the running status in this embodiment may not only include the number of concurrent link requests and the new link request rate, but may also include network bandwidth.
  • the method in this embodiment may also include: Detect whether the network bandwidth meets the preset expansion conditions. When the network bandwidth meets the preset expansion conditions, expand the second forwarding path in the NAT gateway to obtain the target gateway; when the network bandwidth does not meet the preset expansion conditions, there is no need to Expand the capacity of the second forwarding path in the NAT gateway.
  • the method in this embodiment may also include: detecting whether the network bandwidth satisfies the preset shrinking condition, and when the network bandwidth satisfies the preset shrinking condition, then the first node in the NAT gateway is Reduce the capacity of the second forwarding path to obtain the target gateway; when the network bandwidth does not meet the preset reduction conditions, there is no need to reduce the capacity of the second forwarding path in the NAT gateway, thus effectively realizing the flexibly based on network bandwidth Expanding and shrinking the second forwarding path in the NAT gateway further improves the flexibility and reliability of controlling the NAT gateway.
  • the expansion method of the network address translation gateway is to obtain the operating status of the network address translation NAT gateway.
  • the first forwarding path in the NAT gateway is expanded to obtain the target gateway.
  • the running status meets the preset reduction conditions
  • the first forwarding path in the NAT gateway is reduced to obtain the target gateway, which effectively realizes that when the NAT gateway needs to be expanded, the NAT gateway can be The first forwarding path is expanded.
  • the first forwarding path in the NAT gateway can be reduced. That is, the bandwidth, number of concurrent links, and link creation rate can be flexibly adjusted. Performing flexible expansion and contraction operations further improves the address translation quality and efficiency of the network address translation gateway and ensures the practicability of this method.
  • Figure 5 is a schematic flow chart of another network address translation gateway expansion method provided by an embodiment of the present invention. based on the above embodiment, with reference to Figure 5, after obtaining the target gateway, since the target gateway includes
  • the number of first forwarding paths may be multiple, and multiple first forwarding paths may constitute at least two forwarding path groups.
  • a link request For a link request to be processed, a link request only needs to be assigned to one forwarding path group for processing. That’s it. Therefore, in order to accurately analyze and process the link request, this embodiment provides a How to determine the target forwarding path group used to analyze and process the link request.
  • the method in this embodiment may also include:
  • Step S501 Obtain a link request for implementing a network access operation.
  • the client can generate a link request for network access operations based on the user's network access needs.
  • the network address included in the link request needs to be converted. , that is, NAT operation, so the link request can be sent to the capacity expansion device of the NAT gateway, so that the capacity expansion device of the NAT gateway can stably obtain the link request used to implement the network access operation.
  • Step S502 Determine the destination address and destination port corresponding to the link request.
  • the link request includes five-tuple information, that is, source IP address, source port information, protocol number, destination IP address, and destination port information.
  • five-tuple information that is, source IP address, source port information, protocol number, destination IP address, and destination port information.
  • Step S503 In the target gateway, determine a target forwarding path group corresponding to the link request based on the destination address and destination port, and the target forwarding path group includes at least one first forwarding path.
  • the NAT gateway since when the NAT gateway obtains the link request, the NAT gateway can establish the only session control information corresponding to the link request through the five-tuple included in the link request. Therefore, when performing the NAT operation, if the link request access The destination address and destination port are different. For the above link request, even if different first forwarding paths in the NAT gateway are used to allocate the same source port number to the link request, there will be no access conflict. If the destination address and destination port accessed by the link request are the same, for the above link request, if different first forwarding paths in the NAT gateway are used to allocate the same source port number to the link request, an access conflict will occur.
  • the first forwarding path allocated for the link request is related to the destination address and destination port corresponding to the link request.
  • the destination address and destination port can be analyzed and processed to determine the target forwarding path group corresponding to the link request, wherein the target forwarding path group includes at least one first forwarding path located in a target forwarding path.
  • the data between any two first forwarding paths in the path group is the same or synchronized.
  • the link request includes a first link request and a second link request.
  • the first link request corresponds to a first destination address and a first destination port
  • the second link request corresponds to a second destination address and a second destination port.
  • determining the target forwarding path group corresponding to the link request based on the destination address and destination port may include: when the first destination address and the first destination port are the same as the second destination address and the second destination port, then the first link The request and the second link request are assigned to the same target forwarding path group; when the first destination address and the first destination port are different from the second destination address and the second destination port, the first link request and the second link request are assigned to the same or different target forwarding path group.
  • the target forwarding path group for analyzing and processing the link request can be determined based on the destination address and destination port corresponding to the link request.
  • the link request includes the first link request and the second link request
  • the third link request can be obtained The first destination address and first destination port corresponding to a link request, and the second destination address and second destination port corresponding to the second link request.
  • the first link request can be determined based on the destination address and destination port corresponding to the first link request and the second link request. and the destination forwarding path group corresponding to the second link request.
  • the destination addresses and destination ports corresponding to the first link request and the second link request can be analyzed and compared.
  • the first destination address and the first destination port are the same as the second destination address and the second destination port, it means that the first link request and the second link request have the same access purpose.
  • the first link request and the second link request can be Assigned to the same target forwarding path group, where the target forwarding path group may include multiple first forwarding path groups, and data between all first forwarding path groups in the same target forwarding path group is synchronized.
  • first link request and the second link request have different access purposes.
  • first link request and the second link request can be combined.
  • the two link requests are assigned to the same or different target forwarding path groups.
  • Example 1 The five-tuple information corresponding to the first connection request is shown in Table 1. Specifically, the source IP address is 10.1.0.5, the source port is 23333, and the protocol number is Transmission Control Protocol (TCP). , the destination IP address (i.e., the first destination address) is 8.8.8.8, and the destination port (the first destination port) is 80.
  • TCP Transmission Control Protocol
  • the first link request can be assigned to the first target. Forwarding path group, and then the NAT conversion operation can be performed on the source IP address and source port corresponding to the first link request through the first target forwarding path group.
  • Table 2 when performing the NAT conversion operation, the source IP address can be "10.1.0.5" is translated to NAT-IP address "47.1.1.1” and source port "23333" is translated to NAT-port "5000".
  • Example 2 The five-tuple information corresponding to the second link request is shown in Table 3. Specifically, the source IP address is 10.1.0.5, the source port is 23333, and the protocol number is Transmission Control Protocol (TCP). , the destination IP address (i.e., the second destination address) is 114.114.114.114, and the destination port (i.e., the second destination port) is 80. After the NAT gateway obtains the above-mentioned second link request, due to the first link request and the second connection request The access purposes are different.
  • TCP Transmission Control Protocol
  • the second link request can be synchronously assigned to the first target forwarding path group, or the second link request can also be assigned to other target forwarding path groups, and then passed through the first target forwarding path group or Other target forwarding path groups can perform NAT conversion operations on the source IP address and source port corresponding to the second link request.
  • the source IP address can be "10.1.0.5” is translated to NAT-IP address "47.1.1.1” and source port "23333" is translated to NAT-port "5000".
  • the link request since the link request includes five-tuple information, in addition to determining the target forwarding path group corresponding to the link request based on the destination address and destination port corresponding to the link request, it may also include determining the target forwarding path group corresponding to the link request. The corresponding destination address, destination port and protocol number are used to determine the target forwarding path group corresponding to the link request. At this time, determining the target forwarding path group corresponding to the link request based on the destination address and destination port may include: obtaining the protocol number corresponding to the link request; determining the target forwarding path group corresponding to the link request based on the destination address, destination port, and protocol number. Target forwarding path group.
  • the protocol number corresponding to the link request can be obtained first, and then the destination can be The address, destination port, and protocol number are analyzed and processed to determine the target forwarding path group corresponding to the link request.
  • the NAT gateway may include two forwarding path groups and multiple fast forwarding paths communicating with the forwarding path group, wherein each forwarding path group may include two slow forwarding paths.
  • the forwarding path includes a first link request and a second link request.
  • the first link request corresponds to the first destination address, the first destination port and the first protocol number
  • the second link request corresponds to the second destination address, the first protocol number.
  • determining the target forwarding path group corresponding to the link request may include: first destination address, first destination port, first protocol number and Second purpose When the address, second destination port, and second protocol number are the same, the first link request and the second link request are assigned to the same target forwarding path group; when the first destination address, the first destination port, the first protocol number and the When the second destination address, the second destination port, and the second protocol number are different, the first link request and the second link request are assigned to the same or different target forwarding path groups.
  • the corresponding destination address, destination port and protocol number of the first link request and the second link request can be The numbers are analyzed and compared.
  • the first destination address, first destination port, and first protocol number are the same as the second destination address, second destination port, and second protocol number, it means that the first link request and the second link request are respectively The corresponding access purpose and communication protocol are the same.
  • the first link request and the second link request can be assigned to the same target forwarding path group.
  • first destination address, first destination port, and first protocol number are different from the second destination address, second destination port, and second protocol number, it means that the first link request and the second link request respectively correspond to the access.
  • the purpose and communication protocol are different.
  • the first link request and the second link request can be assigned to the same or different target forwarding path groups.
  • the target forwarding path group used to analyze and process the link request is determined through the destination IP and destination port corresponding to the link request, or the destination IP, destination port and protocol number. Since links with different access purposes can be Requests are assigned to different target forwarding path groups for processing, which effectively solves the problem of conflicts between session control information maintained between different target forwarding path groups, thereby ensuring the stability and reliability of analyzing and processing link requests.
  • Step S504 Use the target forwarding path group to process the link request to implement network access operations.
  • processing the link request using the target forwarding path group may include: using a first forwarding path in the target forwarding path group to determine a forwarding rule corresponding to the link request; sending the forwarding rule to a link corresponding to the target forwarding path group.
  • the second forwarding path of the connection is such that the second forwarding path processes the link request based on the forwarding rules to implement the network access operation.
  • the target forwarding path group includes one or more (two or more) first forwarding paths.
  • the first forwarding path in the target forwarding path group can be used. Determine the forwarding rule corresponding to the link request.
  • the first forwarding path can send the forwarding rule to the target.
  • the forwarding path group is connected to a second forwarding path, so that the second forwarding path processes the link request based on the forwarding rule to implement the network access operation.
  • the second forwarding path obtains the forwarding rule corresponding to the link request, after obtaining the corresponding link request, there is no need to access the first forwarding path and directly pass the forwarding included in the second forwarding path.
  • the rules analyze and process the link request, so that the link request can be quickly parsed and forwarded.
  • the destination address and destination port corresponding to the link request are determined, and then in the target gateway, the target corresponding to the link request is determined based on the destination address and destination port. forwarding path group, and use the target forwarding path group to process the link request, thereby effectively realizing that the target forwarding path group for analyzing and processing the link request can be determined based on the access purpose corresponding to the link request.
  • forwarding path group and use the target forwarding path group to process the link request, thereby effectively realizing that the target forwarding path group for analyzing and processing the link request can be determined based on the access purpose corresponding to the link request.
  • the network elements used to analyze and process link requests in the target forwarding path group may include multiple processing cores, and different processing cores may correspond to different hash algorithms, in order to improve processing
  • the target kernel for analyzing and processing the link request can be determined based on the hash algorithm.
  • this embodiment provides a method of using the target forwarding path group Implementation methods for processing link requests, including:
  • Step S601 Obtain multiple processing cores included in the target forwarding path group for analyzing and processing the link request.
  • the network elements used to analyze and process link requests in the target forwarding path group may include multiple processing cores. Different target forwarding path groups correspond to different processing cores, and different processing cores may correspond to different processing cores.
  • Hash algorithm for example: a target forwarding path group can correspond to processing core 1, processing core 2 and processing core 3.
  • the above processing core 1 corresponds to hash algorithm 1
  • processing core 2 corresponds to hash algorithm 2.
  • the processing core 3 corresponds to hash algorithm 3. Any two of the above hash algorithm 1, hash algorithm 2 and hash algorithm 3 are different from each other.
  • Step S602 Determine the first process hash algorithm for analyzing and processing the link request corresponding to each of the multiple processing cores and the second process for analyzing and processing the link request in the second forwarding path. Hash algorithm.
  • the processing core may correspond to the first process hash algorithm
  • the second forwarding path may correspond to the second process hash algorithm.
  • the above-mentioned first process hash algorithm and the second process hash algorithm may be the same or different.
  • first process hash algorithm corresponding to the above-mentioned processing core is a general term, and the first process hash algorithm corresponding to different processing cores is different.
  • multiple processing cores include: first process Process hash algorithm a, first process hash algorithm b, first process hash algorithm c and first process hash algorithm d, the above-mentioned first process hash algorithm a, first process hash algorithm b, first process hash algorithm
  • the process hash algorithm c and the first process hash algorithm d are collectively referred to as the first process hash algorithm.
  • Step S603 Based on the first process hash algorithm and the second process hash algorithm, determine a target kernel among the plurality of processing kernels, and the first process hash algorithm corresponding to the target kernel is the same as the first process hash algorithm.
  • the second process hashing algorithm is different.
  • the first process hash algorithm corresponding to multiple processing cores for analyzing and processing the link request and the second forwarding path for analyzing the link request.
  • the first process hash algorithm and the second process hash algorithm can be analyzed and processed to determine the target kernel among multiple processing kernels, and the determined target kernel corresponds to the third process hash algorithm.
  • the first-pass hashing algorithm is different from the second-pass hashing algorithm.
  • the hash algorithm includes hash algorithm a, hash algorithm b, hash algorithm c, and hash algorithm d.
  • the target forwarding path includes three processing cores, including processing core A respectively. , processing core B, processing core C, where processing core A corresponds to hash algorithm b, processing core B corresponds to hash algorithm a, and processing core C corresponds to hash algorithm d.
  • the second process hash algorithm used to analyze and process the link request in the second forwarding path is hash algorithm b.
  • the processing core B corresponding to hash algorithm a can be used or the hash algorithm
  • the processing core C corresponding to algorithm d is determined as the target core, thus effectively ensuring the accuracy and reliability of determining the target core, and balancing the number of link requests allocated to each target core, further improving the analysis of link requests. Processing quality and efficiency, while ensuring the utilization of processing core resources.
  • Step S604 Use the target kernel to process the link request.
  • the link request can be allocated to the target core to use the target core to process the link request, thus ensuring the quality and efficiency of processing the link request.
  • each of the multiple processing cores is used for analyzing the link request.
  • the first process hash algorithm of processing and the second process hash algorithm used to analyze and process the link request in the second forwarding path, and then based on the first process hash algorithm and the second process
  • the hash algorithm determines the target core among the multiple processing cores and uses the target core to process the link request, thereby not only effectively achieving the quality and efficiency of analyzing and processing the link request, but also enabling This ensures the utilization of resources corresponding to the processing core and avoids the waste of processing core resources, further improving the practicability of the method.
  • Figure 7 is a schematic flowchart of expanding the first forwarding path in the NAT gateway provided by an embodiment of the present invention; based on any of the above embodiments, with reference to Figure 7, this embodiment provides a method for Implementation of expansion of the first forwarding path in the gateway.
  • expansion of the first forwarding path in the NAT gateway in this embodiment may include:
  • Step S701 Determine the forwarding path to be expanded based on the operating status of the first forwarding path in the NAT gateway.
  • the first forwarding path in the NAT gateway needs to be expanded.
  • the first forwarding path in the NAT gateway can be expanded based on the operation.
  • the status determines the forwarding path to be expanded for expansion of the first forwarding path in the NAT gateway.
  • the number of forwarding paths to be expanded can be a multiple of 2, such as 2, 4, or 6. In some instances, the number of forwarding paths to be expanded is 2 to meet the data processing needs.
  • Step S702 Connect the forwarding path to be expanded with the first forwarding path, and perform a data synchronization operation on the forwarding path to be expanded based on the first forwarding path to obtain multiple first forwarding paths after expansion.
  • the forwarding path to be expanded After obtaining the forwarding path to be expanded, the forwarding path to be expanded can be connected to the first forwarding path. Since the forwarding path to be expanded is a newly created forwarding path, the session control information maintained by the forwarding path to be expanded is relatively small or even 0. Therefore, in order to ensure that there is a connection between the forwarding path to be expanded and the historically existing first forwarding path, With the same session control information, a data synchronization operation can be performed on the forwarding path to be expanded based on the first forwarding path, so that multiple first forwarding paths after expansion can be obtained.
  • this embodiment does not limit the implementation method of the data synchronization operation.
  • Those skilled in the art can configure it according to specific application scenarios or application requirements.
  • all session control information maintained in the first forwarding path can be obtained, and then all session control information is copied to the forwarding path to be expanded, thereby realizing forwarding based on the first forwarding path to be expanded.
  • Path to perform data synchronization operations when performing data synchronization operations, all session control information maintained in the first forwarding path can be obtained, and then all session control information is copied to the forwarding path to be expanded, thereby realizing forwarding based on the first forwarding path to be expanded.
  • performing data synchronization operations on the forwarding path to be expanded based on the first forwarding path may include: generating session keepalive information corresponding to the link request through the second forwarding path in the NAT gateway; forwarding corresponding to the link request based on Rules to determine the forwarding path identifier corresponding to the session keep-alive information; send the session keep-alive information to the first forwarding path corresponding to the forwarding path identifier, so that the first forwarding path performs operations on the forwarding path to be expanded based on the session keep-alive information.
  • Data synchronization operations may include: generating session keepalive information corresponding to the link request through the second forwarding path in the NAT gateway; forwarding corresponding to the link request based on Rules to determine the forwarding path identifier corresponding to the session keep-alive information; send the session keep-alive information to the first forwarding path corresponding to the forwarding path identifier, so that the first forwarding path performs operations on the forwarding path to be expanded based on the session keep-a
  • the first forwarding path communication connection has one or more second forwarding paths.
  • the second forwarding path After the first forwarding path generates a forwarding rule corresponding to the link request and sends the forwarding rule to the second forwarding path, the second forwarding path
  • the link request can be analyzed and processed based on the forwarding rules.
  • the second forwarding path can track the session control information corresponding to the link request. , and can perform a reverse reporting operation to the first forwarding path based on the session control information.
  • the session keep-alive information corresponding to the link request can be generated through the second forwarding path in the NAT gateway.
  • the forwarding path identifier corresponding to the session keep-alive information can be determined based on the forwarding rule corresponding to the link request. Different first forwarding paths can be Corresponding to different forwarding path identifiers. Therefore, after the forwarding path identifier is obtained, the session keep-alive information can be sent to the first forwarding path corresponding to the forwarding path identifier. After the first forwarding path obtains the session keep-alive information, the first forwarding path can be based on the session.
  • the keep-alive information performs data synchronization operations on the forwarding path to be expanded, thereby effectively realizing the tracking and reverse reporting operations of the session control information through the second forwarding path.
  • the first forwarding path and the forwarding path to be expanded can be connected through packet stringing.
  • the mechanism implements elastic expansion/shrinking operations.
  • the method in this embodiment may also include detecting the running status of the data synchronization operation. At this time, the method in this embodiment may also include: obtaining the first forwarding The amount of session control information corresponding to the path and the amount of new session control information corresponding to the forwarding path to be expanded; determine the quantity deviation between the amount of session control information and the amount of new session control information; when the quantity deviation is less than the preset threshold, determine The data synchronization operation of the forwarding path to be expanded is completed; when the quantity deviation is greater than or equal to the preset threshold, it is determined that the data synchronization operation of the forwarding path to be expanded is not completed.
  • the forwarding path to be expanded is a newly established forwarding path, the amount of session control information corresponding to it is completely different from the amount of session control information corresponding to the first forwarding path.
  • the first forwarding path can be obtained.
  • the NAT gateway may be configured with a detection device for detecting the amount of session control information. The detection device can obtain the third The amount of session control information corresponding to a forwarding path and the amount of newly created session control information corresponding to the forwarding path to be expanded.
  • the amount of session control information and the amount of new session control information can change dynamically.
  • the amount of session control information corresponding to the first forwarding path is similar to the amount of newly created session control information corresponding to the forwarding path to be expanded, it can be determined that the data synchronization operation of the forwarding path to be expanded is completed. Therefore, in order to accurately determine whether the data synchronization operation of the forwarding path to be expanded is completed, the quantitative deviation between the session control information amount and the new session control information amount can be obtained.
  • the quantitative deviation can be the session control information amount - the new session Control the amount of information, and the amount deviation is greater than or equal to zero.
  • the quantity deviation can be analyzed and compared with the preset threshold.
  • the quantity deviation is less than the preset threshold, it means that the amount of session control information corresponding to the first forwarding path is different from the new amount of session control information corresponding to the forwarding path to be expanded. If the amount of session control information is similar, it can be determined that the data synchronization operation of the forwarding path to be expanded has been completed; when the quantity deviation is greater than or equal to the preset threshold, it means that the amount of session control information corresponding to the first forwarding path is different from that of the forwarding path to be expanded.
  • the corresponding amounts of new session control information are quite different, and it can be determined that the data synchronization operation of the forwarding path to be expanded has not been completed.
  • the NAT gateway may include two slow forwarding paths (i.e., the first forwarding path) and a fast forwarding path (which may be one or more) that is communicatively connected to the slow forwarding path. ), when it is necessary to expand the capacity of a slow forwarding path, you can first determine the forwarding path to be expanded (the two gray slow forwarding paths in Figure 8), and then add the forwarding path to be expanded to the pre- In the established slow forwarding path, after the expansion operation, the backup operation of the session control information can be realized through the serial packet mechanism.
  • the session control information can be reported to the slow forwarding path through the fast forwarding path, thereby achieving
  • the entire expansion process can include three processes: data synchronization in progress, data synchronization completion and capacity expansion completion:
  • all link requests corresponding to fast forwarding paths can be sent to the slow forwarding paths in the original forwarding path group, and then the synchronization mechanism of all slow forwarding paths in the forwarding path group can be used to complete the process. Synchronize the session control information of the slow forwarding path to be expanded.
  • the amount of session control information corresponding to the slow forwarding path to be expanded and the amount of session control information corresponding to the slow forwarding path in the original forwarding path group can be detected in real time.
  • the amount of corresponding session control information is equal or similar, data synchronization is considered complete. For example, when the amount of session control information corresponding to the historical slow forwarding path and the newly expanded slow forwarding path is both 10W, then it can Confirm that the data synchronization operation is completed.
  • the method in this embodiment may also include: Grouping is performed to obtain at least two forwarding path groups, and each forwarding path group includes at least the first forwarding path of the full amount of historical data.
  • the multiple first forwarding paths can be grouped according to a preset policy. For example, the number of groups can be obtained or The size of each forwarding path group (that is, used to identify the number of first forwarding paths included in the forwarding path group), grouping multiple first forwarding paths based on the number of groups or the size of the forwarding path group, thereby obtaining There are at least two forwarding path groups, wherein each forwarding path group includes at least a first forwarding path of the full amount of historical data.
  • the expanded NAT gateway includes 4 slow forwarding paths
  • the above 4 slow forwarding paths can be processed based on the above number of packets.
  • Forwarding path By performing the grouping operation, two forwarding path groups can be obtained, where each forwarding path group includes two slow forwarding paths, thereby effectively realizing the grouping operation of multiple first forwarding paths.
  • the method in this embodiment may also include: obtaining each forwarding path group.
  • the data or data status corresponding to the first forwarding path if the data or data status corresponding to the first forwarding path changes in real time, it means that the data processing status corresponding to the first forwarding path is an active state at this time. If the corresponding data or data status does not change within the preset time period, it means that the data processing status corresponding to the first forwarding path at this time is in an aging state or tends to be in an aging state. When the data processing state corresponding to the first forwarding path is an active state, it means that the first forwarding path needs to process more data. When the data processing state corresponding to the first forwarding path is an aging state, it means that the first forwarding path needs to process more data. A forwarding path requires less and less data to be processed.
  • the forwarding path group will include multiple first forwarding paths.
  • the expanded NAT gateway includes two historical slow forwarding paths (slow forwarding path A and slow forwarding path a) and two newly expanded slow forwarding paths. (Slow forwarding path B and slow forwarding path b), where slow forwarding path A and slow forwarding path B include a full amount of historical data. Therefore, when dividing forwarding path groups, one of the forwarding path groups can include : Slow forwarding path A and slow forwarding path B.
  • Another forwarding path group may include: slow forwarding path a and slow forwarding path b.
  • one of the forwarding path groups may include: slow forwarding path A, slow forwarding path a, and slow forwarding path B, and the other forwarding path group may include: slow forwarding path A, slow forwarding path a, and slow forwarding path B.
  • Forwarding path b thus effectively realizing that each forwarding path group includes a forwarding path with a full amount of historical data, which can effectively avoid interruptions during data processing.
  • the data processing status corresponding to each first forwarding path in the forwarding path group can be detected in real time.
  • the allocation of pending data to the first forwarding path in the aging state can be prohibited.
  • the forwarding path to be expanded is determined based on the operating status of the first forwarding path in the NAT gateway, the forwarding path to be expanded is connected to the first forwarding path, and the forwarding path to be expanded is based on the first forwarding path.
  • the data synchronization operation is performed to obtain multiple first forwarding paths after expansion, which effectively realizes the stable and flexible expansion operation of the first forwarding path in the NAT gateway, further improving the accuracy and reliability of the use of the NAT gateway.
  • Figure 11 is a schematic flowchart of reducing the capacity of the first forwarding path in the NAT gateway provided by an embodiment of the present invention; based on any of the above embodiments, with reference to Figure 11, this embodiment provides a method for reducing the capacity of the first forwarding path in the NAT gateway.
  • Step S1101 Determine the forwarding path to be reduced based on the operating status of the first forwarding path in the NAT gateway.
  • the first forwarding path in the NAT gateway needs to be reduced.
  • the number of forwarding paths to be scaled down may be 2, 4, or 6, etc. In some instances, the number of forwarding paths to be reduced is 2 to meet the data processing needs.
  • Step S1102 Configure the forwarding path to be reduced to prohibit allocation of new link requests.
  • the forwarding path to be reduced is a forwarding path that needs to be deleted, in order not to affect the data processing operation, after determining the forwarding path to be reduced, the forwarding path to be reduced can be configured to prohibit the allocation of new link requests, that is, in NAT After the gateway obtains the forwarding path to be reduced, it will not assign new link requests to the forwarding path to be reduced for analysis and processing. Historical link requests that have been assigned to the forwarding path to be reduced can continue to be sent to the forwarding path to be reduced. It can be processed along the forwarding path, which can avoid interruption of data processing.
  • Step S1103 When the forwarding path to be reduced meets the reduction status, delete the forwarding path to be reduced in the NAT gateway.
  • the method in this embodiment may also include: obtaining the number of link requests corresponding to the forwarding path to be reduced; when the number of link requests is 0 , it is determined that the forwarding path to be reduced meets the reduction status; when the number of link requests is non-0, it is determined that the forwarding path to be reduced does not meet the reduction status.
  • the number of link requests corresponding to the forwarding path to be reduced can be obtained in real time.
  • the number of link requests is 0, it means that the number of link requests to be reduced at this time is If the shrinking forwarding path has no link requests that need to be processed, it can be determined that the forwarding path to be reduced meets the shrinking status; when the number of link requests is non-zero, it means that the forwarding path to be reduced has links that need to be processed. request, and then it can be determined that the forwarding path to be reduced does not meet the reduction status.
  • the forwarding path to be reduced in the NAT gateway can be deleted, thereby effectively reducing the first forwarding path in the NAT gateway. operate.
  • the NAT gateway may include 3 forwarding path groups and a fast forwarding path communicatively connected to the forwarding path group, wherein each forwarding path group may include 2 slow forwarding paths, and , when the slow forwarding path sends the forwarding rule corresponding to the link request to the fast forwarding path, the forwarding rule obtained by the fast forwarding path may include the SP group number of the slow forwarding path corresponding to the link request, and may be based on The SP group number reports the keep-alive information of the session control information.
  • the forwarding path to be reduced can be determined.
  • the forwarding path to be reduced can be the gray slow forwarding path in Figure 12; after determining the forwarding path to be expanded or reduced After that, the shrinking operation can be performed based on the forwarding path to be reduced.
  • the entire shrinking process can include three processes: stopping new creation, waiting for the release of existing session control information, and shrinking the slow forwarding path group:
  • the fast forwarding path can stop sending the new link traffic to the slow forwarding path group to be reduced when processing the new link traffic.
  • the forwarding path to be reduced is determined based on the running status of the first forwarding path in the NAT gateway, and the forwarding path to be reduced is configured to prohibit the allocation of new link requests.
  • the forwarding path to be reduced in the NAT gateway is deleted, effectively realizing the stable and flexible reduction operation of the first forwarding path in the NAT gateway, further improving the accuracy of the use of the NAT gateway. reliability.
  • Figure 14 is a schematic structural diagram of a capacity expansion device for a network address translation gateway provided by an embodiment of the present invention; with reference to Figure 14, this embodiment provides a capacity expansion device for a network address translation gateway.
  • the capacity expansion device may perform the capacity expansion method of the network address translation gateway shown in Figure 4.
  • the capacity expansion device of the network address translation gateway may include:
  • the first acquisition module 11 is used to acquire the operating status of the network address translation NAT gateway.
  • the operating status includes at least one of the following: the number of concurrent link requests and the rate of new link requests;
  • the first processing module 12 is configured to expand the first forwarding path in the NAT gateway when the running state meets the preset expansion conditions, where the first forwarding path is used to maintain session control information corresponding to the link request, and A forwarding rule corresponding to the link request is generated to process the link request based on the forwarding rule.
  • the first processing module 12 is also used to reduce the capacity of the first forwarding path in the NAT gateway when the running state meets the preset scaling conditions.
  • the first obtaining module 11 and the first processing module 12 in this embodiment are used to follow these steps:
  • the first acquisition module 11 is used to acquire the preset expansion threshold and the preset reduction threshold for analyzing and processing the operating status
  • the first processing module 12 is configured to determine that the operating state satisfies the preset expansion condition when at least one operating state is greater than or equal to the corresponding preset expansion threshold; when all operating states are less than the preset reduction threshold, then Make sure that the running status meets the preset shrinkage conditions.
  • the first acquisition module 11 and the first processing module 12 in this embodiment are used to perform the following steps:
  • the first acquisition module 11 is used to acquire the link request used to implement the network access operation
  • the first processing module 12 is used to determine the destination address and destination port corresponding to the link request; in the target gateway, determine the target forwarding path group corresponding to the link request based on the destination address and destination port, and the target forwarding path group includes At least one first forwarding path; using the target forwarding path group to process the link request to implement the network access operation.
  • the link request includes a first link request and a second link request.
  • the first link request corresponds to a first destination address and a first destination port
  • the second link request corresponds to a second destination address and a second destination port;
  • the first processing module 12 determines the target forwarding path group corresponding to the link request based on the destination address and the destination port
  • the first processing module 12 is configured to perform: between the first destination address, the first destination port and the second destination address , when the second destination port is the same, the first link request and the second link request are assigned to the same target forwarding path group; when the first destination address and the first destination port are different from the second destination address and the second destination port , then the first link request and the second link request are assigned to the same or different target forwarding path groups.
  • the first processing module 12 determines the target forwarding path group corresponding to the link request based on the destination address and the destination port, the first processing module 12 is configured to perform: obtain the protocol number corresponding to the link request; Based on the destination address, destination port and protocol number, a target forwarding path group corresponding to the link request is determined.
  • the link request includes a first link request and a second link request.
  • the first link request corresponds to a first destination address, a first destination port, and a first protocol number
  • the second link request corresponds to a second destination address, a first destination port, and a first protocol number. the second destination port and the second protocol number; when the first processing module 12 determines the target forwarding path group corresponding to the link request based on the destination address, the destination port, and the protocol number, the first processing module 12 is configured to perform: When the first destination address, first destination port, and first protocol number are the same as the second destination address, second destination port, and second protocol number, then the first link request and the second link request are assigned to the same target forwarding path. group; when the first destination address, first destination port, and first protocol number are different from the second destination address, second destination port, and second protocol number, the first link request and the second link request are assigned to the same or Different destination forwarding path groups.
  • the first processing module 12 when the first processing module 12 uses the target forwarding path group to process the link request, the first processing module 12 is configured to perform: using the first forwarding path in the target forwarding path group to determine the link request corresponding to forwarding rules; sending the forwarding rules to the second forwarding path connected to the target forwarding path group, so that the second forwarding path processes the link request based on the forwarding rules to implement network access operations.
  • the first processing module 12 when the first processing module 12 uses the target forwarding path group to process the link request, the first processing module 12 is configured to: obtain the information included in the target forwarding path group for A plurality of processing cores that analyze and process the link request; determine the first process hash algorithm corresponding to each of the multiple processing cores for analyzing and processing the link request and the second forwarding path for analyzing and processing the link request.
  • the second process hash algorithm for analysis and processing of the link request; based on the first process hash algorithm and the second process hash algorithm, a target core is determined among the plurality of processing cores, and the target core
  • the corresponding first process hash algorithm is different from the second process hash algorithm; the target kernel is used to process the link request.
  • the first processing module 12 when the first processing module 12 expands the capacity of the first forwarding path in the NAT gateway, the first processing module 12 is configured to perform: based on the running status, determine to expand the capacity of the first forwarding path in the NAT gateway. the forwarding path to be expanded; connect the forwarding path to be expanded with the first forwarding path, and perform a data synchronization operation on the forwarding path to be expanded based on the first forwarding path to obtain multiple first forwarding paths after expansion.
  • the first processing module 12 when the first processing module 12 performs a data synchronization operation on the forwarding path to be expanded based on the first forwarding path, the first processing module 12 is configured to: generate a link request related to the second forwarding path in the NAT gateway. Corresponding session keep-alive information; based on the forwarding rule corresponding to the link request, determine the forwarding path identifier corresponding to the session keep-alive information; send the session keep-alive information to the first forwarding path corresponding to the forwarding path identifier, so that The first forwarding path performs a data synchronization operation on the forwarding path to be expanded based on the session keep-alive information.
  • the first acquisition module 11 and the first processing module 12 in this embodiment are used to perform the following steps:
  • the first acquisition module 11 is used to acquire the amount of session control information corresponding to the first forwarding path and the amount of newly created session control information corresponding to the forwarding path to be expanded;
  • the first processing module 12 is used to determine the quantity deviation between the amount of session control information and the amount of newly created session control information; when the quantity deviation is less than the preset threshold, it is determined to complete the data synchronization operation of the forwarding path to be expanded; when the quantity deviation is greater than or equals the preset threshold, it is determined that the data synchronization operation for the forwarding path to be expanded has not been completed.
  • the processing module 12 is configured to: group multiple first forwarding paths to obtain at least two forwarding path groups, each forwarding path group including at least the first forwarding paths of the full amount of historical data.
  • the first processing module 12 when the first processing module 12 shrinks the first forwarding path in the NAT gateway, the first processing module 12 is configured to perform: determining to shrink the first forwarding path in the NAT gateway based on the running status. The forwarding path to be reduced for the capacity operation; configure the forwarding path to be reduced to prohibit the distribution of new link requests; when the forwarding path to be reduced meets the reduction status, delete the forwarding path to be reduced in the NAT gateway.
  • the first acquisition module 11 and the first processing module 12 in this embodiment are used to perform the following steps:
  • the first acquisition module 11 is used to acquire the number of link requests corresponding to the forwarding path to be reduced;
  • the first processing module 12 is configured to determine that the forwarding path to be scaled down satisfies the scaling down state when the number of link requests is 0; and to determine that the forwarding path to be scaled down does not satisfy the scaling down state when the number of link requests is non-zero.
  • the device shown in Figure 14 can perform the method of the embodiment shown in Figures 3 to 13.
  • parts not described in detail in this embodiment please refer to the relevant description of the embodiment shown in Figures 3 to 13.
  • the implementation process and technical effects of this technical solution please refer to the description in the embodiment shown in Figures 3 to 13, and will not be described again here.
  • the structure of the capacity expansion device of the network address translation gateway shown in Figure 14 can be implemented as an electronic device, and the electronic device can be various devices such as a controller, a personal computer, and a server.
  • the electronic device may include: a first processor 21 and a first memory 22 .
  • the first memory 22 is used to store a program for the corresponding electronic device to execute the network address translation gateway expansion method provided in the embodiment shown in FIGS. 3 to 13
  • the first processor 21 is configured to execute the first program stored in memory 22.
  • the program includes one or more computer instructions, where when one or more computer instructions are executed by the first processor 21, the following steps can be achieved:
  • the running status includes at least one of the following: the number of concurrent link requests and the rate of new link requests;
  • the first forwarding path in the NAT gateway is expanded; wherein the first forwarding path is used to maintain session control information corresponding to the link request and generate forwarding corresponding to the link request. Rules to process link requests based on forwarding rules.
  • the first processor 21 is also used to execute all or part of the steps in the aforementioned embodiments shown in FIGS. 3 to 13 .
  • the structure of the electronic device may also include a first communication interface 23 for the electronic device to communicate with other devices or communication networks.
  • embodiments of the present invention provide a computer storage medium for storing computer software instructions used in electronic devices, which includes instructions for executing the expansion method of the network address translation gateway in the method embodiments shown in FIGS. 3-13. procedures involved.
  • embodiments of the present invention provide a computer program product, including: a computer-readable storage medium storing computer instructions.
  • the computer instructions are executed by one or more processors, the one or more processors are caused to execute the above figure.
  • the device embodiments described above are only illustrative.
  • the units described as separate components may or may not be physically separated.
  • the components shown as units may or may not be physical units, that is, they may be located in one place. , or it can be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art, without exerting creative efforts, situation, it can be understood and implemented.
  • each embodiment can be implemented by adding the necessary general hardware platform, or of course, can also be implemented by combining hardware and software.
  • the above technical solution can be embodied in the form of a computer product in nature or in other words, the part that contributes to the existing technology.
  • the present invention can use one or more computer-usable storage devices containing computer-usable program codes.
  • the form of a computer program product implemented on media including but not limited to disk storage, CD-ROM, optical storage, etc.).
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable device to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture that includes instruction means that performs A function specified in a process or processes in a flow diagram and/or in a block or blocks in a block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable device such that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide The steps used to implement the functionality specified in a process or processes in a flowchart and/or in a block or blocks in a block diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • Memory may include non-permanent storage in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
  • Computer-readable media includes both persistent and non-volatile, removable and non-removable media that can be implemented by any method or technology for storage of information.
  • Information may be computer-readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • read-only memory read-only memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • compact disc read-only memory CD-ROM
  • DVD digital versatile disc
  • Magnetic tape cassettes tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium can be used to store information that can be accessed by a computing device.
  • computer-readable media does not include transitory media, such as modulated data signals and carrier waves.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明实施例提供了一种网络地址转换网关的扩容方法、设备及存储介质。方法包括:获取网络地址转换NAT网关的运行状态,运行状态包括以下至少之一:并发链接请求数量、新建链接请求速率;在运行状态满足预设扩容条件时,则对NAT网关中的第一转发路径进行扩容;其中,第一转发路径用于维护链接请求所对应的会话控制信息,并生成与链接请求相对应的转发规则,以基于转发规则对链接请求进行处理。本实施例的技术方案,有效地实现能够灵活地对并发链接数和链接新建速率进行弹性扩缩容操作,进一步提高了NAT网关的地址转换质量和效率。

Description

网络地址转换网关的扩容方法、设备及存储介质
本申请要求于2022年03月25日提交中国专利局、申请号为202210307674.0、申请名称为“网络地址转换网关的扩容方法、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信技术领域,尤其涉及一种网络地址转换网关的扩容方法、设备及存储介质。
背景技术
网络地址转换(Network Address Translation,简称NAT)网关能够在使用私网IP地址的主机与外界进行通信时,将私网IP地址转换为公网IP地址,以能够访问公网。对于NAT网关而言,由于传统网络的物理资源有限,因此无法实现对NAT网关的性能指标进行灵活的弹性扩容操作。
发明内容
本发明实施例提供了一种网络地址转换网关的扩容方法、设备及存储介质,能够灵活地实现对并发链接数和链接新建速率等性能指标进行弹性扩缩容操作,进一步提高了网关的地址转换质量和效率。
第一方面,本发明实施例提供一种网络地址转换网关的扩容方法,包括:
获取网络地址转换NAT网关的运行状态,所述运行状态包括以下至少之一:并发链接请求数量、新建链接请求速率;
在所述运行状态满足预设扩容条件时,则对所述NAT网关中的第一转发路径进行扩容,获得目标网关;
在所述运行状态满足预设缩容条件时,则对所述NAT网关中的第一转发路径进行缩容,获得目标网关;
其中,所述第一转发路径用于维护链接请求所对应的会话控制信息,并生成与所述链接请求相对应的转发规则,以基于所述转发规则对所述链接请求进行处理。
第二方面,本发明实施例提供一种网络地址转换网关的扩容装置,包括:
第一获取模块,用于获取网络地址转换NAT网关的运行状态,所述运行状态包括以下至少之一:并发链接请求数量、新建链接请求速率;
第一处理模块,用于在所述运行状态满足预设扩容条件时,则对所述NAT网关中的第一转发路径进行扩容,获得目标网关;
第一处理模块,还用于在所述运行状态满足预设缩容条件时,则对所述NAT网关中的第一转发路径进行缩容,获得目标网关;
其中,所述第一转发路径用于维护链接请求所对应的会话控制信息,并生成与所述链接请求相对应的转发规则,以基于所述转发规则对所述链接请求进行处理。
第三方面,本发明实施例提供一种电子设备,包括:存储器、处理器;其中,所述存 储器用于存储一条或多条计算机指令,其中,所述一条或多条计算机指令被所述处理器执行时实现上述第一方面中的网络地址转换网关的扩容方法。
第四方面,本发明实施例提供了一种计算机存储介质,用于储存计算机程序,所述计算机程序使计算机执行时实现上述第一方面中的网络地址转换网关的扩容方法。
第五方面,本发明实施例提供了一种计算机程序产品,包括:存储有计算机指令的计算机可读存储介质,当所述计算机指令被一个或多个处理器执行时,致使所述一个或多个处理器执行上述第一方面所示的网络地址转换网关的扩容方法中的步骤。
本实施例提供的技术方案,通过获取网络地址转换NAT网关的运行状态,在所述运行状态满足预设扩容条件时,则对所述NAT网关中的第一转发路径进行扩容,获得目标网关;从而有效地实现能够灵活地对并发链接数和链接新建速率等NAT网关的性能进行弹性扩缩容操作,进一步提高了NAT网关的地址转换质量和效率。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为相关技术中实施例提供的一种网络地址转换网关的原理框图一;
图2为相关技术中实施例提供的一种网络地址转换网关的原理框图二;
图3为本发明实施例提供的一种网络地址转换网关的扩容方法的原理示意图;
图4为本发明实施例提供的一种网络地址转换网关的扩容方法的流程示意图;
图5为本发明实施例提供的另一种网络地址转换网关的扩容方法的流程示意图;
图6为本发明实施例提供的利用所述目标转发路径组对所述链接请求进行处理的示意图;
图7为本发明实施例提供的对所述NAT网关中的第一转发路径进行扩容的流程示意图;
图8为本发明实施例提供的对所述NAT网关中的第一转发路径进行扩容的示意图一;
图9为本发明实施例提供的对所述NAT网关中的第一转发路径进行扩容的示意图二;
图10为本发明实施例提供的对所述多个第一转发路径进行分组的示意图;
图11为本发明实施例提供的对所述NAT网关中的第一转发路径进行缩容的流程示意图;
图12为本发明实施例提供的对所述NAT网关中的第一转发路径进行缩容的示意图一;
图13为本发明实施例提供的对所述NAT网关中的第一转发路径进行缩容的示意图二;
图14为本发明实施例提供的一种网络地址转换网关的扩容装置的结构示意图;
图15为与图14所示实施例提供的网络地址转换网关的扩容装置对应的电子设备的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员 在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
在本发明实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本发明。在本发明实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义,“多种”一般包含至少两种,但是不排除包含至少一种的情况。
应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
取决于语境,如在此所使用的词语“如果”、“若”可以被解释成为“在……时”或“当……时”或“响应于确定”或“响应于检测”。类似地,取决于语境,短语“如果确定”或“如果检测(陈述的条件或事件)”可以被解释成为“当确定时”或“响应于确定”或“当检测(陈述的条件或事件)时”或“响应于检测(陈述的条件或事件)”。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的商品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种商品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的商品或者系统中还存在另外的相同要素。
另外,下述各方法实施例中的步骤时序仅为一种举例,而非严格限定。
术语定义:
网络功能虚拟化(Network Function Vitrulazition,简称NFV),是一种对于网络架构(network architecture)的概念,即利用虚拟化技术,将网络节点层级的功能,分割成几个功能区块,分别以软件方式实现,不再局限于硬件架构。
网络地址转换(Network Address Translation,简称NAT),用于实现在使用私网IP地址的主机与外界进行通信时,将私网IP地址转换为公网IP地址,以能够访问公网。
慢速转发路径/慢速转发平面(Slow Path,简称SP),用于维护链接请求所对应的会话控制信息,生成与所述链接请求相对应的转发规则,并可以将转发规则发送至快速转发路径,以使得快速转发路径可以基于所述转发规则对所述链接请求进行处理。
快速转发路径/快速转发平面(Fast Path,简称FP),用于解析链接请求所对应的报文,并能够根据转发规则对报文进行转发。
为了便于理解本实施例中网络地址转换网关的扩容方法的具体实现过程和实现效果,下面对相关技术进行简要说明:
网络地址转换(Network Address Translation,简称NAT)网关能够在使用私网IP地址的主机与外界进行通信时,将私网IP地址转换为公网IP地址,以能够访问公网。对于NAT网关而言,网络带宽、并发链接数和链接新建速率是NAT网关的三个主要性能指标,在传统网络中,由于用户实例对应的物理资源有限,因此无法实现对上述三个指标进行弹性扩缩容操作。
目前,相关技术提供了一种基于流量负载分担方式来对网络带宽进行弹性扩缩容操作,然而,基于流量负载分担方式仅能实现NAT网关承载流量的弹性扩容操作。举例来说,如图1-图2所示,基于网络功能虚拟化NFV架构实现的NAT网关包括:两个慢速转发路径和 与慢速转发路径通信连接的多个快速转发路径,其中,慢速转发路径用于维护链接请求所对应的会话控制信息,生成与链接请求相对应的转发规则,并可以将转发规则发送至快速转发路径,在快速转发路径获取到转发规则之后,可以基于转发规则对链接请求进行处理,以实现解析链接请求所对应的报文,并能够根据转发规则对报文进行转发操作。
对于上述NAT网关而言,快速转发路径可以通过负载分担方式接入,当用户流量带宽达到预设瓶颈时,可以通过扩容负载分担成员的个数实现转发带宽的弹性扩容,例如:可以将快速转发路径的数量由4个扩容至5个,从而有效地实现了可以根据需求对网络带宽进行弹性扩容操作;相类似的,在用户流量远远超过所需流量时,可以通过缩小负载分担成员的个数实现转发带宽的弹性缩容,例如:可以将快速转发路径的数量由4个缩容至3个,从而有效地实现了可以根据需求对网络带宽进行弹性缩容操作。
通过上述描述内容可知,上述基于NFV架构的NAT网关仅通过弹性扩容/缩容快速转发路径的数量实现提升/降低NAT网关的带宽操作。然而,由于NAT网关中的一组快速转发路径仅能对应一组慢速转发路径,而慢速转发路径负责维护链接请求所对应的会话控制信息,在快速转发路径的数量是可以灵活变化的,而慢速转发路径的数量并不是灵活变化的,因此,会话控制信息的新建数量和并发能力仍然是固定的,即无法实现弹性扩缩容操作。
具体的,当前NAT网关无法实现一组快速转发路径对应多组慢速转发路径(或者无法实现并发链接数和链接新建速率的弹性扩容)的主要原因有:
(1)在NAT应用场景中,慢速转发路径负责NAT端口的分配操作,而NAT端口的分配操作无法通过简单的负载分担规则实现,即无法简单地、随机地将报文发送到不同的慢速转发路径进行处理,否则可能会造成端口分配冲突。
举例来说,慢速转发路径包括慢速转发路径组1和慢速转发路径组2,在慢速转发路径组1获取到设备A所发送的报文1、慢速转发路径组2获取到设备B所发送的报文2时,若报文1所对应的访问目的与报文2所对应的访问目的相同,在对报文1所分配的慢速转发路径(例如:慢速转发路径组1)与报文2所分配的慢速转发路径(例如:慢速转发路径组2)不同时,通过上述的两个慢速转发路径组可以同时为上述的报文1和报文2分配NAT端口,此时,若为报文1和报文2分配相同的NAT端口,则容易出现NAT端口分配冲突的情况。
(2)在对慢速转发路径或者快速转发路径进行弹性扩容/缩容的过程中,当前所存在的链接请求所对应的会话控制信息可能会被分配到任意的快速转发路径或者慢速转发路径,若新加入的快速转发路径或者慢速转发路径中没有当前所存在的链接请求的会话控制信息,这样可能会造成正在进行的链接请求的处理过程中断。
为了解决上述技术问题,本实施例提供了一种网络地址转换网关的扩容方法、设备及存储介质,参考附图3所示,该网络地址转换网关的扩容方法的执行主体可以为网络地址转换NAT网关的扩容装置,NAT网关的扩容装置可以与NAT网关通信连接,以对NAT网关的各个性能进行灵活调整和控制。
其中,NAT网关可以包括第一转发路径和与第一转发路径通信连接的第二转发路径,第一转发路径用于维护链接请求所对应的会话控制信息,生成与链接请求相对应的转发规则,并可以将转发规则发送至快速转发路径,以使得快速转发路径可以基于转发规则对链 接请求进行处理,因此,第一转发路径也可以称为慢速转发路径,第二转发路径用于解析链接请求所对应的报文,并能够根据转发规则对报文进行转发,因此,第二转发路径也可以称为快速转发路径。需要注意的是,本实施例中的第一转发路径的数量和第二转发路径的数量可以基于NAT网关的运行状态进行灵活调整和设置。
NAT网关的扩容装置可以是指可以在网络虚拟环境中提供计算处理服务的设备,通常是指利用网络进行信息规划、对NAT网关进行控制的装置。在物理实现上,NAT网关的扩容装置可以是任何能够提供计算服务,响应服务请求,并进行处理的设备,例如:可以是集群服务器、常规服务器、云服务器、云主机、虚拟中心等。NAT网关的扩容装置的构成主要包括处理器、硬盘、内存、系统总线等,和通用的计算机架构类似。
具体的,NAT网关的扩容装置,用于获取网络地址转换NAT网关的运行状态,运行状态包括以下至少之一:并发链接请求数量、新建链接请求速率。在获取到运行状态之后,可以分别基于预设扩容条件和预设缩容条件对运行状态进行分析处理,在运行状态满足预设扩容条件时,则说明此时的NAT网关需要进行扩容操作,进而可以对NAT网关中的第一转发路径进行扩容,获得目标网关。举例来说,在NAT网关中包括2个转发路径组和3个第二转发路径时,若NAT网关的数据处理性能无法满足用户需求,则可以将NAT网关中的转发路径组由2个扩容为3个,其中,每个转发路径组中均包括2个或者其他数量的第一转发路径。
在运行状态满足预设缩容条件时,则说明此时的NAT网关需要进行缩容操作,进而可以对NAT网关中的第一转发路径进行缩容,获得目标网关。举例来说,在NAT网关中包括2个转发路径组和3个第二转发路径时,若NAT网关所对应的数据处理资源远远高于用户需求的资源时,为了提高NAT网关所对应的资源利用率,则可以将NAT网关中的转发路径组由2个缩容为1个,其中,每个转发路径组中均包括2个或者其他数量的第一转发路径,由于更多的第一转发路径能够处理更多数量的链接请求,具有更高的链接新建速率,更少的第一转发路径能够处理较少数量的链接请求,具有较低的链接新建速率,从而有效地实现了能够灵活地对并发链接数和/或链接新建速率进行弹性扩缩容操作。
本实施例提供的技术方案,通过获取网络地址转换NAT网关的运行状态,在运行状态满足预设扩容条件时,则对NAT网关中的第一转发路径进行扩容,获得目标网关;在运行状态满足预设缩容条件时,则对NAT网关中的第一转发路径进行缩容,获得目标网关,从而有效地实现通过调整第一转发路径的数量能够灵活地对并发链接数和链接新建速率进行弹性扩缩容操作,进一步提高了NAT网关的地址转换质量和效率。
下面结合附图,对本发明的一些实施方式作详细说明。在各实施例之间不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。
图4为本发明实施例提供的一种网络地址转换网关的扩容方法的流程示意图;参考附图4所示,本实施例提供了一种网络地址转换网关的扩容方法,该方法的执行主体为网络地址转换网关的扩容装置,可以理解的是,该网络地址转换网关的扩容装置可以实现为软件、或者软件和硬件的组合,具体实现时,网络地址转换网关的扩容装置可以配置在网络地址转换网关上,该网络地址转换网关的扩容方法可以包括:
步骤S401:获取网络地址转换NAT网关的运行状态,运行状态包括以下至少之一: 并发链接请求数量、新建链接请求速率。
步骤S402:在运行状态满足预设扩容条件时,则对NAT网关中的第一转发路径进行扩容。其中,第一转发路径用于维护链接请求所对应的会话控制信息,并生成与链接请求相对应的转发规则,以基于转发规则对链接请求进行处理。
在一些实例中,本实施例中的方法还可以包括:
步骤S403:在运行状态满足预设缩容条件时,则对NAT网关中的第一转发路径进行缩容。
下面对上述各个步骤的具体实现过程和实现效果进行详细说明:
步骤S401:获取网络地址转换NAT网关的运行状态,运行状态包括以下至少之一:并发链接请求数量、新建链接请求速率。
其中,在利用网络地址转换NAT网关进行数据处理操作时,NAT网关存在用于标识NAT网关具有不同数据处理性能的不同运行状态,上述的运行状态包括以下至少之一:并发链接请求数量、新建链接请求速率。
具体的,并发链接请求数量可以是指在一预设时间段内或者同一时刻,用户通过NAT网关所建立的并发链接请求的数量,该链接请求用于实现网络访问操作。举例来说,用户可以通过NAT网关建立10个并发链接请求,通过NAT网关向云服务器发送10个并发链接请求,以实现同时能够访问云服务器。需要注意的是,并发链接请求的数量与NAT网关的数据处理需求相关,一般情况下,若并发链接请求的数量越大,NAT网关所需要的数据处理性能较高;若并发链接请求的数量越小,NAT网关所需要的数据处理性能较低。
另外,新建链接请求速率可以是指通过NAT网关对新的链接请求进行建立操作的速率,一般情况下,新建链接请求速率与NAT网关的数据处理性能相关,在新建链接请求速率越大时,则说明NAT网关的数据处理性能越好,在新建链接请求速率越小时,则说明NAT网关的数据处理性能越差。
此外,本实施例对于NAT网关的运行状态的获取方式不做限定,本领域技术人员可以根据具体的应用场景或者应用需求进行配置,例如:在NAT网关中配置有状态检测器,通过状态检测器可以获取NAT网关的运行状态;或者,网络地址转换网关的扩容装置可以向NAT网关发送状态检测数据,而后通过NAT网关获取与状态检测数据相对应的数据检测结果,基于数据检测结果来确定与NAT网关相对应的运行状态。
步骤S402:在运行状态满足预设扩容条件时,则对NAT网关中的第一转发路径进行扩容。其中,第一转发路径用于维护链接请求所对应的会话控制信息,并生成与链接请求相对应的转发规则,以基于转发规则对链接请求进行处理。
其中,NAT网关可以包括第一转发路径和与第一转发路径通信连接的第二转发路径,第一转发路径用于维护链接请求所对应的会话控制信息,生成与链接请求相对应的转发规则,并可以将转发规则发送至快速转发路径,以使得快速转发路径可以基于转发规则对链接请求进行处理,因此,第一转发路径也可以称为慢速转发路径,第二转发路径用于解析链接请求所对应的报文,并能够根据转发规则对报文进行转发,因此,第二转发路径也可以称为快速转发路径。
另外,预先配置有用于对NAT网关的运行状态进行分析处理的预设扩容条件,由 于NAT网关的运行状态可以包括以下至少之一:并发链接请求数量、新建链接请求速率,因此,为了能够对NAT网关进行准确的控制操作,对于不同的运行状态而言,可以对应有不同的预设扩容条件。
举例1,在运行状态包括并发链接请求数量时,用于对并发链接请求数量进行分析处理的预设扩容条件可以包括:在并发链接请求数量大于或等于预设扩容阈值时,则确定并发链接请求数量满足预设扩容条件;在并发链接请求数量小于预设扩容阈值时,则确定并发链接请求数量不满足预设扩容条件。
举例2,在运行状态包括新建链接请求速率时,用于对新建链接请求速率进行分析处理的预设扩容条件可以包括:在新建链接请求速率大于或等于预设扩容速率时,则确定新建链接请求速率满足预设扩容条件;在新建链接请求速率小于预设扩容速率时,则确定新建链接请求速率不满足预设扩容条件。
举例3,在运行状态包括并发链接请求数量和新建链接请求速率时,在获取到网络地址转换NAT网关的运行状态之后,本实施例中的方法还可以包括:获取用于对运行状态进行分析处理的预设扩容阈值;在至少一个运行状态大于或等于所对应的预设扩容阈值时,则确定运行状态满足预设扩容条件;即在运行状态包括并发链接请求数量和新建链接请求速率时,用于对并发链接请求数量和新建链接请求速率进行分析处理的预设扩容条件可以包括:在并发链接请求数量大于或等于预设扩容阈值,和/或新建链接请求速率大于或等于预设扩容速率时,则确定运行状态满足预设扩容条件;在并发链接请求数量小于预设扩容阈值,和/或新建链接请求速率小于预设扩容速率时,则确定运行状态不满足预设扩容条件。
在获取到运行状态之后,为了能够保证NAT网关所对应的网络地址转换的质量和效率,可以获取用于对运行状态进行分析处理的预设扩容条件,而后可以基于预设扩容条件对运行状态进行分析处理,在运行状态满足预设扩容条件时,则说明此时的NAT网关所对应的处理性能不满足当前的数据处理需求,因此需要扩容操作,进而可以对NAT网关中的第一转发路径进行扩容,即可以增加NAT网关中所包括的第一转发路径的数量,从而可以获得进行扩容操作之后的目标网关。
步骤S403:在运行状态满足预设缩容条件时,则对NAT网关中的第一转发路径进行缩容。
其中,预先配置有用于对NAT网关的运行状态进行分析处理的预设缩容条件,由于NAT网关的运行状态可以包括以下至少之一:并发链接请求数量、新建链接请求速率,因此,为了能够对NAT网关进行准确的控制操作,对于不同的运行状态而言,可以对应有不同的预设缩容条件。
举例1,在运行状态包括并发链接请求数量时,用于对并发链接请求数量进行分析处理的预设缩容条件可以包括:在并发链接请求数量小于预设缩容阈值时,则确定并发链接请求数量满足预设缩容条件;在并发链接请求数量大于或等于预设缩容阈值时,则确定并发链接请求数量不满足预设缩容条件。
举例2,在运行状态包括新建链接请求速率时,用于对新建链接请求速率进行分析处理的预设缩容条件可以包括:在新建链接请求速率小于预设缩容速率时,则确定新建链接请求速率满足预设缩容条件;在新建链接请求速率大于或等于预设缩容速率 时,则确定新建链接请求速率不满足预设缩容条件。
举例3,在运行状态包括并发链接请求数量和新建链接请求速率时,在获取网络地址转换NAT网关的运行状态之后,本实施例中的方法还可以包括:获取用于对运行状态进行分析处理的预设缩容阈值;在所有的运行状态均小于预设缩容阈值时,则确定运行状态满足预设缩容条件,即在运行状态包括并发链接请求数量和新建链接请求速率时,用于对并发链接请求数量和新建链接请求速率进行分析处理的预设缩容条件可以包括:在并发链接请求数量小于预设缩容阈值,且新建链接请求速率小于预设缩容速率时,则确定运行状态满足预设缩容条件;在并发链接请求数量大于或等于预设缩容阈值,和/或新建链接请求速率大于或等于预设缩容速率时,则确定运行状态不满足预设缩容条件。
在获取到运行状态之后,可以获取用于对运行状态进行分析处理的预设缩容条件,而后可以基于预设缩容条件对运行状态进行分析处理,在运行状态满足预设缩容条件时,则说明此时的NAT网关所对应的处理性能高于当前的数据处理需求,为了能够保证NAT网关所对应的网络地址转换资源的利用率,因此需要缩容操作,进而可以对NAT网关中的第一转发路径进行缩容,即可以减少NAT网关中所包括的第一转发路径的数量,从而可以获得进行缩容操作之后的目标网关。
在又一些实例中,本实施例中的运行状态不仅可以包括并发链接请求数量和新建链接请求速率,还可以包括网络带宽,在运行状态包括网络带宽时,本实施例中的方法还可以包括:检测网络带宽是否满足预设扩容条件,在网络带宽满足预设扩容条件时,则对NAT网关中的第二转发路径进行扩容,获得目标网关;在网络带宽不满足预设扩容条件时,则无需对NAT网关中的第二转发路径进行扩容操作。相类似的,在获取到网络带宽时,本实施例中的方法还可以包括:检测网络带宽是否满足预设缩容条件,在网络带宽满足预设缩容条件时,则对NAT网关中的第二转发路径进行缩容,获得目标网关;在网络带宽不满足预设缩容条件时,则无需对NAT网关中的第二转发路径进行缩容操作,从而有效地实现了可以灵活地基于网络带宽对NAT网关中的第二转发路径进行扩缩容操作,进一步提高了对NAT网关进行控制的灵活可靠性。
本实施例提供的网络地址转换网关的扩容方法,通过获取网络地址转换NAT网关的运行状态,在运行状态满足预设扩容条件时,则对NAT网关中的第一转发路径进行扩容,获得目标网关,在运行状态满足预设缩容条件时,则对NAT网关中的第一转发路径进行缩容,获得目标网关,有效地实现了在需要对NAT网关进行扩容时,则可以对NAT网关中的第一转发路径进行扩容操作,在需要对NAT网关进行缩容时,则可以对NAT网关中的第一转发路径进行缩容操作,即实现了能够灵活地对带宽、并发链接数和链接新建速率进行弹性的扩缩容操作,进一步提高了网络地址转换网关的地址转换质量和效率,保证了该方法的实用性。
图5为本发明实施例提供的另一种网络地址转换网关的扩容方法的流程示意图;在上述实施例的基础上,参考附图5所示,在获得目标网关之后,由于目标网关中所包括的第一转发路径的数量可以为多个,多个第一转发路径可以构成至少两个转发路径组,而对于待处理的链接请求而言,一个链接请求仅需要分配至一个转发路径组进行处理即可。因此,为了能够准确地对链接请求进行分析处理,本实施例提供了一种 确定用于对链接请求进行分析处理的目标转发路径组的实现方式,具体的,本实施例的方法还可以包括:
步骤S501:获取用于实现网络访问操作的链接请求。
在用户存在网络访问需求时,用户端可以基于用户的网络访问需求生成用于实现网络访问操作的链接请求,为了能够稳定地进行网络访问操作,需要对链接请求中所包括的网络地址进行转换操作,即NAT操作,因此可以将链接请求发送至NAT网关的扩容装置,从而使得NAT网关的扩容装置可以稳定地获得用于实现网络访问操作的链接请求。
步骤S502:确定与链接请求相对应的目的地址和目的端口。
其中,链接请求中包括五元组信息,即源IP地址、源端口信息、协议号、目的IP地址和目的端口信息,在利用NAT网关中的第一转发路径对链接请求进行分析处理时,可以基于链接请求中所包括的五元组信息来建立与链接请求相对应的唯一一个会话控制信息,并且能够对链接请求进行NAT操作,为了避免所建立的与链接请求相对应的会话控制信息出现访问冲突,在获取到链接请求之后,可以对链接请求进行特征提取操作,以确定与链接请求相对应的目的地址和目的端口。
步骤S503:在目标网关中,基于目的地址和目的端口确定与链接请求相对应的目标转发路径组,目标转发路径组中包括至少一个第一转发路径。
其中,由于在NAT网关获取到链接请求时,NAT网关可以通过链接请求中所包括的五元组建立与链接请求相对应的唯一一个会话控制信息,因此,在进行NAT操作时,如果链接请求访问的目的地址和目的端口不同,对于上述链接请求而言,即使利用NAT网关中的不同第一转发路径为链接请求分配相同的源端口号也不会造成访问冲突。如果链接请求访问的目的地址和目的端口相同,对于上述链接请求而言,如果利用NAT网关中的不同第一转发路径为链接请求分配相同的源端口号会造成访问冲突。
由上可知,为链接请求所分配的第一转发路径与链接请求所对应的目的地址和目的端口有关,为了能够保证不同的第一转发路径所处理的会话控制信息不会产生冲突,在获取到目的地址和目的端口之后,可以通过对目的地址和目的端口进行分析处理来确定与链接请求相对应的目标转发路径组,其中,目标转发路径组中包括至少一个第一转发路径,位于一个目标转发路径组中任意两个第一转发路径之间的数据是相同或者同步的。
在一些实例中,在链接请求包括第一链接请求和第二链接请求,第一链接请求对应有第一目的地址和第一目的端口,第二链接请求对应有第二目的地址和第二目的端口时;基于目的地址和目的端口确定与链接请求相对应的目标转发路径组可以包括:在第一目的地址、第一目的端口与第二目的地址、第二目的端口相同时,则将第一链接请求和第二链接请求分配至同一个目标转发路径组;在第一目的地址、第一目的端口与第二目的地址、第二目的端口不同时,则将第一链接请求和第二链接请求分配至相同或者不同的目标转发路径组。
其中,在链接请求包括多个时,为了能够准确地对每个链接请求进行分析处理,可以基于链接请求所对应的目的地址和目的端口来确定用于对链接请求进行分析处理的目标转发路径组。在链接请求中包括第一链接请求和第二链接请求时,可以获取第 一链接请求所对应的第一目的地址和第一目的端口、以及第二链接请求所对应的第二目的地址、第二目的端口。在获取到上述第一链接请求和第二链接请求各自对应的目的地址和目的端口之后,可以基于上述第一链接请求和第二链接请求各自对应的目的地址和目的端口来确定与第一链接请求和第二链接请求各自对应的目的转发路径组。
具体的,将获取到上述第一链接请求和第二链接请求各自对应的目的地址和目的端口之后,可以将第一链接请求和第二链接请求各自对应的目的地址和目的端口进行分析比较,在第一目的地址、第一目的端口与第二目的地址、第二目的端口相同时,则说明第一链接请求与第二链接请求访问目的相同,此时可以将第一链接请求和第二链接请求分配至同一个目标转发路径组,其中,目标转发路径组中可以包括多个第一转发路径组,且位于同一个目标转发路径组中的所有第一转发路径组之间的数据是同步的。或者,在第一目的地址、第一目的端口与第二目的地址、第二目的端口不同时,则说明第一链接请求与第二链接请求访问目的不同,此时可以将第一链接请求和第二链接请求分配至相同或者不同的目标转发路径组。
举例1,第一链接请求所对应的五元组信息如表1所示,具体的,源IP地址为10.1.0.5,源端口为23333,协议号为传输控制协议(Transmission Control Protocol,简称TCP),目的IP地址(即第一目的地址)为8.8.8.8,目的端口(第一目的端口)为80,在NAT网关获取到上述第一链接请求之后,可以将第一链接请求分配至第一目标转发路径组,而后通过第一目标转发路径组可以对第一链接请求所对应的源IP地址和源端口进行NAT转换操作,如表2所示,在进行NAT转换操作时,可以将源IP地址“10.1.0.5”转换为NAT-IP地址“47.1.1.1”,将源端口“23333”转换为NAT-端口“5000”。
表1:
表2:
举例2,第二链接请求所对应的五元组信息如表3所示,具体的,源IP地址为10.1.0.5,源端口为23333,协议号为传输控制协议(Transmission Control Protocol,简称TCP),目的IP地址(即第二目的地址)为114.114.114.114,目的端口(即第二目的端口)为80,在NAT网关获取到上述第二链接请求之后,由于第一链接请求与第二连接请求的访问目的不同,此时,可以将第二链接请求同步分配至第一目标转发路径组,或者,也可以将第二链接请求分配至其他目标转发路径组,而后通过第一目标转发路径组或者其他目标转发路径组可以对第二链接请求所对应的源IP地址和源端口进行NAT转换操作,如表4所示,在进行NAT转换操作时,可以将源IP地址 “10.1.0.5”转换为NAT-IP地址“47.1.1.1”,将源端口“23333”转换为NAT-端口“5000”。
表3:
表4:
由上可知,在同步或者异步地获取到多个待处理的链接请求时,为了能够保证不同的链接请求所建立的会话控制信息不会出现冲突的情况,在为链接请求分配目标转发路径组时,可以预先配置一个规则:若任意两个链接请求的访问目的相同时,则将任意两个链接请求分配至同一个目标转发路径组进行处理;若任意两个链接请求的访问目的不同时,则将上述任意两个链接请求分配至相同或者不同的目标转发路径组进行处理,通过上述所定义的用于确定目标转发路径组的规则,可以有效地保证不同的目标转发路径组之间所处理的会话控制信息不会产生冲突。
简单来说,若任意两个链接请求访问到不同目的,即使为上述链接请求分配相同的NAT-IP和NAT-PORT,这样在对上述链接请求进行回程流量的时候,由于目的IP和目的端口不同,所以基于进行NAT操作之后的链接请求仍然可以查询到两个不同的会话控制信息,即能够将流量进行正确的还原操作,所以若用户访问目的IP和目的PORT不同,可以将链接请求所对应的会话控制信息分别分配到相同或者不同的目标转发路径组中。
需要注意的是,由于链接请求中包括五元组信息,因此,除了基于链接请求相对应的目的地址和目的端口确定与链接请求相对应的目标转发路径组之外,还可以包括基于链接请求相对应的目的地址、目的端口和协议号来确定与链接请求相对应的目标转发路径组。此时,基于目的地址和目的端口确定与链接请求相对应的目标转发路径组可以包括:获取与链接请求相对应的协议号;基于目的地址、目的端口和协议号,确定与链接请求相对应的目标转发路径组。
具体的,为了能够准确地基于链接请求相对应的目的地址、目的端口和协议号来确定与链接请求相对应的目标转发路径组,可以先获取与链接请求相对应的协议号,而后可以对目的地址、目的端口和协议号进行分析处理,以确定与链接请求相对应的目标转发路径组。
举例来说,参考附图6所示,NAT网关中可以包括两个转发路径组和与转发路径组进行通信连接的多个快速转发路径,其中,每个转发路径组中可以包括两个慢速转发路径,在链接请求包括第一链接请求和第二链接请求,第一链接请求对应有第一目的地址、第一目的端口和第一协议号,第二链接请求对应有第二目的地址、第二目的端口和第二协议号时,基于目的地址、目的端口和协议号,确定与链接请求相对应的目标转发路径组可以包括:在第一目的地址、第一目的端口、第一协议号与第二目的 地址、第二目的端口、第二协议号相同时,则将第一链接请求和第二链接请求分配至同一个目标转发路径组;在第一目的地址、第一目的端口、第一协议号与第二目的地址、第二目的端口、第二协议号不同时,则将第一链接请求和第二链接请求分配至相同或者不同的目标转发路径组。
具体的,将获取到上述第一链接请求和第二链接请求各自对应的目的地址、目的端口和协议号之后,可以将第一链接请求和第二链接请求各自对应的目的地址、目的端口和协议号进行分析比较,在第一目的地址、第一目的端口、第一协议号与第二目的地址、第二目的端口、第二协议号相同时,则说明第一链接请求与第二链接请求各自对应的访问目的和通信协议相同,此时可以将第一链接请求和第二链接请求分配至同一个目标转发路径组。另外,在第一目的地址、第一目的端口、第一协议号与第二目的地址、第二目的端口、第二协议号不同时,则说明第一链接请求与第二链接请求各自对应的访问目的和通信协议不同,此时可以将第一链接请求和第二链接请求分配至相同或者不同的目标转发路径组。
本实施例中,通过链接请求所对应的目的IP和目的端口、或者目的IP、目的端口和协议号来确定用于对链接请求进行分析处理的目标转发路径组,由于可以将不同访问目的的链接请求分配至不同的目标转发路径组进行处理,这样有效地解决了不同目标转发路径组之间维护的会话控制信息之间存在冲突的问题,进而保证了对链接请求进行分析处理的稳定可靠性。
步骤S504:利用目标转发路径组对链接请求进行处理,以实现网络访问操作。
在确定目标转发路径组之后,可以利用目标转发路径组对链接请求进行处理,以实现网络访问操作。在一些实例中,利用目标转发路径组对链接请求进行处理可以包括:利用目标转发路径组中的第一转发路径确定与链接请求相对应的转发规则;将转发规则发送至与目标转发路径组相连接的第二转发路径,以使第二转发路径基于转发规则对链接请求进行处理,实现网络访问操作。
具体的,目标转发路径组中包括一个或多个(两个或两个以上)第一转发路径,在将链接请求分配至目标转发路径组时,可以利用目标转发路径组中的第一转发路径确定与链接请求相对应的转发规则,为了能够提高对链接请求进行分析处理,在第一转发路径建立并确定与链接请求相对应的转发规则之后,第一转发路径可以将转发规则发送至与目标转发路径组相连接的第二转发路径,以使第二转发路径基于转发规则对链接请求进行处理,实现网络访问操作。
需要注意的是,当第二转发路径获取到链接请求所对应的转发规则之后,在获取到相对应的链接请求之后,则无需访问第一转发路径,直接通过第二转发路径中所包括的转发规则对链接请求进行分析处理,从而可以快速地对链接请求进行报文解析和转发操作。
本实施例中,通过获取用于实现网络访问操作的链接请求,确定与链接请求相对应的目的地址和目的端口,而后在目标网关中,基于目的地址和目的端口确定与链接请求相对应的目标转发路径组,并利用目标转发路径组对链接请求进行处理,从而有效地实现了可以基于链接请求所对应的访问目的来确定用于对链接请求进行分析处理的目标转发路径组,这样在利用NAT网关进行NAT操作时,能够有效地避免访问冲突 的情况,进一步提高了NAT网关使用的稳定可靠性。
在另一些实例中,由于目标转发路径组中的用于对链接请求进行分析处理的网元中可以包括多个处理内核,而不同的处理内核可以对应有不同的哈希算法,为了能够提高处理内核的资源的利用率,避免处理内核中资源浪费的问题,可以基于哈希算法来确定用于对链接请求进行分析处理的目标内核,此时,本实施例提供了一种利用目标转发路径组对链接请求进行处理的实现方式,具体包括:
步骤S601:获取所述目标转发路径组中所包括的用于对所述链接请求进行分析处理的多个处理内核。
其中,目标转发路径组中的用于对链接请求进行分析处理的网元中可以包括多个处理内核,不同的目标转发路径组对应有不同的处理内核,且不同的处理内核可以对应有不同的哈希算法,例如:一个目标转发路径组可以对应有处理内核1、处理内核2和处理内核3,上述的处理内核1对应有哈希算法1,处理内核2对应有哈希算法2,处理内核3对应有哈希算法3。上述的哈希算法1、哈希算法2和哈希算法3中的任意两个各不相同。
在获取到多个链接请求之后,为了能够保证对链接请求进行分析处理的质量和效果,需要确定用于对各个链接请求进行分析处理的处理内核,需要先获取目标转发路径组中所包括的用于对所述链接请求进行分析处理的多个处理内核,具体的,通过访问目标转发路径组即可直接识别用于对所述链接请求进行分析处理的多个处理内核;或者,通过预先注册或者记载的内核信息即可获取所述目标转发路径组中所包括的用于对所述链接请求进行分析处理的多个处理内核。
步骤S602:确定多个处理内核各自对应的用于对所述链接请求进行分析处理的第一过程哈希算法以及所述第二转发路径中用于对所述链接请求进行分析处理的第二过程哈希算法。
对于链接请求而言,为了能够实现对链接请求进行分析处理,不仅需要确定用于对链接请求进行分析处理的处理内核,还需要确定用于对链接请求进行分析处理的第二转发路径,上述的处理内核可以对应有第一过程哈希算法,第二转发路径对应有第二过程哈希算法,上述的第一过程哈希算法与第二过程哈希算法可以相同或者不同。
需要注意的是,上述的处理内核所对应的第一过程哈希算法为一个统称,而不同的处理内核所对应的第一过程哈希算法不同,举例来说,多个处理内核包括:第一过程哈希算法a、第一过程哈希算法b、第一过程哈希算法c和第一过程哈希算法d,上述的第一过程哈希算法a、第一过程哈希算法b、第一过程哈希算法c和第一过程哈希算法d统称为第一过程哈希算法。
步骤S603:基于所述第一过程哈希算法和所述第二过程哈希算法,在所述多个处理内核中确定目标内核,所述目标内核所对应的第一过程哈希算法与所述第二过程哈希算法不同。
对于多个处理内核而言,由于不同的处理内核可以分配需要进行处理的不同链接请求,为了避免各个处理内核所需要处理的链接请求数量不均匀,从而可以避免处理内核的资源出现浪费的问题,在获得多个处理内核各自对应的用于对所述链接请求进行分析处理的第一过程哈希算法以及所述第二转发路径中用于对所述链接请求进行分 析处理的第二过程哈希算法之后,可以对第一过程哈希算法和第二过程哈希算法进行分析处理,以在多个处理内核中确定目标内核,所确定的目标内核所对应的第一过程哈希算法与第二过程哈希算法不同。
举例来说,哈希算法包括哈希算法a、哈希算法b、哈希算法c、哈希算法d,其中,通过分析识别可知,目标转发路径中包括3个处理内核,分别包括处理内核A、处理内核B、处理内核C,其中,处理内核A对应哈希算法b,处理内核B对应哈希算法a,处理内核C对应哈希算法d。另外,第二转发路径中用于对所述链接请求进行分析处理的第二过程哈希算法为哈希算法b,此时,则可以将哈希算法a所对应的处理内核B或者将哈希算法d所对应的处理内核C确定为目标内核,从而有效地保证了对目标内核进行确定的准确可靠性,并且,可以均衡各个目标内核所分配的链接请求数量,进一步提高了对链接请求进行分析处理的质量和效率,同时能够保证处理内核资源的利用率。
步骤S604:利用所述目标内核对所述链接请求进行处理。
在获取到目标内核之后,则可以将链接请求分配至目标内核,以利用目标内核对链接请求进行处理,从而保证了对链接请求进行处理的质量和效率。
本实施例中,通过获取所述目标转发路径组中所包括的用于对所述链接请求进行分析处理的多个处理内核,确定多个处理内核各自对应的用于对所述链接请求进行分析处理的第一过程哈希算法以及所述第二转发路径中用于对所述链接请求进行分析处理的第二过程哈希算法,而后基于所述第一过程哈希算法和所述第二过程哈希算法,在所述多个处理内核中确定目标内核,并利用所述目标内核对所述链接请求进行处理,从而不仅有效地实现了对链接请求进行分析处理的质量和效率,并且还能够保证处理内核所对应资源的利用率,避免出现对处理内核资源的浪费的问题,进一步提高了该方法的实用性。
图7为本发明实施例提供的对NAT网关中的第一转发路径进行扩容的流程示意图;在上述任意一个实施例的基础上,参考附图7所示,本实施例提供了一种对NAT网关中的第一转发路径进行扩容的实现方式,具体的,本实施例中的对NAT网关中的第一转发路径进行扩容可以包括:
步骤S701:基于运行状态确定对NAT网关中的第一转发路径进行扩容操作的待扩容转发路径。
其中,在运行状态满足预设扩容条件时,则需要对NAT网关中的第一转发路径进行扩容操作,具体的,为了能够实现对NAT网关中的第一转发路径进行扩容操作,可以先基于运行状态确定对NAT网关中的第一转发路径进行扩容操作的待扩容转发路径,待扩容转发路径的数量可以为2、4或者6等2的倍数等参数。在一些实例中,待扩容转发路径的数量为2即可满足数据处理需求。
步骤S702:将待扩容转发路径与第一转发路径进行连接,并基于第一转发路径对待扩容转发路径进行数据同步操作,获得进行扩容后的多个第一转发路径。
在获取到待扩容转发路径之后,可以将待扩容转发路径与第一转发路径进行连接,由于待扩容转发路径是新建的转发路径,待扩容转发路径所维护的会话控制信息比较少甚至为0,因此,为了能够使得待扩容转发路径与历史存在的第一转发路径之间具 有相同的会话控制信息,可以基于第一转发路径对待扩容转发路径进行数据同步操作,从而可以获得进行扩容后的多个第一转发路径。
具体的,在基于第一转发路径对待扩容转发路径进行数据同步操作时,本实施例对于数据同步操作的实现方式不做限定,本领域技术人员可以根据具体的应用场景或者应用需求进行配置,在一些实例中,在进行数据同步操作时,可以获取第一转发路径中所维护的所有会话控制信息,而后将所有会话控制信息复制至待扩容转发路径,从而实现了基于第一转发路径对待扩容转发路径进行数据同步操作。
在另一些实例中,基于第一转发路径对待扩容转发路径进行数据同步操作可以包括:通过NAT网关中的第二转发路径生成与链接请求相对应的会话保活信息;基于链接请求相对应的转发规则,确定与会话保活信息相对应的转发路径标识;将会话保活信息发送至与转发路径标识相对应的第一转发路径,以使第一转发路径基于会话保活信息对待扩容转发路径进行数据同步操作。
具体的,第一转发路径通信连接有一个或多个第二转发路径,在第一转发路径生成与链接请求相对应的转发规则,并将转发规则发送至第二转发路径之后,第二转发路径可以基于转发规则对链接请求进行分析处理操作,为了能够使得第一转发路径能够获知到第二转发路径所对应的报文处理状态,第二转发路径可以对链接请求所对应的会话控制信息进行跟踪,并能够基于会话控制信息向第一转发路径进行反向汇报操作,此时,通过NAT网关中的第二转发路径能够生成与链接请求相对应的会话保活信息,在生成会话保活信息之后,为了能够使得将会话保活信息发送至相对应的第一转发路径,则可以基于链接请求相对应的转发规则,确定与会话保活信息相对应的转发路径标识,不同的第一转发路径可以对应有不同的转发路径标识。因此,在获取到转发路径标识之后,可以将会话保活信息发送至与转发路径标识相对应的第一转发路径,在第一转发路径获取到会话保活信息之后,第一转发路径可以基于会话保活信息对待扩容转发路径进行数据同步操作,从而有效地实现了通过第二转发路径的会话控制信息进行跟踪和反向汇报操作,同时第一转发路径与待扩容转发路径之间可以通过串包机制实现弹性扩/缩容操作。
在基于第一转发路径对待扩容转发路径进行数据同步操作之后,本实施例中的方法还可以包括检测数据同步操作的运行状态,此时,本实施例中的方法还可以包括:获取第一转发路径所对应的会话控制信息量以及待扩容转发路径所对应的新建会话控制信息量;确定会话控制信息量与新建会话控制信息量之间的数量偏差;在数量偏差小于预设阈值时,则确定完成对待扩容转发路径的数据同步操作;在数量偏差大于或等于预设阈值时,则确定未完成对待扩容转发路径的数据同步操作。
其中,由于待扩容转发路径是新建立的转发路径,其所对应的会话控制信息的数量与第一转发路径所对应的会话控制信息的数量完全不同,为了能够实现数据同步操作,可以获取第一转发路径所对应的会话控制信息量以及待扩容转发路径所对应的新建会话控制信息量,具体的,在NAT网关中可以配置有用于检测会话控制信息的数量的检测装置,通过检测装置能够获得第一转发路径所对应的会话控制信息量以及待扩容转发路径所对应的新建会话控制信息量。
需要注意的是,会话控制信息量和新建会话控制信息量可以是动态变化的,一般 情况下,在第一转发路径所对应的会话控制信息量与待扩容转发路径所对应的新建会话控制信息量相类似时,则可以确定完成了对待扩容转发路径的数据同步操作。因此,为了能够准确地判断出是否完成对待扩容转发路径的数据同步操作,则可以获取会话控制信息量与新建会话控制信息量之间的数量偏差,该数量偏差可以为会话控制信息量-新建会话控制信息量,并且,该数量偏差大于或等于零。
在获取到数量偏差之后,可以将数量偏差与预设阈值进行分析比较,在数量偏差小于预设阈值时,则说明第一转发路径所对应的会话控制信息量与待扩容转发路径所对应的新建会话控制信息量相近似,进而可以确定已完成对待扩容转发路径的数据同步操作;在数量偏差大于或等于预设阈值时,则说明第一转发路径所对应的会话控制信息量与待扩容转发路径所对应的新建会话控制信息量相差较大,进而可以确定未完成对待扩容转发路径的数据同步操作。
举例来说,参考附图8-图9所示,NAT网关中可以包括两个慢速转发路径(即第一转发路径)以及与慢速转发路径通信连接的快速转发路径(可以是一个或多个),在需要对慢速转发路径进行扩容操作时,可以先确定用于实现扩容操作的待扩容转发路径(图8中灰色的两个慢速转发路径),而后将待扩容转发路径加入预先建立的慢速转发路径中,在进行扩容操作之后,可以通过串包机制实现会话控制信息的备份操作,具体的,可以通过快速转发路径向慢速转发路径进行会话控制信息的汇报操作,从而实现存量的会话控制信息的同步操作,整个扩容过程可以包括:数据同步中、数据同步完成和扩容完成三个过程:
在进行数据同步的过程中,所有快速转发路径所对应的链接请求可以全部发送至原有的转发路径组中的慢速转发路径,而后可以利用转发路径组内所有慢速转发路径的同步机制完成对待扩容的慢速转发路径的会话控制信息进行同步操作。
在进行数据同步过程中,可以实时检测待扩容的慢速转发路径所对应的会话控制信息量以及原有转发路径组内的慢速转发路径所对应的会话控制信息量,当所有慢速转发路径所对应的会话控制信息的数量相等或者相类似时,则认为数据同步完成,例如:历史的慢速转发路径和新扩容的慢速转发路径各自对应的会话控制信息量均为10W时,则可以确定完成了数据同步操作。
在又一些实例中,为了进一步提高对NAT网关进行控制的稳定可靠性,在获得进行扩容后的多个第一转发路径之后,本实施例中的方法还可以包括:对多个第一转发路径进行分组,获得至少两个转发路径组,每个转发路径组中至少包括全量历史数据的第一转发路径。
在获得进行扩容后的多个第一转发路径之后,为了能够提高NAT网关进行数据处理的质量和效率,可以对按照预设策略对多个第一转发路径进行分组,例如:可以获取分组数量或者每个转发路径组的大小(即用于标识转发路径组中所包括的第一转发路径的数量),基于分组数量或者转发路径组的大小对多个第一转发路径进行分组操作,从而可以获得至少两个转发路径组,其中,每个转发路径组中至少包括全量历史数据的第一转发路径。
举例来说,参考附图10所示,在进行扩容后的NAT网关中包括4个慢速转发路径时,若获取到分组数量为2个,则可以基于上述的分组数量对上述4个慢速转发路径 进行分组操作,从而可以获得两个转发路径组,其中,每个转发路径组中包括两个慢速转发路径,从而有效地实现了对多个第一转发路径进行分组操作。
需要注意的是,为了能够提高NAT网关进行网络地址转换操作的质量、效率以及资源利用率,在获得至少两个转发路径组之后,本实施例中的方法还可以包括:获取转发路径组中每个第一转发路径所对应的数据处理状态;在数据处理状态处于老化状态时,则禁止向处于老化状态的第一转发路径分配待处理的链接请求;在处于老化状态的第一转发路径的数据为零时,则将第一转发路径删除。
其中,对于第一转发路径而言,若第一转发路径所对应的数据或者数据状态是实时变化的,则说明此时第一转发路径所对应的数据处理状态为活跃状态,在第一转发路径所对应的数据或者数据状态在预设时间段内并未发生变化,则说明此时的第一转发路径所对应的数据处理状态为老化状态或者趋向老化状态。在第一转发路径所对应的数据处理状态为活跃状态时,则说明第一转发路径所需要进行处理的数据较多,在第一转发路径所对应的数据处理状态为老化状态时,则说明第一转发路径所需要进行处理的数据越来越少。
在获得至少两个转发路径组之后,由于最开始获得的转发路径组中包括全量历史数据的第一转发路径,此时,转发路径组中会包括多个第一转发路径。举例来说,参考附图10所示,进行扩容后的NAT网关中包括两个历史的慢速转发路径(慢速转发路径A和慢速转发路径a)和两个新扩建的慢速转发路径(慢速转发路径B和慢速转发路径b),其中,慢速转发路径A和慢速转发路径B中包括全量的历史数据,因此,在划分转发路径组时,其中一个转发路径组可以包括:慢速转发路径A和慢速转发路径B,另一个转发路径组可以包括:慢速转发路径a和慢速转发路径b。或者,其中一个转发路径组可以包括:慢速转发路径A、慢速转发路径a和慢速转发路径B,另一个转发路径组可以包括:慢速转发路径A、慢速转发路径a和慢速转发路径b,从而有效地实现了每个转发路径组中均包括具有全量历史数据的转发路径,这样可以有效地避免数据处理过程中出现中断的情况。
为了避免资源的浪费,可以实时检测位于转发路径组中每个第一转发路径所对应的数据处理状态,在数据处理状态处于老化状态时,则可以禁止向处于老化状态的第一转发路径分配待处理的链接请求;并且,在处于老化状态的第一转发路径的数据为零时,则将第一转发路径删除,从而可以有效地实现了对转发路径组中处于老化状态的第一转发路径进行及时清理操作,进一步提高了该方法的实用性。
本实施例中,基于运行状态确定对NAT网关中的第一转发路径进行扩容操作的待扩容转发路径,将待扩容转发路径与第一转发路径进行连接,并基于第一转发路径对待扩容转发路径进行数据同步操作,获得进行扩容后的多个第一转发路径,有效地实现了能够稳定地对NAT网关中的第一转发路径进行灵活的扩容操作,进一步提高了NAT网关使用的准确可靠性。
图11为本发明实施例提供的对NAT网关中的第一转发路径进行缩容的流程示意图;在上述任意一个实施例的基础上,参考附图11所示,本实施例提供了一种对NAT网关中的第一转发路径进行缩容的实现方式,具体的,本实施例中的对NAT网关中的第一转发路径进行缩容可以包括:
步骤S1101:基于运行状态确定对NAT网关中的第一转发路径进行缩容操作的待缩容转发路径。
其中,在运行状态满足预设缩容条件时,则需要对NAT网关中的第一转发路径进行缩容操作,具体的,为了能够实现对NAT网关中的第一转发路径进行缩容操作,可以先基于运行状态确定对NAT网关中的第一转发路径进行缩容操作的待缩容转发路径,待缩容转发路径的数量可以为2个、4个或者6个等等。在一些实例中,待缩容转发路径的数量为2个即可满足数据处理需求。
步骤S1102:将待缩容转发路径配置为禁止分配新建的链接请求。
由于待缩容转发路径是需要进行删除的转发路径,为了能够不影响数据处理操作,在确定待缩容转发路径之后,可以将待缩容转发路径配置为禁止分配新建的链接请求,即在NAT网关获取到待缩容转发路径之后,则不会将新的链接请求分配至待缩容转发路径进行分析处理,对于已经分配至待缩容转发路径的历史链接请求,可以继续保持发送至待缩容转发路径进行处理,这样可以避免数据处理的中断操作。
步骤S1103:在待缩容转发路径满足缩容状态时,则将NAT网关中的待缩容转发路径删除。
其中,在将待缩容转发路径配置为禁止分配新建的链接请求之后,本实施例中的方法还可以包括:获取与待缩容转发路径相对应的链接请求数量;在链接请求数量为0时,则确定待缩容转发路径满足缩容状态;在链接请求数量为非0时,则确定待缩容转发路径不满足缩容状态。
具体的,在将待缩容转发路径配置为禁止分配新建的链接请求之后,可以实时获取与待缩容转发路径相对应的链接请求数量,在链接请求数量为0时,则说明此时的待缩容转发路径没有需要进行处理的链接请求,进而可以确定待缩容转发路径满足缩容状态;在链接请求数量为非0时,则说明此时的待缩容转发路径存在需要进行处理的链接请求,进而可以确定待缩容转发路径不满足缩容状态。
在确定待缩容转发路径满足缩容状态时,为了避免数据资源的浪费,可以将NAT网关中的待缩容转发路径删除,从而有效地实现了对NAT网关中的第一转发路径进行缩容操作。
举例来说,参考附图12-图13,NAT网关可以包括3个转发路径组和与转发路径组通信连接的快速转发路径,其中,每个转发路径组可以包括2个慢速转发路径,并且,在慢速转发路径将链接请求所对应的转发规则发送至快速转发路径时,快速转发路径所获得的转发规则中可以包括与链接请求相对应的慢速转发路径的SP组编号,并可以基于SP组编号上报会话控制信息的保活信息。
在NAT网关的运行状态满足预设缩容条件时,则可以确定待缩容转发路径,例如,待缩容转发路径可以为图12中灰色的慢速转发路径;在确定待扩缩容转发路径之后,可以基于待缩容转发路径进行缩容操作,整个缩容过程可以包括:停止新建、等待存量的会话控制信息进行释放和缩容慢速转发路径组三个过程:
在进行停止新建操作时,快速转发路径在处理新建链接流量时,可以停止将新建链接流量发送至要缩容的慢速转发路径组。
等待存量的会话控制信息进行释放,获取待缩容转发路径所对应的会话控制信息 的数量,在数量降低为0时,则可以进入下一状态。
缩容慢速转发路径集群,将要缩容的慢速转发路径组从NAT网关中的工作组中剔除。
本实施例中,基于运行状态确定对NAT网关中的第一转发路径进行缩容操作的待缩容转发路径,将待缩容转发路径配置为禁止分配新建的链接请求,在待缩容转发路径满足缩容状态时,则将NAT网关中的待缩容转发路径删除,有效地实现了能够稳定地对NAT网关中的第一转发路径进行灵活的缩容操作,进一步提高了NAT网关使用的准确可靠性。
图14为本发明实施例提供的一种网络地址转换网关的扩容装置的结构示意图;参考附图14所示,本实施例提供了一种网络地址转换网关的扩容装置,该网络地址转换网关的扩容装置可以执行上述图4所示的网络地址转换网关的扩容方法,该网络地址转换网关的扩容装置可以包括:
第一获取模块11,用于获取网络地址转换NAT网关的运行状态,运行状态包括以下至少之一:并发链接请求数量、新建链接请求速率;
第一处理模块12,用于在运行状态满足预设扩容条件时,则对NAT网关中的第一转发路径进行扩容,其中,第一转发路径用于维护链接请求所对应的会话控制信息,并生成与链接请求相对应的转发规则,以基于转发规则对链接请求进行处理。
在一些实例中,第一处理模块12,还用于在运行状态满足预设缩容条件时,则对NAT网关中的第一转发路径进行缩容。
在一些实例中,在运行状态包括并发链接请求数量和新建链接请求速率时,在获取网络地址转换NAT网关的运行状态之后,本实施例中的第一获取模块11和第一处理模块12用于执行以下步骤:
第一获取模块11,用于获取用于对运行状态进行分析处理的预设扩容阈值和预设缩容阈值;
第一处理模块12,用于在至少一个运行状态大于或等于所对应的预设扩容阈值时,则确定运行状态满足预设扩容条件;在所有的运行状态均小于预设缩容阈值时,则确定运行状态满足预设缩容条件。
在一些实例中,在获得目标网关之后,本实施例中的第一获取模块11和第一处理模块12用于执行以下步骤:
第一获取模块11,用于获取用于实现网络访问操作的链接请求;
第一处理模块12,用于确定与链接请求相对应的目的地址和目的端口;在目标网关中,基于目的地址和目的端口确定与链接请求相对应的目标转发路径组,目标转发路径组中包括至少一个第一转发路径;利用目标转发路径组对链接请求进行处理,以实现网络访问操作。
在一些实例中,链接请求包括第一链接请求和第二链接请求,第一链接请求对应有第一目的地址和第一目的端口,第二链接请求对应有第二目的地址和第二目的端口;在第一处理模块12基于目的地址和目的端口确定与链接请求相对应的目标转发路径组时,该第一处理模块12用于执行:在第一目的地址、第一目的端口与第二目的地址、第二目的端口相同时,则将第一链接请求和第二链接请求分配至同一个目标转发路径组;在第一目的地址、第一目的端口与第二目的地址、第二目的端口不同时,则将第一链接请求和第二链接请求分配至相同或者不同的目标转发路径组。
在一些实例中,在第一处理模块12基于目的地址和目的端口确定与链接请求相对应的目标转发路径组时,该第一处理模块12用于执行:获取与链接请求相对应的协议号;基于目的地址、目的端口和协议号,确定与链接请求相对应的目标转发路径组。
在一些实例中,链接请求包括第一链接请求和第二链接请求,第一链接请求对应有第一目的地址、第一目的端口和第一协议号,第二链接请求对应有第二目的地址、第二目的端口和第二协议号;在第一处理模块12基于目的地址、目的端口和协议号,确定与链接请求相对应的目标转发路径组时,该第一处理模块12用于执行:在第一目的地址、第一目的端口、第一协议号与第二目的地址、第二目的端口、第二协议号相同时,则将第一链接请求和第二链接请求分配至同一个目标转发路径组;在第一目的地址、第一目的端口、第一协议号与第二目的地址、第二目的端口、第二协议号不同时,则将第一链接请求和第二链接请求分配至相同或者不同的目标转发路径组。
在一些实例中,在第一处理模块12利用目标转发路径组对链接请求进行处理时,该第一处理模块12用于执行:利用目标转发路径组中的第一转发路径确定与链接请求相对应的转发规则;将转发规则发送至与目标转发路径组相连接的第二转发路径,以使第二转发路径基于转发规则对链接请求进行处理,实现网络访问操作。
在一些实例中,在第一处理模块12利用所述目标转发路径组对所述链接请求进行处理时,该第一处理模块12用于执行:获取所述目标转发路径组中所包括的用于对所述链接请求进行分析处理的多个处理内核;确定多个处理内核各自对应的用于对所述链接请求进行分析处理的第一过程哈希算法以及所述第二转发路径中用于对所述链接请求进行分析处理的第二过程哈希算法;基于所述第一过程哈希算法和所述第二过程哈希算法,在所述多个处理内核中确定目标内核,所述目标内核所对应的第一过程哈希算法与所述第二过程哈希算法不同;利用所述目标内核对所述链接请求进行处理。
在一些实例中,在第一处理模块12对NAT网关中的第一转发路径进行扩容时,该第一处理模块12用于执行:基于运行状态确定对NAT网关中的第一转发路径进行扩容操作的待扩容转发路径;将待扩容转发路径与第一转发路径进行连接,并基于第一转发路径对待扩容转发路径进行数据同步操作,获得进行扩容后的多个第一转发路径。
在一些实例中,在第一处理模块12基于第一转发路径对待扩容转发路径进行数据同步操作时,该第一处理模块12用于执行:通过NAT网关中的第二转发路径生成与链接请求相对应的会话保活信息;基于链接请求相对应的转发规则,确定与会话保活信息相对应的转发路径标识;将会话保活信息发送至与转发路径标识相对应的第一转发路径,以使第一转发路径基于会话保活信息对待扩容转发路径进行数据同步操作。
在一些实例中,在基于第一转发路径对待扩容转发路径进行数据同步之后,本实施例中的第一获取模块11和第一处理模块12用于执行以下步骤:
第一获取模块11,用于获取第一转发路径所对应的会话控制信息量以及待扩容转发路径所对应的新建会话控制信息量;
第一处理模块12,用于确定会话控制信息量与新建会话控制信息量之间的数量偏差;在数量偏差小于预设阈值时,则确定完成对待扩容转发路径的数据同步操作;在数量偏差大于或等于预设阈值时,则确定未完成对待扩容转发路径的数据同步操作。
在一些实例中,在获得进行扩容后的多个第一转发路径之后,本实施例中的第一 处理模块12用于:对多个第一转发路径进行分组,获得至少两个转发路径组,每个转发路径组中至少包括全量历史数据的第一转发路径。
在一些实例中,在第一处理模块12对NAT网关中的第一转发路径进行缩容时,该第一处理模块12用于执行:基于运行状态确定对NAT网关中的第一转发路径进行缩容操作的待缩容转发路径;将待缩容转发路径配置为禁止分配新建的链接请求;在待缩容转发路径满足缩容状态时,则将NAT网关中的待缩容转发路径删除。
在一些实例中,在将待缩容转发路径配置为禁止分配新建的链接请求之后,本实施例中的第一获取模块11和第一处理模块12用于执行以下步骤:
第一获取模块11,用于获取与待缩容转发路径相对应的链接请求数量;
第一处理模块12,用于在链接请求数量为0时,则确定待缩容转发路径满足缩容状态;在链接请求数量为非0时,则确定待缩容转发路径不满足缩容状态。
图14所示装置可以执行图3-图13所示实施例的方法,本实施例未详细描述的部分,可参考对图3-图13所示实施例的相关说明。该技术方案的执行过程和技术效果参见图3-图13所示实施例中的描述,在此不再赘述。
在一个可能的设计中,图14所示网络地址转换网关的扩容装置的结构可实现为一电子设备,该电子设备可以是控制器、个人电脑、服务器等各种设备。如图15所示,该电子设备可以包括:第一处理器21和第一存储器22。其中,第一存储器22用于存储相对应电子设备执行上述图3-图13所示实施例中提供的网络地址转换网关的扩容方法的程序,第一处理器21被配置为用于执行第一存储器22中存储的程序。
程序包括一条或多条计算机指令,其中,一条或多条计算机指令被第一处理器21执行时能够实现如下步骤:
获取网络地址转换NAT网关的运行状态,运行状态包括以下至少之一:并发链接请求数量、新建链接请求速率;
在运行状态满足预设扩容条件时,则对NAT网关中的第一转发路径进行扩容;其中,第一转发路径用于维护链接请求所对应的会话控制信息,并生成与链接请求相对应的转发规则,以基于转发规则对链接请求进行处理。
进一步的,第一处理器21还用于执行前述图3-图13所示实施例中的全部或部分步骤。
其中,电子设备的结构中还可以包括第一通信接口23,用于电子设备与其他设备或通信网络通信。
另外,本发明实施例提供了一种计算机存储介质,用于储存电子设备所用的计算机软件指令,其包含用于执行上述图3-图13所示方法实施例中网络地址转换网关的扩容方法所涉及的程序。
此外,本发明实施例提供了一种计算机程序产品,包括:存储有计算机指令的计算机可读存储介质,当计算机指令被一个或多个处理器执行时,致使一个或多个处理器执行上述图3-图13所示方法实施例中网络地址转换网关的扩容方法中的步骤。
以上所描述的装置实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的 情况下,即可以理解并实施。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助加必需的通用硬件平台的方式来实现,当然也可以通过硬件和软件结合的方式来实现。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以计算机产品的形式体现出来,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程设备的处理器以产生一个机器,使得通过计算机或其他可编程设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (16)

  1. 一种网络地址转换网关的扩容方法,其特征在于,包括:
    获取网络地址转换NAT网关的运行状态,所述运行状态包括以下至少之一:并发链接请求数量、新建链接请求速率;
    在所述运行状态满足预设扩容条件时,则对所述NAT网关中的第一转发路径进行扩容;
    其中,所述第一转发路径用于维护链接请求所对应的会话控制信息,并生成与所述链接请求相对应的转发规则,以基于所述转发规则对所述链接请求进行处理。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在所述运行状态满足预设缩容条件时,则对所述NAT网关中的第一转发路径进行缩容。
  3. 根据权利要求1所述的方法,其特征在于,在所述运行状态包括并发链接请求数量和新建链接请求速率时,在获取网络地址转换NAT网关的运行状态之后,所述方法还包括:
    获取用于对所述运行状态进行分析处理的预设扩容阈值和预设缩容阈值;
    在至少一个运行状态大于或等于所对应的预设扩容阈值时,则确定所述运行状态满足预设扩容条件;
    在所有的运行状态均小于预设缩容阈值时,则确定所述运行状态满足预设缩容条件。
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    获取用于实现网络访问操作的链接请求;
    确定与所述链接请求相对应的目的地址和目的端口;
    在进行扩容的目标网关中,基于所述目的地址和目的端口确定与所述链接请求相对应的目标转发路径组,所述目标转发路径组中包括至少一个第一转发路径;
    利用所述目标转发路径组对所述链接请求进行处理,以实现网络访问操作。
  5. 根据权利要求4所述的方法,其特征在于,所述链接请求包括第一链接请求和第二链接请求,所述第一链接请求对应有第一目的地址和第一目的端口,所述第二链接请求对应有第二目的地址和第二目的端口;
    基于所述目的地址和目的端口确定与所述链接请求相对应的目标转发路径组,包括:
    在所述第一目的地址、第一目的端口与所述第二目的地址、第二目的端口相同时,则将所述第一链接请求和所述第二链接请求分配至同一个目标转发路径组;
    在所述第一目的地址、第一目的端口与所述第二目的地址、第二目的端口不同时,则将所述第一链接请求和所述第二链接请求分配至相同或者不同的目标转发路径组。
  6. 根据权利要求4所述的方法,其特征在于,基于所述目的地址和目的端口确定与所述链接请求相对应的目标转发路径组,包括:
    获取与所述链接请求相对应的协议号;
    基于所述目的地址、目的端口和所述协议号,确定与所述链接请求相对应的目标 转发路径组。
  7. 根据权利要求6所述的方法,其特征在于,所述链接请求包括第一链接请求和第二链接请求,所述第一链接请求对应有第一目的地址、第一目的端口和第一协议号,所述第二链接请求对应有第二目的地址、第二目的端口和第二协议号;
    基于所述目的地址、目的端口和所述协议号,确定与所述链接请求相对应的目标转发路径组,包括:
    在所述第一目的地址、第一目的端口、第一协议号与所述第二目的地址、第二目的端口、第二协议号相同时,则将所述第一链接请求和所述第二链接请求分配至同一个目标转发路径组;
    在所述第一目的地址、第一目的端口、第一协议号与所述第二目的地址、第二目的端口、第二协议号不同时,则将所述第一链接请求和所述第二链接请求分配至相同或者不同的目标转发路径组。
  8. 根据权利要求4所述的方法,其特征在于,利用所述目标转发路径组对所述链接请求进行处理,包括:
    利用所述目标转发路径组中的第一转发路径确定与所述链接请求相对应的转发规则;
    将所述转发规则发送至与所述目标转发路径组相连接的第二转发路径,以使所述第二转发路径基于所述转发规则对所述链接请求进行处理,实现网络访问操作。
  9. 根据权利要求4所述的方法,其特征在于,利用所述目标转发路径组对所述链接请求进行处理,包括:
    获取所述目标转发路径组中所包括的用于对所述链接请求进行分析处理的多个处理内核;
    确定多个处理内核各自对应的用于对所述链接请求进行分析处理的第一过程哈希算法以及第二转发路径中用于对所述链接请求进行分析处理的第二过程哈希算法;
    基于所述第一过程哈希算法和所述第二过程哈希算法,在所述多个处理内核中确定目标内核,所述目标内核所对应的第一过程哈希算法与所述第二过程哈希算法不同;
    利用所述目标内核对所述链接请求进行处理。
  10. 根据权利要求1所述的方法,其特征在于,对所述NAT网关中的第一转发路径进行扩容,包括:
    基于所述运行状态确定对所述NAT网关中的第一转发路径进行扩容操作的待扩容转发路径;
    将所述待扩容转发路径与所述第一转发路径进行连接,并基于所述第一转发路径对所述待扩容转发路径进行数据同步操作,获得进行扩容后的多个第一转发路径。
  11. 根据权利要求10所述的方法,其特征在于,基于所述第一转发路径对所述待扩容转发路径进行数据同步操作,包括:
    通过所述NAT网关中的第二转发路径生成与所述链接请求相对应的会话保活信息;
    基于所述链接请求相对应的转发规则,确定与所述会话保活信息相对应的转发路径标识;
    将所述会话保活信息发送至与所述转发路径标识相对应的第一转发路径,以使所 述第一转发路径基于所述会话保活信息对所述待扩容转发路径进行数据同步操作。
  12. 根据权利要求10所述的方法,其特征在于,在基于所述第一转发路径对所述待扩容转发路径进行数据同步之后,所述方法还包括:
    获取所述第一转发路径所对应的会话控制信息量以及所述待扩容转发路径所对应的新建会话控制信息量;
    确定所述会话控制信息量与所述新建会话控制信息量之间的数量偏差;
    在所述数量偏差小于预设阈值时,则确定完成对所述待扩容转发路径的数据同步操作;
    在所述数量偏差大于或等于预设阈值时,则确定未完成对所述待扩容转发路径的数据同步操作。
  13. 根据权利要求10所述的方法,其特征在于,在获得进行扩容后的多个第一转发路径之后,所述方法还包括:
    对所述多个第一转发路径进行分组,获得至少两个转发路径组,每个转发路径组中至少包括全量历史数据的第一转发路径。
  14. 根据权利要求1-13中任意一项所述的方法,其特征在于,对所述NAT网关中的第一转发路径进行缩容,包括:
    基于所述运行状态确定对所述NAT网关中的第一转发路径进行缩容操作的待缩容转发路径;
    将所述待缩容转发路径配置为禁止分配新建的链接请求;
    在所述待缩容转发路径满足缩容状态时,则将所述NAT网关中的待缩容转发路径删除。
  15. 根据权利要求14所述的方法,其特征在于,在将所述待缩容转发路径配置为禁止分配新建的链接请求之后,所述方法还包括:
    获取与所述待缩容转发路径相对应的链接请求数量;
    在所述链接请求数量为0时,则确定所述待缩容转发路径满足缩容状态;
    在所述链接请求数量为非0时,则确定所述待缩容转发路径不满足缩容状态。
  16. 一种电子设备,其特征在于,包括:存储器、处理器;其中,所述存储器用于存储一条或多条计算机指令,其中,所述一条或多条计算机指令被所述处理器执行时实现如权利要求1-15中任意一项所述的网络地址转换网关的扩容方法。
PCT/CN2023/083878 2022-03-25 2023-03-24 网络地址转换网关的扩容方法、设备及存储介质 WO2023179786A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210307674.0 2022-03-25
CN202210307674.0A CN114827079B (zh) 2022-03-25 2022-03-25 网络地址转换网关的扩容方法、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023179786A1 true WO2023179786A1 (zh) 2023-09-28

Family

ID=82529997

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/083878 WO2023179786A1 (zh) 2022-03-25 2023-03-24 网络地址转换网关的扩容方法、设备及存储介质

Country Status (2)

Country Link
CN (1) CN114827079B (zh)
WO (1) WO2023179786A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827079B (zh) * 2022-03-25 2024-04-30 阿里云计算有限公司 网络地址转换网关的扩容方法、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170195217A1 (en) * 2015-12-30 2017-07-06 Akamai Technologies, Inc. Distributed quality-of-service (QoS) in an overlay network using capacity enforcement
US20190097946A1 (en) * 2017-09-28 2019-03-28 Argela Yazilim ve Bilisim Teknolojileri San. ve Tic. A.S. System and method for elastic scaling of virtualized network functions over a software defined network
CN109728984A (zh) * 2018-11-26 2019-05-07 华为技术有限公司 一种接入系统、方法及装置
CN110661904A (zh) * 2019-10-25 2020-01-07 浪潮云信息技术有限公司 一种实现源网络地址转换网关水平扩展的方法
CN114827079A (zh) * 2022-03-25 2022-07-29 阿里云计算有限公司 网络地址转换网关的扩容方法、设备及存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102006672A (zh) * 2010-09-28 2011-04-06 中国联合网络通信集团有限公司 业务请求处理的方法和通信系统以及家庭基站
WO2018049583A1 (zh) * 2016-09-14 2018-03-22 华为技术有限公司 基于网络切片的用户面共享方法、装置及监督管理器
US11436111B2 (en) * 2019-10-03 2022-09-06 Cisco Technology, Inc. Highly-available distributed network address translation (NAT) architecture with failover solutions
CN113825152A (zh) * 2020-06-18 2021-12-21 中兴通讯股份有限公司 容量控制方法、网管设备、管理编排设备、系统及介质
CN112087533B (zh) * 2020-09-11 2023-05-09 北京青云科技股份有限公司 报文处理方法、装置、设备和存储介质
CN112994949A (zh) * 2021-04-02 2021-06-18 软通动力信息技术(集团)股份有限公司 一种专网连接方法、装置、设备及存储介质
CN113114516B (zh) * 2021-05-20 2023-04-07 中国联合网络通信集团有限公司 路由器的管理方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170195217A1 (en) * 2015-12-30 2017-07-06 Akamai Technologies, Inc. Distributed quality-of-service (QoS) in an overlay network using capacity enforcement
US20190097946A1 (en) * 2017-09-28 2019-03-28 Argela Yazilim ve Bilisim Teknolojileri San. ve Tic. A.S. System and method for elastic scaling of virtualized network functions over a software defined network
CN109728984A (zh) * 2018-11-26 2019-05-07 华为技术有限公司 一种接入系统、方法及装置
CN110661904A (zh) * 2019-10-25 2020-01-07 浪潮云信息技术有限公司 一种实现源网络地址转换网关水平扩展的方法
CN114827079A (zh) * 2022-03-25 2022-07-29 阿里云计算有限公司 网络地址转换网关的扩容方法、设备及存储介质

Also Published As

Publication number Publication date
CN114827079B (zh) 2024-04-30
CN114827079A (zh) 2022-07-29

Similar Documents

Publication Publication Date Title
US10917351B2 (en) Reliable load-balancer using segment routing and real-time application monitoring
US10700979B2 (en) Load balancing for a virtual networking system
US10389634B2 (en) Multiple active L3 gateways for logical networks
JP6169251B2 (ja) 分散型ロードバランサにおける非対称パケットフロー
US9509615B2 (en) Managing link aggregation traffic in a virtual environment
US9880870B1 (en) Live migration of virtual machines using packet duplication
WO2023005773A1 (zh) 基于远程直接数据存储的报文转发方法、装置、网卡及设备
CN113326101B (zh) 基于远程直接数据存储的热迁移方法、装置及设备
Liu et al. SDN-based live VM migration across datacenters
WO2014190791A1 (zh) 一种网关设备身份设置的方法及管理网关设备
WO2012065426A1 (zh) 一种分布式缓存系统中负荷分配方法、装置及服务器
US20200036583A1 (en) Consistent processing of transport node network data in a physical sharding architecture
WO2022111313A1 (zh) 一种请求处理方法及微服务系统
CN110830574B (zh) 一种基于docker容器实现内网负载均衡的方法
US9948568B2 (en) Packet size control using maximum transmission units for facilitating packet transmission
WO2023030417A1 (zh) 报文处理方法、设备、存储介质及计算机程序产品
WO2023179786A1 (zh) 网络地址转换网关的扩容方法、设备及存储介质
US10827042B2 (en) Traffic optimization for multi-node applications
US20170195261A1 (en) Apparatus and method for virtual switching
CN112243036B (zh) PaaS服务的数据处理方法及装置、设备、存储介质
WO2023207189A1 (zh) 负载均衡方法及系统、计算机存储介质、电子设备
US20230224248A1 (en) Nat-based traffic steering
US11647083B2 (en) Cluster-aware multipath transmission control protocol (MPTCP) session load balancing
WO2022161501A1 (zh) 多个数据流的处理方法及相关系统
CN116760850B (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: 23774029

Country of ref document: EP

Kind code of ref document: A1