Gateway device, communication method, and program

By pre-calculating and storing parts of response packets in an output queue, the gateway device addresses the latency issues in NAT/NAPT, enabling faster packet transfer.

JP7552919B2Active Publication Date: 2024-09-18NIPPON TELEGRAPH & TELEPHONE CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2023544985
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-09-06
Publication Date
2024-09-18
Estimated Expiration
2041-09-06

AI Technical Summary

Technical Problem

Conventional address translation techniques such as NAT/NAPT struggle with high latency and reduced performance when handling a large number of response packets due to repeated table look-ups and checksum calculations.

Method used

The gateway device performs pre-calculation of a portion of the response packet upon receiving the initial packet, storing it in an output queue, and concatenates it with the data part upon arrival of the actual response packet to expedite the transfer process.

Benefits of technology

This approach enables high-speed transfer of response packets by reducing the need for real-time calculations and table look-ups, thereby improving performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007552919000002
    Figure 0007552919000002
  • Figure 0007552919000007
    Figure 0007552919000007
  • Figure 0007552919000003
    Figure 0007552919000003
Patent Text Reader

Abstract

This gateway device comprises: an address conversion unit that receives a packet from a terminal, performs address conversion on the packet, transmits the address-converted packet to the server, and calculates, in advance, a portion of a response packet to be transmitted to the terminal; and a packet generation unit that generates a response packet to be transmitted to the terminal by using the aforementioned portion and a data portion of a response packet received from the server.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a gateway device that performs address translation. [Background technology]

[0002] Nowadays, not only PCs and mobile terminals but also M2M / IoT devices are being connected to the Internet, and their number is growing to exceed the IPv4 address space.

[0003] One of the issues is the exhaustion of IPv4 addresses. Although IPv6 was introduced to solve this problem, IPv4 is still widely used in minimalist implementations such as existing network equipment and IoT devices that are not compatible with IPv6.

[0004] NAT (Network Address Translation) / NAPT (Network Address Port Translation) is generally used as a method to share a limited number of IPv4 addresses among multiple terminals. By using NAT / NAPT, one global IP can be shared among multiple terminals. In addition, by converting the address of the internal network, it is possible to prevent intrusion from outside. [Prior art documents] [Non-patent literature]

[0005] [Non-Patent Document 1] F. Liu et al, "The Design and Implementation of NAPT Function in Border Gateway Based on LKM," 978-1-5090-1997-7 / 16 (c)2016 IEEE. https: / / ieeexplore.ieee.org / document / 7589735 Summary of the Invention [Problem to be solved by the invention]

[0006] However, when using conventional address translation techniques such as NAT / NAPT, if a large number of response packets are generated, it may not be possible to obtain the desired performance, and the response packets may not be transferred at high speed.

[0007] The present invention has been made in view of the above-mentioned points, and has an object to provide a technique for transferring a response packet at high speed in a gateway device that performs address translation. [Means for solving the problem]

[0008] According to the disclosed technology, an address translation unit receives a packet from a terminal, performs address translation on the packet, transmits the address-translated packet to a server, and pre-calculates a part of a response packet to be transmitted to the terminal; a packet generating unit that generates a response packet to be transmitted to the terminal by using the data portion and the part of the response packet received from the server; A gateway device is provided, comprising: Effect of the Invention

[0009] According to the disclosed technique, it becomes possible to transfer a response packet at high speed in a gateway device that performs address translation. [Brief description of the drawings]

[0010] [Figure 1] FIG. 1 is a diagram for explaining a problem. [Diagram 2] 1 is a system configuration diagram according to an embodiment of the present invention. [Diagram 3] FIG. 2 is a diagram for explaining the operation of the gateway device in the embodiment of the present invention. [Figure 4] FIG. 13 is a diagram for explaining pre-calculation. [Diagram 5] FIG. 13 is a diagram for explaining pre-calculation. [Figure 6] FIG. 13 is a diagram illustrating an example of a NAPT table. [Figure 7] FIG. 1 illustrates an example of an apparatus configuration. [Figure 8] FIG. 2 illustrates an example of a hardware configuration of the apparatus. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0011] Hereinafter, an embodiment of the present invention (the present embodiment) will be described with reference to the drawings. The embodiment described below is merely an example, and the embodiment to which the present invention is applied is not limited to the following embodiment.

