eMule协议说明书(翻译二)

来源:互联网 发布:mac改用户名丢失管理员 编辑:程序博客网 时间:2024/05/16 19:03

1.2.2 Client to client connection

1.2客户端与客户端的连接

An eMule client connects to another eMule client (a source) in order to download a file. A file is divided to parts which are further fragmented. A client may download the same file  from several (different) clients getting different fragments from each one. 

一个eMule客户端连接到另外的一个eMule客户端(一个信息源)是为了下载文件.一个文件已经被分割成更小的片.
一个客户端可以从其它许多(不同)的客户端中下载到该文件的不同的片。

When two clients connect they exchange capability information and then negotiate the start of a download (or upload, depends on perspective). Each client has a download queue which holds a list of clients that are waiting to download files. When the eMule client’s download queue is empty a download request will most probably result in a download start (unless,for example, if the requester is banned). When the download queue isn’t empty a download request results in adding the requesting client to the queue. There is no attempt to serve more than a few clients in a given moment providing a minimum bandwidth of 2.4 kbytes/sec for each. A downloading client may be preempted by a waiting client with a higher queue ranking than his, in the first 15 minutes of the a download session the queue ranking of the downloading eMule client is boosted to prevent thrashing.

当2台客户端连接后,它们就交换性能信息并商量从哪里开始下载(或者上载,需要根据情况来决定).每一个
eMule客户端都有一个下载队列,这个队列中包含着等待下载的其它客户端。当eMule客户端的下载队列腾出
一个下载请求,这时将使得一个下载开始(除非,比如:这请求者被禁止了).当这下载队列不是腾出一个下载
请求将导致添加一个客户请求到队列中.在一个被给的瞬间内不再尝试为少数的客户端中的每一个提供一个
有2.4 kbytesc/秒大小的最小量的带宽.一个正在下载的客户端可能被其它比自己具有更高队列优先权的客户所
先占,在先前的15分钟的下载会话中,正在下载的eMule客户端的队列优先级是会向前推进以防止落后.

When a downloading client reaches the head the download queue, the uploading client initiates a connection in order to send him his needed file parts. An eMule client may be on the waiting queue of several other clients, registered to download the same file parts in each one. When the waiting client actually completes downloading the parts (from one of them) it doesn’t  notify all the rest that they can remove him from their queues, it will simply reject their upload attempt when it reaches the head of their queue.

当一个正要下载的客户端跑到了下载队列的头,则这上载客户端便开始启动一个连接,为的是发送它所想要的文件部分.一个eMule客户端也有可能同时在几个客户端的等待队列中,并从每个客户端中注册下载相同的文件部分.当等待的客户端实际上已经下载完了这一部分(从所有客户端中的一个),并不通知其它的客户端把它从它们的客户端队列中移动除,而是这一客户端达到它们的队列的头时,拒绝它们的上载.

eMule employs a credit system (see section 1.4) in order to encourage uploads, to prevent impersonation eMule secures the credit system using RSA public-key cryptography. Client connections may use a set of messages not defined by the eDonkey protocol, these message are called the extended protocol. The extended protocol is used for the credit system implementation, for general information exchange (like updates of the lists of servers and sources) and to improve performance by sending and receiving compressed file fragments. The eMule client connection uses UDP in a limited manner to periodically check the client’s
status on the upload queue of his peer clients while it is waiting to start downloading a file.

eMule采用信用系统来鼓励上载,为了防止假冒的eMule出现,这信用系统采用了RSA公共密钥加密法.  客户端的连接可以使用一组eDonkey协议没有定义的消息,这些消息称之为扩展协议.这扩展协议是是为了这套 信用系统的执行,为了一般信息交流 (象服务器列表和信息源的更新材料),而且可以改善收发压缩了的文件片. eMule 客户端的连接是使用有限的UDP的方式定期的检查客户端的身份,并等待文件下载的开始.

1.3 Client ID
1.3客户端ID


The client ID is an a 4 byte identifier provided by the server at their connection handshake. A client ID is valid only through the lifetime of a client-server TCP connection although in case the client has a high ID it will be assigned the same ID by all servers until its IP address changes. Client IDs are divided to low IDs and high IDs. The eMule server will typically assigns a client with a low ID when the client can’t accept incoming connections. Having a low ID restricts the client’s use of the eMule network and might result in the server’s rejecting the client’s connection. A high ID is calculated on the basis of the client’s IP address as
described below. This section describes the client ID assignment and significance from the eMule protocol point of view [3]. A high ID is given to clients that allow other clients to freely connect to eMule’s TCP port on their host machine (the default port number is 4662). A client with a high ID has no restrictions in its use of the eMule network. When the server can’t open a TCP connection to the client’s eMule port the client is given a low ID. This happens mainly with clients that set up a firewall on their machine denying incoming connections. A client might also receive a low ID when it the following cases:


客户端ID是一个4字节大小的标识符,这标识符是在它们握手建立连接由服务器提供的.一个客户端ID只在客户端-服务器的TCP 连接的生命期才有效,尽管客户端有可能获得高ID,这将从所有的服务器端获得相同的ID直到它的IP地址改变了. 客户端ID被分为低ID和高ID两种.eMule服务器将给客户端分配一个低ID,当这个客户端不能接受内部连接的时候.有了一个低ID 的时候将限制客户端使用eMule网,而且可能导致服务器拒绝客户端的连接.一个高ID是通过客户端的IP地址计算出来的,将在下面 的内容中描述.本节从eMule的重要观点来看客户端ID的分配和意思[3].一个高ID分配后,可以允许其它的客户在他们的主机上自由 的连接到eMule的TCP端口(缺省的端口是4662).一个具有高ID的客户端来说,对它使用eMule网络来说是没有任何限制的.当服务器端 不能打开一个TCP连接到客户端的eMule端口时,这客户端将获得一个低ID.这主要是发生在客户端在他们的机器上安装了防火墙来组织
引入连接.一个客户端在下面的情况将获得一个低ID:

• When the client is connected through a NAT or proxy servers.
• When the server is to busy (causing the sever’s reconnection timer to expire).

• 当客户端的连接是通过NAT或者代理服务.
• 当服务器端忙(造成服务器的重连接超时)

High IDs are calculated in the following way: assuming the host IP is X.Y.Z.W the ID will
be X +28  Y +216 Z +224 W (’big endian representation’). A low ID is always lower than
16777216 (0x1000000) I could not found any clew about how its calculated, note that when
you have a low ID it differs between servers.

高ID是通过这样的方法计算出来的:假定主机IP为X.Y.Z.W。ID为X + 2^8*Y + 2^16*Z + 2^24*W(以大点描述)。低ID总是小于16777216。
我不能找到任何关于如何计算低ID的线索,注意当你有一个低ID时,对于不同服务器它是不同的。

 

 

以下内容不用翻译了,可以查阅:

http://sunshinehan.spaces.live.com/Blog/cns!1p-BqhnhVO3VRWtABpKNKi7g!140.entry

原创粉丝点击