[go: up one dir, main page]

CN118827824A - IPv6 network access method, device and storage medium - Google Patents

IPv6 network access method, device and storage medium Download PDF

Info

Publication number
CN118827824A
CN118827824A CN202311199488.0A CN202311199488A CN118827824A CN 118827824 A CN118827824 A CN 118827824A CN 202311199488 A CN202311199488 A CN 202311199488A CN 118827824 A CN118827824 A CN 118827824A
Authority
CN
China
Prior art keywords
address
domain name
ipv6
ipv6 address
ipv4
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311199488.0A
Other languages
Chinese (zh)
Inventor
胡淑军
马琼芳
李晗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
Research Institute of China Mobile Communication Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
Research Institute of China Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, Research Institute of China Mobile Communication Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202311199488.0A priority Critical patent/CN118827824A/en
Publication of CN118827824A publication Critical patent/CN118827824A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/167Adaptation for transition between two IP versions, e.g. between IPv4 and IPv6
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/741Routing in networks with a plurality of addressing schemes, e.g. with both IPv4 and IPv6
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses

Landscapes

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

Abstract

本申请实施例提供了一种IPv6网络的访问方法、设备及存储介质,其中,所述方法中,在第一域名对应的第一IPv6地址为第一类型的情况下,用户侧设备只需要依据第一域名对应的第一IPv4地址来维护一个无状态对应表项,不需要维护复杂的有状态NAT46会话表,从而节约了用户侧设备的资源。另外,上述无状态对应表项中的第一IPv4地址是第一域名所对应的已有IPv4地址,不需要占用用户侧设备地址池中的IPv4地址,从而减少了IPv4地址消耗。另外,本申请实施例通过将第一域名对应的真实IPv4地址提供给第一终端,有利于后续第一终端通过该真实IPv4地址进行业务访问。

The embodiment of the present application provides an access method, device and storage medium for an IPv6 network, wherein, in the method, when the first IPv6 address corresponding to the first domain name is of the first type, the user-side device only needs to maintain a stateless corresponding table entry based on the first IPv4 address corresponding to the first domain name, and does not need to maintain a complex stateful NAT46 session table, thereby saving resources of the user-side device. In addition, the first IPv4 address in the above-mentioned stateless corresponding table entry is an existing IPv4 address corresponding to the first domain name, and does not need to occupy an IPv4 address in the user-side device address pool, thereby reducing IPv4 address consumption. In addition, the embodiment of the present application provides the real IPv4 address corresponding to the first domain name to the first terminal, which is conducive to the subsequent first terminal accessing the service through the real IPv4 address.

Description

IPv6网络的访问方法、设备及存储介质IPv6 network access method, device and storage medium

技术领域Technical Field

本申请涉及数据通信技术领域,具体涉及一种IPv6网络的访问方法、设备及存储介质。The present application relates to the field of data communication technology, and in particular to an access method, device and storage medium of an IPv6 network.

背景技术Background Art

近几年,随着IPv6改造工作的不断推进和IPv6新技术的不断演进,全球IPv6流量增幅明显,尤其是中国网络中的IPv6流量实现了大幅增加。随着IPv6流量占比的不断提升,IPv6单栈技术也不断的向前演进。In recent years, with the continuous advancement of IPv6 transformation and the continuous evolution of new IPv6 technologies, global IPv6 traffic has increased significantly, especially in China. As the proportion of IPv6 traffic continues to increase, IPv6 single stack technology is also constantly evolving.

在IPv6单栈演进的过程中,网络地址转换(Network Address Translation,NAT)转换的场景越来越受到重视。其中,NAT64表示将IPv6地址转换成IPv4地址,NAT46表示IPv4地址转换成IPv6地址。一些场景中,网络和业务服务器侧都已经升级为IPv6单栈,而终端侧可能存在家庭无线路由器不支持IPv6等情况,因此可能导致家庭终端只能分配到IPv4私有地址。在这种情况下,需要由用户侧设备(Customer Premise Equipment,CPE),如家庭网关,进行NAT46的转换,从而完成对IPv6网络和业务的访问。In the process of IPv6 single stack evolution, the scenario of Network Address Translation (NAT) conversion has received more and more attention. Among them, NAT64 means converting IPv6 addresses into IPv4 addresses, and NAT46 means converting IPv4 addresses into IPv6 addresses. In some scenarios, the network and service server sides have been upgraded to IPv6 single stack, but the terminal side may have a situation such as the home wireless router does not support IPv6, which may result in the home terminal only being assigned an IPv4 private address. In this case, the user side equipment (Customer Premise Equipment, CPE), such as the home gateway, needs to perform NAT46 conversion to complete the access to the IPv6 network and services.

一些NAT46场景中,需要CPE利用本地配置的IP地址池中的IPv4进行地址转换,造成了IPv4地址的消耗,另外,还需要维护复杂的有状态的NAT46会话表项,造成CPE资源的浪费。In some NAT46 scenarios, the CPE needs to use the IPv4 in the locally configured IP address pool for address translation, resulting in the consumption of IPv4 addresses. In addition, it is necessary to maintain complex stateful NAT46 session entries, resulting in a waste of CPE resources.

发明内容Summary of the invention

本申请的至少一个实施例提供了一种IPv6网络的访问方法、设备及存储介质,用于减少网络地址转换导致的IPv4地址的消耗,节约CPE资源。At least one embodiment of the present application provides an IPv6 network access method, device, and storage medium for reducing the consumption of IPv4 addresses caused by network address translation and saving CPE resources.

为了解决上述技术问题,本申请是这样实现的:In order to solve the above technical problems, this application is implemented as follows:

第一方面,本申请实施例提供了一种IPv6网络的访问方法,应用于用户侧设备,包括:In a first aspect, an embodiment of the present application provides a method for accessing an IPv6 network, which is applied to a user-side device, including:

接收第一终端发送的第一请求消息,所述第一请求消息用于请求第一域名对应的IPv4地址;Receive a first request message sent by a first terminal, where the first request message is used to request an IPv4 address corresponding to a first domain name;

向域名解析服务器发送第二请求消息,所述第二请求消息用于请求第一域名对应的IPv6地址;Sending a second request message to the domain name resolution server, where the second request message is used to request the IPv6 address corresponding to the first domain name;

接收所述域名解析服务器发送的第一响应消息,所述第一响应消息包含所述第一域名对应的第一IPv6地址和所述第一IPv6地址的类型;其中,所述第一IPv6地址的类型包括:通过网络地址转换网关的第一IPv6地址前缀与第一域名对应的第一IPv4地址联合表示的第一类型;通过第一域名对应的独立IPv6地址表示的第二类型;Receive a first response message sent by the domain name resolution server, the first response message including a first IPv6 address corresponding to the first domain name and a type of the first IPv6 address; wherein the type of the first IPv6 address includes: a first type represented by a first IPv6 address prefix of a network address translation gateway and a first IPv4 address corresponding to the first domain name; a second type represented by an independent IPv6 address corresponding to the first domain name;

在所述第一IPv6地址为所述第一类型的情况下,生成所述第一IPv6地址前缀与所述第一IPv4地址的无状态对应表项,并向所述第一终端发送所述第一域名对应的第一IPv4地址。In the case where the first IPv6 address is of the first type, a stateless correspondence table entry between the first IPv6 address prefix and the first IPv4 address is generated, and the first IPv4 address corresponding to the first domain name is sent to the first terminal.

可选的,上述方法还包括:Optionally, the above method further includes:

接收第一访问请求,所述第一访问请求的目的地址为所述第一IPv4地址;receiving a first access request, wherein the destination address of the first access request is the first IPv4 address;

对所述第一访问请求进行第一地址转换处理,发送处理后的所述第一访问请求,其中,所述第一地址转换处理包括:Performing a first address conversion process on the first access request and sending the processed first access request, wherein the first address conversion process includes:

根据所述无状态对应表项,将所述第一访问请求的目的地址转换为所述第一IPv6地址前缀与所述第一IPv4地址联合表示的第一IPv6地址。According to the stateless correspondence table entry, the destination address of the first access request is converted into a first IPv6 address jointly represented by the first IPv6 address prefix and the first IPv4 address.

可选的,所述第一访问请求的源地址为第二IPv4地址,所述第一地址转换处理还包括:Optionally, the source address of the first access request is a second IPv4 address, and the first address conversion process further includes:

将所述第一访问请求的源地址转换为用户侧设备的第二IPv6地址前缀与所述第二IPv4地址联合表示的第二IPv6地址。The source address of the first access request is converted into a second IPv6 address represented by a combination of a second IPv6 address prefix of the user-side device and the second IPv4 address.

可选的,上述方法还包括:Optionally, the above method further includes:

在所述第一IPv6地址为所述第二类型的情况下,根据IPv4地址池中的第三IPv4地址,生成所述第三IPv4地址与所述第一IPv6地址的有状态对应表项,并向所述第一终端发送所述第一域名对应的所述第三IPv4地址。When the first IPv6 address is of the second type, a stateful correspondence table entry between the third IPv4 address and the first IPv6 address is generated according to the third IPv4 address in the IPv4 address pool, and the third IPv4 address corresponding to the first domain name is sent to the first terminal.

可选的,上述方法还包括:Optionally, the above method further includes:

接收第二访问请求,所述第二访问请求的目的地址为所述第三IPv4地址;receiving a second access request, wherein the destination address of the second access request is the third IPv4 address;

对所述第二访问请求进行第二地址转换处理,发送处理后的所述第二访问请求,其中,所述第二地址转换处理包括:Performing a second address conversion process on the second access request and sending the processed second access request, wherein the second address conversion process includes:

根据所述有状态对应表项,将所述第二访问请求的目的地址转换为所述第三IPv4地址对应的所述第一IPv6地址。According to the stateful corresponding table entry, the destination address of the second access request is converted into the first IPv6 address corresponding to the third IPv4 address.

可选的,所述第二访问请求的源地址为第二IPv4地址,所述第二地址转换处理还包括:Optionally, the source address of the second access request is a second IPv4 address, and the second address conversion process further includes:

将所述第二访问请求的源地址转换为用户侧设备的第二IPv6地址前缀与所述第二IPv4地址联合表示的第二IPv6地址。The source address of the second access request is converted into a second IPv6 address represented by a combination of a second IPv6 address prefix of the user-side device and the second IPv4 address.

可选的,所述第一响应消息为基于域名解析扩展EDNS协议的DNS响应消息,所述第一IPv6地址的类型携带在所述DNS响应消息的OPT资源记录中的保留字段中,或者,携带在所述DNS响应消息的头Header部分的保留字段中。Optionally, the first response message is a DNS response message based on the domain name resolution extended EDNS protocol, and the type of the first IPv6 address is carried in a reserved field in the OPT resource record of the DNS response message, or in a reserved field in the header part of the DNS response message.

第二方面,本申请实施例提供了一种IPv6网络的访问方法,应用于域名解析服务器,包括:In a second aspect, an embodiment of the present application provides an IPv6 network access method, which is applied to a domain name resolution server, including:

接收用户侧设备发送的请求消息,所述请求消息用于请求第一域名对应的IPv6地址;Receive a request message sent by a user-side device, where the request message is used to request an IPv6 address corresponding to a first domain name;

向所述用户侧设备发送响应消息,所述响应消息包含所述第一域名对应的第一IPv6地址和和所述第一IPv6地址的类型;Sending a response message to the user-side device, where the response message includes a first IPv6 address corresponding to the first domain name and a type of the first IPv6 address;

其中,所述第一IPv6地址的类型包括:通过网络地址转换网关的第一IPv6地址前缀与第一域名对应的第一IPv4地址联合表示的第一类型;通过第一域名对应的独立IPv6地址表示的第二类型。Among them, the types of the first IPv6 address include: a first type represented by the first IPv6 address prefix of the network address translation gateway and the first IPv4 address corresponding to the first domain name; and a second type represented by an independent IPv6 address corresponding to the first domain name.

可选的,所述响应消息为基于域名解析扩展EDNS协议的DNS响应消息,所述第一IPv6地址的类型携带在所述DNS响应消息的OPT资源记录中的保留字段中,或者,携带在所述DNS响应消息的头Header部分的保留字段中。Optionally, the response message is a DNS response message based on the domain name resolution extended EDNS protocol, and the type of the first IPv6 address is carried in a reserved field in the OPT resource record of the DNS response message, or in a reserved field in the header part of the DNS response message.

可选的,在向所述用户侧设备发送响应消息之前,所述方法还包括:Optionally, before sending the response message to the user-side device, the method further includes:

查询预先建立的域名、IPv6地址、IPv6地址的类型之间的对应关系,确定所述第一域名对应的第一IPv6地址和所述第一IPv6地址的类型。Query the pre-established correspondence between the domain name, the IPv6 address, and the type of the IPv6 address to determine the first IPv6 address corresponding to the first domain name and the type of the first IPv6 address.

第三方面,本申请实施例提供了一种用户侧设备,包括收发机和处理器,其中,In a third aspect, an embodiment of the present application provides a user side device, including a transceiver and a processor, wherein:

所述收发机,用于接收第一终端发送的第一请求消息,所述第一请求消息用于请求第一域名对应的IPv4地址;向域名解析服务器发送第二请求消息,所述第二请求消息用于请求第一域名对应的IPv6地址;接收所述域名解析服务器发送的第一响应消息,所述第一响应消息包含所述第一域名对应的第一IPv6地址和所述第一IPv6地址的类型;其中,所述第一IPv6地址的类型包括:通过网络地址转换网关的第一IPv6地址前缀与第一域名对应的第一IPv4地址联合表示的第一类型;通过第一域名对应的独立IPv6地址表示的第二类型;The transceiver is configured to receive a first request message sent by a first terminal, wherein the first request message is used to request an IPv4 address corresponding to a first domain name; send a second request message to a domain name resolution server, wherein the second request message is used to request an IPv6 address corresponding to the first domain name; receive a first response message sent by the domain name resolution server, wherein the first response message includes a first IPv6 address corresponding to the first domain name and a type of the first IPv6 address; wherein the type of the first IPv6 address includes: a first type jointly represented by a first IPv6 address prefix of a network address translation gateway and a first IPv4 address corresponding to the first domain name; and a second type represented by an independent IPv6 address corresponding to the first domain name;

所述处理器,用于在所述第一IPv6地址为所述第一类型的情况下,生成所述第一IPv6地址前缀与所述第一IPv4地址的无状态对应表项,并向所述第一终端发送所述第一域名对应的第一IPv4地址。The processor is configured to generate a stateless correspondence table entry between the first IPv6 address prefix and the first IPv4 address when the first IPv6 address is of the first type, and send the first IPv4 address corresponding to the first domain name to the first terminal.

可选的,所述收发机,还用于接收第一访问请求,所述第一访问请求的目的地址为所述第一IPv4地址;Optionally, the transceiver is further used to receive a first access request, where the destination address of the first access request is the first IPv4 address;

所述处理器,还用于对所述第一访问请求进行第一地址转换处理,发送处理后的所述第一访问请求,其中,所述第一地址转换处理包括:The processor is further configured to perform a first address conversion process on the first access request and send the processed first access request, wherein the first address conversion process includes:

根据所述无状态对应表项,将所述第一访问请求的目的地址转换为所述第一IPv6地址前缀与所述第一IPv4地址联合表示的第一IPv6地址。According to the stateless correspondence table entry, the destination address of the first access request is converted into a first IPv6 address jointly represented by the first IPv6 address prefix and the first IPv4 address.

可选的,所述第一访问请求的源地址为第二IPv4地址,所述第一地址转换处理还包括:Optionally, the source address of the first access request is a second IPv4 address, and the first address conversion process further includes:

将所述第一访问请求的源地址转换为用户侧设备的第二IPv6地址前缀与所述第二IPv4地址联合表示的第二IPv6地址。The source address of the first access request is converted into a second IPv6 address represented by a combination of a second IPv6 address prefix of the user-side device and the second IPv4 address.

可选的,所述处理器,还用于在所述第一IPv6地址为所述第二类型的情况下,根据IPv4地址池中的第三IPv4地址,生成所述第三IPv4地址与所述第一IPv6地址的有状态对应表项,并向所述第一终端发送所述第一域名对应的所述第三IPv4地址。Optionally, the processor is also used to generate a stateful correspondence table entry between the third IPv4 address and the first IPv6 address according to a third IPv4 address in the IPv4 address pool when the first IPv6 address is of the second type, and send the third IPv4 address corresponding to the first domain name to the first terminal.

可选的,所述收发机,还用于接收第二访问请求,所述第二访问请求的目的地址为所述第三IPv4地址;Optionally, the transceiver is further used to receive a second access request, the destination address of the second access request being the third IPv4 address;

所述处理器,还用于对所述第二访问请求进行第二地址转换处理,发送处理后的所述第二访问请求,其中,所述第二地址转换处理包括:The processor is further configured to perform a second address conversion process on the second access request, and send the processed second access request, wherein the second address conversion process includes:

根据所述有状态对应表项,将所述第二访问请求的目的地址转换为所述第三IPv4地址对应的所述第一IPv6地址。According to the stateful corresponding table entry, the destination address of the second access request is converted into the first IPv6 address corresponding to the third IPv4 address.

可选的,所述第二访问请求的源地址为第二IPv4地址,所述第二地址转换处理还包括:Optionally, the source address of the second access request is a second IPv4 address, and the second address conversion process further includes:

将所述第二访问请求的源地址转换为用户侧设备的第二IPv6地址前缀与所述第二IPv4地址联合表示的第二IPv6地址。The source address of the second access request is converted into a second IPv6 address represented by a combination of a second IPv6 address prefix of the user-side device and the second IPv4 address.

可选的,所述第一响应消息为基于域名解析扩展EDNS协议的DNS响应消息,所述第一IPv6地址的类型携带在所述DNS响应消息的OPT资源记录中的保留字段中,或者,携带在所述DNS响应消息的头Header部分的保留字段中。Optionally, the first response message is a DNS response message based on the domain name resolution extended EDNS protocol, and the type of the first IPv6 address is carried in a reserved field in the OPT resource record of the DNS response message, or in a reserved field in the header part of the DNS response message.

第四方面,本申请实施例提供了一种用户侧设备,包括:处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序,所述程序被所述处理器执行时实现如第一方面所述的方法的步骤。In a fourth aspect, an embodiment of the present application provides a user-side device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the method described in the first aspect.

第五方面,本申请实施例提供了一种域名解析服务器,包括收发机和处理器,其中,In a fifth aspect, an embodiment of the present application provides a domain name resolution server, including a transceiver and a processor, wherein:

所述收发机,用于接收用户侧设备发送的请求消息,所述请求消息用于请求第一域名对应的IPv6地址;The transceiver is used to receive a request message sent by a user-side device, where the request message is used to request an IPv6 address corresponding to the first domain name;

向所述用户侧设备发送响应消息,所述响应消息包含所述第一域名对应的第一IPv6地址和和所述第一IPv6地址的类型;Sending a response message to the user-side device, where the response message includes a first IPv6 address corresponding to the first domain name and a type of the first IPv6 address;

其中,所述第一IPv6地址的类型包括:通过网络地址转换网关的第一IPv6地址前缀与第一域名对应的第一IPv4地址联合表示的第一类型;通过第一域名对应的独立IPv6地址表示的第二类型。Among them, the types of the first IPv6 address include: a first type represented by the first IPv6 address prefix of the network address translation gateway and the first IPv4 address corresponding to the first domain name; and a second type represented by an independent IPv6 address corresponding to the first domain name.

可选的,所述响应消息为基于域名解析扩展EDNS协议的DNS响应消息,所述第一IPv6地址的类型携带在所述DNS响应消息的OPT资源记录中的保留字段中,或者,携带在所述DNS响应消息的头Header部分的保留字段中。Optionally, the response message is a DNS response message based on the domain name resolution extended EDNS protocol, and the type of the first IPv6 address is carried in a reserved field in the OPT resource record of the DNS response message, or in a reserved field in the header part of the DNS response message.

可选的,所述处理器,用于在向所述用户侧设备发送响应消息之前,查询预先建立的域名、IPv6地址、IPv6地址的类型之间的对应关系,确定所述第一域名对应的第一IPv6地址和所述第一IPv6地址的类型。Optionally, the processor is used to query the correspondence between the pre-established domain name, IPv6 address, and IPv6 address type before sending a response message to the user-side device, and determine the first IPv6 address corresponding to the first domain name and the type of the first IPv6 address.

第六方面,本申请实施例提供了一种域名解析服务器,包括:处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序,所述程序被所述处理器执行时实现如第二方面所述的方法的步骤。In a sixth aspect, an embodiment of the present application provides a domain name resolution server, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the method described in the second aspect.

第七方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有程序,所述程序被处理器执行时,实现如上所述的方法的步骤。In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed by a processor, the steps of the method described above are implemented.

与现有技术相比,本申请实施例提供的IPv6网络的访问方法、设备及存储介质,在所述第一IPv6地址为所述第一类型的情况下,用户侧设备只需要依据第一域名对应的真实IPv4地址(第一IPv4地址)来维护一个无状态对应表项,不需要维护复杂的有状态NAT46会话表,从而节约了用户侧设备的资源(如存储资源和计算资源)。另外,上述无状态对应表项中的第一IPv4地址是第一域名所对应的已有IPv4地址,不需要占用用户侧设备本地地址池中的IPv4地址,从而减少了IPv4地址消耗。另外,本申请实施例将第一域名对应的真实IPv4地址提供给第一终端,有利于后续第一终端通过该真实IPv4地址进行业务访问。Compared with the prior art, the access method, device and storage medium of the IPv6 network provided by the embodiment of the present application, when the first IPv6 address is of the first type, the user-side device only needs to maintain a stateless corresponding table item based on the real IPv4 address (first IPv4 address) corresponding to the first domain name, and does not need to maintain a complex stateful NAT46 session table, thereby saving resources (such as storage resources and computing resources) of the user-side device. In addition, the first IPv4 address in the above-mentioned stateless corresponding table item is an existing IPv4 address corresponding to the first domain name, and does not need to occupy the IPv4 address in the local address pool of the user-side device, thereby reducing IPv4 address consumption. In addition, the embodiment of the present application provides the real IPv4 address corresponding to the first domain name to the first terminal, which is conducive to the subsequent first terminal to access the service through the real IPv4 address.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

图1为相关技术中CPE进行NAT46的转换的一种示意图;FIG1 is a schematic diagram of a CPE performing NAT46 conversion in the related art;

图2为相关技术中CPE进行NAT46的转换的另一种示意图;FIG. 2 is another schematic diagram of CPE performing NAT46 conversion in the related art;

图3为相关技术中CPE进行NAT46的转换的又一种示意图;FIG3 is another schematic diagram of CPE performing NAT46 conversion in the related art;

图4为本申请实施例的IPv6网络的访问方法的一种流程图;FIG4 is a flow chart of a method for accessing an IPv6 network according to an embodiment of the present application;

图5为本申请实施例的IPv6网络的访问方法的另一种流程图;FIG5 is another flow chart of a method for accessing an IPv6 network according to an embodiment of the present application;

图6为本申请实施例的IPv6网络的访问方法在设备间的交互流程示例图;6 is an example diagram of the interaction process between devices of the method for accessing an IPv6 network according to an embodiment of the present application;

图7为本申请实施例的IPv6网络的访问方法在设备间的交互流程的另一种示例图;7 is another example diagram of the interaction process between devices of the IPv6 network access method according to an embodiment of the present application;

图8为本申请实施例的EDNS扩展方式的一种示例图;FIG8 is an example diagram of an EDNS extension method according to an embodiment of the present application;

图9为本申请实施例的EDNS扩展方式的另一种示例图;FIG9 is another example diagram of an EDNS extension method according to an embodiment of the present application;

图10为本申请一实施例的用户侧设备的结构示意图;FIG10 is a schematic diagram of the structure of a user-side device according to an embodiment of the present application;

图11为本申请另一实施例的用户侧设备的结构示意图;FIG11 is a schematic diagram of the structure of a user-side device according to another embodiment of the present application;

图12为本申请一实施例的域名解析服务器的结构示意图;FIG12 is a schematic diagram of the structure of a domain name resolution server according to an embodiment of the present application;

图13为本申请另一实施例的域名解析服务器的结构示意图;FIG13 is a schematic diagram of the structure of a domain name resolution server according to another embodiment of the present application;

图14为本申请又一实施例的用户侧设备的结构示意图;FIG14 is a schematic diagram of the structure of a user-side device according to another embodiment of the present application;

图15为本申请又一实施例的域名解析服务器的结构示意图。FIG15 is a schematic diagram of the structure of a domain name resolution server according to another embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

下面将参照附图更详细地描述本申请的示例性实施例。虽然附图中显示了本申请的示例性实施例,然而应当理解,可以以各种形式实现本申请而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本申请,并且能够将本申请的范围完整的传达给本领域的技术人员。The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例例如能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。说明书以及权利要求中“和/或”表示所连接对象的至少其中之一。The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable in appropriate circumstances, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment. "And/or" in the specification and claims represents at least one of the connected objects.

以下描述提供示例而并非限定权利要求中阐述的范围、适用性或者配置。可以对所讨论的要素的功能和布置作出改变而不会脱离本公开的精神和范围。各种示例可恰适地省略、替代、或添加各种规程或组件。例如,可以按不同于所描述的次序来执行所描述的方法,并且可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。The following description provides examples and does not limit the scope, applicability, or configuration set forth in the claims. Changes may be made to the functions and arrangements of the elements discussed without departing from the spirit and scope of the present disclosure. Various examples may appropriately omit, replace, or add various procedures or components. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.

在网络和业务服务器侧都已经升级为IPv6单栈,而终端侧由于家庭无线路由器不支持IPv6等原因,家庭终端只能分配到IPv4私有地址的情况下,需要由CPE进行NAT46的转换,以完成对IPv6网络和业务的访问。请参照图1和图2,其主要处理如下:When the network and service server sides have been upgraded to IPv6 single stack, and the terminal side can only be assigned IPv4 private addresses due to reasons such as the home wireless router not supporting IPv6, the CPE needs to perform NAT46 conversion to complete the access to IPv6 network and services. Please refer to Figures 1 and 2, the main processing is as follows:

由于可能存在家庭网络的无线路由器不支持IPv6等情况,导致家庭终端只能分配到IPv4私有地址。图1中的笔记本电脑、移动终端等终端只分配到IPv4私有地址。当这些IPv4终端访问IPv6业务时,需要在CPE上完成一次NAT46的转换,包括源地址的NAT46转换和目的地址的NAT46转换。Because the wireless router of the home network may not support IPv6, the home terminal can only be assigned an IPv4 private address. The laptops, mobile terminals and other terminals in Figure 1 are only assigned IPv4 private addresses. When these IPv4 terminals access IPv6 services, a NAT46 conversion needs to be completed on the CPE, including NAT46 conversion of the source address and NAT46 conversion of the destination address.

其中,对于源地址的NAT46转换:可以直接由IPv4私有地址加上CPE先前获取的LAN侧IPv6前缀生成IPv6源地址,这是一种无状态NAT46转换技术。对于目的地址的NAT46转换,可以通过有状态NAT46技术来实现。Among them, for NAT46 conversion of source address: the IPv6 source address can be directly generated by adding the IPv4 private address to the LAN side IPv6 prefix previously obtained by the CPE. This is a stateless NAT46 conversion technology. For NAT46 conversion of destination address, it can be achieved through stateful NAT46 technology.

另外,固网场景下,NAT46可部署在家庭网关CPE上;移动场景下,NAT46可部署在终端上。本申请实施例主要以固网场景为例进行说明,移动场景下的实现与固网场景相类似,本申请同时适用于固网和移动场景。In addition, in the fixed network scenario, NAT46 can be deployed on the home gateway CPE; in the mobile scenario, NAT46 can be deployed on the terminal. The embodiment of this application mainly takes the fixed network scenario as an example for explanation, and the implementation in the mobile scenario is similar to the fixed network scenario. This application is applicable to both fixed network and mobile scenarios.

相关技术方案的业务流程如图2所示。其中,从终端访问IPv6业务服务器1的方向上来看(返程方向做相反的转换即可),包括:The service flow of the related technical solution is shown in FIG2 . From the perspective of the terminal accessing the IPv6 service server 1 (the return direction can be converted in the opposite direction), it includes:

(1)终端发起DNS4查询请求,以请求业务服务器1的域名(如,www.abc.com)对应的IPv4地址,CPE获取该请求后作为DNS代理(DNS Proxy)发起DNS6查询请求,向DNS服务器(DNS Server)请求域名对应的IPv6地址。(1) The terminal initiates a DNS4 query request to request the IPv4 address corresponding to the domain name of service server 1 (e.g., www.abc.com). After receiving the request, the CPE acts as a DNS proxy to initiate a DNS6 query request to request the IPv6 address corresponding to the domain name from the DNS server.

(2)CPE收到DNS Server返回的AAAA记录(包含有业务服务器1的IPv6地址)后,进行有状态NAT46转换,即:根据先前配置的IPv4地址池,生成并保存针对业务服务器1的NAT46转换表项,如,业务服务器1-IPv4地址<->业务服务器1-IPv6地址。(2) After receiving the AAAA record (including the IPv6 address of service server 1) returned by the DNS Server, the CPE performs stateful NAT46 translation, that is, based on the previously configured IPv4 address pool, generates and saves a NAT46 translation table entry for service server 1, such as service server 1-IPv4 address <-> service server 1-IPv6 address.

(3)CPE将转换后的业务服务器1的IPv4地址(业务服务器1-IPv4地址)通过DNS4响应消息发送给终端。(3) The CPE sends the converted IPv4 address of the service server 1 (service server 1-IPv4 address) to the terminal via a DNS4 response message.

(4)终端使用该地址为目的地址发起IPv4访问请求,该访问请求到达CPE后进行NAT46转换:(4) The terminal uses this address as the destination address to initiate an IPv4 access request. After the access request reaches the CPE, NAT46 conversion is performed:

源地址进行无状态NAT46转换:根据访问请求的源IPv4地址从IPv4私有地址,转换为该IPv4私有地址和CPE的LAN侧IPv6前缀联合表示的源IPv6地址;Stateless NAT46 translation of the source address: The source IPv4 address of the access request is translated from the IPv4 private address to the source IPv6 address represented by the combination of the IPv4 private address and the LAN-side IPv6 prefix of the CPE.

目的地址进行有状态NAT46转换:使用之前的有状态NAT46转换表项进行转换,即将访问请求的目的IPv4地址从业务服务器1-IPv4地址,转换为业务服务器1-IPv6地址。Stateful NAT46 conversion of the destination address: Use the previous stateful NAT46 conversion table entry for conversion, that is, convert the destination IPv4 address of the access request from the service server 1-IPv4 address to the service server 1-IPv6 address.

如图3所示,在NAT46的场景中,会存在某些网络内容提供商(Internet ContentProvider,ICP),它们提供内容的业务服务器仍然是一个IPv4服务器,但是通过部署NAT64网关,来对外提供类似IPv6的服务。As shown in FIG. 3 , in the NAT46 scenario, there are some Internet Content Providers (ICPs). Their service servers that provide content are still IPv4 servers, but they provide IPv6-like services to the outside world by deploying NAT64 gateways.

在这种情况下,该ICP的DNS服务器向用户返回的AAAA记录(IPv6地址)为:NAT64网关的IPv6前缀和IPv4业务服务器1-IPv4地址1联合表示的IPv6地址,即NAT64网关的IPv6前缀+IPv4业务服务器1-IPv4地址1。而该IPv6地址需要在CPE做有状态的NAT46转换,转换后的地址为:IPv4业务服务器1-IPv4地址2。那么就会存在如下问题:In this case, the AAAA record (IPv6 address) returned to the user by the DNS server of the ICP is: the IPv6 address represented by the IPv6 prefix of the NAT64 gateway and the IPv4 service server 1-IPv4 address 1, that is, the IPv6 prefix of the NAT64 gateway + IPv4 service server 1-IPv4 address 1. However, the IPv6 address needs to be converted by stateful NAT46 in the CPE, and the converted address is: IPv4 service server 1-IPv4 address 2. Then there will be the following problems:

1)针对IPv4业务服务器1消耗了IPv4地址1和IPv4地址2,因此导致了更多的IPv4地址消耗;1) IPv4 service server 1 consumes IPv4 address 1 and IPv4 address 2, thus resulting in more IPv4 address consumption;

2)需要维护一个复杂的有状态NAT46会话表而造成CPE资源的浪费;2) It is necessary to maintain a complex stateful NAT46 session table, which results in a waste of CPE resources;

3)另外也没有将域名对应的真实IPv4地址(如IPv4业务服务器1-IPv4地址1)送给客户端,这不利于业务发展。3) In addition, the real IPv4 address (such as IPv4 service server 1-IPv4 address 1) corresponding to the domain name is not sent to the client, which is not conducive to business development.

为了解决以上问题中的至少一种,本申请实施例提供了一种IPv6网络的访问方法,能够减少网络地址转换导致的IPv4地址的消耗,节约CPE资源。请参照图4,本申请实施例提供的IPv6网络的访问方法,在应用于用户侧设备,如CPE时,包括:In order to solve at least one of the above problems, the embodiment of the present application provides an access method for an IPv6 network, which can reduce the consumption of IPv4 addresses caused by network address translation and save CPE resources. Referring to FIG. 4 , the access method for an IPv6 network provided in the embodiment of the present application, when applied to a user-side device such as a CPE, includes:

步骤41,接收第一终端发送的第一请求消息,所述第一请求消息用于请求第一域名对应的IPv4地址。Step 41: Receive a first request message sent by a first terminal, where the first request message is used to request an IPv4 address corresponding to a first domain name.

这里,第一请求消息可以是DNS4查询请求,其中包含有第一域名和类型A(type:A),以请求第一域名对应的IPv4地址。Here, the first request message may be a DNS4 query request, which includes the first domain name and type A (type: A) to request the IPv4 address corresponding to the first domain name.

步骤42,向域名解析服务器发送第二请求消息,所述第二请求消息用于请求第一域名对应的IPv6地址。Step 42: Send a second request message to the domain name resolution server, where the second request message is used to request the IPv6 address corresponding to the first domain name.

这里,第二请求消息可以是DNS查询请求,其中包含有第一域名和类型4A(type:AAAA),以请求第一域名对应的IPv6地址。Here, the second request message may be a DNS query request, which includes the first domain name and type 4A (type: AAAA) to request the IPv6 address corresponding to the first domain name.

步骤43,接收所述域名解析服务器发送的第一响应消息,所述第一响应消息包含所述第一域名对应的第一IPv6地址和所述第一IPv6地址的类型;其中,所述第一IPv6地址的类型包括:通过网络地址转换网关的第一IPv6地址前缀与第一域名对应的第一IPv4地址联合表示的第一类型;通过第一域名对应的独立IPv6地址表示的第二类型。Step 43, receiving a first response message sent by the domain name resolution server, the first response message including a first IPv6 address corresponding to the first domain name and a type of the first IPv6 address; wherein the type of the first IPv6 address includes: a first type represented by a first IPv6 address prefix of a network address translation gateway and a first IPv4 address corresponding to the first domain name; and a second type represented by an independent IPv6 address corresponding to the first domain name.

这里,所述第一响应消息可以是基于域名解析扩展(Extension Mechanisms forDNS,EDNS)协议的DNS响应消息,所述第一IPv6地址的类型携带在所述DNS响应消息的OPT资源记录中的保留字段(Z字段)中,或者,携带在所述DNS响应消息的头Header部分的保留字段(Z字段)中。第一类型的第一IPv6地址是由网络地址转换网关的第一IPv6地址前缀与第一域名对应的第一IPv4地址拼接而成的IPv6地址。第二类型的第一IPv6地址则是为第一域名所分配的IPv6地址,此时,第一域名可以没有分配IPv4地址。所述的独立IPv6地址是指,该IPv6地址是作为一个整体分配给第一域名的,而非通过网络地址转换网关的IPv6地址前缀与第一域名对应的第一IPv4地址拼接而成。Here, the first response message may be a DNS response message based on the Extension Mechanisms for DNS (EDNS) protocol, and the type of the first IPv6 address is carried in a reserved field (Z field) in the OPT resource record of the DNS response message, or carried in a reserved field (Z field) in the header portion of the DNS response message. The first IPv6 address of the first type is an IPv6 address formed by concatenating the first IPv6 address prefix of the network address translation gateway and the first IPv4 address corresponding to the first domain name. The first IPv6 address of the second type is an IPv6 address assigned to the first domain name, and at this time, the first domain name may not have an assigned IPv4 address. The independent IPv6 address means that the IPv6 address is assigned to the first domain name as a whole, rather than being concatenated by the IPv6 address prefix of the network address translation gateway and the first IPv4 address corresponding to the first domain name.

这样,通过解析第一响应消息,用户侧设备可以获得第一域名对应的第一IPv6地址和所述第一IPv6地址的类型。In this way, by parsing the first response message, the user-side device can obtain the first IPv6 address corresponding to the first domain name and the type of the first IPv6 address.

步骤44,在所述第一IPv6地址为所述第一类型的情况下,生成所述第一IPv6地址前缀与所述第一IPv4地址的无状态对应表项,并向所述第一终端发送所述第一域名对应的第一IPv4地址。Step 44: When the first IPv6 address is of the first type, generate a stateless correspondence table entry between the first IPv6 address prefix and the first IPv4 address, and send the first IPv4 address corresponding to the first domain name to the first terminal.

这里,在所述第一IPv6地址为所述第一类型时,用户侧设备生成一个无状态对应表项,该表项中维护了第一IPv6地址前缀与所述第一IPv4地址之间的对应关系。另外,用户侧设备还向第一终端发送所述第一域名对应的所述第一IPv4地址。Here, when the first IPv6 address is of the first type, the user side device generates a stateless correspondence table entry, in which the correspondence between the first IPv6 address prefix and the first IPv4 address is maintained. In addition, the user side device also sends the first IPv4 address corresponding to the first domain name to the first terminal.

通过以上步骤,本申请实施例在所述第一IPv6地址为所述第一类型的情况下,用户侧设备只需要依据第一域名对应的真实IPv4地址(第一IPv4地址)来维护一个无状态对应表项,不需要维护复杂的有状态NAT46会话表,从而节约了用户侧设备的资源(如存储资源和计算资源)。另外,上述无状态对应表项中的第一IPv4地址是第一域名所对应的已有IPv4地址,不需要占用用户侧设备本地地址池中的IPv4地址,从而减少了IPv4地址消耗。另外,由于在步骤44中,本申请实施例将第一域名对应的真实IPv4地址提供给第一终端,这样有利于后续第一终端通过该真实IPv4地址进行业务访问。Through the above steps, in the embodiment of the present application, when the first IPv6 address is of the first type, the user-side device only needs to maintain a stateless corresponding table item based on the real IPv4 address (first IPv4 address) corresponding to the first domain name, and does not need to maintain a complex stateful NAT46 session table, thereby saving resources (such as storage resources and computing resources) of the user-side device. In addition, the first IPv4 address in the above-mentioned stateless corresponding table item is an existing IPv4 address corresponding to the first domain name, and does not need to occupy the IPv4 address in the local address pool of the user-side device, thereby reducing IPv4 address consumption. In addition, since in step 44, the embodiment of the present application provides the real IPv4 address corresponding to the first domain name to the first terminal, this is conducive to the subsequent first terminal to access the service through the real IPv4 address.

第一终端在获得第一域名对应的真实IPv4地址后,可以基于该真实IPv4地址发起相关业务的访问,例如发起数据面的IPv4访问请求(假设为第一访问请求),此时,上述方法还包括:After obtaining the real IPv4 address corresponding to the first domain name, the first terminal may initiate access to related services based on the real IPv4 address, for example, initiating an IPv4 access request on the data plane (assuming it is a first access request). At this time, the above method further includes:

步骤45a,用户侧设备接收第一访问请求,所述第一访问请求的目的地址为所述第一IPv4地址。Step 45a: The user-side device receives a first access request, where the destination address of the first access request is the first IPv4 address.

这里,上述第一访问请求的源地址为第一终端自身的IPv4地址(假设为第二IPv4地址,如IPv4私网地址1),目的地址为上述第一IPv4地址。Here, the source address of the first access request is the IPv4 address of the first terminal itself (assuming it is the second IPv4 address, such as IPv4 private network address 1), and the destination address is the first IPv4 address.

步骤46a,用户侧设备对所述第一访问请求进行第一地址转换处理,发送处理后的所述第一访问请求,其中,所述第一地址转换处理包括:根据所述无状态对应表项,将所述第一访问请求的目的地址转换为所述第一IPv6地址前缀与所述第一IPv4地址联合表示的第一IPv6地址。Step 46a, the user-side device performs a first address conversion process on the first access request and sends the processed first access request, wherein the first address conversion process includes: according to the stateless corresponding table entry, converting the destination address of the first access request into a first IPv6 address jointly represented by the first IPv6 address prefix and the first IPv4 address.

这里,上述第一地址转换处理是NAT46转换处理。另外,在步骤46a中,所述第一地址转换处理还可以包括:将所述第一访问请求的源地址转换为用户侧设备的第二IPv6地址前缀与所述第二IPv4地址联合表示的第二IPv6地址。即,第二IPv6地址是由用户侧设备的第二IPv6地址前缀与所述第二IPv4地址拼接而成的IPv6地址。Here, the first address conversion process is a NAT46 conversion process. In addition, in step 46a, the first address conversion process may also include: converting the source address of the first access request to a second IPv6 address represented by the second IPv6 address prefix of the user-side device and the second IPv4 address. That is, the second IPv6 address is an IPv6 address formed by concatenating the second IPv6 address prefix of the user-side device and the second IPv4 address.

本申请实施例中,在上述步骤43中获得的所述第一IPv6地址为所述第二类型的情况下,用户侧设备可以根据IPv4地址池(如用户侧设备自身配置的地址池)中的第三IPv4地址,生成所述第三IPv4地址与所述第一IPv6地址的有状态对应表项,并向所述第一终端发送所述第一域名对应的所述第三IPv4地址。In an embodiment of the present application, when the first IPv6 address obtained in the above step 43 is of the second type, the user-side device can generate a stateful correspondence table entry between the third IPv4 address and the first IPv6 address based on the third IPv4 address in the IPv4 address pool (such as the address pool configured by the user-side device itself), and send the third IPv4 address corresponding to the first domain name to the first terminal.

类似的,第一终端在获得第一域名对应的所述第三IPv4地址后,可以基于所述第三IPv4地址发起相关业务的访问,例如发起数据面的IPv4访问请求(假设为第二访问请求),此时,上述方法还包括:Similarly, after obtaining the third IPv4 address corresponding to the first domain name, the first terminal may initiate access to related services based on the third IPv4 address, for example, initiating an IPv4 access request on the data plane (assuming it is a second access request). At this time, the method further includes:

步骤45b,用户侧设备接收第二访问请求,所述第二访问请求的目的地址为所述第三IPv4地址。Step 45b: The user-side device receives a second access request, where the destination address of the second access request is the third IPv4 address.

这里,上述第二访问请求的源地址为第一终端自身的IPv4地址(假设为第二IPv4地址,如IPv4私网地址1),目的地址为上述第三IPv4地址。Here, the source address of the second access request is the IPv4 address of the first terminal itself (assuming it is the second IPv4 address, such as IPv4 private network address 1), and the destination address is the third IPv4 address.

步骤46b,用户侧设备对所述第二访问请求进行第二地址转换处理,发送处理后的所述第二访问请求,其中,所述第二地址转换处理包括:根据所述有状态对应表项,将所述第二访问请求的目的地址转换为所述第三IPv4地址对应的所述第一IPv6地址。Step 46b, the user-side device performs a second address conversion process on the second access request and sends the processed second access request, wherein the second address conversion process includes: according to the stateful corresponding table entry, converting the destination address of the second access request into the first IPv6 address corresponding to the third IPv4 address.

这里,上述第二地址转换处理是NAT46转换处理。另外,在步骤46b中,所述第二地址转换处理还可以包括:将所述第二访问请求的源地址转换为用户侧设备的第二IPv6地址前缀与所述第二IPv4地址联合表示的第二IPv6地址。即,第二IPv6地址是由用户侧设备的第二IPv6地址前缀与所述第二IPv4地址拼接而成的IPv6地址。Here, the second address conversion process is a NAT46 conversion process. In addition, in step 46b, the second address conversion process may also include: converting the source address of the second access request to a second IPv6 address represented by the second IPv6 address prefix of the user-side device and the second IPv4 address. That is, the second IPv6 address is an IPv6 address formed by concatenating the second IPv6 address prefix of the user-side device and the second IPv4 address.

