NAT64 dynamic conversion method, gateway device and system

The NAT64 gateway device receives DNS requests to generate a mapping table and matches the conversion of IPv6 packets, which solves the problem that dynamic conversion cannot be achieved in the IPv6 network conversion of IPv4 network, and realizes automated and efficient NAT64 conversion.

CN120455428APending Publication Date: 2025-08-08WUHAN SIPU TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510739215.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the prior art, NAT64 conversion cannot be dynamically performed in scenarios where IPv6 networks are converted into IPv4 networks, and administrators need to configure the prefix matching NAT64 in advance.

Method used

The NAT64 gateway device receives the terminal's DNS request, obtains the packet information and generates the NAT64 mapping table, and matches the IPv6 packet with the mapping table. If the match is successful, it will be converted into an IPv4 packet, realizing dynamic conversion.

Benefits of technology

It realizes that in the scenario where IPv6 network converts IPv4 network, no need for administrators to manually configure prefixes, and automatically performs NAT64 conversion, improving the flexibility and accuracy of conversion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455428A_ABST
    Figure CN120455428A_ABST
Patent Text Reader

Abstract

The invention relates to an NAT64 dynamic conversion method, gateway equipment and a system, and belongs to the technical field of network communication, and the method comprises the following steps: when the NAT64 gateway equipment receives a DNS request sent by a terminal, indicating that the terminal needs to access an IPv4 network through an IPv6 network, obtaining message information from a DNS server according to the DNS request, then generating an NAT64 mapping table according to the message information, and sending the NAT64 mapping table to the terminal; when the IPv6 message sent by the terminal according to the message information is received, the IPv6 message can be matched with the NAT64 mapping table, and when the matching is successful, the IPv6 message can be converted into the IPv4 message according to the NAT64 mapping table, so that the IPv4 message can be forwarded to the IPv4 network, and the NAT64 conversion technology in the scene of converting the IPv6 network into the IPv4 network is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication technology, and in particular to a NAT64 dynamic conversion method, gateway device and system. Background Art

[0002] In scenarios where IPv6 networks are translating to IPv4 networks, NAT64 currently performs translation based on the IPv6 prefix in the destination address. If the prefix of an IPv6 packet matches the prefix defined for NAT64 on the device, the packet's destination address is an IPv4 network. The packet will be processed by NAT64 and forwarded to the IPv4 network. If the prefix of an IPv6 packet does not match the prefix defined for NAT64 on the device, the packet's destination address is an IPv6 network. The packet will be forwarded directly to the IPv6 network without NAT64 processing. This requires the administrator to have a thorough understanding of the network environment and to pre-configure the prefix that NAT64 matches; dynamic NAT64 translation is not possible.

[0003] Therefore, there is an urgent need to propose a NAT64 dynamic conversion method, gateway device and system to solve the technical problem in the existing technology that NAT64 conversion cannot be dynamically performed in the scenario of IPv6 network conversion to IPv4 network. Summary of the Invention

[0004] In view of this, it is necessary to provide a NAT64 dynamic conversion method, gateway device and system to solve the technical problem in the existing technology that NAT64 conversion cannot be performed dynamically in the scenario of IPv6 network conversion to IPv4 network.

[0005] In order to solve the above problems, in a first aspect, the present invention provides a NAT64 dynamic conversion method, which is applied to a NAT64 gateway device, comprising: When receiving a DNS request sent by a terminal, obtaining message information from a DNS server according to the DNS request, and generating a NAT64 mapping table according to the message information; When receiving an IPv6 message sent by the terminal according to the message information, matching the IPv6 message with the NAT64 mapping table to obtain a matching result; When the matching result is a successful match, the IPv6 message is converted into an IPv4 message according to the NAT64 mapping table, and the IPv4 message is forwarded to the IPv4 network.

[0006] In one possible implementation, the message information includes an initial IPv6 address and an initial IPv4 address corresponding to the domain name; and generating a NAT64 mapping table according to the message information includes: Record the domain name and the corresponding initial IPv6 address and initial IPv4 address to generate a DNS mapping table; Generate a NAT64 mapping table based on the preset configuration information and the DNS mapping table.

[0007] In a possible implementation, matching the IPv6 packet with the NAT64 mapping table to obtain a matching result includes: Match the incoming interface of the IPv6 packet with the incoming interface of the IPv6 address in the NAT64 mapping table; If the match is successful, a matching result is obtained based on the domain name of the IPv6 message and the corresponding domain name in the NAT64 mapping table.

[0008] In a possible implementation, obtaining a matching result based on the domain name of the IPv6 message and the corresponding domain name in the NAT64 mapping table includes: Match the domain name of the IPv6 message with the corresponding domain name in the NAT64 mapping table; If the match is successful, then determining that the match result between the IPv6 packet and the NAT64 mapping table is a successful match; If the match is not successful, the matching result is determined to be unsuccessful.

[0009] In a possible implementation, converting the IPv6 packet into an IPv4 packet according to the NAT64 mapping table includes: Determine an idle address in the IPv4 address pool as the source IP; The source IP is modified to the target IPv4 address in the NAT64 mapping table that successfully matches the IPv6 message.

[0010] In a possible implementation, the method further includes: When the matching result is unsuccessful, the IPv6 message is forwarded to the IPv4 network.

[0011] In a possible implementation, obtaining message information from a DNS server according to the DNS request includes: Enable DNS proxy mode and send the DNS request to the DNS server; When the message information returned by the DNS server according to the DNS request is received, the message information is cached according to the DNS proxy mode.

[0012] In a second aspect, the present invention further provides a gateway device, comprising: A mapping table generation module is used to, when receiving a DNS request sent by a terminal, obtain message information from the DNS server according to the DNS request, and generate a NAT64 mapping table according to the message information; a message matching module, configured to, upon receiving an IPv6 message sent by the terminal according to the message information, match the IPv6 message with the NAT64 mapping table to obtain a matching result; The message conversion module is used to convert the IPv6 message into an IPv4 message according to the NAT64 mapping table when the matching result is a successful match, and forward the IPv4 message to the IPv4 network.

[0013] In a third aspect, the present invention further provides a NAT64 dynamic conversion system, the system comprising a terminal, a NAT64 gateway device and a DNC server; The NAT64 gateway device is configured to, when receiving a DNS request sent by the terminal, obtain message information from the DNS server according to the DNS request, generate a NAT64 mapping table according to the message information, and send the message information to the terminal; The terminal is configured to access the IPv6 network according to the message information and send the IPv6 message to the NAT64 gateway device; The NAT64 gateway device is further used to match the IPv6 message with the NAT64 mapping table. When the match is successful, the IPv6 message is converted into an IPv4 message according to the NAT64 mapping table, and the IPv4 message is forwarded to the IPv4 network.

[0014] In one possible implementation, the terminal is also used to send a DNS request to the NAT64 gateway device when accessing the IPv4 network through the IPv6 network; when receiving the message information returned by the NAT64 gateway device, the terminal parses the message information to obtain a resolution address, and when accessing the IPv6 network according to the resolution address, the terminal sends the IPv6 message to the NAT64 gateway device.

[0015] The beneficial effect of the present invention is as follows: when the NAT64 gateway device receives a DNS request sent by a terminal, indicating that the terminal needs to access the IPv4 network through the IPv6 network, the message information is obtained from the DNS server according to the DNS request, and then a NAT64 mapping table is generated according to the message information. When an IPv6 message is received from the terminal according to the message information, the IPv6 message can be matched with the NAT64 mapping table. When the match is successful, the IPv6 message can be converted into an IPv4 message according to the NAT64 mapping table, so that the IPv4 message can be forwarded to the IPv4 network, thereby realizing the technology of performing NAT64 conversion in the scenario of converting the IPv6 network to the IPv4 network. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram of an embodiment of the NAT64 dynamic conversion method provided by the present invention; Figure 2 A schematic diagram of the structure of an embodiment of the relationship between the gateway and the network provided by the present invention; Figure 3 A schematic diagram of an embodiment of the relationship between the DNS mapping table and the NAT64 mapping table provided by the present invention; Figure 4 A schematic diagram of the structure of an embodiment of the NAT64 dynamic translation system provided by the present invention; Figure 5 A schematic diagram of an embodiment of a NAT64 translation table structure example provided by the present invention; Figure 6 A schematic structural diagram of an embodiment of the gateway device provided by the present invention. DETAILED DESCRIPTION

[0017] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, and are not used to limit the scope of the present invention.

[0018] A DNS server (Domain Name System) is a system used to translate human-readable domain names (such as www.example.com) into computer-readable IP addresses (such as 192.0.2.1). DNS is a fundamental component of the internet, allowing users to access websites and other network resources by domain name, without having to remember complex numeric IP addresses.

[0019] ‌IPv4 (Internet Protocol version 4)‌ is the fourth version of the Internet Protocol and one of the most widely used Internet protocols. It lays the foundation for Internet communications. IPv4 uniquely identifies and locates devices through 32-bit IPv4 addresses, enabling data packets to be correctly forwarded from one device to another, providing basic network connectivity and communication capabilities for devices.‌‌

[0020] IPv6 (Internet Protocol Version 6) is the next-generation IP protocol designed by the Internet Engineering Task Force (IETF) to replace IPv4. IPv6 boasts enough addresses to encode every grain of sand in the world. Its addresses are 128 bits long and divided into eight parts, each of 16 bits. Addresses are typically expressed in three categories.

[0021] like Figure 1 As shown, a specific embodiment of the present invention discloses a NAT64 dynamic conversion method, including: S101. When a DNS request sent by a terminal is received, message information is obtained from a DNS server according to the DNS request, and a NAT64 mapping table is generated according to the message information.

[0022] Among them, the NAT64 dynamic conversion method provided in the embodiment of the present application can be applied to the NAT64 dynamic conversion system. The NAT64 dynamic conversion system can be a software system running on a terminal device. The terminal device can be a server, a tablet computer, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a mobile phone and other terminal devices. The embodiment of the present application does not impose any restrictions on the specific type of the terminal device. The NAT64 dynamic conversion system can include a NAT64 gateway device, an IPv6 terminal and an IPv4 terminal, such as Figure 2 As shown, a NAT64 gateway device can be a device that performs IPv6 and IPv4 address mapping. It is responsible for converting addresses and protocols between IPv6 traffic and IPv4 traffic.

[0023] In an embodiment of the present invention, the NAT64 gateway device can receive a DNS request sent by the NAT64 gateway device. When the DNS request is received, it indicates that the IPv4 network needs to be accessed through the IPv6 network. The NAT64 gateway device can send the DNS request to the DNS server. The DNS server can return message information according to the DNS request. When the NAT64 gateway device receives the returned message information, it can generate a NAT64 mapping table according to the message information, and can also send the message information to the IPv6 terminal.

[0024] S102: When receiving an IPv6 message sent by the terminal according to the message information, match the IPv6 message with the NAT64 mapping table to obtain a matching result.

[0025] Among them, the IPv6 terminal can send an IPv6 message to the NAT64 gateway device according to the message information. When the NAT64 gateway device receives the IPv6 message sent by the IPv6 terminal according to the message information, it can match the IPv6 message with the data stored in the NAT64 mapping table to obtain a matching result.

[0026] S103: When the matching result is successful, the IPv6 message is converted into an IPv4 message according to the NAT64 mapping table, and the IPv4 message is forwarded to the IPv4 network.

[0027] When the matching result is successful, the IPv6 message can be converted into an IPv4 message according to the successful matching data in the NAT64 mapping table, thereby achieving IPv6 to IPv4 conversion, and then the IPv4 message can be forwarded to the IPv4 network.

[0028] Compared with the existing technology, the present embodiment provides that when the NAT64 gateway device receives a DNS request sent by the terminal, it indicates that the terminal needs to access the IPv4 network through the IPv6 network, then obtains the message information from the DNS server according to the DNS request, and then generates a NAT64 mapping table according to the message information. When the IPv6 message sent by the terminal according to the message information is received, the IPv6 message can be matched with the NAT64 mapping table. When the match is successful, the IPv6 message can be converted into an IPv4 message according to the NAT64 mapping table, so that the IPv4 message can be forwarded to the IPv4 network, thereby realizing the technology of performing NAT64 conversion in the scenario of converting the IPv6 network to the IPv4 network.

[0029] In some embodiments of the present invention, step S101 includes: Enable DNS proxy mode and send DNS requests to the DNS server; When receiving the message information returned by the DNS server according to the DNS request, the message information is cached according to the DNS proxy mode.

[0030] In a specific embodiment of the present invention, when the NAT64 gateway device receives a DNS request, the DNS proxy mode can be turned on. The main functions of the DNS proxy mode include caching DNS query results, reducing the query frequency of remote DNS servers, improving the response speed and efficiency of network applications, and providing different DNS resolution results based on geographical location, thereby achieving faster access speed or regional content access control. The NAT64 gateway device sends a DNS request to the DNS server, and then receives the message information returned by the DNS server based on the DNS request, and caches the message information according to the DNS proxy mode.

[0031] In some embodiments of the present invention, the message information includes an initial IPv6 address and an initial IPv4 address corresponding to the domain name; step S101 further includes: Record the domain name and the corresponding initial IPv6 address and initial IPv4 address to generate a DNS mapping table; Generate a NAT64 mapping table based on the preset configuration information and the DNS mapping table.

[0032] In a specific embodiment of the present invention, the NAT64 gateway device can be configured with a domain name of a NAT64 rule, and the NAT64 gateway device will monitor the DNS request message of the domain name. The message information may include the initial IPv6 address and the initial IPv4 address corresponding to the domain name, such as the AAAA address and the A address; the NAT64 gateway device is also used to record the domain name and the corresponding initial IPv6 address and initial IPv4 address, generate a DNS mapping table, and generate a NAT64 mapping table according to the configuration information of the NAT64 gateway device and the DNS mapping table. The configuration information may include data such as the interface, domain name, IPv4 address pool, etc., such as Figure 3 As shown, Figure 3The DNS mapping table in the example includes domain names, IPv4 addresses, and IPv6 addresses; the NAT64 mapping table includes the inbound interface, domain name, IPv4 address, IPv6 address, and IPv4 address pool. This shows that the NAT64 mapping table is a combination of the DNS mapping table and configuration information, making the NAT64 translation process more flexible and dynamic. It combines the IPv4 and IPv6 address mappings obtained through DNS resolution with the NAT64 rule configuration to form a complete translation basis, enabling dynamic NAT64 translation without the administrator having to manually configure a fixed NAT64 prefix. For example, assume the NAT64 rule configuration includes the domain name "example.com," the interface is GE1, and the IPv4 address pool is 121.1.1.0 / 24. When the device captures a DNS request for example.com and obtains the AAAA address as 2001:db8::1 and the A address as 93.184.216.34, it generates a record in the NAT64 mapping table: Interface: GE1 Domain name: example.com IPv6 address: 2001:db8::1 Corresponding IPv4 address: 93.184.216.34 Available IPv4 address pool: 121.1.1.0 / 24.

[0033] In some embodiments of the present invention, step S102 includes: Match the incoming interface of the IPv6 packet with the incoming interface of the IPv6 address in the NAT64 mapping table; If the match is successful, the matching result is obtained based on the domain name of the IPv6 message and the corresponding domain name in the NAT64 mapping table.

[0034] In a specific embodiment of the present invention, NAT64 matching logic provides a flexible method for determining whether to perform NAT64 processing on a message. By using multiple judgment criteria (including the inbound interface, destination address, and NAT64 rule configuration), traffic requiring NAT64 conversion can be more accurately identified, while also correctly processing IPv6 traffic that does not require conversion. This method improves the adaptability and efficiency of the system and avoids unnecessary conversion operations. The matching process of the NAT64 gateway device involves matching the inbound interface and domain name of the IPv6 message with the inbound interface and domain name in the NAT64 mapping table. Specifically, the matching process can be to match the inbound interface of the IPv6 message with the inbound interface of the IPv6 address in the NAT64 mapping table. If the match is unsuccessful, the message is forwarded directly without NAT64 processing. If the match is successful, a matching result is obtained based on the domain name in the IPv6 message and the corresponding domain name in the NAT64 mapping table.

[0035] In some embodiments of the present invention, obtaining a matching result based on the domain name of the IPv6 message and the corresponding domain name in the NAT64 mapping table includes: Match the domain name of the IPv6 packet with the corresponding domain name in the NAT64 mapping table; If the match is successful, the match result between the IPv6 packet and the NAT64 mapping table is determined to be a successful match; If the match is not successful, the matching result is determined to be unsuccessful.

