`
isiqi
  • 浏览: 16049509 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论
阅读更多

原文:http://nutss.gforge.cis.cornell.edu/pub/imc05-tcpnat/

译者:云中哈哈

翻译开始时间:2007.1.22

译文:

Abstract:

概要

Inrecentyears,thestandardscommunityhasdevelopedtechniquesfortraversingNAT/firewallboxeswithUDP(thatis,establishingUDPflowsbetweenhostsbehindNATs).BecauseoftheasymmetricnatureofTCPconnectionestablishment,however,NATtraversalofTCPismoredifficult.ResearchershaverecentlyproposedavarietyofpromisingapproachesforTCPNATtraversal.Thesuccessoftheseapproaches,however,dependonhowNATboxesrespondtovarioussequencesofTCP(andICMP)packets.

近几年,标准化连接已经发展了用UDP穿透NAT和防火墙的技术,那就是,在主机和NAT间建立UDP流。因为TCP连接建立的不对称性,所以TCP穿透NAT是比较困难的。近期,研究者们通过大量的渠道去尝试TCP穿透NAT,依赖于NAT回复的大量TCP和ICMP包的顺序,终于有方法得以成功打通NAT。

ThispaperpresentsthefirstbroadstudyofNATbehaviorforacomprehensivesetofTCPNATtraversaltechniquesoverawiderangeofcommercialNATproducts.WedevelopedapubliclyavailablesoftwaretestsuitethatmeasurestheNAT'sresponsesbothtoavarietyofisolatedprobesandtocompleteTCPconnectionestablishments.WetestsixteenNATproductsinthelab,and93homeNATsinthewild.Usingtheseresults,aswellasmarketdataforNATproducts,weestimatethelikelihoodofsuccessfulNATtraversalforhomenetworks.TheinsightsgainedfromthispapercanbeusedtoguidebothdesignofTCPNATtraversalprotocolsandthestandardizationofNAT/firewallbehavior,includingtheIPv4-IPv6translatingNATscriticalforIPv6transition.

此页介绍了一次广泛的研究,通过不同种类的NAT产品,使用一组全面的TCP穿透的技术,来学习NAT的行为。我们开发了一个公共存在的软件测试套件,不管是用大量独立的探针,还是完全建立的TCP连接,它能确认NAT的回复信息。我们在实验室中测试6种类型的NAT产品,还有在外面的93种家庭NAT。用这些结果,只要是市场上的NAT产品的数据,我们都能估计家庭网络成功穿透这类产品的可能性。从此页中所获得的这种洞查力将可以使用于指导TCP穿透NAT协议的设计,还可以使用于使NAT或防火墙的行为标准化,包括IPv4-IPv6转换NAT的IPv6转换鉴定.

1Introduction

1介绍

Networkaddressandporttranslators(NATs)andfirewallsbreaktheIPconnectivitymodelby preventinghostsoutsidetheprotectednetwork2frominitiatingaconnectionwithahostinsidethe protectednetwork.IfbothendpointsareprotectedbytheirrespectiveNATorfirewall,ordinaryTCP cannotbeestablishedsincetheendinitiatingtheTCPisoutsidetheotherend'sNAT3.Thisistrueeveniftheconnectionwouldbeallowedaccordingtoeachend'sfirewallsecuritypolicy.Forinstance,ifthefirewallpolicyisthatinternalhostsmayinitiateTCPconnections,andbothhostswishtoinitiate.

网络地址和端口映射机制和防火墙,会打破IP接连模式,防止外网终端连接内网终端,中断他们正在建立的联接。如果两台终端都处于各自的NAT和防火墙内时,当终端初使化的这个TCP连接在其它的NAT外时,这种普通的TCP接连是不能建立成功的。但是,如果终端们各自的防火墙的安全配置允可的话,那么,这个接连是可以成功的。例子:我们可以把防火墙设置为:当终端双方都希望去建立时,允许内部的主机去初使化一个TCP接连与外部主机相联。

Recentworkhasproposedwork-aroundsthatestablishaTCPconnectionwithouttheuseofproxiesortunnels[9,5,3,6].Thisisaccomplishedbysettingupthenecessaryconnection-stateontheNATthroughacarefullycraftedexchangeofTCPpackets.However,notallNATsinthewildreactthesameway,causingtheseapproachestofailinvariouscases.UnderstandingsuchbehaviorinNATsandmeasuringhowmuchtheydetractfromtheoriginalgoalofuniversalconnectivityintheInternetiscrucialtointegratingthemcleanlyintothearchitecture.

最近,建立TCP接连工作打算不用代理和通道〔9,5,3,6〕,而是把它们聚合在一起。通过一种安全的TCP包转换步骤,在NAT上完全建立一种必须的接连状态。然而在外网上,不是所有的NAT都能这么做,还是有很多种的情况会导致这些步骤的失败。明白了NAT的行为,确认有多少在网络上的原始目的地连接,能很是清楚地把他们结合进框架中来。

TheInternetarchitecturetodayisvastlydifferentfromthatenvisionedwhenTCP/IPwasdesigned.FirewallsandNATsoftenmakeitimpossibletoestablishaconnectionevenifitdoesnotviolatepolicy.Forinstance,AliceandBobmaydisallowunsolicitedconnectionsbyhidingbehindaNATorconfiguringtheirfirewallstodropinboundSYNpackets.YetwhenbothAliceandBobagreetoestablishaconnectionthereisnowaytodosowithoutreconfiguringtheirNATsinceAlice'sSYNisdroppedbyBob'sNATandviceversa.Evenso,NATsandfirewallshavebecomeapermanentpartofthenetworkinfrastructureandwillcontinuetoremainsoforalongtime.EvenifIPv6isdeployedglobally,IPv4-IPv6NATswillbeneededduringthelengthytransition,andIPv6firewallswillbeneededforsecurity.Asaresult,mechanismsthatenabletwoconsentinghostsbehindNATstocommunicatewitheachotherareneeded.

网络结构演变到今天,已经与当初TCP/IP被设计时所预想的样子,有了巨大的不同。防火墙和NAT的出现,经常让网络没有办法去建立一个连接,甚至当这个连接是没有违反约束的时候也不可以。举例:Alice和Bob可能不允许让一个在NAT后面的没有请求的连接建立成功,或者设置他们的防火墙去丢掉返回的SYN(同步信号)包,然而当他们都同意希望去建立一个连接时,Alice的SYN包会被Bob的NAT扔掉,相反的连接也是如此,他们都没有办法建立除非重新设置他们的NAT。尽管如此,NAT和防火墙在网络下层构架中还是一个永远不可替代的部份,而且会在很长的时间内继续扮演下去。甚至当IPv6的展开全球化,在过度的转换中还是需求IPv4-IPv6NAT来进行地址转换,而且IPv6防火墙将会被用于安全方面。最终,我们需要一种能够会让两台在NAT后的受允许的主机互相通讯的机制。

ThisproblemhasbeensolvedforUDPbySTUN[15].InSTUN,AlicesendsaUDPpackettoBob.AlthoughthispacketisdroppedbyBob'sNAT,itcausesAlice'sNATtocreatelocalstatethatallowsBob'sresponsetobedirectedtoAlice.BobthensendsaUDPpackettoAlice.Alice'sNATconsidersitpartofthefirstpacket'sflowandroutesitthrough,whileBob'sNATconsidersitaconnectioninitiationandcreateslocalstatetorouteAlice'sresponses.ThisapproachisusedbySkype,apopularVoIPapplication[2].Unfortunately,establishingTCPismorecomplicated.OnceAlicesendsherSYNpacket,herOSstackaswellasherNATexpecttoreceiveaSYNACKpacketfromBobinresponse.However,sincetheSYNpacketwasdropped,Bob'sstackdoesn'tgeneratetheSYNACK.Proposedworkaroundstotheproblemarecomplicated,theirinteractionswithNATsinthewildarepoorlyunderstood,andtheextenttowhichtheysolvetheproblemisnotknown.Consequentlyapplicationssuchasthefile-transfermoduleinSkypeusecontraindicatedprotocolslikeUDP.Whilesuchapproachesmaywork,webelieveitisimportantthatwhereverpossible,applicationsusethenativeOSTCPstack.Thisisinparttoavoidincreasinglycomplexprotocolstacks,butmoreimportantlybecauseTCPstackshave,overtheyears,beencarefullyoptimizedforhighperformanceandcongestionfriendliness.

这个问题已经可以通过STUN[15]的UDP去解决。在STUN[15]中,Alice发送一个UDP包给Bob,尽管这个包被Bob的NAT所丢弃,这时,Bob发送一个UDP包给Alice,Alice的NAT根据第一个包流的部份东西去判断它,让他通过,当Bob的NAT考虑他是一个连接的初使化,并创建一个本地的状态去让Alice的回复通过。这个程序是Skype所使用的。SKYPE是一个流行的VoIP程序,他的操作系统栈好像他的NAT一样,期望去接收一个Bob回复来的SYN确认包。然而,当SYN包被丢弃时,Bob的栈由于收不到,不能产生一个SYN确认包。为了问题而做的计划是复杂的,他们在外部经过NAT的交流不可能成功的,并且他们解决此问题的扩展也是不能知道的。因此,那些好像在SKYPE使用的文件传输模式的程序使用不恰当的协议类似于UDP。当这些方法能工作时,程序使用的是原始的操作系统TCP协议栈,我们相信这否可能实现都很重要。这是一个方面它可以避免增加复杂的协议栈,更重要的是这几年TCP栈很小心的在高性能和用户友好性的优化,使之能更好的使用。


Overallthisworkmakesfourcontributions.First,weidentifyanddescribethecompletesetofNATcharacteristicsimportanttoTCPNATtraversal.Second,wemeasuretheprevalencebothoftheseindividualcharacteristicsandofthesuccessrateofpeer-to-peerTCPconnectionsforthevariousproposedapproaches.Third,basedonthesemeasurements,wesuggestmodificationstotheproposedapproaches.Fourth,weprovidepublic-domainsoftwaretoolkitthatcanbeusedtomeasureNATsastheyevolve,andasthebasisofTCPNATtraversalinP2Papplications.AltogetherweprovideinsightsforapplicationdevelopersintotheinherenttradeoffsbetweenimplementationcomplexityandNAT-traversalsuccessrate.Finally,ourresultscanbeusedtoguidethestandardizationprocessofNATsandfirewalls,makingthemmoretraversalfriendlywithoutcircumventingsecuritypolicies.

全部的工作有四种贡献。一:我们识别并描述这一套NAT特性的设置对使用TCP进行NAT传输来说很重要,二:我们得以在大量提议的方法中去测量普遍的情况,不管是这些独立的特性的流行度还是使用TCP做P2P连接的成功率的流行度。三,根据这些测量,我们能够对这些提议出来的方法进行建议修改。四、我提供公共的软件工具包,它能被随便NAT的发展进行测量。并且,能够做为通过TCP进行P2P程序在NAT上传输的基础。总而言之,我们能提供这种洞察力,在程序发展深入到内在的固有程度上,能使用它找到在复杂的工具和NAT传输成功率之间的一种平衡点。最后,我们的结果能被用于引导标准化的NAT和防火墙程序的开发,使得它们不需要围绕严格的策略就能更加友好地穿越。


Therestofthepaperisorganizedasfollows.Section2discussestheproposedTCPNAT-traversalapproaches.Section3andSection4explainoursetupfortestingNATsandtheobservedNATbehavior.Section5analyzesport-predictionandSection6analyzespeer-to-peerTCPestablishment.Section7discussesrelatedwork.Section8concludesthepaper.

接下来的内容如下:第二部份是讨论支持TCP的NAT穿透方法。第三和第四部份描述了我们的测试NAT和观察NAT的行为。第五部份分析了端口预言机制,第六部份分析了对等网的TCP建立。第7部份讨论了有关的工作,最后一部份为结束感言。

2TCPNAT-Traversal

第二部份:TCP的NAT穿透

InthissectionwediscusstheTCPNAT-traversalapproachesthathavebeenproposedinrecentliterature.Inalltheapproaches,bothendsinitiateaTCPconnection.TheoutboundSYNpacketfromeachhostcreatesthenecessaryNATstateforitsownNATs.EachapproachthenreconcilesthetwoTCPattemptsintoasingleconnectionthroughdifferentmechanismsasdescribedinthissection.TheaddressandporttowhichtheseoriginalSYNsaresentisdeterminedthroughportprediction.PortpredictionallowsahosttoguesstheNATmappingforaconnectionbeforesendingtheoutboundSYNandisdiscussedindetaillater.Theapproachesalsorequiresomecoordinationbetweenthetwohosts.Thisisaccomplishedoveranout-of-bandchannelsuchasaconnectionproxiedbyathirdpartyoraUDP/STUNsession.

在这节中我们讨论的是,在最近的文献中所提出的TCP穿透NAT的方法,以及结束或开始一个TCP的连接。从各自的主机外出的SYN包,为他们自己的NAT产生可能的NAT状态。这章中,每一种方法都通过一种简单的连接,经过之前描述过的那些不同的机器,去调节两种TCP的企图。地址和端口指向那些最初的SYN包发向的通过端口预指定的地方。端口预报允许一个主机去猜测NAT映射,找到一个在发出外发的SYN包的连接,这个在之后还会讨论到。这个方法也需要两部主机之前的协作。这是完整地经过一个不得穿越的链路,就像是通过一个第三方的或是UDP/STUN会话的连接代理。

OncethedirectTCPconnectionisestablished,theout-of-bandchannelcanbeclosed.ThereconciliationmechanismusedtriggersdifferentbehaviorindifferentNATscausingtheproposedapproachestofailinmanyinstances.Inaddition,itispossibleforeitherendpointtobebehindmultipleNATs4inserial.InsuchcasesthebehaviorobservedisacompositeofthebehaviorofalltheNATsandfirewallsinthepath.Forbrevityweshalloverloadtheterm`NAT'tomeanthecompositeNAT/firewall.

