Immediately after the connection establishment the client sends several query messages regarding the file it wishes to download.
The basic message exchange is composed from four messages: A sends a file request message immediately followed by a requested
file ID message. B replies to the file request by a file request answer and to the requested file ID message by a file status
message. In my viewpoint, it could be more easier than in this way to adopt two messages (a request and reply).
The extended protocol adds two messages to this sequence a source request and a source answer. This extension is used to pass
B's source to A. To elaborate, there is no requirement that B completes to download a file before it can send file parts to other
clients, B can send to A any part it has completed to download even when it has only a small fragment of the file.
When A requests a file from B, but B does not have this file in its shared files. B skips the file request answer message and
send a file not found message, immmediately after the requested file ID message.
For each uploaded file the client maintains an upload priority queue. The priority of each client in the queue is calculated
on the basis of the client's time in the queue and a priority modifier. At the head of the queue are clients which have the highest
"score". The score is calculated using the following formula: score = (rating * seconds_in_the_queue) / 100 or ∞ in case the downloading
client is defined as a friend. The initial rating value is 100 except for banned users which receive 0 rating (and thus are prevented
from reaching the top of the queue). The rating is modified either by the downloading client's credit (which ranges from 1 - 10)
or by the uploaded file priority (0.2 - 1.8) which is set by the uploading client. When a client's score is higher than the score
of the rest of the clients it starts downloading the file. A client will continue to download a file until one of the following
conditions occurs:
1. The uploading client was terminated by the user;
2. The downloading client has got all the parts is needs for the file;
3. The downloading client was preempted by another downloading client which has higher priority than his.
In order to allow a client which just started downloading to get a few megabytes of data before it is preempted, eMule boosts
the initial rating of a downloading client to 200 for the first 15 minutes of its download.
The basic message exchange is composed from four messages: A sends a file request message immediately followed by a requested
file ID message. B replies to the file request by a file request answer and to the requested file ID message by a file status
message. In my viewpoint, it could be more easier than in this way to adopt two messages (a request and reply).
The extended protocol adds two messages to this sequence a source request and a source answer. This extension is used to pass
B's source to A. To elaborate, there is no requirement that B completes to download a file before it can send file parts to other
clients, B can send to A any part it has completed to download even when it has only a small fragment of the file.
When A requests a file from B, but B does not have this file in its shared files. B skips the file request answer message and
send a file not found message, immmediately after the requested file ID message.
For each uploaded file the client maintains an upload priority queue. The priority of each client in the queue is calculated
on the basis of the client's time in the queue and a priority modifier. At the head of the queue are clients which have the highest
"score". The score is calculated using the following formula: score = (rating * seconds_in_the_queue) / 100 or ∞ in case the downloading
client is defined as a friend. The initial rating value is 100 except for banned users which receive 0 rating (and thus are prevented
from reaching the top of the queue). The rating is modified either by the downloading client's credit (which ranges from 1 - 10)
or by the uploaded file priority (0.2 - 1.8) which is set by the uploading client. When a client's score is higher than the score
of the rest of the clients it starts downloading the file. A client will continue to download a file until one of the following
conditions occurs:
1. The uploading client was terminated by the user;
2. The downloading client has got all the parts is needs for the file;
3. The downloading client was preempted by another downloading client which has higher priority than his.
In order to allow a client which just started downloading to get a few megabytes of data before it is preempted, eMule boosts
the initial rating of a downloading client to 200 for the first 15 minutes of its download.
本文详细介绍了P2P文件共享中客户端间的基本消息交换流程,包括文件请求与响应、源请求及响应等关键步骤,并阐述了上传优先级队列的工作原理及其评分机制。
731

被折叠的 条评论
为什么被折叠?