[0036] In a specific embodiment of the present invention, the domain name of the IPv6 packet is again matched against the corresponding domain name in the NAT64 mapping table. The matching process determines whether the NAT64 rule is configured with a domain name. If so, the domain name is determined to match the corresponding domain name in the NAT64 mapping table. If so, the IPv6 packet is determined to have successfully matched the NAT64 mapping table, and the match result is determined to be a successful match. If not, the match result is determined to be an unsuccessful match. For example, assume the following configuration: the NAT64 rule is configured for interface GE1, the NAT64 mapping table contains the destination IPv6 address 2001:db8:1::1, and the domain name configured in the NAT64 rule is example.com. When an IPv6 packet is received: if the packet enters through interface GE2, it is directly forwarded without processing. If the packet enters through interface GE1, the destination address is 2001:db8:1::1, and the address is example.com, NAT64 processing is performed. If the packet enters through interface GE1, the destination address is 2001:db8:1::1, but the address is not example.com, it is directly forwarded without processing. If a packet enters from the GE1 interface and its destination address is not in the NAT64 mapping table, it is forwarded directly without processing. This multi-level judgment logic ensures that only traffic that truly requires NAT64 translation is processed, improving system efficiency and accuracy.

[0037] In some embodiments of the present invention, the method further comprises: If the match result is unsuccessful, the IPv6 packet is forwarded to the IPv4 network.

[0038] In a specific embodiment of the present invention, when the matching result is an unsuccessful match, NAT64 conversion is not performed, and the IPv6 message is directly forwarded to the IPv4 network.

[0039] In some embodiments of the present invention, step S103 includes: Determine an idle address in the IPv4 address pool as the source IP; Change the source IP address to the destination IPv4 address that successfully matches the IPv6 packet in the NAT64 mapping table.

[0040] In a specific embodiment of the present invention, an idle address in the IPv4 address pool can be determined as the source IP. When the matching result is a successful match, the source IP can be modified to the target IPv4 address in the NAT64 mapping table that successfully matches the IPv6 message.

[0041] In embodiments of the present invention, the structure and usage of the NAT64 mapping table provide an efficient way to record and manage NAT64 translation status information. It supports not only IPv6-to-IPv4 translation but also reverse IPv4-to-IPv6 translation, thus enabling complete bidirectional communication. This method significantly improves the efficiency and accuracy of NAT64 translation and facilitates subsequent session tracking and troubleshooting. For example, during the forward translation (IPv6-to-IPv4) process, when a terminal initiates an IPv6 request (for example, accessing 1111::1111:80 from 2000:db8::1:5000), the device performs the following operations: It checks whether the inbound interface (for example, GE1) and the destination address (1111::1111) match the NAT64 rules. If so, it selects an available IPv4 address (for example, 121.1.1.1) from the NAT64 mapping table as the source IP address. It then translates the destination IP address into the corresponding IPv4 address (for example, 1.1.1.1). A NAT64 translation table entry is generated, containing the following information: IPv6 source address: 2000:db8::1, IPv6 source port: 5000, IPv6 destination address: 1111::1111, IPv6 destination port: 80, translated IPv4 source address: 121.1.1.1, translated IPv4 destination address: 1.1.1.1. Reverse translation (IPv4 to IPv6): When the server (1.1.1.1) responds, the device performs the following operations: It searches the NAT64 translation table for a match between the source IP address (1.1.1.1) and the destination IP address (121.1.1.1). After finding a matching entry, it performs reverse translation: translating the source IP address from 1.1.1.1 to 1111::1111 and the destination IP address from 121.1.1.1 to 2000:db8::1, and then forwards the translated IPv6 packet to the terminal. In this way, the NAT64 translation table implements bidirectional translation between IPv6 and IPv4, ensuring the continuity and correctness of communication.

[0042] This method in the embodiment of the present invention ensures that the traffic that needs NAT64 conversion can be correctly processed without affecting the IPv6 traffic that does not need conversion. This method ensures that the traffic that needs NAT64 conversion can be correctly processed without affecting the IPv6 traffic that does not need conversion.

[0043] like Figure 4As shown, a specific embodiment of the present invention discloses a NAT64 dynamic translation system 100, the system 100 includes a terminal 101, a NAT64 gateway device 102 and a DNC server 103; The NAT64 gateway device 102 may be configured to receive a DNS request sent by the terminal 101. Upon receiving the DNS request, the DNS request may be sent to the DNS server 103. The DNS server 103 may return message information according to the DNS request. The NAT64 gateway device 102 may receive the message information returned by the DNS server 103, generate a NAT64 mapping table according to the message information, and send the message information to the terminal 101. The terminal 101 can be used to access the IPv6 network according to the content parsed from the message information when receiving the message information, and send the IPv6 message to the NAT64 gateway device 102; The NAT64 gateway device 102 can also be used to match the IPv6 message with the NAT64 mapping table. When the match is successful, the IPv6 message can be converted into an IPv4 message according to the NAT64 mapping table, and then the IPv4 message can be forwarded to the IPv4 network.

[0044] In some embodiments of the present invention, the terminal 101 is also used to send a DNS request to the NAT64 gateway device 102 when accessing the IPv4 network through the IPv6 network; when receiving the message information returned by the NAT64 gateway device 102, the message information is parsed to obtain the resolution address, and when accessing the IPv6 network according to the resolution address, the IPv6 message is sent to the NAT64 gateway device 102.

[0045] In this embodiment of the present invention, 1. Network topology: A terminal on an IPv6 network needs to access a server on an IPv4 network. 2. Terminal operation: The terminal (IPv6 address is 2000:db8::1) attempts to access the webpage of domain name 1. 3. DNS request process: The terminal initiates an AAAA DNS request for domain name 1. The device enables DNS proxy and, upon receiving the terminal's request, initiates AAAA and A DNS requests to the DNS server. The DNS server returns the AAAA address (1111::1111) and A address (1.1.1.1) for domain name 1. The device records this information, forms a DNS mapping table, and generates a NAT64 mapping table. The device sends the DNS response to the terminal. 4. Access process: The terminal uses the resolved IPv6 address (1111::1111:80) to access the webpage of domain name 1. The device receives the packet and finds that the inbound interface is GE1 and the destination address is 1111::1111, matching the NAT64 rule. The device performs NAT64 translation: Source IP: Selects an idle IPv4 address pool address 121.1.1.1 from the NAT64 mapping table Destination IP: Uses the IPv4 address 1.1.1.1 resolved by domain name 1. The port remains unchanged. The device generates a NAT64 mapping table to record this translation. The translated IPv4 packet is sent to the IPv4 network. 5. Response process: The server (1.1.1.1) receives the request and responds. The device receives the IPv4 response packet and searches the NAT64 mapping table. The NAT64 mapping table is as follows: Figure 5 As shown, Figure 5 This is the NAT64 mapping table (i.e., an example of the NAT64 translation table structure). The device performs reverse translation: the source IP address is converted from 1.1.1.1 to 1111::1111, and the destination IP address is converted from 121.1.1.1 to 2000:db8::1. The converted IPv6 packet is then sent to the terminal. The above embodiment demonstrates that the entire NAT64 dynamic translation process, from DNS request, address mapping, message translation, to final communication completion, is automated, eliminating the need for administrators to manually configure NAT64 matching prefixes.

[0046] In order to better implement the NAT64 dynamic conversion method in the embodiment of the present invention, based on the NAT64 dynamic conversion method, the embodiment of the present invention also provides a gateway device, such as Figure 6 Shown, including: A mapping table generating module 601 is configured to, upon receiving a DNS request sent by a terminal, obtain message information from a DNS server according to the DNS request and generate a NAT64 mapping table according to the message information; The message matching module 602 is used to match the IPv6 message with the NAT64 mapping table when receiving the IPv6 message sent by the terminal according to the message information to obtain a matching result; The message conversion module 603 is configured to convert the IPv6 message into an IPv4 message according to the NAT64 mapping table when the matching result is successful, and forward the IPv4 message to the IPv4 network.

[0047] The NAT64 dynamic conversion method provided in the above embodiment can implement the technical solution described in the above NAT64 dynamic conversion method embodiment. The specific implementation principles of the above modules or units can be found in the corresponding contents in the above NAT64 dynamic conversion method embodiment, which will not be repeated here.

[0048] The NAT64 dynamic translation method, gateway device, and system provided by the present invention are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only intended to help understand the method and core concept of the present invention. At the same time, for those skilled in the art, based on the concept of the present invention, there may be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A NAT64 dynamic conversion method, characterized in that: Applicable to NAT64 gateway devices, including: When receiving a DNS request sent by a terminal, obtaining message information from a DNS server according to the DNS request, and generating a NAT64 mapping table according to the message information; When receiving an IPv6 message sent by the terminal according to the message information, matching the IPv6 message with the NAT64 mapping table to obtain a matching result; When the matching result is a successful match, the IPv6 message is converted into an IPv4 message according to the NAT64 mapping table, and the IPv4 message is forwarded to the IPv4 network.

