In fact, the development of the network comes from the sharing of resources. For sharing, we need to upload and download resources. How to download it? Here we will introduce the main principles of the eMule protocol. First, let's take a look at the basic concepts of this Protocol.
Introduction to eMule protocol specifications
The eMule network is composed of hundreds of eMule servers and millions of eMule clients. The client must connect to a server to obtain network services. As long as the client is in the system, the server connection remains open. These servers mainly perform clustered index services as if they were in Napster.
Each eMule client is pre-configured with a server list and a shared file list of the local file system. The client connects to an eMule server using a single TCP to log on to the network and obtain the desired file information and client. The eMule client also uses hundreds of TCP connections to connect to other clients to upload and download files.
Each eMule protocol client maintains an upload queue for each shared file. The client to be downloaded is first added to the bottom of the queue, and then gradually advances to the top of the queue and starts to download its files. A client can download different file blocks of the same file from several different eMule clients.
The client can also upload the file blocks of unfinished files. Finally, the eMule Protocol extends the eDonkey capability and allows clients to exchange information about servers, other clients, and files. Note that the communication between the client and the server is based on TCP.
The server uses an internal database to store information about the client and files. An eMule server does not store any files. It makes a clustered index for the storage information about the file location. Another feature of the server began to be protested, because the connection failed to receive two connected clients due to the firewall connection. This connection function adds server load.
Compared with servers and other clients, the eMule protocol uses UDP to enhance client capabilities. The client's ability to send and receive UDP information is not mandatory in daily use. When a Firewall prevents it from sending and receiving UDP information, it can also run without flaws.
Client-to-server connection
When starting, the client uses TCP to connect to an eMule server. The server provides a client ID, which is valid throughout the client-server connection lifecycle. If the client has a high ID, it will receive the same ID from all servers until its IP address changes ). After the connection is established, the client sends its shared file list to the server. The server stores this list in its internal database.
Usually contains hundreds of thousands of valid files and active clients. The eMule client also sends a download list containing the files it wants to download. The second chapter provides a detailed description of the TCP information exchange between the eMule client and the server.
After the connection is established, the eMule server sends a list of other clients that use the files it wants to download to the client. These clients are called "sources "). From this point on, the eMule protocol client starts to establish a connection with other clients, as described in 1.2.2.
Note that the client/service TCP connection remains in the connection state during the entire client session. After the first handshake, the user activity is used to stimulate the transaction: Sometimes, the client sends a file search request, which is responded to by the search result. A search transaction generally queries the specified file in the source, use the source IP address and port) list to answer this query. The queryer can download the file from this list.
UDP is used for communication between the client and the server that it is not connected. The purpose of UDP information is to enhance file search, enhance source search, and maintain the connection status to ensure that the eMule protocol server in the client server list is valid ).