请参照图5,本申请实施例提供的IPv6网络的访问方法,在应用于域名解析服务器时,包括:Referring to FIG. 5 , the IPv6 network access method provided in the embodiment of the present application, when applied to a domain name resolution server, includes:

步骤51,接收用户侧设备发送的请求消息,所述请求消息用于请求第一域名对应的IPv6地址。Step 51: Receive a request message sent by a user-side device, where the request message is used to request an IPv6 address corresponding to a first domain name.

这里,上述请求消息可以是DNS查询请求,其中包含有第一域名和类型4A(type:AAAA),以请求第一域名对应的IPv6地址。Here, the request message may be a DNS query request, which includes the first domain name and type 4A (type: AAAA) to request the IPv6 address corresponding to the first domain name.

步骤52,向所述用户侧设备发送响应消息,所述响应消息包含所述第一域名对应的第一IPv6地址和和所述第一IPv6地址的类型;其中,所述第一IPv6地址的类型包括:通过网络地址转换网关的第一IPv6地址前缀与第一域名对应的第一IPv4地址联合表示的第一类型;通过第一域名对应的独立IPv6地址表示的第二类型。Step 52, sending a response message to the user side device, the response message including the first IPv6 address corresponding to the first domain name and the type of the first IPv6 address; wherein the type of the first IPv6 address includes: a first type represented by the first IPv6 address prefix of the network address translation gateway and the first IPv4 address corresponding to the first domain name; a second type represented by an independent IPv6 address corresponding to the first domain name.

这里,所述响应消息可以是基于EDNS协议的DNS响应消息,所述第一IPv6地址的类型携带在所述DNS响应消息的OPT资源记录中的保留字段(Z字段)中,或者,携带在所述DNS响应消息的头Header部分的保留字段(Z字段)中。第一类型的第一IPv6地址是由网络地址转换网关的第一IPv6地址前缀与第一域名对应的第一IPv4地址拼接而成的IPv6地址。第二类型的第一IPv6地址则是为第一域名所分配的IPv6地址。Here, the response message may be a DNS response message based on the EDNS protocol, and the type of the first IPv6 address is carried in a reserved field (Z field) in the OPT resource record of the DNS response message, or carried in a reserved field (Z field) in the header portion of the DNS response message. The first IPv6 address of the first type is an IPv6 address formed by concatenating the first IPv6 address prefix of the network address translation gateway and the first IPv4 address corresponding to the first domain name. The first IPv6 address of the second type is an IPv6 address assigned to the first domain name.

具体的,所述域名解析服务器可以通过查询预先建立的域名、IPv6地址、IPv6地址的类型之间的对应关系,确定所述第一域名对应的第一IPv6地址和所述第一IPv6地址的类型。上述对应关系,可以是预先配置在域名解析服务器的。Specifically, the domain name resolution server can determine the first IPv6 address corresponding to the first domain name and the type of the first IPv6 address by querying the pre-established correspondence between the domain name, IPv6 address, and the type of the IPv6 address. The above correspondence can be pre-configured in the domain name resolution server.

通过以上步骤,实现了域名解析服务器将第一域名对应的第一IPv6地址的类型通知给用户侧设备,以帮助用户侧设备在第一IPv6地址为第一类型的情况下,建立无状态对应表项,以节约IPv4资源和用户侧设备资源。Through the above steps, the domain name resolution server notifies the user-side device of the type of the first IPv6 address corresponding to the first domain name, so as to help the user-side device establish a stateless corresponding table entry when the first IPv6 address is of the first type, so as to save IPv4 resources and user-side device resources.

以上从用户侧设备和域名解析服务器侧分别介绍了本申请实施例的相关方法。下面进一步结合图6和图7,通过设备间的交互流程的示例,对本申请实施例的以上方法作进一步的描述。其中,图6是针对域名对应的IPv6地址为第一类型的流程示例,图7是针对域名对应的IPv6地址为第二类型的流程示例。The above describes the relevant methods of the embodiments of the present application from the user side device and the domain name resolution server side. The following further describes the above methods of the embodiments of the present application by further combining Figures 6 and 7 through examples of the interaction process between devices. Among them, Figure 6 is an example of the process for the IPv6 address corresponding to the domain name as the first type, and Figure 7 is an example of the process for the IPv6 address corresponding to the domain name as the second type.

以下示例通过扩展DNS协议来解决相关的NAT46问题:The following example solves the NAT46 related issues by extending the DNS protocol:

CPE针对DNS服务器(DNS server)返回的AAAA记录,需要区分出该IPv6服务是直接通过纯IPv6服务器(对应于第二类型的IPv6地址)提供的,还是通过“NAT64+IPv4服务器”的方式(对应于第一类型的IPv6地址)提供的。对于前者还是使用有状态NAT46,而对于后者则可以使用无状态NAT46,这样既可以减少IPv4地址的浪费,又可以减轻CPE维护NAT会话表的压力,同时还能把真实的Ipv4服务器地址提供给终端(客户端)。For the AAAA record returned by the DNS server, the CPE needs to distinguish whether the IPv6 service is provided directly through a pure IPv6 server (corresponding to the second type of IPv6 address) or through a "NAT64+IPv4 server" (corresponding to the first type of IPv6 address). For the former, stateful NAT46 is still used, while for the latter, stateless NAT46 can be used, which can reduce the waste of IPv4 addresses and the pressure on the CPE to maintain the NAT session table, while providing the real IPv4 server address to the terminal (client).

具体的,通过扩展DNS协议,DNS server在通过DNS响应消息返回AAAA记录的同时,标识出该AAAA记录的服务器是哪种IPv6服务模式(即域名对应的IPv6地址的类型)。Specifically, by extending the DNS protocol, the DNS server identifies which IPv6 service mode the server of the AAAA record is (ie, the type of IPv6 address corresponding to the domain name) when returning the AAAA record through a DNS response message.

扩展方式一:EDNS扩展Extension method 1: EDNS extension

首先,如图8所示,需要在DNS响应消息的OPT资源记录中的“Z”字段(即保留字段)中,新增1比特(bit)作为“NAT”标识。当该bit置1时,表示“该AAAA记录提供的IPv6服务为:NAT64+IPv4模式”,即域名对应IPv6地址为上文的第一类型;当该bit置0时,表示“该AAAA记录提供的IPv6服务为:纯IPv6模式”,即域名对应IPv6地址为上文的第二类型。First, as shown in Figure 8, it is necessary to add a bit as a "NAT" identifier in the "Z" field (i.e., reserved field) in the OPT resource record of the DNS response message. When the bit is set to 1, it means "the IPv6 service provided by the AAAA record is: NAT64+IPv4 mode", that is, the domain name corresponds to the IPv6 address of the first type above; when the bit is set to 0, it means "the IPv6 service provided by the AAAA record is: pure IPv6 mode", that is, the domain name corresponds to the IPv6 address of the second type above.

EDNS扩展后,“NAT64+IPv4服务器”IPv6服务模式(即域名对应IPv6地址为上文的第一类型)的流程如图6所示,主要包括:After EDNS is extended, the process of the "NAT64+IPv4 server" IPv6 service mode (i.e., the domain name corresponding to the IPv6 address is the first type above) is shown in Figure 6, which mainly includes:

步骤a:终端发起DNS4查询请求,请求获取某域名的A记录(请求域名对应的IPv4地址)。Step a: The terminal initiates a DNS4 query request to obtain the A record of a domain name (the IPv4 address corresponding to the requested domain name).

步骤b:CPE接收到上述查询请求后,向DNS Server请求该域名的AAAA记录(请求域名对应的IPv6地址)。Step b: After receiving the query request, the CPE requests the AAAA record of the domain name (requesting the IPv6 address corresponding to the domain name) from the DNS Server.

步骤c:DNS Server返回该域名的AAAA记录,同时在OPT资源记录中的“NAT”标识位被置1。AAAA记录中包括的IPv6地址是由NAT64前缀与域名对应的IPv4地址1拼接而成的IPv6地址。Step c: The DNS Server returns the AAAA record of the domain name, and the "NAT" flag in the OPT resource record is set to 1. The IPv6 address included in the AAAA record is an IPv6 address formed by concatenating the NAT64 prefix and the IPv4 address 1 corresponding to the domain name.

步骤d:由于“NAT”位为1,CPE则进行无状态NAT46转换,即生成并保存NAT64前缀与该IPv4地址1的无状态对应表项。Step d: Since the "NAT" bit is 1, the CPE performs stateless NAT46 conversion, that is, generates and saves a stateless correspondence table entry between the NAT64 prefix and the IPv4 address 1.

步骤e:CPE向终端发送DNS4响应,返回该域名的A记录(IPv4地址1);Step e: The CPE sends a DNS4 response to the terminal, returning the A record of the domain name (IPv4 address 1);

步骤f:终端开启IPv4数据面访问:源地址为终端的IPv4私有地址,目的地址为IPv4地址1。Step f: The terminal enables IPv4 data plane access: the source address is the terminal's IPv4 private address, and the destination address is IPv4 address 1.

步骤g:CPE执行NAT46转换,源地址和目的地址的转换均为无状态NAT46转换:Step g: CPE performs NAT46 translation. The translation of source address and destination address are both stateless NAT46 translation:

源地址转换为:CPE的LAN侧IPv6前缀+IPv4私有地址;The source address is converted to: CPE LAN side IPv6 prefix + IPv4 private address;

目的地址转换为:NAT64前缀+IPv4地址1。The destination address is converted to: NAT64 prefix + IPv4 address 1.

步骤h:NAT46转换完毕后,开启IPv6数据面访问。Step h: After NAT46 conversion is completed, enable IPv6 data plane access.

EDNS扩展后,“纯IPv6服务器”IPv6服务模式(即域名对应IPv6地址为上文的第二类型)的流程如图7所示,包括:After EDNS is extended, the process of the "pure IPv6 server" IPv6 service mode (i.e., the domain name corresponding to the IPv6 address is the second type above) is shown in Figure 7, including:

步骤a:终端发起DNS4查询请求,请求获取某域名的A记录(请求域名对应的IPv4地址)。Step a: The terminal initiates a DNS4 query request to obtain the A record of a domain name (the IPv4 address corresponding to the requested domain name).

步骤b:CPE获取该查询请求后,向DNS Server请求该域名的AAAA记录(请求域名对应的IPv6地址)。Step b: After receiving the query request, the CPE requests the AAAA record of the domain name (the IPv6 address corresponding to the requested domain name) from the DNS Server.

步骤c:DNS Server返回该域名的AAAA记录,同时在OPT资源记录中的“NAT”标识位被置0。此时AAAA记录中包括的IPv6地址是域名对应的独立IPv6地址。Step c: The DNS Server returns the AAAA record of the domain name, and the "NAT" flag in the OPT resource record is set to 0. At this time, the IPv6 address included in the AAAA record is the independent IPv6 address corresponding to the domain name.

步骤d:由于“NAT”位为0,CPE则进行有状态NAT46转换,即根据配置的IPv4地址池,生成并保存有状态的NAT46表项:IPv4地址池中的IPv4地址1<->AAAA记录中的IPv6地址1。Step d: Since the "NAT" bit is 0, the CPE performs stateful NAT46 translation, that is, generates and saves a stateful NAT46 entry according to the configured IPv4 address pool: IPv4 address 1 in the IPv4 address pool <-> IPv6 address 1 in the AAAA record.

步骤e:CPE向终端发送DNS4响应,返回该域名的A记录(IPv4地址池中的IPv4地址1)。Step e: The CPE sends a DNS4 response to the terminal, returning the A record of the domain name (IPv4 address 1 in the IPv4 address pool).

步骤f:终端开启IPv4数据面访问:源地址为IPv4私有地址,目的地址为所述IPv4地址池中的IPv4地址1。Step f: The terminal enables IPv4 data plane access: the source address is an IPv4 private address, and the destination address is IPv4 address 1 in the IPv4 address pool.

步骤g:CPE执行NAT46转换,其中源地址为无状态NAT46转换,而目的地址则为有状态NAT46转换:Step g: CPE performs NAT46 translation, where the source address is stateless NAT46 translation and the destination address is stateful NAT46 translation:

源地址转换为:CPE的LAN侧IPv6前缀+IPv4私有地址;The source address is converted to: CPE LAN side IPv6 prefix + IPv4 private address;

目的地址转换为:AAAA记录中的IPv6地址1。The destination address is converted to: IPv6 address 1 in the AAAA record.

步骤8:NAT46转换完毕后,开启IPv6数据面访问。Step 8: After NAT46 conversion is completed, enable IPv6 data plane access.

作为EDNS扩展的另一种扩展方式,如图9所示,可以针对DNS响应消息的Header部分,将原有的3个保留位(Z字段)中的1个比特(bit)作为“NAT”标识。当该bit置1时,表示“该AAAA记录提供的IPv6服务为:NAT64+IPv4模式”,即域名对应IPv6地址为上文的第一类型;当该bit置0时,表示“该AAAA记录提供的IPv6服务为:纯IPv6模式”,即域名对应IPv6地址为上文的第二类型。As another extension method of EDNS extension, as shown in Figure 9, for the Header part of the DNS response message, one bit of the original three reserved bits (Z field) can be used as the "NAT" identifier. When the bit is set to 1, it means "the IPv6 service provided by the AAAA record is: NAT64+IPv4 mode", that is, the domain name corresponds to the IPv6 address of the first type above; when the bit is set to 0, it means "the IPv6 service provided by the AAAA record is: pure IPv6 mode", that is, the domain name corresponds to the IPv6 address of the second type above.

Header扩展后,两种IPv6服务模式的流程分别与图6和图7相类似,唯一区别是“NAT”标识位所处的位置不同。After the header is expanded, the processes of the two IPv6 service modes are similar to Figure 6 and Figure 7 respectively. The only difference is the location of the "NAT" flag.

以上介绍了本申请实施例的各种方法。下面将进一步提供实施上述方法的装置。The above describes various methods of the embodiments of the present application. The following further provides devices for implementing the above methods.

请参考图10,本申请实施例还提供一种用户侧设备,包括:Referring to FIG. 10 , the present embodiment further provides a user-side device, including:

第一接收模块1001,用于接收第一终端发送的第一请求消息,所述第一请求消息用于请求第一域名对应的IPv4地址;A first receiving module 1001 is used to receive a first request message sent by a first terminal, where the first request message is used to request an IPv4 address corresponding to a first domain name;

第一发送模块1002,用于向域名解析服务器发送第二请求消息,所述第二请求消息用于请求第一域名对应的IPv6地址;A first sending module 1002 is used to send a second request message to a domain name resolution server, where the second request message is used to request an IPv6 address corresponding to the first domain name;

第二接收模块1003,用于接收所述域名解析服务器发送的第一响应消息,所述第一响应消息包含所述第一域名对应的第一IPv6地址和所述第一IPv6地址的类型;其中,所述第一IPv6地址的类型包括:通过网络地址转换网关的第一IPv6地址前缀与第一域名对应的第一IPv4地址联合表示的第一类型;通过第一域名对应的独立IPv6地址表示的第二类型;The second receiving module 1003 is used to receive a first response message sent by the domain name resolution server, wherein the first response message includes a first IPv6 address corresponding to the first domain name and a type of the first IPv6 address; wherein the type of the first IPv6 address includes: a first type represented by a first IPv6 address prefix of a network address translation gateway and a first IPv4 address corresponding to the first domain name; and a second type represented by an independent IPv6 address corresponding to the first domain name;

第一处理模块1004,用于在所述第一IPv6地址为所述第一类型的情况下,生成所述第一IPv6地址前缀与所述第一IPv4地址的无状态对应表项,并向所述第一终端发送所述第一域名对应的第一IPv4地址。The first processing module 1004 is used to generate a stateless correspondence table entry between the first IPv6 address prefix and the first IPv4 address when the first IPv6 address is of the first type, and send the first IPv4 address corresponding to the first domain name to the first terminal.

通过以上模块,本申请实施例能够减少网络地址转换导致的IPv4地址的消耗,节约CPE资源。Through the above modules, the embodiment of the present application can reduce the consumption of IPv4 addresses caused by network address translation and save CPE resources.

可选的,上述用户侧设备还包括:Optionally, the user-side device further includes:

第三接收模块,用于接收第一访问请求,所述第一访问请求的目的地址为所述第一IPv4地址;A third receiving module, configured to receive a first access request, wherein the destination address of the first access request is the first IPv4 address;

第二处理模块,用于对所述第一访问请求进行第一地址转换处理,发送处理后的所述第一访问请求,其中,所述第一地址转换处理包括:The second processing module is configured to perform a first address conversion process on the first access request and send the processed first access request, wherein the first address conversion process includes:

根据所述无状态对应表项,将所述第一访问请求的目的地址转换为所述第一IPv6地址前缀与所述第一IPv4地址联合表示的第一IPv6地址。According to the stateless correspondence table entry, the destination address of the first access request is converted into a first IPv6 address jointly represented by the first IPv6 address prefix and the first IPv4 address.

可选的,所述第一访问请求的源地址为第二IPv4地址,所述第一地址转换处理还包括:Optionally, the source address of the first access request is a second IPv4 address, and the first address conversion process further includes:

将所述第一访问请求的源地址转换为用户侧设备的第二IPv6地址前缀与所述第二IPv4地址联合表示的第二IPv6地址。The source address of the first access request is converted into a second IPv6 address represented by a combination of a second IPv6 address prefix of the user-side device and the second IPv4 address.

可选的,上述用户侧设备还包括:Optionally, the user-side device further includes:

第三处理模块,用于在所述第一IPv6地址为所述第二类型的情况下,根据IPv4地址池中的第三IPv4地址,生成所述第三IPv4地址与所述第一IPv6地址的有状态对应表项,并向所述第一终端发送所述第一域名对应的所述第三IPv4地址。The third processing module is used to generate a stateful correspondence table entry between the third IPv4 address and the first IPv6 address according to the third IPv4 address in the IPv4 address pool when the first IPv6 address is of the second type, and send the third IPv4 address corresponding to the first domain name to the first terminal.

可选的,上述用户侧设备还包括:Optionally, the user-side device further includes:

第四接收模块,用于接收第二访问请求,所述第二访问请求的目的地址为所述第三IPv4地址;a fourth receiving module, configured to receive a second access request, wherein the destination address of the second access request is the third IPv4 address;

第四处理模块,用于对所述第二访问请求进行第二地址转换处理,发送处理后的所述第二访问请求,其中,所述第二地址转换处理包括:The fourth processing module is configured to perform a second address conversion process on the second access request and send the processed second access request, wherein the second address conversion process includes:

根据所述有状态对应表项,将所述第二访问请求的目的地址转换为所述第三IPv4地址对应的所述第一IPv6地址。According to the stateful corresponding table entry, the destination address of the second access request is converted into the first IPv6 address corresponding to the third IPv4 address.

可选的,所述第二访问请求的源地址为第二IPv4地址,所述第二地址转换处理还包括:Optionally, the source address of the second access request is a second IPv4 address, and the second address conversion process further includes:

将所述第二访问请求的源地址转换为用户侧设备的第二IPv6地址前缀与所述第二IPv4地址联合表示的第二IPv6地址。The source address of the second access request is converted into a second IPv6 address represented by a combination of a second IPv6 address prefix of the user-side device and the second IPv4 address.

可选的,所述第一响应消息为基于域名解析扩展EDNS协议的DNS响应消息,所述第一IPv6地址的类型携带在所述DNS响应消息的OPT资源记录中的保留字段中,或者,携带在所述DNS响应消息的头Header部分的保留字段中。Optionally, the first response message is a DNS response message based on the domain name resolution extended EDNS protocol, and the type of the first IPv6 address is carried in a reserved field in the OPT resource record of the DNS response message, or in a reserved field in the header part of the DNS response message.

需要说明的是,该实施例中的设备是与上述应用于用户侧设备的方法对应的设备,上述各实施例中的实现方式均适用于该设备的实施例中,也能达到相同的技术效果。本申请实施例提供的上述设备,能够实现上述方法实施例所实现的所有方法步骤,且能够达到相同的技术效果,在此不再对本实施例中与方法实施例相同的部分及有益效果进行具体赘述。It should be noted that the device in this embodiment is a device corresponding to the method applied to the user-side device, and the implementation methods in the above embodiments are all applicable to the embodiments of the device, and can also achieve the same technical effect. The above device provided in the embodiment of the present application can implement all the method steps implemented in the above method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as those in the method embodiment in this embodiment will not be specifically described here.

请参考图11,本申请实施例还提供一种终端1100,包括:收发机1101和处理器1102;Please refer to FIG11 , an embodiment of the present application further provides a terminal 1100 , including: a transceiver 1101 and a processor 1102 ;

所述收发机1101,用于接收第一终端发送的第一请求消息,所述第一请求消息用于请求第一域名对应的IPv4地址;向域名解析服务器发送第二请求消息,所述第二请求消息用于请求第一域名对应的IPv6地址;接收所述域名解析服务器发送的第一响应消息,所述第一响应消息包含所述第一域名对应的第一IPv6地址和所述第一IPv6地址的类型;其中,所述第一IPv6地址的类型包括:通过网络地址转换网关的第一IPv6地址前缀与第一域名对应的第一IPv4地址联合表示的第一类型;通过第一域名对应的独立IPv6地址表示的第二类型;The transceiver 1101 is configured to receive a first request message sent by a first terminal, wherein the first request message is used to request an IPv4 address corresponding to a first domain name; send a second request message to a domain name resolution server, wherein the second request message is used to request an IPv6 address corresponding to the first domain name; receive a first response message sent by the domain name resolution server, wherein the first response message includes a first IPv6 address corresponding to the first domain name and a type of the first IPv6 address; wherein the type of the first IPv6 address includes: a first type jointly represented by a first IPv6 address prefix of a network address translation gateway and a first IPv4 address corresponding to the first domain name; and a second type represented by an independent IPv6 address corresponding to the first domain name;

所述处理器1102,用于在所述第一IPv6地址为所述第一类型的情况下,生成所述第一IPv6地址前缀与所述第一IPv4地址的无状态对应表项,并向所述第一终端发送所述第一域名对应的第一IPv4地址。The processor 1102 is configured to generate a stateless correspondence table entry between the first IPv6 address prefix and the first IPv4 address when the first IPv6 address is of the first type, and send the first IPv4 address corresponding to the first domain name to the first terminal.

可选的,所述收发机,还用于接收第一访问请求,所述第一访问请求的目的地址为所述第一IPv4地址;Optionally, the transceiver is further used to receive a first access request, where the destination address of the first access request is the first IPv4 address;

所述处理器,还用于对所述第一访问请求进行第一地址转换处理,发送处理后的所述第一访问请求,其中,所述第一地址转换处理包括:The processor is further configured to perform a first address conversion process on the first access request and send the processed first access request, wherein the first address conversion process includes:

根据所述无状态对应表项,将所述第一访问请求的目的地址转换为所述第一IPv6地址前缀与所述第一IPv4地址联合表示的第一IPv6地址。According to the stateless correspondence table entry, the destination address of the first access request is converted into a first IPv6 address jointly represented by the first IPv6 address prefix and the first IPv4 address.

可选的,所述第一访问请求的源地址为第二IPv4地址,所述第一地址转换处理还包括:Optionally, the source address of the first access request is a second IPv4 address, and the first address conversion process further includes:

将所述第一访问请求的源地址转换为用户侧设备的第二IPv6地址前缀与所述第二IPv4地址联合表示的第二IPv6地址。The source address of the first access request is converted into a second IPv6 address represented by a combination of a second IPv6 address prefix of the user-side device and the second IPv4 address.

可选的,所述处理器,还用于在所述第一IPv6地址为所述第二类型的情况下,根据IPv4地址池中的第三IPv4地址,生成所述第三IPv4地址与所述第一IPv6地址的有状态对应表项,并向所述第一终端发送所述第一域名对应的所述第三IPv4地址。Optionally, the processor is also used to generate a stateful correspondence table entry between the third IPv4 address and the first IPv6 address according to a third IPv4 address in the IPv4 address pool when the first IPv6 address is of the second type, and send the third IPv4 address corresponding to the first domain name to the first terminal.

可选的,所述收发机,还用于接收第二访问请求,所述第二访问请求的目的地址为所述第三IPv4地址;Optionally, the transceiver is further used to receive a second access request, the destination address of the second access request being the third IPv4 address;

所述处理器,还用于对所述第二访问请求进行第二地址转换处理,发送处理后的所述第二访问请求,其中,所述第二地址转换处理包括:The processor is further configured to perform a second address conversion process on the second access request, and send the processed second access request, wherein the second address conversion process includes:

根据所述有状态对应表项,将所述第二访问请求的目的地址转换为所述第三IPv4地址对应的所述第一IPv6地址。According to the stateful corresponding table entry, the destination address of the second access request is converted into the first IPv6 address corresponding to the third IPv4 address.

可选的,所述第二访问请求的源地址为第二IPv4地址,所述第二地址转换处理还包括:Optionally, the source address of the second access request is a second IPv4 address, and the second address conversion process further includes:

将所述第二访问请求的源地址转换为用户侧设备的第二IPv6地址前缀与所述第二IPv4地址联合表示的第二IPv6地址。The source address of the second access request is converted into a second IPv6 address represented by a combination of a second IPv6 address prefix of the user-side device and the second IPv4 address.

可选的,所述第一响应消息为基于域名解析扩展EDNS协议的DNS响应消息,所述第一IPv6地址的类型携带在所述DNS响应消息的OPT资源记录中的保留字段中,或者,携带在所述DNS响应消息的头Header部分的保留字段中。Optionally, the first response message is a DNS response message based on the domain name resolution extended EDNS protocol, and the type of the first IPv6 address is carried in a reserved field in the OPT resource record of the DNS response message, or in a reserved field in the header part of the DNS response message.

需要说明的是,该实施例中的设备是与上述应用于用户侧设备的方法对应的设备,上述各实施例中的实现方式均适用于该设备的实施例中,也能达到相同的技术效果。本申请实施例提供的上述设备,能够实现上述方法实施例所实现的所有方法步骤,且能够达到相同的技术效果,在此不再对本实施例中与方法实施例相同的部分及有益效果进行具体赘述。It should be noted that the device in this embodiment is a device corresponding to the method applied to the user-side device, and the implementation methods in the above embodiments are all applicable to the embodiments of the device, and can also achieve the same technical effect. The above device provided in the embodiment of the present application can implement all the method steps implemented in the above method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as those in the method embodiment in this embodiment will not be specifically described here.

请参考图12,本申请实施例还提供一种域名解析服务器,包括:Referring to FIG. 12 , the embodiment of the present application further provides a domain name resolution server, including:

第一接收模块1201,用于设备发送的请求消息,所述请求消息用于请求第一域名对应的IPv6地址;A first receiving module 1201 is used for a request message sent by a device, where the request message is used to request an IPv6 address corresponding to a first domain name;

第一发送模块1202,用于向所述用户侧设备发送响应消息,所述响应消息包含所述第一域名对应的第一IPv6地址和和所述第一IPv6地址的类型;A first sending module 1202 is configured to send a response message to the user-side device, where the response message includes a first IPv6 address corresponding to the first domain name and a type of the first IPv6 address;

其中,所述第一IPv6地址的类型包括:通过网络地址转换网关的第一IPv6地址前缀与第一域名对应的第一IPv4地址联合表示的第一类型;通过第一域名对应的独立IPv6地址表示的第二类型。Among them, the types of the first IPv6 address include: a first type represented by the first IPv6 address prefix of the network address translation gateway and the first IPv4 address corresponding to the first domain name; and a second type represented by an independent IPv6 address corresponding to the first domain name.

通过以上模块,本申请实施例减少了网络地址转换导致的IPv4地址的消耗,节约CPE资源。Through the above modules, the embodiment of the present application reduces the consumption of IPv4 addresses caused by network address translation and saves CPE resources.

可选的,所述响应消息为基于域名解析扩展EDNS协议的DNS响应消息,所述第一IPv6地址的类型携带在所述DNS响应消息的OPT资源记录中的保留字段中,或者,携带在所述DNS响应消息的头Header部分的保留字段中。Optionally, the response message is a DNS response message based on the domain name resolution extended EDNS protocol, and the type of the first IPv6 address is carried in a reserved field in the OPT resource record of the DNS response message, or in a reserved field in the header part of the DNS response message.

可选的,上述域名解析服务器,还包括:Optionally, the domain name resolution server further includes:

查询模块,用于查询预先建立的域名、IPv6地址、IPv6地址的类型之间的对应关系,确定所述第一域名对应的第一IPv6地址和所述第一IPv6地址的类型。The query module is used to query the pre-established correspondence between the domain name, IPv6 address, and the type of IPv6 address, and determine the first IPv6 address corresponding to the first domain name and the type of the first IPv6 address.

需要说明的是,该实施例中的设备是与上述应用于域名解析服务器侧的方法对应的设备,上述各实施例中的实现方式均适用于该设备的实施例中,也能达到相同的技术效果。本申请实施例提供的上述设备,能够实现上述方法实施例所实现的所有方法步骤,且能够达到相同的技术效果,在此不再对本实施例中与方法实施例相同的部分及有益效果进行具体赘述。It should be noted that the device in this embodiment is a device corresponding to the method applied to the domain name resolution server side, and the implementation methods in the above embodiments are all applicable to the embodiments of the device, and can also achieve the same technical effects. The above device provided in the embodiment of the present application can implement all the method steps implemented in the above method embodiment, and can achieve the same technical effects. The parts and beneficial effects that are the same as those in the method embodiment in this embodiment will not be specifically described here.

请参考图13,本申请实施例还提供一种域名解析服务器1300,包括:收发机1301和处理器1302;Please refer to FIG. 13 , the embodiment of the present application further provides a domain name resolution server 1300 , including: a transceiver 1301 and a processor 1302 ;

所述收发机1301,用于接收用户侧设备发送的请求消息,所述请求消息用于请求第一域名对应的IPv6地址;向所述用户侧设备发送响应消息,所述响应消息包含所述第一域名对应的第一IPv6地址和和所述第一IPv6地址的类型;The transceiver 1301 is configured to receive a request message sent by a user-side device, the request message being used to request an IPv6 address corresponding to a first domain name; and send a response message to the user-side device, the response message including a first IPv6 address corresponding to the first domain name and a type of the first IPv6 address;

其中,所述第一IPv6地址的类型包括:通过网络地址转换网关的第一IPv6地址前缀与第一域名对应的第一IPv4地址联合表示的第一类型;通过第一域名对应的独立IPv6地址表示的第二类型。Among them, the types of the first IPv6 address include: a first type represented by the first IPv6 address prefix of the network address translation gateway and the first IPv4 address corresponding to the first domain name; and a second type represented by an independent IPv6 address corresponding to the first domain name.

可选的,所述响应消息为基于域名解析扩展EDNS协议的DNS响应消息,所述第一IPv6地址的类型携带在所述DNS响应消息的OPT资源记录中的保留字段中,或者,携带在所述DNS响应消息的头Header部分的保留字段中。Optionally, the response message is a DNS response message based on the domain name resolution extended EDNS protocol, and the type of the first IPv6 address is carried in a reserved field in the OPT resource record of the DNS response message, or in a reserved field in the header part of the DNS response message.

可选的,所述处理器用于在向所述用户侧设备发送响应消息之前,查询预先建立的域名、IPv6地址、IPv6地址的类型之间的对应关系,确定所述第一域名对应的第一IPv6地址和所述第一IPv6地址的类型。Optionally, the processor is used to query the pre-established correspondence between the domain name, IPv6 address, and IPv6 address type before sending a response message to the user-side device, and determine the first IPv6 address corresponding to the first domain name and the type of the first IPv6 address.

需要说明的是,该实施例中的设备是与上述应用于域名解析服务器侧的方法对应的设备,上述各实施例中的实现方式均适用于该设备的实施例中,也能达到相同的技术效果。本申请实施例提供的上述设备,能够实现上述方法实施例所实现的所有方法步骤,且能够达到相同的技术效果,在此不再对本实施例中与方法实施例相同的部分及有益效果进行具体赘述。It should be noted that the device in this embodiment is a device corresponding to the method applied to the domain name resolution server side, and the implementation methods in the above embodiments are all applicable to the embodiments of the device, and can also achieve the same technical effects. The above device provided in the embodiment of the present application can implement all the method steps implemented in the above method embodiment, and can achieve the same technical effects. The parts and beneficial effects that are the same as those in the method embodiment in this embodiment will not be specifically described here.

请参考图14,本申请实施例还提供一种用户侧设备1400,包括处理器1401,存储器1402,存储在存储器1402上并可在所述处理器1401上运行的计算机程序,该计算机程序被处理器1401执行时实现上述由用户侧设备执行的IPv6网络的访问方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Please refer to Figure 14. An embodiment of the present application also provides a user-side device 1400, including a processor 1401, a memory 1402, and a computer program stored in the memory 1402 and executable on the processor 1401. When the computer program is executed by the processor 1401, each process of the above-mentioned IPv6 network access method embodiment executed by the user-side device is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

请参考图15,本申请实施例还提供一种域名解析服务器1500,包括处理器1501,存储器1502,存储在存储器1502上并可在所述处理器1501上运行的计算机程序,该计算机程序被处理器1501执行时实现上述由域名解析服务器执行的IPv6网络的访问方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Please refer to Figure 15. An embodiment of the present application also provides a domain name resolution server 1500, including a processor 1501, a memory 1502, and a computer program stored in the memory 1502 and executable on the processor 1501. When the computer program is executed by the processor 1501, each process of the above-mentioned IPv6 network access method embodiment executed by the domain name resolution server is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现上述IPv6网络的访问方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,所述的计算机可读存储介质,如只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned IPv6 network access method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

需要说明的是,在本文中,术语“包括”、“中包含”或者其任何其他变体意在涵盖非排他性的中包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, in this article, the terms "include", "include" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims (23)

1. An access method of an IPv6 network, applied to a user side device, is characterized by comprising:
Receiving a first request message sent by a first terminal, wherein the first request message is used for requesting an IPv4 address corresponding to a first domain name;
Sending a second request message to a domain name resolution server, wherein the second request message is used for requesting an IPv6 address corresponding to the first domain name;
Receiving a first response message sent by the domain name resolution server, wherein the first response message comprises a first IPv6 address corresponding to the first domain name and the type of the first IPv6 address; wherein, the types of the first IPv6 address include: a first type jointly represented by a first IPv6 address prefix of the network address translation gateway and a first IPv4 address corresponding to the first domain name; a second type represented by an independent IPv6 address corresponding to the first domain name;
And under the condition that the first IPv6 address is of the first type, generating a stateless corresponding table entry of the first IPv6 address prefix and the first IPv4 address, and sending the first IPv4 address corresponding to the first domain name to the first terminal.
2. The method as recited in claim 1, further comprising:
receiving a first access request, wherein the destination address of the first access request is the first IPv4 address;
performing first address conversion processing on the first access request, and sending the processed first access request, wherein the first address conversion processing comprises:
And converting the destination address of the first access request into a first IPv6 address which is jointly represented by the first IPv6 address prefix and the first IPv4 address according to the stateless corresponding table entry.
3. The method of claim 2, wherein the source address of the first access request is a second IPv4 address, and wherein the first address translation process further comprises:
and converting the source address of the first access request into a second IPv6 address which is jointly represented by a second IPv6 address prefix of the user side device and the second IPv4 address.
4. A method according to any one of claims 1 to 3, further comprising:
And under the condition that the first IPv6 address is of the second type, generating a stateful corresponding table entry of the third IPv4 address and the first IPv6 address according to the third IPv4 address in the IPv4 address pool, and sending the third IPv4 address corresponding to the first domain name to the first terminal.
5. The method as recited in claim 4, further comprising:
Receiving a second access request, wherein the destination address of the second access request is the third IPv4 address;
performing second address conversion processing on the second access request, and sending the processed second access request, wherein the second address conversion processing includes:
and converting the destination address of the second access request into the first IPv6 address corresponding to the third IPv4 address according to the stateful corresponding table entry.
6. The method of claim 5, wherein the source address of the second access request is a second IPv4 address, and wherein the second address translation process further comprises:
And converting the source address of the second access request into a second IPv6 address which is jointly represented by a second IPv6 address prefix of the user side device and the second IPv4 address.
7. The method of claim 1, wherein the step of determining the position of the substrate comprises,
The first response message is a DNS response message based on the domain name resolution extension EDNS protocol, and the type of the first IPv6 address is carried in a reserved field in an OPT resource record of the DNS response message or in a reserved field of a Header portion of the DNS response message.
8. An access method of an IPv6 network, applied to a domain name resolution server, is characterized by comprising:
receiving a request message sent by user side equipment, wherein the request message is used for requesting an IPv6 address corresponding to a first domain name;
Transmitting a response message to the user side equipment, wherein the response message comprises a first IPv6 address corresponding to the first domain name and the type of the first IPv6 address;
Wherein, the types of the first IPv6 address include: a first type jointly represented by a first IPv6 address prefix of the network address translation gateway and a first IPv4 address corresponding to the first domain name; and a second type represented by an independent IPv6 address corresponding to the first domain name.
9. The method of claim 8, wherein the step of determining the position of the first electrode is performed,
The response message is a DNS response message based on the domain name resolution extension EDNS protocol, and the type of the first IPv6 address is carried in a reserved field in an OPT resource record of the DNS response message or in a reserved field of a Header portion of the DNS response message.
10. The method of claim 8, wherein prior to sending a response message to the user-side device, the method further comprises:
Inquiring a pre-established corresponding relation among the domain name, the IPv6 address and the type of the IPv6 address, and determining a first IPv6 address corresponding to the first domain name and the type of the first IPv6 address.
11. A user side device comprising a transceiver and a processor, wherein,
The transceiver is configured to receive a first request message sent by a first terminal, where the first request message is used to request an IPv4 address corresponding to a first domain name; sending a second request message to a domain name resolution server, wherein the second request message is used for requesting an IPv6 address corresponding to the first domain name; receiving a first response message sent by the domain name resolution server, wherein the first response message comprises a first IPv6 address corresponding to the first domain name and the type of the first IPv6 address; wherein, the types of the first IPv6 address include: a first type jointly represented by a first IPv6 address prefix of the network address translation gateway and a first IPv4 address corresponding to the first domain name; a second type represented by an independent IPv6 address corresponding to the first domain name;
The processor is configured to generate a stateless corresponding entry of the first IPv6 address prefix and the first IPv4 address, and send the first IPv4 address corresponding to the first domain name to the first terminal, where the first IPv6 address is of the first type.
12. The apparatus of claim 11, wherein the user side device,
The transceiver is further configured to receive a first access request, where a destination address of the first access request is the first IPv4 address;
the processor is further configured to perform a first address conversion process on the first access request, and send the processed first access request, where the first address conversion process includes:
And converting the destination address of the first access request into a first IPv6 address which is jointly represented by the first IPv6 address prefix and the first IPv4 address according to the stateless corresponding table entry.
13. The user side device of claim 12, wherein the source address of the first access request is a second IPv4 address, and wherein the first address translation process further comprises:
and converting the source address of the first access request into a second IPv6 address which is jointly represented by a second IPv6 address prefix of the user side device and the second IPv4 address.
14. The user side device according to any of the claims 11 to 13, characterized in that,
The processor is further configured to generate, when the first IPv6 address is of the second type, a stateful correspondence table entry between the third IPv4 address and the first IPv6 address according to a third IPv4 address in an IPv4 address pool, and send the third IPv4 address corresponding to the first domain name to the first terminal.
15. The apparatus of claim 14, wherein the user side device,
The transceiver is further configured to receive a second access request, where a destination address of the second access request is the third IPv4 address;
The processor is further configured to perform a second address conversion process on the second access request, and send the processed second access request, where the second address conversion process includes:
and converting the destination address of the second access request into the first IPv6 address corresponding to the third IPv4 address according to the stateful corresponding table entry.
16. The user side device of claim 15, wherein the source address of the second access request is a second IPv4 address, and wherein the second address translation process further comprises:
And converting the source address of the second access request into a second IPv6 address which is jointly represented by a second IPv6 address prefix of the user side device and the second IPv4 address.
17. The apparatus of claim 11, wherein the user side device,
The first response message is a DNS response message based on the domain name resolution extension EDNS protocol, and the type of the first IPv6 address is carried in a reserved field in an OPT resource record of the DNS response message or in a reserved field of a Header portion of the DNS response message.
18. A user-side device, comprising: a processor, a memory and a program stored on the memory and executable on the processor, which when executed by the processor, performs the steps of the method according to any one of claims 1 to 7.
19. A domain name resolution server comprising a transceiver and a processor, wherein,
The transceiver is configured to receive a request message sent by a user side device, where the request message is used to request an IPv6 address corresponding to the first domain name;
Transmitting a response message to the user side equipment, wherein the response message comprises a first IPv6 address corresponding to the first domain name and the type of the first IPv6 address;
Wherein, the types of the first IPv6 address include: a first type jointly represented by a first IPv6 address prefix of the network address translation gateway and a first IPv4 address corresponding to the first domain name; and a second type represented by an independent IPv6 address corresponding to the first domain name.
20. The domain name resolution server of claim 19, wherein the domain name resolution server is configured to,
The response message is a DNS response message based on the domain name resolution extension EDNS protocol, and the type of the first IPv6 address is carried in a reserved field in an OPT resource record of the DNS response message or in a reserved field of a Header portion of the DNS response message.
21. The domain name resolution server of claim 19, wherein the domain name resolution server is configured to,
The processor is configured to query a correspondence between a domain name, an IPv6 address, and a type of the IPv6 address, which are established in advance, before sending a response message to the user side device, and determine a first IPv6 address corresponding to the first domain name and the type of the first IPv6 address.
22. A domain name resolution server, comprising: a processor, a memory and a program stored on the memory and executable on the processor, which when executed by the processor performs the steps of the method according to any one of claims 8 to 10.
23. A computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 10.
CN202311199488.0A 2023-09-18 2023-09-18 IPv6 network access method, device and storage medium Pending CN118827824A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311199488.0A CN118827824A (en) 2023-09-18 2023-09-18 IPv6 network access method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311199488.0A CN118827824A (en) 2023-09-18 2023-09-18 IPv6 network access method, device and storage medium

Publications (1)

Publication Number Publication Date
CN118827824A true CN118827824A (en) 2024-10-22

Family

ID=93084293

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311199488.0A Pending CN118827824A (en) 2023-09-18 2023-09-18 IPv6 network access method, device and storage medium

Country Status (1)

Country Link
CN (1) CN118827824A (en)

Similar Documents

Publication Publication Date Title
JP5551247B2 (en) Method and host node for multi-NAT64 environment
CN100512522C (en) Mobile terminal equipment and packet communication method between terminals
CN104734963B (en) A kind of IPv4 and IPv6 network interconnecting methods based on SDN
JP3972733B2 (en) Address translation device, address translation system, and SIP server
US7937471B2 (en) Creating a public identity for an entity on a network
US20130173757A1 (en) Method, System, Push Client, and User Equipment for Service Communication
CN102158563B (en) Method, system and device for acquiring IPv6 (Internet Protocol Version 6) configuration information from IPv6 transition network
JP2001527331A (en) Ways to support mobility on the Internet
KR20090057025A (en) How to discover an outbound SIP proxy server
CN110995886B (en) Network address management method, device, electronic equipment and medium
JP2001285357A (en) Multicast communication method
WO2010108431A1 (en) Method for realizing ipv6 host visting ipv4 host, method for obtaining ipv6 address prefix and translation device
US20060153230A1 (en) IPv6 / IPv4 translator
CN110691150A (en) SDN-based IPv4 and IPv6 interconnection method and system
JP3344238B2 (en) IPv4-IPv6 communication method and IPv4-IPv6 translation device
CN116800710A (en) network communication system
US7440466B2 (en) Method, apparatus and system for accessing multiple nodes on a private network
CN104935682A (en) A domain name resolution method and system
CN115668889A (en) Domain Name System (DNS) service for Variable Length Address (VLA) networks
CN105939398B (en) IPv6 transition method and device
CN104935677B (en) A NAT64 resource acquisition method and acquisition/allocation device
CN115250289B (en) Service routing method and device
CN118827824A (en) IPv6 network access method, device and storage medium
CN101572729B (en) A method for processing virtual private network node information and related equipment and system
JP3864397B2 (en) User edge router, gateway router, multihoming communication system, multihoming communication method, and multihoming communication program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination