1、张鹏毕设英文翻译西安邮电学院 毕 业 设 计(译 文)论文题目: P2P技术在多媒体服务中的应用研究 院 (系): 通信与信息工程学院 专 业: 通 信 工 程 班 级: 通工0614班 学生姓名: 张 鹏 导师姓名: 杨小宝 职称: 工程师 DirectoryPeer-to-Peer (P2P) communication across middle-boxes 13.1Relaying 13.2Connection reversal 13.3UDP hole punching 33.3.1Peers behind different NATs 33.3.2Peers behind the
2、same NAT 53.3.3Peers separated by multiple NATs 63.3.4Consistent port bindings 73.4UDP port number prediction 73.5Simultaneous TCP open 9目录利用代理服务器的P2P通信 13.1转发 13.2反向连接 13.3UDP打洞技术 23.3.1处于不同NAT之后的客户端通信 23.3.2客户端都处于相同的NAT之后 33.3.3客户端分别处于多层NAT之后 43.3.4保持端口绑定 53.4UPD端口号预言 53.5同时开放TCP连接 6Peer-to-Peer (
3、P2P) communication across middle-boxesTechniques for P2P Communication over middle-boxesThis section reviews in detail the currently known techniques for implementing peer-to-peer communication over existing middle boxes, from the perspective of the application or protocol designer.3.1RelayingThe mo
4、st reliable, but least efficient, method of implementing peer-to-peer communication in the presence of a middle-box is to make the peer-to-peer communication look to the network like client/server communication through relaying. For example, suppose two client hosts, A and B, have each initiated TCP
5、 or UDP connections with a well-known server S having a permanent IP address.The clients reside on separate private networks, however, and their respective middleboxes prevent either client from directly initiating a connection to the other(as in FIG 1-1).FIG 1-1 Server RelayingInstead of attempting
6、 a direct connection, the two clients can simply use the server S to relay messages between them. For example, to send a message to client B, client A simply sends the message to server S along its already-established client/server connection, and server S then sends the message on to client B using
7、 its existing client/server connection with B.This method has the advantage that it will always work as long as both clients have connectivity to the server. Its obvious disadvantages are that it consumes the servers processing power and network bandwidth unnecessarily, and communication latency bet
8、ween the two clients is likely to be increased even if the server is well- connected. The TURN protocol TURN defines a method of implementing relaying in a relatively secure fashion.3.2Connection reversalThe second technique works if only one of the clients is behind a middle box. For example, suppo
9、se client A is behind a NAT but client B has a globally routable IP address, as in the FIG1-2: FIG 1-2 Connection reversalClient A has private IP address 10.0.0.1, and the application is using TCP port 1234.This client has established a connection with server S at public IP address 18.181.0.31 and p
10、ort 1235.NAT A has assigned TCP port 62000, at its own public IP address 155.99.25.11, to serve as the temporary public endpoint address for As session with S: therefore, server S believes that client A is at IP address 155.99.25.11 using port 62000. Client B, however, has its own permanent IP addre
11、ss, 138.76.29.7, and the peer-to-peer application on B is accepting TCP connections at port 1234.Now suppose client B would like to initiate a peer-to-peer communication session with client A. B might first attempt to contact client A either at the address client A believes itself to have, namely 10
12、.0.0.1:1234, or at the address of A as observed by server S, namely 155.99.25.11:62000. In either case, however, the connection will fail. In the first case, traffic directed to IP address 10.0.0.1 will simply be dropped by the network because 10.0.0.1 is not a publicly routable IP address. In the s
13、econd case, the TCP SYN request from B will arrive at NAT-A directed to port 62000, but NAT A will reject the connection request because only outgoing connections are allowed.After attempting and failing to establish a direct connection to A, client B can use server S to relay a request to client A
14、to initiate a reversed connection to client B. Client A, upon receiving this relayed request through S, opens a TCP connection to client B at Bs public IP address and port number. NAT A allows the connection to proceed because it is originating inside the firewall, and client B can receive the conne
15、ction because it is not behind amiddle-box.A variety of current peer-to-peer systems implement this technique.Its main limitation, of course, is that it only works as long as only one of the communicating peers is behind a NAT: in the increasingly common case where both peers are behindNAT-s,the met
16、hod fails.Because connection reversal is not a general solution to the problem,it is NOT recommended as a primary strategy. Applications may choose to attempt connection reversal, but should be able to fall back automatically on another mechanism such as relaying if neither a forward nor a reverse c
17、onnection can be established.3.3UDP hole punchingThe 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
18、 holes through the middle-box 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
19、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 dir
20、ect peer-to-peer communication reside behind two different NAT-s.In the second,the two clients actually reside behind the same NAT, but do not necessarily know that they do.3.3.1Peers behind different NATsSuppose clients A and B both have private IP addresses and lie behind different network address
21、 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 As session with S, and causing NAT B to assign its port 31000 to
22、 Bs session with S, respectively.FIG 1-3 A and B communication sessions with server SNow suppose that client A wants to establish a UDP communication session directly with client B.If A simply starts sending UDP messages to Bs public address, 138.76.29.7:31000, then NAT B will typically discard thes
23、e incoming messages (unless it is a full cone NAT), because the source address and port number does not match those of S, with which the original outgoing session was established.Similarly, if B simply starts sending UDP messages to As public address, then NAT A will typically discard these messages
24、.Suppose A starts sending UDP messages to Bs public address, however, and simultaneously relays a request through server S to B, asking B to start sending UDP messages to As public address. As outgoing messages directed to Bs public address (138.76.29.7:31000) cause NAT A to open up a new communicat
25、ion session between As private address and Bs public address. At the same time, Bs messages to As public address (155.99.25.11:62000) cause NAT B to open up a new communication session between Bs private address and As public address. Once the new UDP sessions have been opened up in each direction,
26、client A and B can communicate with each other directly without further burden on the introduction server S.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 conne
27、ction 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 STU
28、N, 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 t
29、wo or more levels3.3.2Peers behind the same NATNow 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
30、 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.FIG 1-4 A,B established a UDP session with server SSuppose that A and B use the UDP hole punching technique as outlined above to establish a communicati
31、on channel using server S as an introducer.Then A and B will learn each others 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
32、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 Bs public address, the packet initially has a source IP address
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1