一旦这个直接的TCP连接被建立,这个不可越的链路就能被关闭。重连机制使用触发不同的行为作用于不同的NAT,这种方法在很多的实例上会使得那些提议的方法失效。另外。那些在在NAT后。。。。这种发现行为的方法是一种在这些路径中的NAT和防火墙的行为的复合。为了简单,我们把NAT与防火墙的复合单单用NAT来复合。



(a)STUNT#1



(b)STUNT#2



(c)NATBlaster



(d)P2PNAT

Figure1:PacketsgeneratedbyvariousTCPNAT-traversalapproaches.SolidlinesareTCP/IPandICMPpacketspertainingtotheconnectionattemptwhiledottedlinesarecontrolmessagessentoveranout-of-bandchannel.

图1:通过大量的TCP穿透NAT方法来产生包。当虚线是控制消息被发送到一个不能穿透的链路时,实线是TCP/IP和ICMP包进行连接的意图的指示。



Approach NAT/NetworkIssues LinuxIssues WindowsIssues
STUNT#1 DeterminingTTL Superuserpriv. Superuserpriv.
ICMPerror SettingTTL
TCPSeq#changes
IPAddressSpoofing
STUNT#2 DeterminingTTL SettingTTL
ICMPerror
SYN-outSYN-in
NATBlaster DeterminingTTL Superuserpriv. Superuserpriv.
ICMPerror SettingTTL
TCPSeq#changes RAWsockets(postWinXPSP2)
SYN-outSYNACK-out
P2PNAT TCPsimultaneousopen TCPsimultaneousopen(preWinXPSP2)
Packetflood
STUNT#1no-TTL RSTerror Superuserpriv. Superuserpriv.
TCPSeq#changes TCPsimultaneousopen(preWinXPSP2)
Spoofing
STUNT#2no-TTL RSTerror
SYN-outSYN-in
NATBlasterno-TTL RSTerror Superuserpriv. Superuserpriv.
TCPSeq#changes RAWsockets(postWinXPSP2)
SYN-outSYNACK-out TCPsimultaneousopen(preWinXPSP2)

Table1:NATandnetworkissuesencounteredbyvariousTCPNAT-traversalapproachesaswellastheimplementationissuesweencountered.
表一:通过大量的TCP穿透NAT方法和我们的执行结果来计算出的NAT以及网络的问题,

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics