Using predictive dynamic network address translation

By predictively filling the NAT table and using machine learning technology to add expected NAT table entries in advance, the problem of NAT table misses is solved, network communication efficiency is improved, and latency and controller load are reduced.

CN114979062BActive Publication Date: 2024-08-27NVIDIA CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210142493.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-04-13
Filing Date
2022-02-16
Publication Date
2024-08-27
Estimated Expiration
2042-02-16

AI Technical Summary

Technical Problem

The existing NAT table miss problem resulted in network communication delays and increased load on the gateway controller, and it was impractical to increase the memory size to solve this problem.

Method used

By predictively populating the NAT table, using machine learning techniques such as recursive neural networks to learn and apply patterns of private source addresses, expected NAT table entries are added in advance to improve the NAT table hit rate.

Benefits of technology

Significantly improve the NAT table hit rate, reduce packet delay and reduce the gateway controller load, reduce packet processing delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114979062B_ABST
    Figure CN114979062B_ABST
Patent Text Reader

Abstract

A method for network communication, comprising: receiving a data packet from a first network having a header specifying a first source address in the first network and a destination address in a second network; and looking up the first source address in a network address translation (NAT) table. In response to looking up the first source address, when it is found that the first source address is not listed in the NAT table, adding an entry to the NAT table that specifies a corresponding second source address in the second network. Predictively selecting one or more additional first source addresses that are not listed in the NAT table, and adding one or more other entries to the NAT table that specify one or more second source addresses in a public network that correspond to the one or more additional first source addresses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates generally to packet network communications and, more particularly, to methods and apparatus for Network Address Translation (NAT). Background Art

[0002] Network Address Translation (NAT) is a method of remapping one Internet Protocol (IP) address space to another Internet Protocol (IP) address space by modifying the network address information in the IP header of packets passing through a router or other switching device. NAT has become a popular and fundamental tool for conserving global IP address space because it allows one or a small number of Internet routable IP addresses of the NAT gateway to be used for the entire private network. NAT is also commonly used in load balancing applications.

[0003] In a typical configuration, a local network uses one or more private IP address subnets. Routers in the local network have private addresses in this private address space. The routers are also connected to external networks, such as the Internet, that have one or more public IP addresses. When traffic passes from the local network to the Internet, the router applies NAT to convert the source IP address in each packet on the fly from a private address to a public address. The router tracks the header data of outgoing packets (such as the destination address and protocol port) and uses this information to convert the public IP destination address of the incoming packet to the appropriate private IP address, thereby forwarding each packet to its destination on the local network. Summary of the invention

[0004] Embodiments of the present invention described below provide improved methods, devices, and software for forwarding data packets in a network.

[0005] Therefore, according to an embodiment of the present invention, a method for network communication is provided, which includes: receiving a data packet having a header specifying a first source address in the first network and a destination address in a second network from a first network; and looking up the first source address in a network address translation (NAT) table. When it is found that the first source address is not listed in the NAT table in response to looking up the first source address, an entry is added to the NAT table specifying a second source address in the second network corresponding to the first source address. One or more additional first source addresses in the first network that are not listed in the NAT table and are expected to receive other data packets are predictively selected, and one or more other entries are added to the NAT table specifying one or more second source addresses in the second network corresponding to the one or more additional first source addresses.

[0006] In some embodiments, the first source address and the destination address include Internet Protocol (IP) addresses. In disclosed embodiments, looking up the first source address includes searching an entry in a NAT table based on both the first source address and the destination IP address. Additionally or alternatively, the header specifies a protocol port of the data packet, and looking up the first source address includes searching an entry in a NAT table based on both the first source address and the protocol port.

[0007] Further additionally or alternatively, the method includes periodically removing from the NAT table one or more entries that have not been accessed within a predefined aging period.

[0008] In some embodiments, when the first source address belongs to a given subnet, predictively selecting one or more additional first source addresses includes selecting at least one additional first source address from the given subnet. In one embodiment, selecting at least one additional first source address includes adding all first source addresses in the given subnet to the NAT table.

