CN1691664A - Conversion Method of ICMP Error Message in PAT Mode in NAT-PT Gateway - Google Patents
Conversion Method of ICMP Error Message in PAT Mode in NAT-PT Gateway Download PDFInfo
- Publication number
- CN1691664A CN1691664A CN 200410037011 CN200410037011A CN1691664A CN 1691664 A CN1691664 A CN 1691664A CN 200410037011 CN200410037011 CN 200410037011 CN 200410037011 A CN200410037011 A CN 200410037011A CN 1691664 A CN1691664 A CN 1691664A
- Authority
- CN
- China
- Prior art keywords
- error message
- address
- nat
- ipv4
- ipv6
- 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.)
- Granted
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Small-Scale Networks (AREA)
Abstract
Description
技术领域technical field
本发明涉及网络通信技术领域,尤其涉及一种NAT-PT(网间地址转换协议)中PAT(基于端口号的地址转换)模式下ICMP(网间控制报文协议)差错报文的转换方法。The invention relates to the technical field of network communication, in particular to a method for converting ICMP (Internet Control Message Protocol) error messages in PAT (Port Number-Based Address Translation) mode in NAT-PT (Internet Address Translation Protocol).
背景技术Background technique
目前数据网络中以IPv4(互联网协议第四版)技术为主导,随着网络规模的扩大,IPv6(互联网协议第六版)技术以其庞大的地址空间等优势将逐渐取代目前的IPv4技术。然而,这种彻底的取代需要长期的过程。在这个长期的由IPv4技术向IPv6技术演进的过程中,为了共享网络资源,必须要解决IPv4网络和IPv6网络互通的问题,也就是使IPv6网络中的节点与IPv4网络中的节点可以互访,反之亦然。NAT-PT技术提供了一种主要的解决方案,该协议规范由RFC2766(RFC,请求注解)定义。The current data network is dominated by IPv4 (Internet Protocol Version 4) technology. With the expansion of network scale, IPv6 (Internet Protocol Version 6) technology will gradually replace the current IPv4 technology with its advantages such as huge address space. However, such a thorough replacement requires a long-term process. In this long-term evolution process from IPv4 technology to IPv6 technology, in order to share network resources, it is necessary to solve the problem of intercommunication between IPv4 network and IPv6 network, that is, to enable nodes in the IPv6 network and nodes in the IPv4 network to communicate with each other. vice versa. The NAT-PT technology provides a major solution, and the protocol specification is defined by RFC2766 (RFC, Request for Comments).
NAT-PT网关便是在IPv6网络和IPv4网络之间设置的基于NAT-PT实现的网关设备。在IPv6网络节点与IPv4网络节点相互通信时,NAT-PT网关将往来的IPv6报文和IPv4报文进行相互转换,以适应对端的IP(互联网协议)类型。所述的转换通常包括IP地址的转换以及协议的转换,例如,进行IPv4报文头和IPv6报文头的协议转换。A NAT-PT gateway is a NAT-PT-based gateway device set between an IPv6 network and an IPv4 network. When the IPv6 network node and the IPv4 network node communicate with each other, the NAT-PT gateway converts the IPv6 message and the IPv4 message between them, so as to adapt to the IP (Internet Protocol) type of the opposite end. The conversion generally includes IP address conversion and protocol conversion, for example, protocol conversion between IPv4 message header and IPv6 message header.
所述的转换的处理过程如图1所示,在报文转换过程中,需要用可标识的IPv4地址替换IPv6地址的问题,方法是从IPv4地址池中分配临时的IPv4地址来映射IPv6地址。对于用IPv6地址替换IPv4地址的问题,方式是分配专门的IPv6前缀,称为NAT-PT前缀,用前缀+IPv4地址构成新的IPv6地址来映射原来的IPv4地址。The processing process of the conversion is shown in Figure 1. In the message conversion process, it is necessary to replace the IPv6 address with an identifiable IPv4 address. The method is to allocate a temporary IPv4 address from the IPv4 address pool to map the IPv6 address. For the problem of replacing IPv4 addresses with IPv6 addresses, the method is to assign a special IPv6 prefix, called NAT-PT prefix, and use the prefix + IPv4 address to form a new IPv6 address to map the original IPv4 address.
下面以一个实例描述NAT-PT的转换处理过程:The following uses an example to describe the conversion process of NAT-PT:
从I Pv6网络中的节点发向IPv4网络中的节点的IPv6报文到达NAT-PT网关,首先进行IP地址转换,然后进行协议转换,具体包括:The IPv6 message sent from the node in the IPv6 network to the node in the IPv4 network arrives at the NAT-PT gateway, first performs IP address conversion, and then performs protocol conversion, specifically including:
将IPv6报文头被转换成IPv4报文头;The IPv6 packet header is converted into an IPv4 packet header;
传输层报头经过校验和调整或端口转换后成为IPv4报文的传输层报头;The transport layer header becomes the transport layer header of the IPv4 packet after checksum adjustment or port translation;
报文数据正文中的应用层协议报文在经过应用层ALG的处理后(即如果包含IP地址,可能需要IP地址转换),成为IPv4的报文数据正文。After the application layer protocol message in the message data body is processed by the application layer ALG (that is, if it contains an IP address, IP address translation may be required), it becomes the IPv4 message data body.
从IPv4节点发向IPv6节点的IPv4报文到达NAT-PT网关,首先进行IPv4地址到I Pv6地址的转换,然后进行协议转换,具体包括:When an IPv4 message sent from an IPv4 node to an IPv6 node arrives at the NAT-PT gateway, it first converts the IPv4 address to the IPv6 address, and then performs protocol conversion, including:
IPv4报文头被转换成IPv6报文头;The IPv4 header is converted to an IPv6 header;
IPv4报文中的传输层报头经过校验和调整或端口转换后成为IPv6报文的传输层报头;The transport layer header in the IPv4 message becomes the transport layer header of the IPv6 message after checksum adjustment or port translation;
报文数据正文中的应用层协议报文在经过应用层ALG的处理后(即如果包含IP地址,可能需要IP地址转换),成为IPv6的报文数据正文。After the application layer protocol message in the message data body is processed by the application layer ALG (that is, if it contains an IP address, IP address translation may be required), it becomes the IPv6 message data body.
报文协议转换的具体细节,NAT-PT协议要求遵循SIIT(报头转换协议)协议规范。For specific details of packet protocol conversion, the NAT-PT protocol requires compliance with the SIIT (Header Transformation Protocol) protocol specification.
在NAT-PT报文协议转换过程中,存在以下情况,如图2所示,IPv6网络中的源节点发送原始报文到IPv4网络中的目的节点,经过NAT-PT网关时被转换为IPv4报文,该IPv4报文到达IPv4网络的中间节点时,发生错误(如目的地不可达等),由该中间节点产生ICMPv4(基于IPv4的ICMP)差错报文发回给IPv6源节点,ICMPv4差错报文中包含出错IPv4报文(即NAT-PT网关转换后的IPv4原始报文)。ICMPv4差错报文的IPv4报文头称为外部IP报文头,而后面包含的IPv4原始报文中的IPv4报文头称为内部IP报文头。In the NAT-PT message protocol conversion process, there are the following situations. As shown in Figure 2, the source node in the IPv6 network sends the original message to the destination node in the IPv4 network, and it is converted into an IPv4 message when passing through the NAT-PT gateway. When the IPv4 message arrives at the intermediate node of the IPv4 network, an error occurs (such as the destination is unreachable, etc.), the intermediate node generates an ICMPv4 (IPv4-based ICMP) error message and sends it back to the IPv6 source node, and the ICMPv4 error report The text contains an error IPv4 message (that is, the IPv4 original message converted by the NAT-PT gateway). The IPv4 header of an ICMPv4 error packet is called the outer IP header, and the IPv4 header in the original IPv4 packet included later is called the inner IP header.
当ICMPv4差错报文返回到NAT-PT网关时,需要转换成IPv6的协议类型的ICMPv6差错报文。要求外部IPv4报文头,ICMPv4报头,以及内部IPv4报文头和传输层都需要转换为相应的IPv6协议类型。When the ICMPv4 error message is returned to the NAT-PT gateway, it needs to be converted into an ICMPv6 error message of the IPv6 protocol type. It is required that the external IPv4 packet header, ICMPv4 header, and the internal IPv4 packet header and transport layer need to be converted to the corresponding IPv6 protocol type.
对于外部IPv4报文头和内部IPv4报文头的转换,均需要根据IPv4到IPv6地址的映射关系,进行源地址和目的地址的转换。但是对于NAT-PT的节省IPv4地址的PAT地址转换方式,因为需要根据地址+传输层的端口号进行转换,导致地址对所述的ICMP差错报文无法进行转换处理。在IPv6原始报文通过NAT-PT网关时,进行PAT地址转换,将IPv6源地址+IPv6源端口转换为IPv4源地址+I Pv4源端口(假设为ADDR4+PORT4)。当中间节点产生的ICMPv4差错报文返回经过NAT-PT网关时,对于IPv4报头需要根据IPv4目的地址+IPv4目的端口(此时为ADDR4+PORT4),确定需要转换的IPv6目的地址。但对于外部I Pv4报头,由于传输层已不是原始报文的传输层,而是ICMPv4报头,所以没有所需的目的端口信息,也就无法确定应该转换的IPv6目的地址,因此,所述的ICMP差错报文无法返回到I Pv6网络中的源节点。这样,便无法保证在IPv4网络与IPv6网络互通的过程中对差错的控制处理。For the conversion of the external IPv4 message header and the internal IPv4 message header, it is necessary to convert the source address and the destination address according to the mapping relationship between IPv4 and IPv6 addresses. However, for the PAT address translation method of NAT-PT to save IPv4 addresses, because it needs to be translated according to the address+port number of the transport layer, the address pair cannot be converted to the ICMP error message. When the original IPv6 message passes through the NAT-PT gateway, PAT address translation is performed to convert the IPv6 source address+IPv6 source port into IPv4 source address+IPv4 source port (assumed to be ADDR4+PORT4). When the ICMPv4 error message generated by the intermediate node returns through the NAT-PT gateway, the IPv4 header needs to determine the IPv6 destination address to be converted according to the IPv4 destination address+IPv4 destination port (ADDR4+PORT4 at this time). But for the external IPv4 header, because the transport layer is not the transport layer of the original message, but the ICMPv4 header, there is no required destination port information, and the IPv6 destination address that should be converted cannot be determined. Therefore, the ICMP Error messages cannot be returned to the source node in the IPv6 network. In this way, it is impossible to guarantee the control and processing of errors during the intercommunication process between the IPv4 network and the IPv6 network.
发明内容Contents of the invention
本发明的目的是提供一种NAT-PT网关中PAT模式下ICMP差错报文的转换方法,从而实现了在IPv4网络与IPv6网络互通的过程中可以对出现的差错进行控制处理。The purpose of the present invention is to provide a conversion method of ICMP error messages in PAT mode in a NAT-PT gateway, thereby realizing the control and processing of the errors that occur during the intercommunication process between the IPv4 network and the IPv6 network.
本发明的目的是通过以下技术方案实现的:The purpose of the present invention is achieved through the following technical solutions:
本发明提供了一种NAT-PT网关中PAT模式下ICMP差错报文的转换方法,该方法为:在PAT(基于端口的地址转换)模式下,NAT-PT(网间协议转换协议)网关收到IPv4网络发来的ICMP(网间控制协议)差错报文时,根据所述报文的内部报头的地址及端口信息进行ICMP差错报文的地址转换处理。The invention provides a method for converting ICMP error message under PAT mode in a NAT-PT gateway. When receiving an ICMP (Internetwork Control Protocol) error message from the IPv4 network, perform address translation processing of the ICMP error message according to the address and port information of the inner header of the message.
所述的NAT-PT网关中PAT模式下ICMP差错报文的转换方法进一步包括:The conversion method of ICMP error message under the PAT mode in the described NAT-PT gateway further comprises:
A、NAT-PT网关获取IPv4网络发来的ICMP差错报文的内部报头的IPv4地址信息及相应的端口信息;A, NAT-PT gateway obtains the IPv4 address information and the corresponding port information of the internal header of the ICMP error message that IPv4 network sends;
B、根据所述的IPv4地址信息及相应的端口信息查找确定与其对应的IPv6地址信息及相应的端口信息;B, search and determine corresponding IPv6 address information and corresponding port information according to the IPv4 address information and corresponding port information;
C、利用确定的IPv6地址信息及相应的端口信息进行ICMP差错报文的转换。C. Using the determined IPv6 address information and corresponding port information to convert the ICMP error message.
本发明中,执行所述的步骤A之前还包括:In the present invention, before performing the step A, it also includes:
IPv6网络中的源节点向IPv4网络中的目的节点发送报文;The source node in the IPv6 network sends a message to the destination node in the IPv4 network;
当所述的报文经过NAT-PT网关时,在NAT-PT网关保存IPv6源地址和IPv6源端口与IPv4源地址和IPv4源端口的对应关系。When the message passes through the NAT-PT gateway, the corresponding relationship between the IPv6 source address and IPv6 source port and the IPv4 source address and IPv4 source port is stored in the NAT-PT gateway.
所述的步骤A包括:Described step A comprises:
在NAT-PT网关,根据收到IPv4网络返回报文承载的信息确定为所述的ICMP差错报文,获取ICMP差错报文的内部报头的IPv4地址信息及相应的端口信息。At the NAT-PT gateway, it is determined as the ICMP error message according to the information carried by the received IPv4 network return message, and the IPv4 address information and corresponding port information of the inner header of the ICMP error message are obtained.
所述的步骤C包括:Described step C comprises:
将确定的IPv6地址信息作为发送给IPv6网络中的源节点的ICMP差错报文外部报头的目的地址,将确定的IPv6地址信息及相应的端口信息作为发送给IPv6网络中的源节点的ICMP差错报文的内部报头的源地址及源端口信息。Use the determined IPv6 address information as the destination address of the external header of the ICMP error message sent to the source node in the IPv6 network, and use the determined IPv6 address information and corresponding port information as the ICMP error message sent to the source node in the IPv6 network The source address and source port information of the internal header of the document.
所述的ICMP差错报文为IPv4网络中的中间节点产生的ICMP差错报文,所述的中间节点为目的地址为IPv4网络中的节点的报文在IPv4网络中到达目的节点前经过的节点。The ICMP error message is an ICMP error message generated by an intermediate node in the IPv4 network, and the intermediate node is a node whose destination address is a node in the IPv4 network before reaching the destination node in the IPv4 network.
所述的NAT-PT网关中PAT模式下ICMP差错报文的转换方法还包括:The conversion method of the ICMP error message under the PAT mode in the described NAT-PT gateway also includes:
D、NAT-PT网关收到IPv6网络发来的ICMP差错报文时,根据所述报文的外部报头或内部报头的地址信息进行ICMP差错报文的地址转换处理。D. When the NAT-PT gateway receives the ICMP error message from the IPv6 network, it performs address conversion processing of the ICMP error message according to the address information of the outer header or the inner header of the message.
所述的步骤D包括:Described step D comprises:
D1、NAT-PT网关收到IPv6网络发来的ICMP差错报文;D1. The NAT-PT gateway receives the ICMP error message from the IPv6 network;
D2、从所述的ICMP差错报文中获取外部报头的地址信息,并根据获取的外部报头的地址信息确定地址转换处理需要的地址信息;D2. Obtain the address information of the external header from the ICMP error message, and determine the address information required for address translation processing according to the obtained address information of the external header;
D3、根据确定的地址转换处理需要的地址信息进行所述的ICMP差错报文的转换处理。D3. Perform the conversion processing of the ICMP error message according to the determined address information required for the address conversion processing.
所述的步骤D3包括:Described step D3 comprises:
根据确定的地址转换处理需要的地址信息进一步确定外部IPv6报文头、ICMPv6(基于IPv6的ICMP)报文头及内部IPv6报文头的地址信息及内部传输层的端口信息;Further determine the address information of the external IPv6 message header, the ICMPv6 (IPv6-based ICMP) message header and the address information of the internal IPv6 message header and the port information of the internal transport layer according to the address information needed for the determined address translation process;
根据所述的进一步确定的地址信息和端口信息进行需要发送给IPv4网络的ICMP差错报文的转换处理。According to the further determined address information and port information, the conversion processing of the ICMP error message that needs to be sent to the IPv4 network is performed.
由上述本发明提供的技术方案可以看出,本发明提供了一种在NAT-PT网关上对收到的ICMP差错报文的转换处理方法,便于对网络中出现的差错进行控制处理。而且,对于IPv4网络与IPv6网络互通时采用PAT方式进行地址转换处理的情况,本发明是通过提取经过NAT-PT网关上的I Pv4网络返回的ICMP差错报文的内部报头的地址信息及传输层端口信息进行差错报文的转换处理,保证了由IPv4网络返回到NAT-PT网关的ICMP差错报文可以正确地返回到IPv6网络中的源节点,从而实现了在IPv4网络与IPv6网络互通的过程中可以对出现的差错的控制处理,提高了网络的性能。It can be seen from the above-mentioned technical solution provided by the present invention that the present invention provides a method for converting and processing received ICMP error messages on the NAT-PT gateway, which facilitates the control and processing of errors occurring in the network. And, when adopting PAT mode to carry out the situation of address translation processing when IPv4 network and IPv6 network intercommunicate, the present invention is by extracting the address information and the transport layer of the internal header of the ICMP error message that the IPv4 network on the NAT-PT gateway returns The port information is used to convert the error message, which ensures that the ICMP error message returned from the IPv4 network to the NAT-PT gateway can be correctly returned to the source node in the IPv6 network, thereby realizing the process of intercommunication between the IPv4 network and the IPv6 network It can control and process the errors that occur in the network, which improves the performance of the network.
附图说明Description of drawings
图1为IPv4网络与IPv6网络互通的组网结构示意图;Fig. 1 is a schematic diagram of the networking structure of IPv4 network and IPv6 network intercommunication;
图2为IPv4网络与IPv6网络互通时报文的转换过程示意图;Fig. 2 is a schematic diagram of the conversion process of the message when the IPv4 network and the IPv6 network are intercommunicated;
图3为IPv6网络与IPv4网络互通时产生差错报文的转换过程示意图;Fig. 3 is the schematic diagram of the conversion process of the error message generated when the IPv6 network and the IPv4 network intercommunicate;
图4为本发明所述的方法的流程图。Fig. 4 is a flowchart of the method of the present invention.
具体实施方式Detailed ways
在IPv4网络与IPv6网络互通的过程中,两网络需要经过NAT-PT网关进行报文的转换,从而保证两网的互通。同时,在IP网络中,当报文在传输过程出现错误时,则在出现错误的节点将产生ICMP差错报文,报文中承载着原始报文的信息及生成的ICMP差错报文的报头信息,所述的ICMP差错报文需要返回给发送原始报文的源节点,因此,在两网络进行报文交互的过程中,可能发生的以下两种情况:During the intercommunication between the IPv4 network and the IPv6 network, the two networks need to pass through the NAT-PT gateway for packet conversion, so as to ensure the intercommunication between the two networks. At the same time, in the IP network, when an error occurs in the transmission process of the message, an ICMP error message will be generated at the node where the error occurs, and the message carries the information of the original message and the header information of the generated ICMP error message , the ICMP error message needs to be returned to the source node that sent the original message. Therefore, in the process of message interaction between the two networks, the following two situations may occur:
第一,IPv4网络发向IPv6网络的报文经过NAT-PT网关进入IPv6网络后,在中间节点发生错误,此时,中间节点将向NAT-PT返回相应的ICMP错误报文,该报文返回到NAT-PT网关后,再经过相应的转换处理发送给IPv4网络中发送原始报文的源节点;First, after the message sent from the IPv4 network to the IPv6 network passes through the NAT-PT gateway and enters the IPv6 network, an error occurs at the intermediate node. At this time, the intermediate node will return a corresponding ICMP error message to the NAT-PT, and the message returns After arriving at the NAT-PT gateway, it will be sent to the source node that sent the original message in the IPv4 network through corresponding conversion processing;
第二,IPv6网络发向IPv4网络的报文经过NAT-PT网关进入IPv4网络后,在中间节点发生错误,此时,中间节点将向NAT-PT网关返回相应的ICMP错误报文,该报文返回到NAT-PT网关后,再经过相应的转换处理发送给IPv6网络中发送原始报文的源节点。Second, after the message sent from the IPv6 network to the IPv4 network passes through the NAT-PT gateway and enters the IPv4 network, an error occurs at the intermediate node. At this time, the intermediate node will return a corresponding ICMP error message to the NAT-PT gateway. After returning to the NAT-PT gateway, it will be sent to the source node that sent the original message in the IPv6 network through corresponding conversion processing.
对于以上两种情况中的第一种情况:当NAT-PT网关收到所述的ICMP差错报文后,获取报文的目的IPv6地址信息,根据所述的IPv6地址的映射关系,将其替换为相应的IPv4地址即可,对于差错报文的内部报头,则同样根据NAT-PT网关保存的地址映射关系进行转换,即获取内部报头的地址信息及端口信息,根据保存的地址映射关系查找与其对应的IPv4地址及端口信息,并进行相应的转换处理即可。所述的传输层可以是TCP(传输控制协议)或者UDP(数据报协议)。For the first case in the above two cases: after the NAT-PT gateway receives the ICMP error message, it obtains the destination IPv6 address information of the message, and replaces it according to the mapping relationship of the IPv6 address The corresponding IPv4 address is enough. For the internal header of the error message, it is also converted according to the address mapping relationship saved by the NAT-PT gateway, that is, the address information and port information of the internal header are obtained, and the corresponding address is searched according to the saved address mapping relationship. Corresponding IPv4 address and port information, and perform corresponding conversion processing. The transport layer may be TCP (Transmission Control Protocol) or UDP (Datagram Protocol).
而对于上述第二种情况:在基于PAT模式下,所述的差错报文的外部目的地址(IPv4地址),由于同一IPv4地址可以与多个IPv6地址形成映射关系,所以如果仍按照第一种情况采用的方法将无法找到确定的IPv6地址替换该IPv4地址;同时,因为所述的差错报文的外部传输层端口信息已经不是原始报文的传输层端口信息,所以无法根据差错报文的外部报头进行相应的转换处理;为此,本发明采用了根据差错报文内部报头的地址及传输层端口信息进行地址转换的解决方法。And for above-mentioned second kind of situation: under the PAT-based mode, the external destination address (IPv4 address) of described error message, because same IPv4 address can form mapping relationship with a plurality of IPv6 addresses, so if still according to first kind The method that situation adopts can't find definite IPv6 address to replace this IPv4 address; Simultaneously, because the external transport layer port information of described error message is not the transport layer port information of original message, so can't according to the external transport layer port information of error message. The corresponding conversion process is performed on the header; for this reason, the present invention adopts a solution for address conversion based on the address of the internal header of the error message and the port information of the transport layer.
下面对由IPv6网络发向IPv4网络的报文在IPv4网络中的中间节点处发生错误时,本发明提供的根据差错报文内部报头的地址及传输层端口信息进行地址转换的解决方法做进一步说明,本发明中,对于由IPv6网络到IPv4网络的原始报文转换采用PAT方式,因此,本发明具体的实现方式参见图3和图4,包括以下步骤:When an error occurs at an intermediate node in the IPv4 network for the message sent to the IPv4 network by the IPv6 network, the address conversion method provided by the present invention according to the address of the internal header of the error message and the transport layer port information will be further described Illustrate, among the present invention, adopt PAT mode for the conversion of the original message by IPv6 network to IPv4 network, therefore, the concrete implementation mode of the present invention is referring to Fig. 3 and Fig. 4, comprises the following steps:
步骤41:IPv6网络中的源节点发送报文6packet到IPv4网络中的目的节点,报文6packet源地址和源端口分别为6SourceAddr和6SourcePort,分别为IPv6的源地址和源端口。Step 41: The source node in the IPv6 network sends a message 6packet to the destination node in the IPv4 network. The source address and source port of the message 6packet are 6SourceAddr and 6SourcePort, respectively, which are the source address and source port of IPv6.
步骤42:由IPv6网络发向IPv4网络的报文经过NAT-PT网关时,生成并记录IPv6源地址+IPv6源端口到IPv4源地址+IPv4源端口的转换关系;Step 42: when the message sent to the IPv4 network by the IPv6 network passes through the NAT-PT gateway, generate and record the conversion relationship from the IPv6 source address+IPv6 source port to the IPv4 source address+IPv4 source port;
所述的报文6packet经过NAT-PT网关时需要被转换为IPv4报文4packet,如果地址转换采用PAT模式实现,则假设转换后的IPv4源地址和源端口分别为4SourceAddr和4SourcePort,此时,在NAT-PT网关中保留地址映射关系为:6SourceAddr+6SourcePort<----->4SourceAddr+4SourcePort,为节省IPv4地址资源,通常一个IPv4地址通过与不同的端口号配合可以与多个不同的IPv6地址建立对应关系;Described message 6packet needs to be converted into IPv4 message 4packet when passing through NAT-PT gateway, if address translation adopts PAT mode to realize, then the IPv4 source address and source port after assuming conversion are respectively 4SourceAddr and 4SourcePort, at this moment, in The reserved address mapping relationship in the NAT-PT gateway is: 6SourceAddr+6SourcePort<----->4SourceAddr+4SourcePort, in order to save IPv4 address resources, usually an IPv4 address can be associated with multiple different IPv6 addresses by cooperating with different port numbers establish a corresponding relationship;
也就是说,在该步骤中,由IPv6网络发向IPv4网络的报文经过NAT-PT网关时,需要为所述的报文的源IPv6地址及端口号分配空闲的IPv4地址及空闲的IPv4端口号,并记录该源IPv6地址及端口号与分配的空闲的IPv4地址及空闲的IPv4端口号的映射关系,从而保证对所述的源节点发送的报文进行相应的地址转换处理,且对于返回的报文可以正确地返回IPv6网络中的源节点。That is to say, in this step, when the message sent to the IPv4 network by the IPv6 network passes through the NAT-PT gateway, it is necessary to allocate a free IPv4 address and a free IPv4 port for the source IPv6 address and port number of the message number, and record the mapping relationship between the source IPv6 address and port number and the assigned idle IPv4 address and idle IPv4 port number, thereby ensuring that the message sent by the source node is correspondingly addressed, and for the returned The message can be correctly returned to the source node in the IPv6 network.
步骤43:所述的经过转换的IPv4报文4packet由NAT-PT网关发往IPv4目的节点,在经过IPv4网络的中间节点时产生错误,生成ICMPv4(基于IPv4的ICMP)差错报文4IcmpErrorPacket,报文4IcmpErrorPacket中包含出错报文4packet(即原始报文)的I P报文头以及传输层信息,由于所述的报文4IcmpErrorPacket需要发回给出错的原始报文的源节点,因此报文4IcmpErrorPacket的目的地址被设为4SourceAddr,使所述的报文将先返回到NAT-PT网关。Step 43: the IPv4 message 4packet through conversion is sent to IPv4 destination node by NAT-PT gateway, produces error when passing through the intermediate node of IPv4 network, generates ICMPv4 (ICMP based on IPv4) error message 4IcmpErrorPacket, message 4IcmpErrorPacket contains the IP header and the transport layer information of the error message 4packet (i.e. the original message), because the said message 4IcmpErrorPacket needs to be sent back to the source node of the wrong original message, so the purpose of the message 4IcmpErrorPacket The address is set to 4SourceAddr so that said message will first be returned to the NAT-PT gateway.
步骤44:当NAT-PT网关接收到IPv4网络返回的ICMP差错报文后,为进行相应的地址转换,则需要从所述的差错报文的内部IPv4报头以及传输层中提取IPv4源地址+IPv4源端口信息;Step 44: After the NAT-PT gateway receives the ICMP error message returned by the IPv4 network, in order to perform corresponding address translation, it needs to extract the IPv4 source address+IPv4 from the internal IPv4 header of the error message and the transport layer source port information;
即根据目的地址4SourceAddr,报文4IcmpErrorPacket被发送到NAT-PT网关,NAT-PT网关需要将报文4IcmpErrorPacket转换成相应的IPv6ICMP差错报文6IcmpErrorPacket,以便发送给IPv6源节点,为了将收到的报文4IcmpErrorPacket转换为IPv6ICMP差错报文6IcmpErrorPacket,必须确定6IcmpErrorPacket的IPv6目的地址,该地址实际上应该为IPv6源节点的地址,即6SourceAddr;That is, according to the destination address 4SourceAddr, the message 4IcmpErrorPacket is sent to the NAT-PT gateway, and the NAT-PT gateway needs to convert the message 4IcmpErrorPacket into the corresponding IPv6ICMP error message 6IcmpErrorPacket, so as to send it to the IPv6 source node, in order to send the received message 4IcmpErrorPacket is converted into IPv6ICMP error message 6IcmpErrorPacket, the IPv6 destination address of 6IcmpErrorPacket must be determined, which should actually be the address of the IPv6 source node, namely 6SourceAddr;
由于报文4IcmpErrorPacket中包含出错报文4packet的IP报文头以及传输层信息,因此从中便可以得到被NAT-PT网关转换过的IPv4源地址4SourceAddr和源端口4SourcePort。Since the message 4IcmpErrorPacket contains the IP header and transport layer information of the error message 4packet, the IPv4 source address 4SourceAddr and source port 4SourcePort converted by the NAT-PT gateway can be obtained therefrom.
步骤45:通过提取的IPv4源地址及IPv4源端口信息,查找保存记录的转换关系,从而确定所需要转换的IPv6源地址+IPv6源端口;Step 45: through the extracted IPv4 source address and IPv4 source port information, search for the conversion relationship of the saved record, so as to determine the IPv6 source address+IPv6 source port that needs to be converted;
具体为:使用4SourceAddr+4SourcePort关键字,通过NAT-PT网关保留的地址映射关系:6SourceAddr+6SourcePort<----->4SourceAddr+4SourcePort,反向查找到对应的IPv6地址6SourceAddr和IPv6端口6SourcePort。Specifically: use the 4SourceAddr+4SourcePort keyword, through the address mapping relationship reserved by the NAT-PT gateway: 6SourceAddr+6SourcePort<----->4SourceAddr+4SourcePort, reverse lookup to the corresponding IPv6 address 6SourceAddr and IPv6 port 6SourcePort.
步骤46:使用查找确定的IPv6源地址,作为外部IPv4报头中IPv4目的地址所要转换的I Pv6目的地址,即将6SourceAddr作为转换后的IPv6ICMP差错报文6IcmpErrorPacket的IPv6目的地址;Step 46: use the IPv6 source address determined by searching, as the IPv6 destination address to be converted by the IPv4 destination address in the outer IPv4 header, about 6SourceAddr is used as the IPv6 destination address of the converted IPv6ICMP error message 6IcmpErrorPacket;
同时使用查找确定的IPv6源地址+IPv6源端口,对内部IPv4报文进行转换,即将内部IPv4报文头的IPv4源地址及IPv4源端口信息4SourceAddr+4SourcePort转换为查找确定的IPv6源地址+IPv6源端口6SourceAddr+6SourcePort。At the same time, the IPv6 source address + IPv6 source port determined by the search is used to convert the internal IPv4 message, that is, the IPv4 source address and IPv4 source port information 4SourceAddr+4SourcePort of the internal IPv4 message header is converted into the IPv6 source address + IPv6 source port determined by the search. Port 6SourceAddr+6SourcePort.
步骤47:将转换完成的IPv6 ICMP差错报文6IcmpErrorPacket发送到IPv6网络中的源节点。Step 47: send the converted IPv6 ICMP error message 6IcmpErrorPacket to the source node in the IPv6 network.
本发明中,对于由IPv6网络返回到NAT-PT网关的ICMP差错报文,则既可以根据所述报文的外部报头的地址信息进行转换处理,也可以根据所述报文的内部报头的地址信息进行转换处理。In the present invention, for the ICMP error message returned to the NAT-PT gateway by the IPv6 network, the conversion process can be carried out according to the address information of the external header of the message, or according to the address information of the internal header of the message Information is converted.
由上述本发明的描述可以看出,本发明可以有效地对PAT模式下IPv4网络和IPv6网络互通时对所出现的差错进行控制处理,无论是基于由IPv4网络发往IPv6网络的报文产生的差错报文,还是基于由IPv6网络发往IPv4网络的报文产生的差错报文,均可以利用内部报头中的信息以及NAT-PT网关中保存的相应的地址映射关系进行相应的转换处理,并将所述的差错报文返回至相应的源节点,实现对出现的差错的控制处理。As can be seen from the above description of the present invention, the present invention can effectively control and process the errors that occur when the IPv4 network and the IPv6 network communicate with each other under the PAT mode, no matter it is based on the message generated by the IPv4 network to the IPv6 network. The error message, or the error message generated based on the message sent from the IPv6 network to the IPv4 network, can use the information in the internal header and the corresponding address mapping relationship stored in the NAT-PT gateway to perform corresponding conversion processing, and The error message is returned to the corresponding source node, so as to control and process the error that occurs.
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求书的保护范围为准。The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed in the present invention can easily think of changes or Replacement should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2004100370113A CN100490445C (en) | 2004-04-21 | 2004-04-21 | Method of ICMP error message conversion under PAT mode in NAT-PT gateway |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2004100370113A CN100490445C (en) | 2004-04-21 | 2004-04-21 | Method of ICMP error message conversion under PAT mode in NAT-PT gateway |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1691664A true CN1691664A (en) | 2005-11-02 |
CN100490445C CN100490445C (en) | 2009-05-20 |
Family
ID=35346790
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2004100370113A Expired - Fee Related CN100490445C (en) | 2004-04-21 | 2004-04-21 | Method of ICMP error message conversion under PAT mode in NAT-PT gateway |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100490445C (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007118398A1 (en) * | 2006-04-14 | 2007-10-25 | Huawei Technologies Co., Ltd. | Method and system for measuring network performance |
CN100477671C (en) * | 2005-12-16 | 2009-04-08 | 中国科学院计算技术研究所 | Network address translation method supporting multi-session application layer protocol in PAT mode |
WO2009124477A1 (en) * | 2008-04-08 | 2009-10-15 | 华为技术有限公司 | Method, system and device for packet transmission |
CN101179506B (en) * | 2007-11-26 | 2010-06-02 | 中兴通讯股份有限公司 | Method for private network terminal to detect public network terminal |
CN1992675B (en) * | 2005-12-31 | 2010-07-14 | 中兴通讯股份有限公司 | Method for guaranteeing interconnection between network address conversion apparatus and external network |
CN102045244A (en) * | 2009-10-10 | 2011-05-04 | 中兴通讯股份有限公司 | IPV4 (Internet Protocol Version 4) network as well as implementation method and system for intercommunicating with new network |
CN101616193B (en) * | 2009-07-16 | 2011-11-09 | 清华大学 | Setting method of beacon host computer in IPv4 address transmultiplexer |
CN101257389B (en) * | 2007-03-02 | 2012-05-23 | 株式会社日立制作所 | ICMP translator |
CN104333513A (en) * | 2014-10-23 | 2015-02-04 | 深圳供电局有限公司 | Method for supporting IPv4 message transmission, sending device and receiving device |
-
2004
- 2004-04-21 CN CNB2004100370113A patent/CN100490445C/en not_active Expired - Fee Related
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100477671C (en) * | 2005-12-16 | 2009-04-08 | 中国科学院计算技术研究所 | Network address translation method supporting multi-session application layer protocol in PAT mode |
CN1992675B (en) * | 2005-12-31 | 2010-07-14 | 中兴通讯股份有限公司 | Method for guaranteeing interconnection between network address conversion apparatus and external network |
WO2007118398A1 (en) * | 2006-04-14 | 2007-10-25 | Huawei Technologies Co., Ltd. | Method and system for measuring network performance |
US8005011B2 (en) | 2006-04-14 | 2011-08-23 | Huawei Technologies Co., Ltd. | Method and system for measuring network performance |
CN101257389B (en) * | 2007-03-02 | 2012-05-23 | 株式会社日立制作所 | ICMP translator |
CN101179506B (en) * | 2007-11-26 | 2010-06-02 | 中兴通讯股份有限公司 | Method for private network terminal to detect public network terminal |
WO2009124477A1 (en) * | 2008-04-08 | 2009-10-15 | 华为技术有限公司 | Method, system and device for packet transmission |
CN101616193B (en) * | 2009-07-16 | 2011-11-09 | 清华大学 | Setting method of beacon host computer in IPv4 address transmultiplexer |
CN102045244A (en) * | 2009-10-10 | 2011-05-04 | 中兴通讯股份有限公司 | IPV4 (Internet Protocol Version 4) network as well as implementation method and system for intercommunicating with new network |
CN104333513A (en) * | 2014-10-23 | 2015-02-04 | 深圳供电局有限公司 | Method for supporting IPv4 message transmission, sending device and receiving device |
CN104333513B (en) * | 2014-10-23 | 2018-02-23 | 深圳供电局有限公司 | Method for supporting IPv4 message transmission, sending device and receiving device |
Also Published As
Publication number | Publication date |
---|---|
CN100490445C (en) | 2009-05-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5239618B2 (en) | Address translation apparatus, method and program, and node | |
CN1711739A (en) | Method and device for supporting a 6to4 tunneling protocol across a network address translation mechanism | |
CN1992667A (en) | ISATAP router for tunneling packets and method thereof | |
CN101030935A (en) | Method for crossing NAT-PT by IPSec | |
CN101227373A (en) | Intercommunication method between IPv4 and IPv6 networks based on stateless mapping | |
CN1585376A (en) | Addressing converting method and mixed addressing converting router for realizing it | |
CN102255982A (en) | Internet protocol version 4 (IPv4)/IPv6 translation gateway and translation method | |
CN1716954A (en) | Intercommunication method between IPv6 network and IPv4 network based on transition mechanism | |
JP2004222229A (en) | Router and its packet transmission method | |
CN1380773A (en) | Enhanced NAT-PT protocol scheme | |
CN101030934A (en) | Method for spanning heterogeneous network mobile telecommunication based on two-way tunnel | |
CN101068189A (en) | A Method of Supporting IPv4 Application Programs Using Tunnel Between Hosts in IPv6 | |
CN1691664A (en) | Conversion Method of ICMP Error Message in PAT Mode in NAT-PT Gateway | |
CN1691665A (en) | A method for realizing communication between IPv4 network and IPv6 network | |
CN103888554B (en) | IPv4 and the domain name analytic method and system of IPv6 intercommunications | |
CN1747457A (en) | A method of cross-gateway communication | |
CN103780492B (en) | The method and relevant device of message forwarding | |
CN104735073A (en) | IPv4-IPv6 transitional protocol dispatching method and device | |
CN1235368C (en) | Address conversion method for simultaneously supporting one-to-one and many-to-many under the PAT mode | |
CN101030936A (en) | Telecommunication for switching node from IPv4 network to IPv6 network | |
CN1529481A (en) | Method for Realizing Distributed Application Layer Conversion Gateway Inside Network Processor | |
CN100505686C (en) | Method for realizing communication between mobile IPv6 node and IPv4 communication partner | |
CN1859314A (en) | Communication method | |
WO2022089412A1 (en) | Communication method and device | |
CN1870568A (en) | Method for implementing network address conversion anti-virus transition |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20090520 |