Peer-to-peer network is a network technology proposed in this context, which can be simply defined as the ability to exchange information directly, share computer resources and services, and peer computers with both client and server functions. All nodes in this network are peer-to-peer (called peers), each node has the same responsibility and ability and work together to complete the task, the peer through the direct interconnection of information resources, processor resources, storage resources and even cache resources, such as full sharing, without relying on centralized server support.
With the broadband network can make everyone on the internet to share in ordinary way difficult to access a variety of huge resources. Each PC that uses peer-to-peer software is a client that downloads resources, and the server uploads files, and also gives them when requested.
BT believes everyone knows. ExplainBitTorrent is a multi-point download of open source peer software, the prevalence of the use of traditional HTTP and FTP this point to multi-point download is not enough to meet the needs of everyone. It can be connected and slowed down as the number of downloads increases. and peer-to-hand technology is a form of unconventional, greatly saving network bandwidth. Allows you to connect directly to other users ' computers, Exchange and search for files, instead of web browsing and downloading, to maximize the use of network bandwidth. It is very convenient. is a multi-point download of the shared file software, because in the download, but also for other users to provide uploads, so will not increase with the number of users to reduce download speed, therefore, the more people download, the faster the speed. Now many large companies, such as Redhat, have used BT to let their customers download the development version.
Linux-to-peer protocol mainly includes: BitTorrent, AMule, Gnutella, etc. In this paper, we introduce the method of using the peer service in the BitTorrent of common use.
1, build BitTorrent server
BitTorrent is written in the Python language and is an open source software that can run under Windows or in a Linux environment, and currently the latest version under Linux is 6.1.2.
BitTorrent's official website: http://bitconjurer.org/BitTorrent/
Installing BitTorrent software
Because the software is written in Python, you need to use commands before installing BitTorrent:#rpm-qa|grep Python
Check that the Python language is configured. Otherwise, you will need to download the installation to the official Python website http://www.python.org, and then execute the following command to install the BitTorrent software:#rpm-IVH bittorrent-6.1.2.python2.4.noarch.rpm
After the installation is complete, all BitTorrent commands and tools are installed in the/usr/bin directory. Includes: btmaketorrent.py (make Seed tool), bttest.py (test Seed tool), bttrack.py (make Tracker tool), btdownloadheadless.py (make Shared Source tool), btlaunchmany.py (background start shared Source tool), btshowmetainfo.py (View Download tool), btdownloadgui.py (Graphical authoring Shared Source tool), btmaketorrent.py (graphical production of seed tools).
Configuring and starting BitTorrent
The core of BitTorrent is that the Tracker,bittorrent service does not require a server, but the BitTorrent service still has the concept of a server, called Tracker. To be precise, tracker refers to a program running on a server that can track how many people are simultaneously downloading the same file. When a BT client connects to tracker, a download list is generated, according to which the BT client automatically connects to other nodes in the network for download. So the first step is to start a tracker:#./bttrack.py--port 8760--dfile dstate >/dev/null 2>&1 &
It is recommended to use normal user rights to start the service, which is more secure. This command generates a dstate file in the current directory and opens Port 8760.
seed Production (seed)
The track service of the BT server does not provide a download service, and the download is its seed (seed), which is a client that has already been downloaded or is being downloaded. Because there is no such seed at first, you have to build one yourself, if you want to make a seed for/home/cjh.avi, the relevant commands are:#./btdownloadheadless.py--max_allow_in--max_upload_rate--minport 8888--m
The relevant parameters are described as follows:
--max_allow 200: Indicates that the seed can accept up to 200 connections.
--max_upload_rate 100: Refers to the maximum acceptable download bandwidth for this seed (byte)/s, which can control the download bandwidth.
--minport 8888--maxport 8888: Set the maximum minimum listening port number so that the seed is only listening on the 8888 port, so it is convenient to start the port on the fire wall.
Mp3.vio.torrent: Is the name of the seed file being made.
Set up Apache server
Configure the Web server to have the seed (. torrent) file associated with the application/x-bittorrent. Soon Apache config file:/etc/httpd.conf, add a line:addtype application/x-bittorrent. Torrent
Then we need to restart the Web server and open the firewall 6888 port:
Build BT server under Linux