[0009] Additionally or alternatively, predictively selecting one or more additional first source addresses includes detecting a pattern in a first source address of a data packet received from the first network, and selecting at least one additional first source address in response to the detected pattern. In some embodiments, detecting the pattern includes applying a recursive neural network model to the first source address. Additionally or alternatively, the detection pattern includes filtering the data packets to select a set of first source addresses that are subject to address translation using a NAT table, and applying only the selected set of first source addresses to the predictive logic in order to detect the pattern. Further additionally or alternatively, the detection pattern includes assigning weights to the first source addresses of the data packets in response to a corresponding frequency of packet flows from the first source addresses, and applying the weights in the predictive logic in order to detect the pattern.

[0010] In some embodiments, the method includes reading a second source address corresponding to the first source address in the second network from a NAT table, inserting the second source address into a header of a data packet in place of the first source address, and sending the data packet having the second source address in the header to the second network. In the disclosed embodiment, sending the data packet includes modifying at least one field in the header of the data packet in response to an entry in the NAT table, the at least one field being selected from a group of fields consisting of a destination address, a source port, and a destination port. Additionally or alternatively, the method includes: receiving other data packets from the second network, the other data packets having other destination addresses that are the same as the second source address inserted into the header of the sent data packet; looking up the other destination address in the NAT table to find the first source address corresponding to the other destination address; and inserting the first source address into the header of the other data packets in place of the other destination address, and forwarding the other data packets through the first network.

[0011] In some implementations, the first network is a private network and the second network is a public network.

[0012] According to an embodiment of the present invention, a device for network communication is also provided, comprising: a plurality of ports, at least including a first port configured to receive a data packet having a header specifying a first source address in the first network and a destination address in the second network from a first network, and a second port configured to send the data packet to the second network. The memory is configured to store a network address translation (NAT) table. The processing circuit is configured to look up a first source address in the NAT table, and in response to finding the first source address and finding that the first source address is not listed in the NAT table: adding an entry to the NAT table specifying a second source address corresponding to the first source address in the second network; and in response to adding the entry, predictively selecting one or more additional first source addresses in the first network that are not listed in the NAT table and are expected to receive other data packets from it; and adding one or more other entries to the NAT table specifying one or more second source addresses corresponding to the one or more additional first source addresses in the second network.

[0013] The present invention will be more fully understood from the following detailed description of embodiments in conjunction with the accompanying drawings, in which: BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 is a block diagram schematically illustrating a network communication system according to an embodiment of the present invention;

[0015] Figure 2 is a block diagram schematically illustrating details of a NAT gateway implementing prediction logic according to an embodiment of the present invention;

[0016] Figure 3 is a block diagram schematically illustrating forwarding and control functions of a NAT gateway according to an embodiment of the present invention;

[0017] Figure 4 is a flow chart schematically illustrating a method for predictive population of a NAT table according to an embodiment of the present invention; and

[0018] Figure 5 is a block diagram schematically illustrating prediction logic for updating entries in a NAT table according to an embodiment of the present invention. DETAILED DESCRIPTION

[0019] Overview

[0020] NAT gateway stores the NAT table of the entry with the corresponding relation between indication private IP address and public IP address usually.(table entry can also be used for converting other packet header fields, such as, layer 4 protocol port.) the entry in the NAT table can be static or dynamic.In static entry, each private IP address has its own fixed public IP address, and this address constantly remains in the table and can not be replaced.But the available entry number in the NAT table may not be enough to each IP address distribution static entry in the private network.In this case, dynamically distribute entry to the private IP address that is used for outgoing packet to be sent to public network.

[0021] When the gateway receives an outgoing packet from the private network, the forwarding logic in the gateway checks the source IP address and port against the entries in the NAT table. When a matching entry is found, the forwarding logic modifies the packet header accordingly and immediately forwards the packet to the public network. If no match is found, the forwarding logic captures the packet and "kicks" the appropriate packet header fields to the software-driven controller in the gateway. The controller assigns a new dynamic NAT entry for the source IP address and inserts the entry into the NAT table. The NAT entry can then be used to forward the captured packets and other packets from the same source IP address. After a period of inactivity for a given dynamic NAT entry, the entry may age and be removed from the table to make room for a new entry.