[0012] In the following explanation, IPv4 and TCP are given as specific examples, but these are merely examples. The technology according to the present invention can be applied to any protocol that can communicate through NAPT. For example, the technology according to the present invention can be applied to IPv6, UDP, ICMP, etc. In the case of ICMP, there is no port number, and instead an ICMP Identifier is used.

[0013] In the following, the conventional operation and problems of NAPT will be described in detail, and then an embodiment of the technology according to the present invention will be described. Note that the analysis content in the description of the conventional operation and problems is not publicly known.

[0014] (Regarding conventional operation) An example of a general operation of NAPT will be described with reference to Fig. 1. In the example of Fig. 1, a client terminal 20 exists on the LAN side, a server 30 exists on the WAN side, and a gateway device 10 implementing NAPT exists between them.

[0015] The IP addresses and port numbers are as shown in the figure. As shown in Figure 1, A=10.0.0.1:10080, B=8.8.8.8:80, and C=192.168.11.8:11111.

[0016] When the gateway device 10 receives a packet, it performs the following process.

[0017] ·In the communication from the LAN side to the WAN side, perform IP address / port conversion of the packet and record the conversion information in the NAPT table.

[0018] ·In the communication from the WAN side to the LAN side, perform conversion back to the original IP address / port based on the NAPT table.

[0019] More specifically, it is as follows.

[0020] <Processing by the gateway device in the communication from the LAN side to the WAN side> S1: Generate the port number after conversion from the source IP address and source port number of the received packet.

[0021] S2: Record the source port number, source IP address, and the port number after conversion in the NAPT table.

[0022] S3: Replace the source IP address of the received packet with the WAN side IP address.

[0023] S4: Replace the source port number of the received packet with the WAN side port number.

[0024] S5: Calculate and replace the checksum.

[0025] <Processing by the gateway device in the communication from the WAN side to the LAN side> S1: For the received packet, search for the IP address and port number from the NAPT table based on the destination port number.

[0026] S2: Replace the destination port number of the packet with the port number found.

[0027] S3: Replace the destination IP address of the packet with the IP address found.

[0028] S4: Calculate and replace the checksum.

[0029] (About the assignment) In the gateway device 10 that implements the conventional NAPT that performs the above-mentioned operations, if a large number of response packets are generated, there is a possibility that sufficient performance cannot be obtained. The reason is as follows.

[0030] That is, as explained in the above operation example, when the gateway device 10 receives a response packet, it must repeatedly perform "table lookup → IP address / port number conversion → checksum calculation / substitution" for each packet, which causes a delay in transfer. The delay becomes particularly large when large data is divided.

[0031] Furthermore, if the number of response packets (number of client terminals) increases, the table lookup takes a long time.

[0032] The following describes a technique according to the present embodiment that solves the above problems.

[0033] (System Configuration) The system configuration in this embodiment is shown in Fig. 2. As shown in Fig. 2, this system includes a gateway device 100, a client terminal 200 which is a device on the LAN side, and a server 300 which is a device on the WAN side, and the client terminal 200 and the server 300 are connected to the gateway device 100 via a network.

[0034] The client terminal 200 and the server 300 may each be a device that operates based on the conventional technology. The gateway device 100 is basically a device that performs NAPT operations, but as described below, it executes operations to solve the above problems.

[0035] (Operation of Gateway Device 100) In this embodiment, regarding the address conversion process of response packets, which was an issue with the conventional method, a part of the response packet is calculated and generated in advance. When a response packet is received, the bit sequence calculated and generated in advance is combined with the data part of the response packet and then transmitted.

[0036] Referring to FIG. 3, the operation of the gateway device 100 will be described. In FIG. 3, for the received packet, the destination address (IP address + port number) = B and the source address = A. Similarly for other packets, the destination address and source address are assigned as shown. Also, the table shown in the upper part of FIG. 3 is the NAPT table held by the gateway device 100.

[0037] <Communication from LAN side to WAN side> The gateway device 100 performs NAPT on the received packet (S101), and while transmitting the NAPTed packet to the WAN side, it calculates in advance a part of the response packet (such as the IP header) and stores it in the output queue on the LAN side (S102).