2. The NAT64 dynamic conversion method according to claim 1, wherein: The message information includes the initial IPv6 address and the initial IPv4 address corresponding to the domain name; Generating a NAT64 mapping table according to the message information includes: Record the domain name and the corresponding initial IPv6 address and initial IPv4 address to generate a DNS mapping table; Generate a NAT64 mapping table based on the preset configuration information and the DNS mapping table.

3. The NAT64 dynamic conversion method according to claim 1, wherein: The matching of the IPv6 packet with the NAT64 mapping table to obtain a matching result includes: Match the incoming interface of the IPv6 packet with the incoming interface of the IPv6 address in the NAT64 mapping table; If the match is successful, a matching result is obtained based on the domain name of the IPv6 message and the corresponding domain name in the NAT64 mapping table.

4. The NAT64 dynamic conversion method according to claim 3, wherein: Obtaining a matching result based on the domain name of the IPv6 message and the corresponding domain name in the NAT64 mapping table includes: Match the domain name of the IPv6 message with the corresponding domain name in the NAT64 mapping table; If the match is successful, then determining that the match result between the IPv6 packet and the NAT64 mapping table is a successful match; If the match is not successful, the matching result is determined to be unsuccessful.

5. The NAT64 dynamic conversion method according to claim 1, wherein: The converting of the IPv6 message into an IPv4 message according to the NAT64 mapping table includes: Determine an idle address in the IPv4 address pool as the source IP; The source IP is modified to the target IPv4 address in the NAT64 mapping table that successfully matches the IPv6 message.

6. The NAT64 dynamic conversion method according to claim 1, wherein: The method further comprises: When the matching result is unsuccessful, the IPv6 message is forwarded to the IPv4 network.

7. The NAT64 dynamic conversion method according to claim 1, wherein: The obtaining message information from the DNS server according to the DNS request includes: Enable DNS proxy mode and send the DNS request to the DNS server; When the message information returned by the DNS server according to the DNS request is received, the message information is cached according to the DNS proxy mode.

8. A gateway device, characterized in that: include: A mapping table generation module is used to, when receiving a DNS request sent by a terminal, obtain message information from the DNS server according to the DNS request, and generate a NAT64 mapping table according to the message information; a message matching module, configured to, upon receiving an IPv6 message sent by the terminal according to the message information, match the IPv6 message with the NAT64 mapping table to obtain a matching result; The message conversion module is used to convert the IPv6 message into an IPv4 message according to the NAT64 mapping table when the matching result is a successful match, and forward the IPv4 message to the IPv4 network.

9. A NAT64 dynamic translation system, characterized in that: The system includes terminals, NAT64 gateway devices and DNC servers; The NAT64 gateway device is configured to, when receiving a DNS request sent by the terminal, obtain message information from the DNS server according to the DNS request, generate a NAT64 mapping table according to the message information, and send the message information to the terminal; The terminal is configured to access the IPv6 network according to the message information and send the IPv6 message to the NAT64 gateway device; The NAT64 gateway device is further used to match the IPv6 message with the NAT64 mapping table. When the match is successful, the IPv6 message is converted into an IPv4 message according to the NAT64 mapping table, and the IPv4 message is forwarded to the IPv4 network.

10. The NAT64 dynamic translation system according to claim 1, wherein: The terminal is also used to send a DNS request to the NAT64 gateway device when accessing the IPv4 network through the IPv6 network; when receiving the message information returned by the NAT64 gateway device, the terminal parses the message information to obtain a resolution address, and when accessing the IPv6 network according to the resolution address, the terminal sends the IPv6 message to the NAT64 gateway device.

Citation Information

Patent Citations

  • Method of accessing private network server on public network client side, and router

    CN103338151A

  • System and method for achieving intercommunication between IPv4 network and IPv6 network based on NAT64

    CN104270475A

  • IPv4 and IPv6 network interconnection method based on SDN

    CN104734963A

  • IPv4 / IPv6 intercommunication system based on HTTP ALG and NAT64 technology

    CN106790098A