简体   繁体   English

Bittorent协议。 同一对等体之间的多次下载

[英]Bittorent protocol. Multiple downloads between same peers

I'am just started to studying bittorent protocol and have one question about bittorrent clients that uses same ports for all incoming connections. 我才刚刚开始研究苦涩的协议,并对有关将所有传入连接使用相同端口的Bittorrent客户端有一个问题。

Here is example of my problem: 这是我的问题的示例:

1st connection: A local peer listening on 1.0.0.1:1 and receives connection from remote peer with address 2.0.0.2:2 . 1st连接:本地对等方侦听1.0.0.1:1,并从地址为2.0.0.2:2的远程对等方接收连接。 OK. 好。 Start PWP 启动PWP

2nd connection: A local peer listening on 1.0.0.1:1 and receives connection from remote peer with address 3.0.0.3:2 . 第2个连接:本地对等方侦听1.0.0.1:1,并从地址为3.0.0.3:2的远程对等方接收连接。 OK. 好。 Start PWP 启动PWP

3rd connection: A local peer listening on 1.0.0.1:1 and receives connection from remote peer with address 2.0.0.2:2 but with another InfoHash. 第三个连接:本地对等方侦听1.0.0.1:1,并从地址为2.0.0.2:2但与另一个InfoHash的远程对等方接收连接。 ??? ???

Is 3rd connection possible or remote peer( 2.0.0.2:2 ) have to track it's connections to local peer( 1.0.0.1:1 ) and will connect to local peer through different port and also announce himself 2nd time to tracker with different port or/and peer id? 是否可以进行第三次连接,否则远程对等方( 2.0.0.2:2 )必须跟踪其与本地对等方( 1.0.0.1:1 )的连接,并且将通过不同的端口连接至本地对等方,并且还第二次向自己使用不同端口的跟踪器通告自己/和对等ID?

Yes, it is possible for two peers to use more than one connection, sharing torrents with different InfoHashes at the same time. 是的,两个对等方可以使用多个连接,同时与不同的InfoHash共享种子。 There are two different cases depending on what type of transport protocol the connection is done over. 根据连接所采用的传输协议类型,有两种不同的情况。

TCP connection TCP连接

When a bittorrent peer shares over TCP, it opens up a incoming port that is announced to the tracker(s) and that port is the one used to connect to by every other peer that initiates a connection to that peer. 当bittorrent对等点通过TCP共享时,它将打开一个传入端口,该端口将通知跟踪器,并且该端口是其他所有与该对等点建立连接的对等点所使用的端口。 However, a peer that initiates and makes a outgoing connections uses a different port number for every outgoing connection. 但是,发起并建立传出连接的对等方会为每个传出连接使用不同的端口号。
That makes it possible to uniquely identify every connection by its (IP:PORT<->IP:PORT) -pair. 这样就可以通过(IP:PORT <-> IP:PORT)对来唯一地标识每个连接。

uTP/UDP connection uTP / UDP连接

When a peer shares over uTP/UDP it uses the same port for both incoming and outgoing connections. 当对等方通过uTP / UDP共享时,它使用相同的端口进行传入和传出连接。 To make it possible to differentiate between the connections, the uTP protocol extension instead uses a connection_id that is unique for every connection. 为了能够连接之间进行区分, 在UTP协议扩展 ,而不是使用connection_id是为每个连接唯一的。
The advantage with using the same port for both incoming and outgoing connections is that it makes UDP hole punching possible. 对传入和传出连接使用相同的端口的优势在于,它可以进行UDP打孔


The peer makes a separate announce to the tracker(s) for every different InfoHash . 对等体针对每个不同的InfoHash向跟踪器单独发出通知
All modern clients reuses the same incoming port for all torrents it shares. 所有现代客户端都将相同的传入端口重用于其共享的所有种子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在两个对等之间传输文件时防止超时 - Preventing timeout while transferring files between 2 peers python bittorrent 对等协议无法连接到任何对等点 - python bittorrent peer protocol unable to connect to any peers 可以使用本地端口通过UDP连接到多个远程对等吗? - Could a local port be used to connect to multiple remote peers over UDP? 在同一台计算机上的多个客户端之间进行区分 - Distinguishing Between Multiple Clients On Same Machine 在同一个NAT之后的多个客户端之间进行区分 - Distinguishing between multiple clients behind the same NAT 泡菜协议2和3之间的巨大差异(以字节为单位) - Huge size(in bytes) difference between pickle protocol 2 and 3 socket() 中的类型和协议有什么区别? - what's the difference between type and protocol in socket()? 使用select()从使用UDP套接字的多个对等方接收消息,同时从STDIN接收用户输入 - Using select() to receive from multiple peers using UDP sockets while taking user input from STDIN 如何在没有服务器的情况下在多个设备中的同一应用程序之间共享数据库 - How to share database between same application in multiple devices without server 同一命令的多个手册页之间有什么区别? - What is the difference between multiple man pages of the same command?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM