rfc2766.Network Address Translation - Protocol Translation (NAT-PT)
v4v6过渡

IPv4到IPv6过渡技术过渡问题的出现随着Internet的不断发展,原有IPv4的许多不足逐渐暴露了出来,这里面最迫切需要解决的就是IP地址空间耗尽和骨干路由器中路由表过于庞大的问题。
这两个问题直接导致了IETF成立IPng工作组来制定新一代的IP协议,并在1995年底为它分配了版本号6,称为IPv6 ( 或 IPng ) 。
为了彻底解决目前IPv4遇到的问题并对未来的应用提供更好的支持,IPv6的设计者们最后决定将IPv6设计成一个新的协议,而不仅仅是IPv4的扩展。
尽管在设计IPv6的时候已经充分考虑了和IPv4的兼容性,但是它们不是完全兼容的。
可以预见,Internet由IPv4向IPv6过渡需要一个相当长的时间才能完成,在这段时间内这种不兼容性的影响将会很突出,IETF已经成立的专门的工作组NGTRANS来研究从IPv4向IPv6的过渡问题。
过渡机制概述我们面临的主要问题不是IPv6本身的问题,而是如何渐进的、无伤害的由基于IPv4的网络过渡到基于IPv6的网络,同时尽可能减少过渡的成本的问题,SIT ( Simple Internet Transition ) 阐述了过渡的要求。
由于过渡是渐进的,在过渡的初期,Internet将由运行IPv4的"海洋"和运行IPv6的"小岛"组成。
随着时间的推移,IPv4的海洋将会逐渐变小,而IPv6的小岛将会越来越多,最终完全取代IPv4。
在过渡的初期,要解决的主要是IPv6小岛之间的通信问题,随后是IPv6小岛和IPv4海洋之间通信的问题。
针对这两类问题已经提出了很多方案,有一些已经相当成熟并形成了RFC,有一些还只是草案。
解决过渡问题的成熟的基本技术主要有三种:1. 双协议栈 ( Dual Stack, RFC2893 )主机同时运行IPv4和IPv6两套协议栈,同时支持两套协议2. 隧道技术 ( Tunnel, RFC2893 )这种机制用来在IPv4网络之上连接IPv6的站点,站点可以是一台主机,也可以是多个主机。
IPv6-IPv4无感知接入与加速

IPv6/IPv4无感知接入与加速摘要本文提出了一种技术方案,不仅能够改善ipv4向ipv6过渡初期,ipv6网络资源使用率不足的问题,而且,在终端用户无感知、网络管理员部署维护方便的前提下,使终端用户得到更好的接入服务,提升终端用户的体验。
关键词 ipv4;ipv6;过渡;接入中图分类号tp393 文献标识码a 文章编号 1674-6708(2013)96-0219-021 背景随着以ipv4(internet portocol version 4)为基础的互联网的发展,用户快速增加,ipv4地址数已经分配殆尽。
ipv6(internet portocol version 6)作为业界公认的用以替代ipv4的技术,正在扩展其部署范围。
ipv6与ipv4相比,提供了更巨大的ip地址空间,以解决现有互联网地址短缺的问题。
ipv6采用了全新的编址方式,在设计上并不向下兼容ipv4,这种不兼容性使得升级到ipv6必须部署一张全新的网络,而不能在ipv4的基础上进行延伸和扩展。
ipv6部署初期,需要大量的投入,却没有与成本相匹配的收益,严重阻碍了ipv6的推广。
2 现状和问题在ipv4向ipv6过渡的初期,因特网服务提供商(internet service provider,isp)通常为用户提供ipv4和ipv6双栈接入。
一般的网络应用都是在客户机和服务器之间进行的,只有当终端用户、应用服务器以及连接它们的网络都支持ipv6时,才可能使用ipv6进行通信,否则仍只能使用ipv4进行通信。
目前,由于大多数终端操作系统和应用程序客户端不支持ipv6,即终端用户不支持ipv6,而且,用户内网原有的部分网络设备也不支持ipv6,所以大部分网络应用仍使用ipv4进行通信;另外,由于ipv6对比ipv4只是网络传输协议的升级,无法直接提升终端用户的体验,大部分终端用户不会主动寻求使用ipv6。
正是由于以上这些原因,一方面,即使isp提供了ipv6网络接入——外网支持ipv6,内容提供商(content provider,cp)支持使用ipv6访问——应用服务器支持ipv6,这些资源也将闲置或无法充分利用,造成了浪费。
【IPv6】NAT-PT for IPv6机制详解及实验