[0038] Also, the gateway device 100 stores the source IP address, the source port number before conversion, and the source port number after conversion of the received packet in the NAPT table, and also stores the number of the output queue where the pre-calculated information is stored in the NAPT table (S103).

[0039] When storing information in the NAPT table, based on the LRU method, the latest information is stored at the upper part of the NAPT table. This is to assume that a response packet will come soon after the received packet is transmitted, so as to hit the table faster. Thereby, even if the number of terminals increases, the degradation of the lookup performance can be reduced.

[0040] <Communication from WAN side to LAN side> When the gateway device 100 receives a response packet from the WAN side, if the packet has an IP header and other information that has been calculated in advance, the gateway device 100 distributes the uncalculated portion of the packet (called the "data portion") to the corresponding output queue, and generates and outputs a packet by concatenating the calculated portion and the uncalculated portion.

[0041] 3, when the gateway device 100 receives a response packet, it searches (looks up) the NAPT table using the port number of the destination of the response packet as a key (S104). If the port number matches (hits) in the NAPT table as a result of the search and an output queue number exists in that row (entry), it stores the data portion of the response packet in that queue (S105).

[0042] In the output queue (output queue #1 in the example of FIG. 3), the packet is completed by concatenating the part that has been pre-calculated and already stored with the data part (S106) and is output.

[0043] As described above, in this embodiment, the response packet is converted in advance, so that the response packet can be transferred at high speed.

[0044] (Example of precalculation method) As described above, the gateway device 100 calculates in advance a part of the response packet from the IP address and port number of the packet received from the LAN side.

[0045] A specific example is shown in Fig. 4. As shown in Fig. 4, the gateway device 100 calculates the IP header and IP header checksum in the response packet in advance. If the conversion of the information of the received packet to the information of the response packet is expressed as "information → information", then the conversion (calculation) is performed as follows, as shown in Fig. 4: "destination port number (dstPort) → source port number (srcPort)", "source port number (srcPort) → destination port number (dstPort)", "destination IP address (dstIP) → source IP address (srcIP)", and "source IP address (srcIP) → destination IP address (dstIP)". Furthermore, the IP header checksum is calculated.

[0046] On the other hand, the NAPT process converts the source port number (srcPort) and the source IP address (srcIP) to generate a transmission packet.

[0047] An example of the range of pre-calculation in the case of TCP will be described with reference to Figure 5. In this example, the area enclosed in a thick frame indicated by A in Figure 5 is the range of pre-calculation. In other words, the entire IP header and the source port number and destination port number of the TCP header are calculated in advance. In other words, the portion from the beginning of the IP header up to 32 x 7 bits is calculated in advance.

[0048] The checksum of the IP header enclosed in the thick frame shown in B is also calculated in advance. At this time, temporary fixed values ​​are used for the time to live and total length.

[0049] The checksum of the TCP header enclosed in a bold frame shown in C must be recalculated after the response packet arrives because the IP address and port number change. Since the calculation includes the payload, it cannot be calculated in advance.

[0050] (About NAPT table) Next, the NAPT table will be described in more detail. An example of the NAPT table is shown in FIG.

[0051] After NAPT, if information related to the NAPT does not exist in the NATP table, the gateway device 100 adds the information to the NAPT table as an entry. In the case of a flow that was recently converted, the entry remains and no addition is required.

[0052] It is desirable to set a time to live for each entry. Also, it is desirable for the converted port number to be a hash value based on the IP address and port number, but this is not a limitation.

[0053] The output queue number in the NAPT table is information indicating a data store that can uniquely identify the calculated bit string, such as a cache memory address or a register number. Here, the pre-calculated bit string of the packet itself may be stored in the NAPT table.

[0054] It is also possible for an entry to exist that does not have an output queue, for example, when there is no free space in the output queue, when the queue has been deleted, when there is no need to store data in the queue in the first place, etc.

[0055] (Example of device configuration) The gateway device 100 performing the above-mentioned operations may have any configuration (functional block) as long as it is capable of executing the above-mentioned operations. As an example, a configuration example of the gateway device 100 is shown in FIG.

[0056] 7, the gateway device 100 includes a NAPT table 110, an address conversion unit 120, a packet generation unit 130, an output queue 140, an output queue 150, and a table search unit 160. "PHY" in Fig. 7 is a physical layer function that serves as an interface with the network.

[0057] The address conversion unit 120 executes the address conversion process of the NAPT. The packet generation unit 130 generates a packet by concatenating the address-converted header and the data portion. The address conversion unit 120 also performs pre-calculation. The pre-calculation may be performed by the packet generation unit 130.

[0058] More specifically, the address conversion unit 120 receives a packet from a terminal, performs address conversion on the packet, transmits the address-converted packet to a server, and precalculates a part of a response packet to be transmitted to the terminal. The packet generation unit 130 generates a response packet to be transmitted to the terminal using the data part and the part of the response packet received from the server.

[0059] When a response packet arrives, the table search unit 160 searches the NAPT table 110 based on the destination port number.

[0060] Pre-calculated information is stored in output queue 140. When a corresponding output queue is found by a search by table search unit 160, a data portion is stored in output queue 140, and packet generation unit 130 generates a packet to be output by concatenating the pre-calculated information and the data portion.

[0061] If the table search section 160 finds no corresponding output queue, the packet generator 130 generates a packet in the same manner as when a normal NAPT response packet is received, and the packet is stored in the output queue 150 .

[0062] The gateway device 100 shown in FIG. 7 can be realized by hardware implementation using ASIC or FPGA, or can be realized by software implementation in which a computer having a CPU and memory executes a program.

[0063] Alternatively, a configuration in which hardware and software implementations are mixed may be adopted. For example, the address conversion unit 120 may be implemented in software, and the rest may be implemented in hardware.

[0064] When the gateway device 100 is implemented by an FPGA, it is desirable to implement the processes of the address conversion unit 120, the packet generation unit 130, the table search unit 160, etc. on an FPGA circuit. Furthermore, by parallelizing each process in a pipeline, it becomes possible to process many flows.

[0065] When implemented on an FPGA, the NAPT table is a storage device with enough capacity to hold port numbers and queue numbers. However, for faster lookups, it is preferable to store the NAPT table in RAM (SRAM, DRAM, etc.) connected to the FPGA. Also, when implemented on an FPGA, it is preferable to store queues in registers or RAM.

[0066] (Hardware configuration example) A description will be given of a hardware configuration example in the case where the gateway device 100 is implemented by a computer and software. This computer may be a physical computer or a virtual machine on the cloud.

[0067] That is, the gateway device 100 can be realized by executing a program corresponding to the processing performed by the gateway device 100 using hardware resources such as a CPU and memory built into a computer. The above program can be recorded on a computer-readable recording medium (such as a portable memory) and stored or distributed. The above program can also be provided via a network such as the Internet or email.

[0068] Fig. 8 is a diagram showing an example of the hardware configuration of the computer. The computer in Fig. 8 has a drive device 1000, an auxiliary storage device 1002, a memory device 1003, a CPU 1004, an interface device 1005, a display device 1006, an input device 1007, an output device 1008, and the like, which are all connected to each other via a bus BS. When the gateway device 100 is realized by combining hardware implementation and software implementation, the configuration shown in Fig. 8 may be a configuration for realizing software implementation (e.g., an address conversion unit) in the gateway device 100.

[0069] The program for realizing the processing on the computer is provided by a recording medium 1001 such as a CD-ROM or a memory card. When the recording medium 1001 storing the program is set in the drive device 1000, the program is installed from the recording medium 1001 to the auxiliary storage device 1002 via the drive device 1000. However, the program does not necessarily have to be installed from the recording medium 1001, but may be downloaded from another computer via a network. The auxiliary storage device 1002 stores the installed program as well as necessary files, data, etc.

[0070] The memory device 1003 reads out and stores the program from the auxiliary storage device 1002 when an instruction to start the program is received. The CPU 1004 realizes functions related to the gateway device 100 in accordance with the program stored in the memory device 1003. The interface device 1005 is used as an interface for connecting to a network, etc. The display device 1006 displays a GUI (Graphical User Interface) or the like according to a program. The input device 1007 is composed of a keyboard and mouse, buttons, a touch panel, etc., and is used to input various operation instructions. The output device 1008 outputs the results of calculations.

[0071] (Additional Note) This specification discloses at least the gateway device, communication method, and program described in the following sections. (Section 1) an address translation unit that receives a packet from a terminal, performs address translation on the packet, transmits the address-translated packet to a server, and pre-calculates a part of a response packet to be transmitted to the terminal; a packet generating unit that generates a response packet to be transmitted to the terminal by using the data portion and the part of the response packet received from the server; A gateway device comprising: (Section 2) The address conversion unit stores information before conversion in the packet received from the terminal, information after conversion of the information, and information indicating the part in a table held by the gateway device. 2. The gateway device according to claim 1. (Section 3) a table search unit that searches the table based on a response packet received from the server, When the table search unit detects an entry corresponding to the response packet, the packet generation unit generates a response packet to be transmitted to the terminal using the part specified by information of the entry. 3. The gateway device according to claim 2. (Section 4) The part includes an IP header of a response packet to be sent to the terminal. 4. A gateway device according to claim 1, wherein the gateway device is a (Section 5) The address conversion unit stores the part calculated in advance in an output queue, and the packet generation unit generates a response packet to be transmitted to the terminal using the part stored in the output queue and the data part. 5. A gateway device according to claim 1. (Section 7) A communication method performed by a gateway device, comprising: receiving a packet from a terminal, performing address translation on the packet, and transmitting the packet after address translation to a server, while also calculating in advance a part of a response packet to be transmitted to the terminal; generating a response packet to be transmitted to the terminal using the data portion of the response packet received from the server and the portion; A communication method comprising: (Section 8) A program for causing a computer to function as each unit in the gateway device according to any one of claims 1 to 5.

[0072] Although the present embodiment has been described above, the present invention is not limited to such a specific embodiment, and various modifications and variations are possible within the scope of the gist of the present invention described in the claims. [Explanation of symbols]

[0073] 10, 100 Gateway device 110 NAPT Table 120 Address conversion unit 130 Packet Generator 140 Output Queues 150 Output Queues 160 Table Search Unit 20,200 client terminals 30, 300 servers 1000 Drive Device 1001 Recording media 1002 Auxiliary storage 1003 Memory device 1004 CPU 1005 Interface device 1006 Display device 1007 Input Device 1008 Output device

Claims

1. an address translation unit that receives a packet from a terminal, performs address translation on the packet, transmits the address-translated packet to a server, and pre-calculates a part of a response packet to be transmitted to the terminal; a packet generating unit that generates a response packet to be transmitted to the terminal by using the data portion and the part of the response packet received from the server; A gateway device comprising:

2. The address conversion unit stores information before conversion in the packet received from the terminal, information after conversion of the information, and information indicating the part in a table held by the gateway device. The gateway device according to claim 1 .

3. a table search unit that searches the table based on a response packet received from the server, When the table search unit detects an entry corresponding to the response packet, the packet generation unit generates a response packet to be transmitted to the terminal using the part specified by information of the entry. The gateway device according to claim 2 .

4. The part includes an IP header of a response packet to be sent to the terminal.

4. The gateway device according to claim 1, wherein the gateway device is a first gateway.

5. The address conversion unit stores the part calculated in advance in an output queue, and the packet generation unit generates a response packet to be transmitted to the terminal using the part stored in the output queue and the data part.

5. The gateway device according to claim 1, wherein the gateway device is a first gateway.

6. A communication method performed by a gateway device, comprising: receiving a packet from a terminal, performing address translation on the packet, and transmitting the packet after address translation to a server, while also calculating in advance a part of a response packet to be transmitted to the terminal; generating a response packet to be transmitted to the terminal using the data portion of the response packet received from the server and the portion; A communication method comprising:

7. A program for causing a computer to function as each unit in the gateway device according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Packet transfer apparatus and packet transfer method

    JP2005094050A

  • Gateway device, and method of assigning port number

    JP2011103566A

  • Network address translation method, network address translation proxy response method, network address translation device, and network address translation proxy response device

    JP2012156656A