??xml version="1.0" encoding="utf-8" standalone="yes"?>中文字幕日本人妻久久久免费,久久影视综合亚洲,精品久久久久久亚洲http://www.shnenglu.com/ivenher/category/789.htmlzh-cnMon, 19 May 2008 21:50:45 GMTMon, 19 May 2008 21:50:45 GMT60P2P communication across middleboxesQ翻?Q?/title>http://www.shnenglu.com/ivenher/articles/2682.html爱饭?/dc:creator>爱饭?/author>Thu, 12 Jan 2006 06:22:00 GMThttp://www.shnenglu.com/ivenher/articles/2682.htmlhttp://www.shnenglu.com/ivenher/comments/2682.htmlhttp://www.shnenglu.com/ivenher/articles/2682.html#Feedback0http://www.shnenglu.com/ivenher/comments/commentRss/2682.htmlhttp://www.shnenglu.com/ivenher/services/trackbacks/2682.html P2P communication across middleboxesQ翻?Q?BR> 原文版权QCopyright (C) The Internet Society (2003).All Rights Reserved.
Now consider the scenario in which the two clients (probably unknowingly) happen to reside behind the same NAT, and are therefore located in the same private IP address space. Client A has established a UDP session with server S, to which the common NAT has assigned public port number 62000. Client B has similarly established a session with S, to which the NAT has assigned public port number 62001.
Suppose that A and B use the UDP hole punching technique as outlined above to establish a communication channel using server S as an introducer. Then A and B will learn each other's public IP addresses and port numbers as observed by server S, and start sending each other messages at those public addresses.The two clients will be able to communicate with each other this way as long as the NAT allows hosts on the internal network to open translated UDP sessions with other internal hosts and not just with external hosts. We refer to this situation as "loopback translation," because packets arriving at the NAT from the private network are translated and then "looped back" to the private network rather than being passed through to the public network. For example, when A sends a UDP packet to B's public address, the packet initially has a source IP address and port number of 10.0.0.1:124 and a destination of 155.99.25.11:62001. The NAT receives this packet, translates it to have a source of 155.99.25.11:62000 (A's public address) and a destination of 10.1.1.3:1234, and then forwards it on to B. Even if loopback translation is supported by the NAT, this translation and forwarding step is obviously unnecessary in this situation, and is likely to add latency to the dialog between A and B as well as burdening the NAT.
我们假设QClient A ?Client B 要用上一节我们所描述?“UDP打洞技术”,q过服务器Sq个“媒人”来认识Q这样Client A 和Client B首先从服务端S得到了彼此的公网IP地址和端口,然后往Ҏ的公|IP地址和端口上发送消息。在q种情况下,如果NAT 仅仅允许?内部|主Z其他内部|主机(处于同一个NAT之后的网l主机)之间打开UDP会话通信通道Q而内部网L与其他外部网L׃允许的话Q那么Client A 和Client B可以通话了。我们把q种情Ş叫做“loopback translation?“回环{换?Q因为数据包首先从局域网的私有IP发送到NAT转换Q然后“绕一圈”,再回到局域网中来Q但是这hLq些数据通过公网传送好。D例来_?Client A发送了一个UDP数据包到 Client B的公|IP地址Q这个数据包的报头中׃有一个源地址10.0.0.1:124和一个目标地址155.99.25.11:62001。NAT接收到这个包以后Q就?q行地址转换)解析个包中有一个公|地址源地址155.99.25.11:62000和一个目标地址10.1.1.3:1234Q然后再发送给BQ虽说NAT支持“loopback translation”,我们也发玎ͼ在这U情形下,q个解析和发送的q程有些多余Qƈ且这个Client A 和Client B 之间的对话可能潜在性地lNAT增加了负担?BR>
The solution to this problem is straightforward, however. When A and B initially exchange address information through server S, they should include their own IP addresses and port numbers as "observed" by themselves, as well as their addresses as observed by S.The clients then simultaneously start sending packets to each other at each of the alternative addresses they know about, and use the first address that leads to successful communication. If the two clients are behind the same NAT, then the packets directed to their private addresses are likely to arrive first, resulting in a direct communication channel not involving the NAT. If the two clients are behind different NATs, then the packets directed to their private addresses will fail to reach each other at all, but the clients will hopefully establish connectivity using their respective public addresses. It is important that these packets be authenticated in some way, however, since in the case of different NATs it is entirely possible for A's messages directed at B's private address to reach some other, unrelated node on A's private network, or vice versa.
其实Q解册个问题的Ҏ是显而易见的。当 Client A和ClientB 最初通过服务器S交换彼此的地址信息Ӟ他们也就应该“发现”了自己的IP地址和端口——也是服务器S所发现的。两个客L同时的发?数据?到对方的公网地址和私有地址上,然后选择首先使得通信成功的那个地址可以了。如果两个客L都位于同一个NAT之后Q那么发往U有地址的数据包应该先于发往公网地址的数据包到达Q这样就建立了一个不包括NAT的直q通信通道。如果两个客L位于不同NAT之后Q虽然发送到ҎU有地址的数据包会毫无疑问的发送失败,但还是很有可能用他们各自的公网IP地址来徏立一条通信通道的。所以检这些数据包的方法和工作变得非帔R要,不论如何Q只要双斚w处于不同NAT之后Q就完全有可?Client A 惛_送到 Client B 的信息会被发到别的无关的地方去,反之亦然QClient B 惛_送到 Client A的消息也会被发到别的无关的地方去Q?BR>
(最后一句“unrelated node on A's private network”没有完全理解是什么意思,MQ放到整个语境中Q应该就是说QClient A 瞄准 Client B的私有地址端口的信息会被NAT转发到别的地方去Q因Z者处于不同的NAT之后QNAT A 如果?内部|络 扑ֈ了一个拥有与Client B相同的私有地址的电脑,׃把信息发送过去,q样Q就Ҏ不会发送到 Client B 上去)
]]>P2P communication across middleboxesQ翻?Q?/title>http://www.shnenglu.com/ivenher/articles/2681.html爱饭?/dc:creator>爱饭?/author>Thu, 12 Jan 2006 06:21:00 GMThttp://www.shnenglu.com/ivenher/articles/2681.htmlhttp://www.shnenglu.com/ivenher/comments/2681.htmlhttp://www.shnenglu.com/ivenher/articles/2681.html#Feedback0http://www.shnenglu.com/ivenher/comments/commentRss/2681.htmlhttp://www.shnenglu.com/ivenher/services/trackbacks/2681.htmlP2P communication across middleboxesQ翻?Q?BR> 原文版权QCopyright (C) The Internet Society (2003).? All Rights Reserved.
The third technique, and the one of primary interest in this document, is widely known as "UDP Hole Punching." UDP hole punching relies on the properties of common firewalls and cone NATs to allow appropriately designed peer-to-peer applications to "punch holes" through the middlebox and establish direct connectivity with each other, even when both communicating hosts may lie behind middleboxes. This technique was mentioned briefly in section 5.1 of RFC 3027 [NAT-PROT], and has been informally described elsewhere on the Internet [KEGEL] and used in some recent protocols [TEREDO, ICE]. As the name implies, unfortunately, this technique works reliably only with UDP.
We will consider two specific scenarios, and how applications can be designed to handle both of them gracefully. In the first situation, representing the common case, two clients desiring direct peer-to- peer communication reside behind two different NATs. In the second, the two clients actually reside behind the same NAT, but do not necessarily know that they do.
Suppose clients A and B both have private IP addresses and lie behind different network address translators. The peer-to-peer application running on clients A and B and on server S each use UDP port 1234.? A and B have each initiated UDP communication sessions with server S, causing NAT A to assign its own public UDP port 62000 for A's session with S, and causing NAT B to assign its port 31000 to B's session with S, respectively.
我们假设 Client A ?Client B 都拥有自qU有IP地址Qƈ且都处在不同的NAT之后Q端对端的程序运行于 CLIENT A,CLIENT B,S之间Qƈ且它们都开放了UDP端口1234?CLIENT A和CLIENT B首先分别与S建立通信会话Q这时NAT A把它自己的UDP端口62000分配lCLIENT A与S的会话,NAT B也把自己的UDP端口31000分配lCLIENT B与S的会话。如下图所C:
假如q个时?CLIENT A 想与 CLIENT B建立一条UDP通信直连Q如?CLIENT A只是单的发送一个UDP信息到CLIENT B的公|地址138.76.29.7:31000的话QNAT B会不加考虑的将q个信息丢弃Q除非NAT B是一?full cone NATQ,因ؓ q个UDP信息中所包含的地址信息Q与CLIENT B和服务器S建立q接时存储在NAT B中的服务器S的地址信息不符。同LQCLIENT B如果做同L事情Q发送的UDP信息也会?NAT A 丢弃?BR>
Suppose A starts sending UDP messages to B's public address, however, and simultaneously relays a request through server S to B, asking B to start sending UDP messages to A's public address.? A's outgoing messages directed to B's public address (138.76.29.7:31000) cause NAT A to open up a new communication session between A's private address and B's public address. At the same time, B's messages to A's public address (155.99.25.11:62000) cause NAT B to open up a new communication session between B's private address and A's public address. Once the new UDP sessions have been opened up in each direction, client A and B can communicate with each other directly without further burden on the "introduction" server S.
假如 CLIENT A 开始发送一?UDP 信息?CLIENT B 的公|地址上,与此同时Q他又通过S中{发送了一个邀请信息给CLIENT BQ请求CLIENT B也给CLIENT A发送一个UDP信息?CLIENT A的公|地址上。这时CLIENT A向CLIENT B的公|IP(138.76.29.7:31000)发送的信息D NAT A 打开一个处?CLIENT A的私有地址和CLIENT B的公|地址之间的新的通信会话Q与此同ӞNAT B 也打开了一个处于CLIENT B的私有地址和CLIENT A的公|地址(155.99.25.11:62000)之间的新的通信会话。一旦这个新的UDP会话各自向对Ҏ开了,CLIENT A和CLIENT B之间可以直接通信Q而无需S来牵U搭桥了?q就是所谓的打洞技?Q?BR>
The UDP hole punching technique has several useful properties. Once a direct peer-to-peer UDP connection has been established between two clients behind middleboxes, either party on that connection can in turn take over the role of "introducer" and help the other party establish peer-to-peer connections with additional peers, minimizing the load on the initial introduction server S. The application does not need to attempt to detect explicitly what kind of middlebox it is behind, if any [STUN], since the procedure above will establish peer- to-peer communication channels equally well if either or both clients do not happen to be behind a middlebox.? The hole punching technique even works automatically with multiple NATs, where one or both clients are removed from the public Internet via two or more levels of address translation.
]]>P2P communication across middleboxesQ翻?Q?/title>http://www.shnenglu.com/ivenher/articles/2680.html爱饭?/dc:creator>爱饭?/author>Thu, 12 Jan 2006 06:19:00 GMThttp://www.shnenglu.com/ivenher/articles/2680.htmlhttp://www.shnenglu.com/ivenher/comments/2680.htmlhttp://www.shnenglu.com/ivenher/articles/2680.html#Feedback0http://www.shnenglu.com/ivenher/comments/commentRss/2680.htmlhttp://www.shnenglu.com/ivenher/services/trackbacks/2680.htmlP2P communication across middleboxesQ翻?Q?BR> 从今天开始将陆箋译Peer-to-Peer (P2P) communication across middleboxesq篇文章,q没有按照章节次序来Q请读者见谅?BR> 原文版权QCopyright (C) The Internet Society (2003). All Rights Reserved.
A variant of the UDP hole punching technique discussed above exists that allows P2P UDP sessions to be created in the presence of some symmetric NATs. This method is sometimes called the "N+1" technique [BIDIR] and is explored in detail by Takeda [SYM-STUN]. The method works by analyzing the behavior of the NAT and attempting to predict the public port numbers it will assign to future sessions.
Consider again the situation in which two clients, A and B, each behind a separate NAT, have each established UDP connections with a permanently addressable server S:
让我们来考虑q样一U情况,有两个客L A ?BQ他们都藏在不同的NAT后面Q他们都开放了一个UDPq接l具有固定IP的Server SQ如下图
NAT A has assigned its own UDP port 62000 to the communication session between A and S, and NAT B has assigned its port 31000 to the session between B and S. By communicating through server S, A and B learn each other's public IP addresses and port numbers as observed by S. Client A now starts sending UDP messages to port 31001 at address 138.76.29.7 (note the port number increment), and client B simultaneously starts sending messages to port 62001 at address 155.99.25.11. If NATs A and B assign port numbers to new sessions sequentially, and if not much time has passed since the A-S and B-S sessions were initiated, then a working bi-directional communication channel between A and B should result.
A's messages to B cause NAT A to open up a new session, to which NAT A will (hopefully) assign public port number 62001, because 62001 is next in sequence after the port number 62000 it previously assigned to the session between A and S. Similarly, B's messages to A will cause NAT B to open a new session, to which it will (hopefully) assign port number 31001. If both clients have correctly guessed the port numbers each NAT assigns to the new sessions, then a bi-directional UDP communication channel will have been established as shown below.
NAT A 分配了它自己的UDP端口62000Q用来保?客户端A ?服务器S 的通信会话Q?NAT B 也分配了31000端口Q用来保?客户端B ?服务器S 的通信会话。通过?服务器S的对话,客户端A ?客户端B 都相互知道了Ҏ所映射的真实IP和端口?BR> 客户端A发送一条UDP消息?138.76.29.7:31001(h意到端口L增加)Q同?客户端B发送一条UDP消息?155.99.25.11:62001。如果NAT A 和NAT Bl箋分配端口l新的会话,q且从A-S和B-S的会话时间消耗得q不多的话,那么一条处于客LA和客LB之间的双向会话通道徏立了?BR> 客户端A发出的消息送达BD了NAT A打开了一个新的会话,q且我们希望 NAT A会指派62001端口l这个新的会话,因ؓ62001是62000后,NAT会自动指z 从服务器S到客LA之间的新会话的端口号Q类似的Q客LB发出的消息送达AD?NAT B打开了一个新的会话,q且我们希望 NAT B 会指派31001q个端口l新的会话;如果两个客户端都正确的猜到了对Ҏ会话被指z端口P那么q个 客户端AQ客LB的双向连接就被打通了。其l果如下图所C:
Obviously there are many things that can cause this trick to fail. If the predicted port number at either NAT already happens to be in use by an unrelated session, then the NAT will skip over that port number and the connection attempt will fail. If either NAT sometimes or always chooses port numbers non-sequentially, then the trick will fail.
If a different client behind NAT A (or B respectively) opens up a new outgoing UDP connection to any external destination after A (B) establishes its connection with S but before sending its first message to B (A), then the unrelated client will inadvertently "steal" the desired port number. This trick is therefore much less likely to work when either NAT involved is under load.
Since in practice a P2P application implementing this trick would still need to work if the NATs are cone NATs, or if one is a cone NAT and the other is a symmetric NAT, the application would need to detect beforehand what kind of NAT is involved on either end [STUN] and modify its behavior accordingly, increasing the complexity of the algorithm and the general brittleness of the network.
Finally, port number prediction has no chance of working if either client is behind two or more levels of NAT and the NAT(s) closest to the client are symmetric. For all of these reasons, it is NOT recommended that new applications implement this trick; it is mentioned here for historical and informational purposes.
]]>P2P communication across middleboxesQ术语篇Q?/title>http://www.shnenglu.com/ivenher/articles/2679.html爱饭?/dc:creator>爱饭?/author>Thu, 12 Jan 2006 06:18:00 GMThttp://www.shnenglu.com/ivenher/articles/2679.htmlhttp://www.shnenglu.com/ivenher/comments/2679.htmlhttp://www.shnenglu.com/ivenher/articles/2679.html#Feedback0http://www.shnenglu.com/ivenher/comments/commentRss/2679.htmlhttp://www.shnenglu.com/ivenher/services/trackbacks/2679.htmlP2P communication across middleboxesQ术语篇Q?BR> 2. Terminology
2. 术语
In this section we first summarize some middlebox terms. We focus hereon the two kinds of middleboxes that commonly cause problems for P2P applications.
A firewall restricts communication between a private internal network and the public Internet, typically by dropping packets that are deemed unauthorized. A firewall examines but does not modify the IP address and TCP/UDP port information in packets crossing the boundary.
A network address translator not only examines but also modifies the header information in packets flowing across the boundary, allowing many hosts behind the NAT to share the use of a smaller number of public IP addresses (often one). Network address translators in turn have two main varieties:
A Basic NAT maps an internal host's private IP address to a public IP address without changing the TCP/UDP port numbers in packets crossing the boundary. Basic NAT is generally only useful when the NAT has a pool of public IP addresses from which to make address bindings on behalf of internal hosts.
By far the most common, a Network Address/Port Translator examines and modifies both the IP address and the TCP/UDP port number fields of packets crossing the boundary, allowing multiple internal hosts to share a single public IP address simultaneously.
Refer to [NAT-TRAD] and [NAT-TERM] for more general information on NAT taxonomy and terminology. Additional terms that further classify NAPT are defined in more recent work [STUN]. When an internal host opens an outgoing TCP or UDP session through a network address/port translator, the NAPT assigns the session a public IP address and port number so that subsequent response packets from the external endpoint can be received by the NAPT, translated, and forwarded to the internal host. The effect is that the NAPT establishes a port binding between (private IP address, private port number) and (public IP address, public port number).
The port binding defines the address translation the NAPT will perform for the duration of the session. An issue of relevance to P2P applications is how the NAT behaves when an internal host initiates multiple simultaneous sessions from a single (private IP, private port) pair to multiple distinct endpoints on the external network.
After establishing a port binding between a (private IP, private port) tuple and a (public IP, public port) tuple, a cone NAT will re-use this port binding for subsequent sessions the application may initiate from the same private IP address and port number, for as long as at least one session using the port binding remains active.
For example, suppose Client A in the diagram below initiates two simultaneous outgoing sessions through a cone NAT, from the same internal endpoint (10.0.0.1:1234) to two different external servers, S1 and S2. The cone NAT assigns just one public endpoint tupleQ元l), 155.99.25.11:62000, to both of these sessions, ensuring that the "identity" of the client's port is maintained across address translation. Since Basic NATs and firewalls do not modify port numbers as packets flow across the middlebox, these types of middleboxes can be viewed as a degenerate form of Cone NAT.
A symmetric NAT, in contrast, does not maintain a consistent port binding between (private IP, private port) and (public IP, public port) across all sessions.
Instead, it assigns a new public port to each new session. For example, suppose Client A initiates two outgoing sessions from the same port as above, one with S1 and one with S2. A symmetric NAT might allocate the public endpoint 155.99.25.11:62000 to session 1, and then allocate a different public endpoint 155.99.25.11:62001, when the application initiates session 2. The NAT is able to differentiate between the two sessions for translation purposes because the external endpoints involved in the sessions (those of S1 and S2) differ, even as the endpoint identity of the client application is lost across the address translation boundary.
The issue of cone versus symmetric NAT behavior applies equally to TCP and UDP traffic. Cone NAT is further classified according to how liberally the NAT accepts incoming traffic directed to an already-established (publicIP, public port) pair. This classification generally applies only to UDP traffic, since NATs and firewalls reject incoming TCP connection attempts unconditionally unless specifically configured to do otherwise.
After establishing a public/private port binding for a new outgoing session, a full cone NAT will subsequently accept incoming traffic to the corresponding public port from ANY external endpoint on the public network. Full cone NAT is also sometimes called "promiscuous" NAT.
A restricted cone NAT only forwards an incoming packet directed to a public port if its external (source) IP address matches the address of a node to which the internal host has previously sent one or more outgoing packets. A restricted cone NAT effectively refines the firewall principle of rejecting unsolicited incoming traffic, by restricting incoming traffic to a set of "known" external IP addresses.
A port-restricted cone NAT, in turn, only forwards an incoming packet if its external IP address AND port number match those of an external endpoint to which the internal host has previously sent outgoing packets. A port-restricted cone NAT provides internal nodes the same level of protection against unsolicited incoming traffic that a symmetric NAT does, while maintaining a private port's identity across translation.
P2P-application as used in this document is an application in which each P2P participant registers with a public registration server, and subsequently uses either its private endpoint, or public endpoint, or both, to establish peering sessions.
P2P-Middlebox
A P2P-Middlebox is middlebox that permits the traversal of P2P applications.
P2P代理
P2P代理是一个允?P2P应用E序q行通信的代理机?BR>
P2P-firewall
A P2P-firewall is a P2P-Middlebox that provides firewall functionality but performs no address translation.
P2P防火?BR> P2P防火墙是一个提供了防火墙的功能的P2P代理Q但是不q行地址转换.
P2P-NAT
A P2P-NAT is a P2P-Middlebox that provides NAT functionality, and may also provide firewall functionality. At minimum, a P2P-Middlebox must implement Cone NAT behavior for UDP traffic, allowing applications to establish robust P2P connectivity using the UDP hole punching technique.
When a host in the private domain of a NAT device attempts to connect with another host behind the same NAT device using the public address of the host, the NAT device performs the equivalent of a "Twice-nat" translation on the packet as follows. The originating host's private endpoint is translated into its assigned public endpoint, and the target host's public endpoint is translated into its private endpoint, before the packet is forwarded to the target host. We refer the above translation performed by a NAT device as "Loopback translation".
]]>P2P communication across middleboxesQ前a)http://www.shnenglu.com/ivenher/articles/2678.html爱饭?/dc:creator>爱饭?/author>Thu, 12 Jan 2006 06:16:00 GMThttp://www.shnenglu.com/ivenher/articles/2678.htmlhttp://www.shnenglu.com/ivenher/comments/2678.htmlhttp://www.shnenglu.com/ivenher/articles/2678.html#Feedback0http://www.shnenglu.com/ivenher/comments/commentRss/2678.htmlhttp://www.shnenglu.com/ivenher/services/trackbacks/2678.html 原文地址Q?A target=_blank>http://midcom-p2p.sourceforge.net/draft-ford-midcom-p2p-01.txt
Present-day Internet has seen ubiquitous deployment of "middleboxes" such as network address translators(NAT), driven primarily by the ongoing depletion of the IPv4 address space. The asymmetric addressing and connectivity regimes established by these middleboxes, however, have created unique problems for peer-to-peer (P2P) applications and protocols, such as teleconferencing and multiplayer on-line gaming. These issues are likely to persist even into the IPv6 world, where NAT is often used as an IPv4 compatibility mechanism [NAT-PT], and firewalls will still be commonplace even after NAT is no longer required.
Currently deployed middleboxes are designed primarily around the client/server paradigm, in which relatively anonymous client machines actively initiate connections to well-connected servers having stable IP addresses and DNS names.
Most middleboxes implement an asymmetric communication model in which hosts on the private internal network can initiate outgoing connections to hosts on the public network, but external hosts cannot initiate connections to internal hosts except as specifically configured by the middlebox's ****istrator. In the common case of NAPT, a client on the internal network does not have a unique IP address on the public Internet, but instead must share a single public IP address, managed by the NAPT, with other hosts on the same private network.The anonymity and inaccessibility of the internal hosts behind a middlebox is not a problem for client software such as web browsers, which only need to initiate outgoing connections. This inaccessibility is sometimes seen as a privacy benefit.
In the peer-to-peer paradigm, however, Internet hosts that would normally be considered "clients" need to establish communication sessions directly with each other. The initiator and the responder might lie behind different middleboxes with neither endpoint having any permanent IP address or other form of public network presence. A common on-line gaming architecture, for example, is for the participating application hosts to contact a well-known server for initialization and ****istration purposes. Subsequent to this, the hosts establish direct connections with each other for fast and efficient propagation of updates during game play.
Similarly, a file sharing application might contact a well-known server for resource discovery or searching, but establish direct connections with peer hosts for data transfer. Middleboxes create problems for peer-to-peer connections because hosts behind a middlebox normally have no permanently usable public ports on the Internet to which incoming TCP or UDP connections from other peers can be directed.
RFC 3235 [NAT-APPL] briefly addresses this issue, but does not offer any general solutions.
In this document we address the P2P/middlebox problem in two ways. First, we summarize known methods by which P2P applications can work around the presence of middleboxes. Second, we provide a set of application design guidelines based on these practices to make P2P applications operate more robustly over currently-deployed middleboxes. Further, we provide design guidelines for future middleboxes to allow them to support P2P applications more effectively. Our focus is to enable immediate and wide deployment of P2P applications requiring to traverse middleboxes.
A. 源地址(内网IP地址)不同Q忽略其它因? 在NAPT上肯定对应不同的Session B. 源地址(内网IP地址)相同Q源端口不同Q忽略其它的因素Q则在NAPT上也肯定对应不同的Session C. 源地址(内网IP地址)相同Q源端口相同Q目的地址(公网IP地址)相同Q目的端口不同,则在NAPT上肯定对应同一个Session D. 源地址(内网IP地址)相同Q源端口相同Q目的地址(公网IP地址)不同Q忽略目的端口,则在NAPT上是如何处理Session的呢Q?BR> D的情冉|式我们关心和要讨论的问题。依据目的地址(公网IP地址)对于Session的徏立的军_方式我们NAPT讑֤划分Z大类:
看完了上面的数据l构是更明白了还是更晕了Q?呵呵! 多想一会儿׃明白了。通过NAT,内网计算机向外q结是很Ҏ的,NAPT会自动处理,我们的应用程序根本不必关心它是如何处理的。那么外部的计算机想讉K内网中的计算机如何实现呢Q我们来看一下下面的程Q?BR> c 是一台在NAPT后面的内|计机Qs是一台有外网IP地址的计机。c d?s 发vq接hQNAPT依据上面描述的规则在自己的数据结构中记录下来Q徏立一个Session. 然后 c ?s 之间可以实现双向的透明的数据传输了。如下面所C?
1. A 惌?B, A 从服务器那儿获取?B 的NAT地址和映端? A 通知服务器,服务器告?B A的NAT地址和映端? B ?A 发vq接QA 肯定无法接收到。此?A ?B 发vq接Q?A 对应的NAT建立了一个新的SessionQ分配了一个新的映端口, B ?NAT 接收到UDP包后Q在自己的映表中查询,无法扑ֈ映射,因此包丢弃了?BR> 2. B 惌?A, B 从服务器那儿获取?A 的NAT地址和映端? B 通知服务? 服务器告?A B的NAT地址和映端?A ?B 发vq接, A 对应的NAT建立了一个新的SessionQ分配了一个新的映端口B肯定无法接收到。此?B ?A 发vq接, ׃ B 无法获取 A 建立的新的Session的映端口,仍是使用服务器上获取的映端口进行连接, 因此 A 的NAT在接收到UDP包后Q在自己的映表中查询,无法扑ֈ映射? 因此包丢弃了?BR> Ҏ以上分析Q只有当q接的两端的NAT都ؓCone NAT的情况下Q才能进行UDP的内|穿透互联?BR>
NAPT(The IP Network Address/Port Translator) q行UDPIK如何进行现实的验证和分?