一、机制概述RFC2766、RFC2765。
NAT-PT(网络地址转换-协议转换)是一种地址转换技术,它可以把IPv6地址转换成IPv4地址,反之亦然。
NAT-PT基于RFC2766中定义的无状态IP/ICMP转换器(SIIT)算法。
SIIT算法互译IPv4和IPv6数据包头部,也包括ICMP头部。
需要注意的是,在IPv6环境中,不建议像IPv4对待NAT的态度哪样,去使用NAT。
仅仅在V4单协议与V6单协议网络需要互相通信的时候,才建议使用NAT-PT。
我们看上面的例子,对于IPv6单协议网络而言,首先它有访问IPv6因特网的需求,因此默认的IPv6流量全部交给R1,另外,它可能还有访问IPv4因特网的需求,这时候,就需要借助R2这台NAT-PT设备。
2001:2::/96,这个长度为96位的前缀是我们为了NAT-PT操作预定义的前缀,可以自定义,但是长度必须是96bits。
在IPv6单协议网络中产生的、去往2001:2::/96这个目的地的流量被路由到R2也就是NAT-PT设备,然后数据包中的IPv6地址被转换为IPv4地址并传送给IPv4因特网中的IPv4单协议节点。
二、NAT-PT配置及原理2.1 静态NAT-PT1、静态NAT-PT(单向)A和B的配置都极其简单A的配置:interface FastEthernet0/0ipv6 enableipv6 address 2001:1::1/64ipv6 route ::/0 2001:1::FFFFB的配置如下:interface FastEthernet0/0ip address 202.101.100.2 255.255.255.0ip route 0.0.0.0 0.0.0.0 202.101.100.1R2的配置如下:ipv6 unicast-routing!interface FastEthernet0/0 !! 连接A的接口ipv6 enableipv6 address 2001:1::FFFF/64ipv6 nat!interface FastEthernet1/0ip address 202.101.100.1 255.255.255.0ipv6 nat!ipv6 nat prefix 2001:2::/96 !! 是一个为NAT-PT预留的池ipv6 nat v6v4 source 2001:1::1 202.101.100.100 !! 相当于将2001:1::1这个IPv6的节点,“告知”给IPv4单协议网络中的用户知道,可以以202.101.100.100的方式访问。
IPV4向IPV6过渡的解决方案

目前过渡问题成熟的技术方案基本分为三种:[1] 双协议栈( Dual Stack, RFC2893 ):主机同时运行IPv4和IPv6两套协议栈,同时支持两套协议[2] 隧道技术( Tunnel, RFC2893 ):这种机制用来在IPv4网络之上连接IPv6的站点,站点可以是一台主机,也可以是多个主机。
隧道技术将IPv6的分组封装到IPv4的分组中,封装后的IPv4分组将通过IPv4的路由体系传输,分组报头的"协议" 域设置为41,指示这个分组的负载是一个IPv6的分组,以便在适当的地方恢复出被封装的IPv6分组并传送给目的站点。
根据封装/解封装操作发生位置的不同,隧道可以分为四种:λ路由器到路由器( Router-to-Router )λ主机到路由器( Host-to-Router )λ主机到主机( Host-to-Host )λ路由器到主机( Router-to-Host )根据建立方式的不同,隧道又可以分成两类:λ (手工)配置的隧道( Configured Tunnel )λ自动配置的隧道( Auto-configured Tunnel )[3] 翻译技术,最具代表性的是NAT-PT ( Network Address Translation - Protocol Translation,RFC2766 ):利用转换网关来在IPv4和IPv6网络之间转换IP报头的地址,同时根据协议不同对分组做相应的语义翻译,从而使纯IPv4和纯IPv6站点之间能够透明通信。
需要指出的是,这些过渡机制都不是普遍适用的,每一种机制都适用于某种或几种特定的网络情况,而且常常需要和其它的技术组合使用。
在实际应用时需要综合考虑各种实际情况来制定合适的过渡策略。
过渡解决方案【方案简介】IPv6 虚拟接入解决方案是建立在虚拟网络(VPN)之上的隧道型IPv6过渡综合解决方案。
通过使用该方案,在满足IPv4用户的基本IPv6接入需求,提供高可靠的安全性保证;同时利用IPv6的便利性和平坦性,向用户提供更为方便的互联网应用。
第4章 网络地址转换(NAT)

第4章网络地址转换(NAT)⏹NAT概述随着网络的发展,公用IP地址的需求与日俱增。
为了缓解公用IP地址的不足,并且保护公司内部服务器的私网地址,可以使用NAT(Network Address Translation,网络地址转换)技术将私网地址转化成为公网地址,缓解IP地址的不足,并且隐藏内部服务器的私网地址。
⏹NAT的概述与现实方式1.NAT概念网络地址转换(NAT)通过将内部网络的私有IP地址翻译成全球唯一的公网IP地址,使内部网络可以连接到互联网等外部网络上,广泛应用于各种类型的互联网接入方式和各种类型的网络中。
原因很简单,NAT不仅解决了IP地址不足的问题,而且还能够隐藏内部网络的细节,避免来自网络外部的攻击,起到一定的安全作用。
借助于NAT,私有保留地址的内部网络通过路由器发送数据包时,私有地址被转换成合法的IP地址,这样一个局域网只需要少量地址(甚至是一个),即可实现使私有地址网络中的所有计算机与互联网的通信需求。
2.NAT的实现方式NAT的实现方式有以下三种:静态转换(Static Translation)动态转换(Dynamic Translation)端口多路复用(Port Address Translation,PAT)静态转换IP地址的对应关系是一对一且不变的,并没有节约公用IP地址,只是隐藏了主机的真实地址。
动态转换虽然在一定情况下节约了公用IP地址,但是当内部网络同时访问Internet的主机数大于合法地址池中的IP地址数时就不适用了。
端口多路复用可以使所有的内部网络主机共享一个合法的外部IP地址,从而最大限度的节约IP地址资源。
由于动态转换形成的IP地址的对应关系是不确定的、随机的;端口多路复用使用的是端口号的转换,也是不确定的,所以内网服务器不能使用这两种转换方式,这是由于外网用户无法确定服务器合法的公网IP地址,导致无法访问服务器。
这时使用静态转换将私有IP地址转换为固定的合法的IP地址,这样服务器有了固定的合法的公网IP地址,才能实现外网的访问。
IPv4

IPv4向IPv6的过渡策略作者:张建立来源:《信息安全与技术》2013年第08期【摘要】本文简单介绍了IPv6协议,并阐述了在现阶段IPv4与IPv6共存的情况下,IPv4 向IPv6过渡的三种较为成熟的双协议栈技术、隧道技术和NAT-PT技术,最后概括了过渡策略的演进。
【关键词】 IPv6;双协议栈;NAT-PT1 前言近年来,互联网的迅猛发展导致了IP地址资源的紧张。
目前的IP协议版本IPv4已经暴露出其当初设计不足的地方,使得升级IP协议成为必然。
从20世纪90年代初以来,国际上已经开始讨论下一代的IP协议,IETF最终确定IPng协议为版本6,称为IPv6。
IPv6从1995年被IETF首次提出后,近年来在全球范围内受到普遍关注。
目前,IPv6协议的框架和各项技术已经逐步成熟,并在越来越广泛的范围内得到实践。
但是现行Internet上成千上万的主机、路由器等网络设备都运行着IPv4协议。
这就决定了IPv4的网络向IPv6演进将是一个浩大而且繁杂的工程,IPv4和IPv6网络将在很长时间内共存,如何从IPv4平滑地过渡到IPv6是一个非常复杂的问题。
2 IPv6协议概述2.1 IPv6的报头格式净荷长度。
长度为1 6位,其中包括包净荷的字节长度,即IPv6头后的包中包含的字节数。
这意味着在计算净荷长度时包含了IPv6扩展头的长度。
下一个头。
这个字段指出了IPv6头后所跟的头字段中的协议类型。
与IPv6协议字段类似,下一个头字段可以用来指出高层是TCP还是UDP,但它也可以用来指明IPv6扩展头的存在。
跳极限。
长度为8位。
每当一个节点对包进行一次转发之后,这个字段就会被减1。
如果该字段达到0,这个包就将被丢弃。
IPv4中有一个具有类似功能的生存期字段,但与IPv4不同,人们不愿意在IPv6中由协议定义一个关于包生存时间的上限。
这意味着对过期包进行超时判断的功能可以由高层协议完成。
源地址。
长度应为128位,指出了IPv6包的发送方地址。
NAT详细描述

1、NAT原理1.1、概述RFC1631、RFC3022以及相关RFC定义的NA T(Network Address Translator)是一种将IP地址从一个编址域映射到另一个编址域的方法,典型的应用是把RFC1918定义的私有IP 地址映射到Internet所使用的公有IP地址。
NA T与网络中其它计算设备的关系如图1.1。
虽然NA T技术已经得到广泛应用,但它是一把双刃剑,在带来节省IPv4地址空间等好处的同时,破坏了Internet最基本的“端到端的透明性”的设计理念,增加了网络的复杂性,阻碍了业务的创新。
IETF一直主张利用IPv6技术解决地址短缺问题,因此IETF虽然出版了几个与NA T相关的RFC,但对NA T技术(尤其是穿越问题)一直没有系统的标准工作,如SIP和Mobile IP就是NA T出现后设计的一些协议,都未考虑到NA T的穿越问题。
现在业界意识到Internet 在短期内不可能过渡到IPv6,IPv4和IPv6将长期共存,NA T以及NA T-PT(Network Address Translation - Protocol Translation)将继续得到长期应用,因此NA T相关问题开始引起IETF (Internet Engineering Task Force)和ITU-T(International Telecommunication Union)等相关国际标准化组织的关注。
中国通信标准化协会IP与多媒体工作委员会也正在积极参与ITU-T SG16组的相关活动,加紧制定中国多媒体业务NA T穿越标准[1]。
说明:ICD:Inner Computing Device,内部计算设备,内部主机,内网主机OCD:Outer Computing Device,外部计算设备,外部主机,外网主机ICD和OCD是相对而言的,OCD也可能在1个或多个NAT后面图1.1 NA T与计算设备的关系1.2、分类从功能上看,主要有以下几种典型的NA T(RFC2663),如图1.2)。
11NAT————————动态静态地址转换

模块十一 NATInternet 技术的飞速进展,使愈来愈多的用户加入到互联网,因此IP 地址欠缺已成为一个十分突出的问题。
NAT(Network Address Translation,网络地址翻译)是解决 IP 地址欠缺的重要手腕。
第一讲 NAT 概述NAT 是一个 IETF 标准,许诺一个机构以一个地址出此刻 Internet上。
NAT 技术使得一个私有网络能够通过 Internet 注册 IP 连接到外部世界,位于 Inside 网络和 Outside 网络中的 NAT 路由器在发送数据包之前,负责把内部 IP 地址翻译成外部合法 IP 地址。
NAT 将每一个局域网节点的 IP 地址转换成一个合法 IP 地址,反之亦然。
它也能够应用到防火墙技术里,把个别 IP 地址隐藏起来不被外界发觉,对内部网络设备起到爱惜的作用,同时,它还帮忙网络能够超越地址的限制,合理地安排网络中的公有 Internet 地址和私有 IP 地址的利用。
NAT 有三种类型:静态 NAT、动态 NAT 和端口地址转换(PAT)。
1.静态 NAT静态 NAT 中,内部网络中的每一个主机都被永久映射成外部网络中的某个合法的地址。
静态地址转换将内部本地地址与内部合法地址进行一对一的转换,且需要指定和哪个合法地址进行转换。
若是内部网络有 E-mail 效劳器或 FTP 效劳器等能够为外部用户提供的效劳,这些效劳器的 IP 地址必需采纳静态地址转换,以便外部用户能够利用这些效劳。
2.动态 NAT动态 NAT 第一要概念合法地址池,然后采纳动态分派的方式映射到内部网络。
动态 NAT 是动态一对一的映射。
3.PATPAT 那么是把内部地址映射到外部网络的 IP 地址的不同端口上,从而能够实现多对一的映射。
PAT 关于节省 IP 地址是最为有效的。
第二讲实验 1:静态 NAT 配置1. 实验目的通过本实验能够把握(1)静态 NAT 的特点。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Network Working Group G. Tsirtsis Request for Comments: 2766 BT Category: Standards Track P. Srisuresh Campio Communications February 2000 Network Address Translation - Protocol Translation (NAT-PT)Status of this MemoThis document specifies an Internet standards track protocol for theInternet community, and requests discussion and suggestions forimprovements. Please refer to the current edition of the "InternetOfficial Protocol Standards" (STD 1) for the standardization stateand status of this protocol. Distribution of this memo is unlimited.Copyright NoticeCopyright (C) The Internet Society (2000). All Rights Reserved.AbstractThis document specifies an IPv4-to-IPv6 transition mechanism, inaddition to those already specified in [TRANS]. This solutionattempts to provide transparent routing, as defined in [NAT-TERM], to end-nodes in V6 realm trying to communicate with end-nodes in V4realm and vice versa. This is achieved using a combination of Network Address Translation and Protocol Translation. The scheme describeddoes not mandate dual-stacks (i.e., IPv4 as well as V6 protocolsupport) or special purpose routing requirements (such as requiringtunneling support) on end nodes. This scheme is based on acombination of address translation theme as described in [NAT-TERM]and V6/V4 protocol translation theme as described in [SIIT].AcknowledgementsSpecial thanks to Pedro Marques for reviewing an earlier version ofthis memo. Also, many thanks to Alan O’Neill and Martin Tatham, asthe mechanism described in this document was initially developedthrough discussions with them.Tsirtsis & Srisuresh Standards Track [Page 1]Table of Contents1. Introduction (2)2. Terminology (3)2.1 Network Address Translation (NAT) (4)2.2 NAT-PT flavors (4)2.2.1 Traditional-NAT-PT (4)2.2.2 Bi-directional-NAT-PT (5)2.3 Protocol Translation (PT) (5)2.4 Application Level Gateway (ALG) (5)2.5 Requirements (5)3. Traditional-NAT-PT operation (V6 to V4) (6)3.1 NAT-PT Outgoing Sessions (6)3.2 NAPT-PT Outgoing Sessions (7)4. Use of DNS-ALG for Address assignment (8)4.1 V4 Address Assignment for Incoming Connections (V4 to V6). 94.2 V4 Address Assignment for Outgoing Connections (V6 to V4). 115. Protocol Translation Details (12)5.1 Translating IPv4 Headers to IPv6 Headers (13)5.2 Translating IPv6 Headers to IPv4 Headers (13)5.3 TCP/UDP/ICMP Checksum Update (13)6. FTP Application Level Gateway (FTP-ALG) Support (14)6.1 Payload modifications for V4 originated FTP sessions (15)6.2 Payload modifications for V6 originated FTP sessions (16)6.3 Header updates for FTP control packets (16)7. NAT-PT Limitations and Future Work (17)7.1 Topology Limitations (17)7.2 Protocol Translation Limitations (17)7.3 Impact of Address Translation (18)7.4 Lack of End-to-End Security (18)7.5 DNS Translation and DNSSEC (18)8. Applicability Statement (18)9. Security Considerations (19)10. References (19)Authors’ Addresses (20)Full Copyright Statement (21)1. IntroductionIPv6 is a new version of the IP protocol designed to modernize IPv4which was designed in the 1970s. IPv6 has a number of advantages over IPv4 that will allow for future Internet growth and will simplify IP configuration and administration. IPv6 has a larger address spacethan IPv4, an addressing model that promotes aggressive routeaggregation and a powerful autoconfiguration mechanism. In time, it is expected that Internet growth and a need for a plug-and-playsolution will result in widespread adoption of IPv6.Tsirtsis & Srisuresh Standards Track [Page 2]There is expected to be a long transition period during which it will be necessary for IPv4 and IPv6 nodes to coexist and communicate. Astrong, flexible set of IPv4-to-IPv6 transition and coexistencemechanisms will be required during this transition period.The SIIT proposal [SIIT] describes a protocol translation mechanismthat allows communication between IPv6-only and IPv4-only nodes viaprotocol independent translation of IPv4 and IPv6 datagrams,requiring no state information for the session. The SIIT proposalassumes that V6 nodes are assigned a V4 address for communicatingwith V4 nodes, and does not specify a mechanism for the assignment of these addresses.NAT-PT uses a pool of V4 addresses for assignment to V6 nodes on adynamic basis as sessions are initiated across V4-V6 boundaries. The V4 addresses are assumed to be globally unique. NAT-PT with privateV4 addresses is outside the scope of this document and for furtherstudy. NAT-PT binds addresses in V6 network with addresses in V4network and vice versa to provide transparent routing [NAT-TERM] for the datagrams traversing between address realms. This requires nochanges to end nodes and IP packet routing is completely transparent [NAT-TERM] to end nodes. It does, however, require NAT-PT to trackthe sessions it supports and mandates that inbound and outbounddatagrams pertaining to a session traverse the same NAT-PT router.You will note that the topology restrictions on NAT-PT are the samewith those described for V4 NATs in [NAT-TERM]. Protocol translation details specified in [SIIT] would be used to extend addresstranslation with protocol syntax/semantics translation. A detailedapplicability statement for NAT-PT may be found at the end of thisdocument in section 7.By combining SIIT protocol translation with the dynamic addresstranslation capabilities of NAT and appropriate ALGs, NAT-PT provides a complete solution that would allow a large number of commonly used applications to interoperate between IPv6-only nodes and IPv4-onlyA fundamental assumption for NAT-PT is only to be use when no othernative IPv6 or IPv6 over IPv4 tunneled means of communication ispossible. In other words the aim is to only use translation betweenIPv6 only nodes and IPv4 only nodes, while translation between IPv6only nodes and the IPv4 part of a dual stack node should be avoidedover other alternatives.2. TerminologyThe majority of terms used in this document are borrowed almost as is from [NAT-TERM]. The following lists terms specific to this document. Tsirtsis & Srisuresh Standards Track [Page 3]2.1 Network Address Translation (NAT)The term NAT in this document is very similar to the IPv4 NATdescribed in [NAT-TERM], but is not identical. IPv4 NAT translatesone IPv4 address into another IPv4 address. In this document, NATrefers to translation of an IPv4 address into an IPv6 address andvice versa.While the V4 NAT [NAT-TERM] provides routing between private V4 andexternal V4 address realms, NAT in this document provides routingbetween a V6 address realm and an external V4 address realm.2.2 NAT-PT flavorsJust as there are various flavors identified with V4 NAT in [NAT-TERM], the following NAT-PT variations may be identified in thisdocument.2.2.1 Traditional NAT-PTTraditional-NAT-PT would allow hosts within a V6 network to accesshosts in the V4 network. In a traditional-NAT-PT, sessions are uni-directional, outbound from the V6 network. This is in contrast with Bi-directional-NAT-PT, which permits sessions in both inbound andoutbound directions.Just as with V4 traditional-NAT, there are two variations totraditional-NAT-PT, namely Basic-NAT-PT and NAPT-PT.With Basic-NAT-PT, a block of V4 addresses are set aside fortranslating addresses of V6 hosts as they originate sessions to theV4 hosts in external domain. For packets outbound from the V6 domain, the source IP address and related fields such as IP, TCP, UDP andICMP header checksums are translated. For inbound packets, thedestination IP address and the checksums as listed above aretranslated.NAPT-PT extends the notion of translation one step further by alsotranslating transport identifier (e.g., TCP and UDP port numbers,ICMP query identifiers). This allows the transport identifiers of anumber of V6 hosts to be multiplexed into the transport identifiersof a single assigned V4 address. NAPT-PT allows a set of V6 hosts to share a single V4 address. Note that NAPT-PT can be combined withBasic-NAT-PT so that a pool of external addresses are used inconjunction with port translation.Tsirtsis & Srisuresh Standards Track [Page 4]For packets outbound from the V6 network, NAPT-PT would translate the source IP address, source transport identifier and related fieldssuch as IP, TCP, UDP and ICMP header checksums. Transport identifier can be one of TCP/UDP port or ICMP query ID. For inbound packets, the destination IP address, destination transport identifier and the IPand transport header checksums are translated.2.2.2 Bi-Directional-NAT-PTWith Bi-directional-NAT-PT, sessions can be initiated from hosts inV4 network as well as the V6 network. V6 network addresses are bound to V4 addresses, statically or dynamically as connections areestablished in either direction. The name space (i.e., their FullyQualified Domain Names) between hosts in V4 and V6 networks isassumed to be end-to-end unique. Hosts in V4 realm access V6-realmhosts by using DNS for address resolution. A DNS-ALG [DNS-ALG] mustbe employed in conjunction with Bi-Directional-NAT-PT to facilitatename to address mapping. Specifically, the DNS-ALG must be capableof translating V6 addresses in DNS Queries and responses into theirV4-address bindings, and vice versa, as DNS packets traverse between V6 and V4 realms.2.3 Protocol Translation (PT)PT in this document refers to the translation of an IPv4 packet into a semantically equivalent IPv6 packet and vice versa. Protocoltranslation details are described in [SIIT].2.4 Application Level Gateway (ALG)Application Level Gateway (ALG) [NAT-TERM] is an application specific agent that allows a V6 node to communicate with a V4 node and viceversa. Some applications carry network addresses in payloads. NAT-PT is application unaware and does not snoop the payload. ALG could work in conjunction with NAT-PT to provide support for many suchapplications.2.5 RequirementsThe keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD,SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they appear in this document, are to be interpreted as described in [KEYWORDS].Tsirtsis & Srisuresh Standards Track [Page 5]3. Traditional-NAT-PT Operation (V6 to V4)NAT-PT offers a straight forward solution based on transparentrouting [NAT-TERM] and address/protocol translation, allowing a large number of applications in V6 and V4 realms to inter-operate withoutrequiring any changes to these applications.In the following paragraphs we describe the operation oftraditional-NAT-PT and the way that connections can be initiated from a host in IPv6 domain to a host in IPv4 domain through atraditional-NAT-PT3.1 Basic-NAT-PT Operation[IPv6-B]-+| +==============+[IPv6-A]-+-[NAT-PT]---------| IPv4 network |--[IPv4-C]| +==============+(pool of v4 addresses)Figure 1: IPv6 to IPv4 communicationNode IPv6-A has an IPv6 address -> FEDC:BA98::7654:3210Node IPv6-B has an IPv6 address -> FEDC:BA98::7654:3211Node IPv4-C has an IPv4 address -> 132.146.243.30NAT-PT has a pool of addresses including the IPv4 subnet120.130.26/24The V4 addresses in the address pool could be allocated one-to-one to the V6 addresses of the V6 end nodes in which case one needs as many V4 addresses as V6 end points. In this document we assume that the V6 network has less V4 addresses than V6 end nodes and thus dynamicaddress allocation is required for at least some of them.Say the IPv6 Node A wants to communicate with the IPv4 Node C. Node A creates a packet with:Source Address, SA=FEDC:BA98::7654:3210 and DestinationAddress, DA = PREFIX::132.146.243.30NOTE: The prefix PREFIX::/96 is advertised in the stub domain by the NAT-PT, and packets addressed to this PREFIX will be routed to theNAT-PT. The pre-configured PREFIX only needs to be routable withinthe IPv6 stub domain and as such it can be any routable prefix thatthe network administrator chooses.The packet is routed via the NAT-PT gateway, where it is translatedto IPv4.Tsirtsis & Srisuresh Standards Track [Page 6]If the outgoing packet is not a session initialisation packet, theNAT-PT SHOULD already have stored some state about the relatedsession, including assigned IPv4 address and other parameters for the translation. If this state does not exist, the packet SHOULD besilently discarded.If the packet is a session initialisation packet, the NAT-PT locally allocates an address (e.g: 120.130.26.10) from its pool ofaddresses and the packet is translated to IPv4. The translationparameters are cached for the duration of the session and the IPv6 to IPv4 mapping is retained by NAT-PT.The resulting IPv4 packet has SA=120.130.26.10 and DA=132.146.243.30. Any returning traffic will be recognised as belonging to the samesession by NAT-PT. NAT-PT will use the state information to translate the packet, and the resulting addresses will beSA=PREFIX::132.146.243.30, DA=FEDC:BA98::7654:3210. Note that thispacket can now be routed inside the IPv6-only stub network as normal.3.2 NAPT-PT OperationNAPT-PT, which stands for "Network Address Port Translation +Protocol Translation", would allow V6 nodes to communicate with theV4 nodes transparently using a single V4 address. The TCP/UDP portsof the V6 nodes are translated into TCP/UDP ports of the registeredV4 address.While NAT-PT support is limited to TCP, UDP and other portmultiplexing type of applications, NAPT-PT solves a problem that isinherent with NAT-PT. That is, NAT-PT would fall flat when the poolof V4 addresses assigned for translation purposes is exhausted. Once the address pool is exhausted, newer V6 nodes cannot establishsessions with the outside world anymore. NAPT-PT, on the other hand, will allow for a maximum of 63K TCP and 63K UDP sessions per IPv4address before having no TCP and UDP ports left to assign.To modify the example sited in figure 1, we could have NAPT-PT on the border router (instead of NAT-PT) and all V6 addresses could bemapped to a single v4 address 120.130.26.10.IPv6 Node A would establish a TCP session with the IPv4 Node C asfollows:Node A creates a packet with:Source Address, SA=FEDC:BA98::7654:3210 , source TCP port = 3017 and Destination Address, DA = PREFIX::132.146.243.30, destination TCPport = 23.Tsirtsis & Srisuresh Standards Track [Page 7]When the packet reaches the NAPT-PT box, NAPT-PT would assign one of the TCP ports from the assigned V4 address to translate the tuple of (Source Address, Source TCP port) as follows:SA=120.130.26.10, source TCP port = 1025 andDA=132.146.243.30, destination TCP port = 23.The returning traffic from 132.146.243.30, TCP port 23 will berecognised as belonging to the same session and will be translatedback to V6 as follows:SA = PREFIX::132.146.243.30, source TCP port = 23;DA = FEDC:BA98::7654:3210 , destination TCP port = 3017Inbound NAPT-PT sessions are restricted to one server per service,assigned via static TCP/UDP port mapping. For example, the Node[IPv6-A] in figure 1 may be the only HTTP server (port 80) in the V6 domain. Node [IPv4-C] sends a packet:SA=132.146.243.30, source TCP port = 1025 andDA=120.130.26.10, destination TCP port = 80NAPT-PT will translate this packet to:SA=PREFIX::132.146.243.30, source TCP port = 1025DA=FEDC:BA98::7654:3210, destination TCP port = 80In the above example, note that all sessions which reach NAPT-PT with a destination port of 80 will be redirected to the same node [IPv6-A].4. Use of DNS-ALG for Address AssignmentAn IPv4 address is assigned by NAT-PT to a V6 node when NAT-PTidentifies the start of session, inbound or outbound. Identification of the start of a new inbound session is performed differently thanfor outbound sessions. However, the same V4 address pool is used for assignment to V6 nodes, irrespective of whether a session isinitiated outbound from a V6 node or initiated inbound from a V4node.Policies determining what type of sessions are allowed and in whichdirection and from/to which nodes is out of the scope of thisdocument.Tsirtsis & Srisuresh Standards Track [Page 8]IPv4 name to address mappings are held in the DNS with "A" records.IPv6 name to address mappings are at the moment held in the DNS with "AAAA" records. "A6" records have also been defined but at the timeof writing they are neither fully standardized nor deployed.In any case, the DNS-ALG’s principle of operation described in thissection is the same with either "AAAA" or "A6" records. The onlydifference is that a name resolution using "A6" records may requiremore than one query - reply pairs. The DNS-ALG SHOULD, in that case, track all the replies in the transaction before translating an "A6"record to an "A" record.One of the aims of NAT-PT design is to only use translation whenthere is no other means of communication, such as native IPv6 or some form of tunneling. For the following discussion NAT-PT, in additionto the IPv4 connectivity that it has it may also have a native IPv6and/or a tunneled IPv6 connection.4.1 V4 Address assignment for incoming connections (V4 to V6)[DNS]--+| [DNS]------[DNS]-------[DNS][IPv6-B]-+ | || +==============+ |[IPv6-A]-+----[NAT-PT]------| IPv4 network |--[IPv4-C]| +==============+(pool of v4 addresses)Figure 2: IPv4 to IPv6 communicationNode IPv6-A has an IPv6 address -> FEDC:BA98::7654:3210Node IPv6-B has an IPv6 address -> FEDC:BA98::7654:3211Node IPv4-C has an IPv4 address -> 132.146.243.30NAT-PT has a pool of addresses including the IPv4 subnet120.130.26/24In figure 2 above, when Node C’s name resolver sends a name look uprequest for Node A, the lookup query is directed to the DNS server on the V6 network. Considering that NAT-PT is residing on the borderrouter between V4 and V6 networks, this request datagram wouldtraverse through the NAT-PT router. The DNS-ALG on the NAT-PT device would modify DNS Queries for A records going into the V6 domain asfollows: (Note that a TCP/UDP DNS packet is recognised by the factthat its source or destination port number is 53)a) For Node Name to Node Address Query requests: Change the Query type from "A" to "AAAA" or "A6".Tsirtsis & Srisuresh Standards Track [Page 9]b) For Node address to Node name query requests: Replace thestring "IN-ADDR.ARPA" with the string "IP6.INT". Replace theV4 address octets (in reverse order) preceding the string "IN- ADDR.ARPA" with the corresponding V6 address (if there exists a map) octets in reverse order.In the opposite direction, when a DNS response traverses from the DNS server on the V6 network to the V4 node, the DNS-ALG once againintercepts the DNS packet and would:a) Translate DNS responses for "AAAA" or "A6" records into "A"records, (only translate "A6" records when the name hascompletely been resolved)b) Replace the V6 address resolved by the V6 DNS with the V4address internally assigned by the NAT-PT router.If a V4 address is not previously assigned to this V6 node, NAT-PTwould assign one at this time. As an example say IPv4-C attempts toinitialise a session with node IPv6-A by making a name lookup ("A"record) for Node-A . The name query goes to the local DNS and fromthere it is propagated to the DNS server of the IPv6 network. TheDNS-ALG intercepts and translates the "A" query to "AAAA" or "A6"query and then forwards it to the DNS server in the IPv6 networkwhich replies as follows: (The example uses AAAA records forconvenience)Node-A AAAA FEDC:BA98::7654:3210,this is returned by the DNS server and gets intercepted andtranslated by the DNS-ALG to:Node-A A 120.130.26.1The DNS-ALG also holds the mapping between FEDC:BA98::7654:3210 and120.130.26.1 in NAT-PT. The "A" record is then returned to Node-C.Node-C can now initiate a session as follows:SA=132.146.243.30, source TCP port = 1025 andDA=120.130.26.1, destination TCP port = 80the packet will be routed to NAT-PT, which since it already holds amapping between FEDC:BA98::7654:3210 and 120.130.26.1 can translate the packet to:SA=PREFIX::132.146.243.30, source TCP port = 1025DA=FEDC:BA98::7654:3210, destination TCP port = 80the communication can now proceed as normal.Tsirtsis & Srisuresh Standards Track [Page 10]The TTL values on all DNS resource records (RRs) passing throughNAT-PT SHOULD be set to 0 so that DNS servers/clients do not cachetemporarily assigned RRs. Note, however, that due to some buggy DNSclient implementations a value of 1 might in some cases work better. The TTL values should be left unchanged for statically mappedaddresses.Address mappings for incoming sessions, as described above, aresubject to denial of service attacks since one can make multiplequeries for nodes residing in the V6 network causing the DNS-ALG tomap all V4 addresses in NAT-PT and thus block legitimate incomingsessions. Thus, address mappings for incoming sessions should timeout to minimise the effect of denial of service attacks.Additionally, one IPv4 address (using NAPT-PT, see 3.2) could bereserved for outgoing sessions only to minimise the effect of suchattacks to outgoing sessions.4.2 V4 Address assignment for outgoing connections (V6 to V4)V6 nodes learn the address of V4 nodes from the DNS server in the V4 domain or from the DNS server internal to the V6 network. Werecommend that DNS servers internal to V6 domains maintain a mapping of names to IPv6 addresses for internal nodes and possibly cachemappings for some external nodes. In the case where the DNS server in the v6 domain contains the mapping for external V4 nodes, the DNSqueries will not cross the V6 domain and that would obviate the need for DNS-ALG intervention. Otherwise, the queries will cross the V6domain and are subject to DNS-ALG intervention. We recommendexternal DNS servers in the V4 domain cache name mapping for external nodes (i.e., V4 nodes) only. Zone transfers across IPv4 - IPv6boundaries are strongly discouraged.In the case of NAPT-PT, a TCP/UDP source port is assigned from theregistered V4 address upon detection of each new outbound session.We saw that a V6 node that needs to communicate with a V4 node needs to use a specific prefix (PREFIX::/96) in front of the IPv4 addressof the V4 node. The above technique allows the use of this PREFIXwithout any configuration in the nodes.To create another example from Figure 2 say Node-A wants to set up a session with Node-C. For this Node-A starts by making a name look-up ("AAAA" or "A6" record) for Node-C.Since Node-C may have IPv6 and/or IPv4 addresses, the DNS-ALG on the NAT-PT device forwards the original AAAA/A6 query to the external DNS system unchanged, as well as an A query for the same node. If anAAAA/A6 record exists for the destination, this will be returned to Tsirtsis & Srisuresh Standards Track [Page 11]NAT-PT which will forward it, also unchanged, to the originatinghost.If there is an A record for Node-C the reply also returns to theNAT-PT. The DNS-ALG then, translates the reply adding the appropriate PREFIX and forwards it to the originating device with any IPv6addresses that might have learned. So, if the reply isNodeC A 132.146.243.30, it is translated toNodeC AAAA PREFIX::132.146.243.30 or toNodeC A6 PREFIX::132.146.243.30Now Node A can use this address like any other IPv6 address and theV6 DNS server can even cache it as long as the PREFIX does notchange.An issue here is how the V6 DNS server in the V6 stub domain talks to the V4 domain outside the V6 stub domain. Remember that there are no dual stack nodes here. The external V4 DNS server needs to point to a V4 address, part of the V4 pool of addresses, available to NAT-PT.NAT-PT keeps a one-to-one mapping between this V4 address and the V6 address of the internal V6 DNS server. In the other direction, the V6 DNS server points to a V6 address formed by the IPv4 address of theexternal V4 DNS servers and the prefix (PREFIX::/96) that indicatesnon IPv6 nodes. This mechanism can easily be extended to accommodate secondary DNS servers.Note that the scheme described in this section impacts DNSSEC. Seesection 7.5 of this document for details.5. Protocol Translation DetailsThe IPv4 and ICMPv4 headers are similar to their V6 counterparts but a number of field are either missing, have different meaning ordifferent length. NAT-PT SHOULD translate all IP/ICMP headers from v4 to v6 and vice versa in order to make end-to-end IPv6 to IPv4communication possible. Due to the address translation function andpossible port multiplexing, NAT-PT SHOULD also make appropriateadjustments to the upper layer protocol (TCP/UDP) headers. A separate section on FTP-ALG describes the changes FTP-ALG would make to FTPpayload as an FTP packet traverses from V4 to V6 realm or vice versa. Protocol Translation details are described in [SIIT], but there aresome modifications required to SIIT because of the fact that NAT-PTalso performs Network Address Translation.Tsirtsis & Srisuresh Standards Track [Page 12]5.1 Translating IPv4 headers to IPv6 headersThis is done exactly the same as in SIIT apart from the followingfields:Source Address:The low-order 32 bits is the IPv4 source address. The high-order 96 bits is the designated PREFIX for all v4communications. Addresses using this PREFIX will be routedto the NAT-PT gateway (PREFIX::/96)Destination Address:NAT-PT retains a mapping between the IPv4 destinationaddress and the IPv6 address of the destination node. TheIPv4 destination address is replaced by the IPv6 addressretained in that mapping.5.2 Translating IPv6 headers to IPv4 headersThis is done exactly the same as in SIIT apart from the SourceAddress which should be determined as follows:Source Address:The NAT-PT retains a mapping between the IPv6 source addressand an IPv4 address from the pool of IPv4 addressesavailable. The IPv6 source address is replaced by the IPv4address retained in that mapping.Destination Address:IPv6 packets that are translated have a destination addressof the form PREFIX::IPv4/96. Thus the low-order 32 bits ofthe IPv6 destination address is copied to the IPv4destination address.5.3 TCP/UDP/ICMP Checksum UpdateNAT-PT retains mapping between IPv6 address and an IPv4 address from the pool of IPv4 addresses available. This mapping is used in thetranslation of packets that go through NAT-PT.The following sub-sections describe TCP/UDP/ICMP checksum updateprocedure in NAT-PT, as packets are translated from V4 to V6 and vice versa.Tsirtsis & Srisuresh Standards Track [Page 13]。