[0022] The packet is kicked to the gateway controller for software-based processing to increase the significant delay of the forwarding process. When the gateway needs to handle a large number of different packet streams, the load of the NAT update process on the controller may be very heavy, thus further increasing the delay. Therefore, it may be expected to increase the NAT table hit rate by forwarding logic, thereby reducing the quantity of the packet kicked as much as possible. Although the problem of NAT table misses can be alleviated by increasing the size of the table, it is usually impractical to provide a high-speed memory of sufficient size for this purpose.

[0023] Embodiments of the invention described herein solve the problem of NAT table misses by predictively populating the NAT table (i.e., adding entries for packet flows that are expected to occur in the near future to the table, even before these packets actually arrive at the gateway). The prediction can be based, for example, on patterns of private source addresses that the gateway has encountered in packets recently received from the private network. Machine learning techniques (such as training recursive neural networks) can be used to learn and apply such patterns. Using such predictions to populate the NAT table can significantly improve the NAT table hit rate, thereby reducing overall packet delay and alleviating the load on the gateway controller.

[0024] In the disclosed embodiment, the packet processing circuit in the NAT gateway includes both packet forwarding logic and prediction logic. When the NAT gateway receives a packet (wherein the packet header specifies a private source address and a public destination address) from a private network through one of its ports, the forwarding logic searches for the private source address in the NAT table. When finding appropriate entries, the forwarding logic reads the public source address corresponding to the private source address from the NAT table, inserts the public source address into the header of the data packet to replace the private source address, and sends the data packet with the public source address in the header to the public network. Additionally or alternatively, the NAT table entry can be applied to modify one or more other packet header fields, such as destination address, source port and destination port.

[0025] When the forwarding logic finds that the private source address is not listed in the NAT table, the processing circuit adds a new entry to the NAT table that specifies the public source address corresponding to the private source address. In addition, the prediction logic uses the private source address to select one or more additional private source addresses that are not listed in the NAT table and are expected to receive other data packets from. The processing circuit adds other entries to the NAT table that specify the public source addresses corresponding to the selected additional private source addresses. The forwarding circuit can then use the new NAT table entry when forwarding both the current packet and future packets.

[0026] For the sake of specificity and clarity, certain methods and algorithms for NAT prediction are described below with reference to a particular type of gateway architecture and configuration between a private network and a public network. Alternatively, the methods, algorithms, and gateway architectures described herein can be used for other NAT applications, including NAT between two private networks or two public networks. Further alternatively or additionally, the principles of the present invention can be applied to other types of packet forwarding and processing devices that use other architectures and algorithms for NAT prediction. All of these alternative implementations are considered to be within the scope of the present invention. In addition, the prediction methods described below for populating the tables used in packet forwarding can be applied mutatis mutandis to other network protocols and services known in the art, such as Layer 2 learning and bidirectional forwarding detection (BFD).

[0027] System Description

[0028] Figure 1 2 is a block diagram schematically illustrating a network communication system 20 according to an embodiment of the present invention. In the system 20, a NAT gateway 22 connects a first network (in this example, a private network 24, such as an enterprise network or a data center network) to a second network (e.g., a public network 26, such as the public Internet). It is assumed that both networks 24 and 26 are IP networks. Therefore, computers 28, 30, 32 on the private network 24 are identified by private IP source addresses, while servers 34 on the public network 26 are identified by public IP addresses.

[0029] NAT gateway 22 is usually configured as a router, which has a forwarding logic 36 for forwarding packets from private network 24 to public network 26 and vice versa. When a packet with a header specifying a private source IP address is received from private network 24, for example, when a packet with a public destination IP address (such as, the address of server 34) is received from computer 28, forwarding logic 36 looks up the private source IP address in NAT table 38. NAT table 38 is usually configured as a database, but other suitable list formats can be used alternatively. The search in the NAT table can also include other header fields (such as, source port and / or destination port) and destination IP address. Based on the entries in NAT table 38, forwarding logic 36 inserts the public source IP address into the packet header, and can also modify other header fields, and then sends the packet to public network 26. In order to fill NAT table 38, NAT gateway 22 applies prediction logic 40, as previously described and described in detail below.

[0030] When the server 34 receives a packet from the NAT gateway 22, it will typically return one or more response packets with a destination address field set to the same public IP address inserted by the NAT gateway as the source address. Upon receiving the response packet from the public network 26, the forwarding logic 36 in the NAT gateway 22 looks up the destination IP address of the packet in the NAT table 38 to find the private source IP address corresponding to the public destination IP address. (Again, the public source IP address of the packet and the destination port and / or source port in the packet header may also be used in the NAT lookup.) Based on the NAT table entry, the forwarding logic 36 inserts the appropriate private source IP address into the header of one or more data packets (e.g., the private IP address of the computer 28) in place of the public destination address, and forwards the packet accordingly through the private network 24.

[0031] Figure 2is a block diagram schematically illustrating details of a NAT gateway 22 implementing prediction logic according to an embodiment of the present invention. The gateway 22 includes a plurality of ports 50, including at least one port connected to a private network 24 and at least one other port connected to a public network 26. The ports 50 typically include suitable physical layer (PHY) interfaces and media access control (MAC) interfaces, such as Ethernet PHY interfaces and MAC interfaces, which are implemented in suitable hardware circuits known in the art. The ports 50 are interconnected by forwarding logic 36, which is configured to perform the functions described herein, for example, in a suitable application specific integrated circuit (ASIC). A high-speed memory (such as a static random access memory (SRAM) 52) integrated with or connected to the forwarding logic 36 maintains a NAT table 38 ( Figure 1 ) and other data used by the forwarding logic (such as routing tables).

[0032] The high-level functions of the gateway 22, including adding entries to the NAT table in the memory 52, are performed by a controller such as a central processing unit (CPU) 54 under the control of appropriate software. As previously described, these functions include the prediction logic 40 ( Figure 1 ) is applied, the purpose of which is to add entries for certain source addresses that are private to the NAT table 38 before the gateway 22 has actually received packets from these source addresses. In the illustrated embodiment, the prediction logic is implemented using a suitable neural network running on a graphics processing unit (GPU) 56. In one embodiment, a recurrent neural network (RNN) 58 is used for this purpose, as further described below. Alternatively, other types of neural networks and other kinds of machine learning and prediction algorithms can be used for the purpose of NAT table entry prediction.

[0033] exist Figure 2 In the illustrated embodiment, CPU 54 and GPU 56 together perform the functions of prediction logic 40, and these units, together with forwarding logic 36, serve as processing circuitry in gateway 22. In one embodiment, the forwarding logic, CPU, and GPU are all implemented in a single integrated circuit, such as the NVIDIA NVIDIA NVIDIA GPU (Santa Clara, California). Data Processing Unit (DPU). Alternatively, the functionality of the processing circuitry in gateway 22 may be implemented in a collection of two or more chips with suitable interconnects. Figure 1 and 2 Particular reference is made to the operation of a gateway router in system 20, but the principles of the present invention may alternatively be implemented in other network devices used to implement NAT on a large scale.

[0034] Figure 31 is a block diagram schematically illustrating the forwarding and control functions of a NAT gateway, such as gateway 22, according to an embodiment of the present invention. These functions are generally divided between a data plane 60 that performs the actual NAT lookup and packet forwarding operations and a control plane 62 that populates the NAT table and performs functions such as prediction logic 40. Figure 2 In the embodiment of FIG. 5 , the data plane 60 is implemented by the forwarding logic 36, while the control plane 62 is implemented by the CPU 54 and the GPU 56. Alternatively, as previously described, other implementations and functional partitioning may be used. Figure 3 Only the functions of the gateway 22 that are directly related to the novel NAT function of the gateway are shown, while other functions known in the art are omitted for simplicity.

[0035] In the data plane 60, from the private network 24 ( Figure 1 ) received packets are parsed by packet ingress processing logic 64, which extracts the packet header fields required for the NAT lookup. Forwarding logic 36 looks up the private source address (and possibly other fields, such as the source port) of each such incoming packet in NAT table 38. If the lookup is successful (as indicated by a hit 66), forwarding logic 38 reads the corresponding public IP address from the matching NAT table entry and inserts it into the header of the data packet in place of the private source address. Packet egress processing logic 68 completes assembly of the packet and sends it to the public network 26.

[0036] In this embodiment, the memory 52 ( Figure 2 ) also contains static NAT configuration rules 70 that specify fixed public IP addresses for certain private IP addresses on network 24. When the lookup in dynamic NAT table 38 is unsuccessful, forwarding logic 36 checks the private source IP address of the packet against the NAT configuration rules. If no corresponding rule is found (as indicated by the absence of a hit 72), forwarding logic 36 uses the public source IP address indicated by the rule and passes the packet to egress processing logic 68.

[0037] If the lookup in the NAT configuration rule 70 results in a hit 72, the forwarding logic 38 kicks the packet to the control plane 62. The packet remains in the buffer 74 and waits to be reinjected into the forwarding flow until the appropriate entry has been added to the dynamic NAT table 38.

[0038] In the control plane 62, typically in the CPU 54 ( Figure 2) loads entries into the dynamic NAT table 38 as needed. The NAT control process 76 is also responsible for loading NAT configuration rules 70 based on configuration input 78 entered by an operator of the gateway 22, for example. In addition, the NAT control process 76 monitors the age of the entries in the NAT table 38 and "ages" entries that have not been used in forwarding packets for more than a predefined time limit. Once an entry has aged, its slot in the NAT table 38 can be filled by another entry when needed.

[0039] When the NAT control process 76 loads a new entry into the NAT table 38 for a given private source IP address, and additional slots are available for filling in the table, the process 76 consults the inline prediction-based service daemon 80 to select one or more additional private source addresses that are not listed in the NAT table and from which other data packets are expected to be received. The daemon 80 can be implemented in software running on a general-purpose processor such as the CPU 54; alternatively or additionally, some functions of the daemon 80, particularly computationally intensive functions, can be performed using dedicated programmable hardware such as the GPU 56. In either case, the software for selecting and predicting NAT entries to be entered into the NAT table 38 can be stored on a tangible, non-transitory computer-readable medium such as an optical memory, a magnetic memory, or an electronic memory. Based on the predictions made by the daemon 80, the NAT control process 76 adds one or more additional entries to the NAT table that specify the public source addresses corresponding to these additional private source addresses predicted. The following reference is made to Figure 4 and 5 Let’s further describe the prediction process.

[0040] In some embodiments, the daemon 80 predicts and selects additional private source addresses by detecting patterns in the private source addresses of data packets received from the private network 24 and selecting private source addresses that are expected to occur based on the detected patterns. In order to learn patterns of private source addresses that have occurred in the past, the daemon 80 receives and stores training data for packet flows that have been processed using entries in the NAT table 38. (The term "flow" refers to a sequence of packets that have the same values ​​in one or more header fields, including at least the source address, and possibly the same source port, destination address, and / or destination port.) For example, the training data may relate to times in the past when new entries for these flows were added to the NAT table. Figure 5 In the illustrated embodiment, the training data is used to train a neural network to recognize and respond to patterns in packet flows. Alternatively, other machine learning and prediction methods known in the art may be used for this purpose, for example, statistical methods such as Bayesian prediction.

[0041] Method for predictive population of NAT tables

[0042] Figure 4 is a flow chart schematically illustrating a method for predictive population of NAT table 38 that may be performed by prediction logic 40 according to an embodiment of the present invention. In response to a prediction request from NAT control process 76, daemon process 80 checks at training check step 90 whether sufficient historical data has been accumulated to make predictions based on past patterns of packet flows processed by NAT table 38. For example, several hours of data may be required to train daemon process 80 to make reliable predictions. (The training may also be updated from time to time as new training samples are accumulated.)

[0043] When there is not enough historical data for training, the daemon process 80 predicts additional entries to be added to the NAT table 38 based on pre-programmed logical rules at a programmed selection step 92. For example, when the private source address of the packet that triggers the NAT table update belongs to a given subnet on the private network 24, the daemon process 80 can select one or more additional private source addresses from the same subnet to add to the NAT table 38, or it can even add all private source addresses in the given subnet to the NAT table (assuming there is enough space in the table). Alternatively or additionally, other logical selection rules can be applied. At a conversion output step 94, the NAT control process 76 loads the NAT entry of the predicted entry into the NAT table 38.

[0044] On the other hand, when it is found in step 90 that a sufficient amount of data has been accumulated to train the machine learning model, the daemon process 80 uses the model at a model-based prediction step 96 to predict the private addresses to be added to the NAT table 38. Specifically, based on the private source address of the packet that triggered the NAT table update and the pattern of private source addresses and NAT table updates in the packets before it, the daemon process 80 is able to predict the NAT table entries that are most likely to be needed in the near future. The NAT control process 76 loads these entries into the NAT table 38 at step 94. The accurate prediction at step 96 reduces the number of packets that will have to be kicked to the control plane 62, and thus reduces the delay forwarding through the data plane 60, while reducing the computational load on the control plane.

[0045] Figure 51 is a block diagram schematically illustrating prediction logic 98 for updating entries in NAT table 38 according to an embodiment of the present invention. The embodiment utilizes a recurrent neural network (RNN) that includes a plurality of repeating layers 106 linked together in sequence. In the illustrated embodiment, there are n layers 106 configured as long short-term memory (LSTM) networks known in the art, where each layer 106 receives the state and output of the previous layer. LSTM networks are particularly useful in learning and then recognizing long-term patterns, such as, for example, patterns of private network addresses and updates in NAT table 38. In this example, the network receives k past packet flows F1, F2, ..., F k The input sequence 100, and output the next n packets F k+1 、F k+2 ,…,F k+n The predicted sequence is 112.

[0046] In some embodiments, not all flows need to be used for prediction, and flows that contribute to the prediction may have different weights, reflecting their predicted value. Specifically, flows that will not be converted by the dynamic NAT table 38 (such as flows with Figure 3 ) may be less relevant to the prediction. For this reason, the NAT filter 102 filters the input sequence 100 so as to select a set of private source addresses that are subject to address translation using the NAT table, and only the selected set is applied to the prediction logic 98. The remaining flows are filtered out from the input sequence 100 and do not contribute to generating the prediction sequence 112. Additionally or alternatively, the weighted logic 104 assigns weights to the private source addresses of the data packets based on the corresponding frequencies of the packet flows represented by the data packets, and the layer 106 of the LSTM network receives these weighted values. Therefore, the sparse flows with low packet frequencies contribute less to the prediction sequence 112. NAT filtering 108 and weights 110 can also be applied to the predicted flows output by the LSTM network to remove irrelevant and sparse flows from the list of entries to be predictively added to the NAT table.

[0047] As mentioned above, this is described only by way of example. Figure 5 The architecture of prediction logic 98 is shown. After reading this specification, other methods for predicting entries to be added to the NAT table with or without NAT filtering and weighting of data samples will be apparent to those skilled in the art. All of these methods are considered to be within the scope of the present invention.

[0048] The following table shows a list of entries in NAT table 38 as they change over time in response to packet flows forwarded by gateway 22. In these tables, SA and SP represent the private source IP address and source port in the received packet header; DA and DP represent the public destination IP address and destination port; and NSA and NSP represent the new public source IP address and source port inserted into the corresponding packet header after NAT.

[0049] Table 1

[0050] SA DA SP DP NSA NSP 1 10.10.10.1 100.10.10.1 P1 P30 91.10.10.1 PA 2 10.10.10.2 100.10.10.1 P2 P40 91.10.10.2 PB 3 20.20.20.1 120.10.10.1 P100 P50 92.10.10.1 PC 4 40.40.40.2 140.10.10.1 P200 P60 94.10.10.2 PD 5 50.10.10.2 150.10.10.1 P300 P70 95.10.10.2 PE

[0051] In Table 1, the NAT control process 76 ( Figure 3 ) has loaded a specific set of entries into the NAT table 38, and the prediction logic 40 learns this pattern of entries. However, over time, these entries age and are replaced by a new set of entries in the NAT table, as shown in Table 2:

[0052] Table 2

[0053] SA DA SP DP NSA NSP 1 10.10.10.10 100.10.10.10 P1 P30 91.10.10.10 PA 2 20.20.20.20 120.10.10.20 P2 P40 92.10.10.20 PB 3 20.20.20.30 120.10.10.30 P100 P50 92.10.10.30 PC 4 30.30.30.10 130.10.10.10 P200 P60 93.10.10.10 PD 5 30.30.30.20 130.10.10.20 P300 P70 93.10.10.20 PE

[0054] Subsequently, the entries in slots 2-5 in Table 2 also age. The new packet is kicked to the control plane 62, where SA=10.10.10.1, DA=100.10.10.1, SP=P1 and DP=P30. The NAT control process 76 adds an entry for the flow in slot 2 of the NAT table, as shown in Table 3:

[0055] Table 3

[0056] SA DA SP DP NSA NSP 1 10.10.10.10 100.10.10.10 P1 P30 N150.10.10.10 PA 2 10.10.10.1 100.10.10.1 P1 P30 91.10.20.1 PA 3 20.20.20.1 120.10.10.1 P100 P50 92.10.30.1 PC 4 40.40.40.2 140.10.10.1 P200 P60 94.10.40.2 PD 5 50.10.10.2 150.10.10.1 P300 P70 93.10.10.20 PE

[0057] Furthermore, daemon process 80 recognizes that this entry is part of a pattern of flows that occurred previously, as shown by the entries in slots 3-5 in Table 1. Therefore, NAT control process 76 predictively adds these entries to slots 3-5 in Table 3 to replace the aged entries.

[0058] It should be understood that the above embodiments are cited by way of example, and the present invention is not limited to the embodiments specifically shown and described above. On the contrary, the scope of the present invention includes the combination and sub-combination of the various features described above, as well as changes and modifications that a person skilled in the art may think of when reading the foregoing description and that are not disclosed in the prior art.

Claims

1. A method for network communication, include: receiving a data packet from a first network having a header specifying a first source address in the first network and a destination address in a second network; Searching for the first source address in the network address translation NAT table; as well as In response to searching for the first source address, when it is found that the first source address is not listed in the NAT table: adding to the NAT table an entry specifying a second source address in the second network corresponding to the first source address; predictively selecting one or more additional first source addresses in the first network that are not listed in the NAT table and from which other data packets are expected to be received; as well as One or more other entries are added to the NAT table specifying one or more second source addresses in the second network corresponding to the one or more additional first source addresses.

2. The method of claim 1, wherein the first source address and the destination address comprise Internet Protocol (IP) addresses. 3 . The method of claim 2 , wherein looking up the first source address comprises searching for an entry in the NAT table based on both the first source address and a destination IP address.

4. The method of claim 2, wherein the header specifies a protocol port of the data packet, and wherein looking up the first source address comprises searching for an entry in the NAT table based on both the first source address and the protocol port. 5 . The method of claim 1 , further comprising periodically removing from the NAT table one or more entries that have not been accessed within a predefined aging period.

6. The method of claim 1, wherein the first source address belongs to a given subnet, and wherein predictively selecting the one or more additional first source addresses comprises selecting at least one additional first source address from the given subnet.

7. The method of claim 6, wherein selecting the at least one additional first source address comprises adding all of the first source addresses in the given subnet to the NAT table.

8. The method of claim 1, wherein predictively selecting the one or more additional first source addresses comprises detecting a pattern in the first source address of data packets received from the first network, and selecting at least one additional first source address in response to the detected pattern.

9. The method of claim 8, wherein detecting the pattern comprises applying a recursive neural network model to the first source address.

10. The method of claim 8, wherein detecting the pattern comprises filtering the data packets to select a set of the first source addresses subject to address translation using the NAT table, and applying only the selected set of the first source addresses to prediction logic in order to detect the pattern.

11. The method of claim 8, wherein detecting the pattern comprises assigning weights to the first source address of the data packets in response to respective frequencies of packet flows from the first source address, and applying the weights in prediction logic to detect the pattern.

12. The method according to claim 1, further comprising: include: reading the second source address in the second network corresponding to the first source address from the NAT table, and inserting the second source address into the header of the data packet to replace the first source address; as well as The data packet having the second source address in the header is sent to the second network.

13. The method of claim 12, wherein sending the data packet comprises modifying at least one field in the header of the data packet in response to an entry in the NAT table, the at least one field being selected from the group of fields consisting of the destination address, source port, and destination port.

14. The method according to claim 12, further comprising: include: receiving a further data packet from the second network, the further data packet having a further destination address which is the same as the second source address inserted in the header of the sent data packet; Searching the other destination address in the NAT table to find the first source address corresponding to the other destination address; as well as The first source address is inserted into the header of the other data packet in place of the other destination address, and the other data packet is forwarded over the first network.

15. The method of claim 1, wherein the first network is a private network and the second network is a public network.

16. A device for network communication, include: a plurality of ports, the plurality of ports comprising at least a first port configured to receive, from a first network, a data packet having a header specifying a first source address in the first network and a destination address in a second network, and a second port configured to send the data packet to the second network; A memory configured to store a network address translation NAT table; as well as processing circuitry configured to look up the first source address in the NAT table, and upon finding that the first source address is not listed in the NAT table in response to looking up the first source address: add to the NAT table an entry specifying a second source address in the second network that corresponds to the first source address; responsive to adding the entry, predictively selecting one or more additional first source addresses in the first network that are not listed in the NAT table and from which other data packets are expected to be received; and adding to the NAT table one or more other entries specifying one or more second source addresses in the second network corresponding to the one or more additional first source addresses.

17. The apparatus of claim 16, wherein the first source address and the destination address comprise Internet Protocol (IP) addresses.

18. The apparatus of claim 17, wherein the processing circuit is configured to search the NAT table for an entry based on both the first source address and a destination IP address.

19. The apparatus of claim 17, wherein the header specifies a protocol port of the data packet, and wherein the processing circuit is configured to search the NAT table for an entry based on both the first source address and the protocol port.

20. The device of claim 16, wherein the processing circuit is configured to periodically remove one or more entries from the NAT table that have not been accessed within a predefined aging period.

21. The apparatus of claim 16, wherein the first source address belongs to a given subnet, and wherein predictively selecting the one or more additional first source addresses comprises selecting at least one additional first source address from the given subnet.

22. The apparatus of claim 21, wherein selecting the at least one additional first source address comprises adding all of the first source addresses in the given subnet to the NAT table.

23. The apparatus of claim 16, wherein predictively selecting the one or more additional first source addresses comprises detecting a pattern in the first source address of data packets received from the first network, and selecting at least one additional first source address in response to the detected pattern.

24. The apparatus of claim 23, wherein detecting the pattern comprises applying a recursive neural network model to the first source address.

25. The apparatus of claim 23, wherein detecting the pattern comprises filtering the data packets to select a set of the first source addresses subject to address translation using the NAT table, and applying only the selected set of the first source addresses to prediction logic in order to detect the pattern.

26. The apparatus of claim 23, wherein detecting the pattern comprises assigning weights to the first source address of the data packets in response to respective frequencies of packet flows from the first source address, and applying the weights in prediction logic to detect the pattern.

27. The apparatus of claim 26, wherein the processing circuit is configured to read the second source address in the second network corresponding to the first source address from the NAT table, insert the second source address into the header of the data packet to replace the first source address, and send the data packet with the second source address in the header to the second network.

28. The apparatus of claim 27, wherein the processing circuit is configured to modify at least one field in the header of the data packet in response to an entry in the NAT table, the at least one field selected from the group of fields consisting of the destination address, source port, and destination port.

29. The apparatus of claim 28, wherein the second port is coupled to receive other data packets from the second network, the other data packets having other destination addresses that are the same as the second source address inserted into the header of the transmitted data packets, and The processing circuit is configured to look up the other destination address in the NAT table to find the first source address corresponding to the other destination address, insert the first source address into the header of the other data packet to replace the other destination address, and forward the other data packet through the first network.

30. The apparatus of claim 16, wherein the first network is a private network and the second network is a public network.