Javatpoint Logo
Javatpoint Logo

What is BitTorrent?

BitTorrent is a communication protocol for peer-to-peer file sharing (P2P), enabling users to distribute data and electronic files over the Internet in a decentralized manner.

BitTorrent is one of the most common protocols for transferring large files, such as digital video files containing TV shows and video clips or digital audio files containing songs.

  • As of 2013, BitTorrent has 15 to 27 million concurrent users at any time.
  • As of January 2012, BitTorrent is utilized by 150 million active users. Based on this figure, the total number of monthly users may be estimated to exceed a quarter of a billion (≈ 250 million).
  • On 15 May 2017, an update to the protocol specification was released by BitTorrent, called BitTorrent v2. BitTorrent was updated to support the new version on 6 September 2020.

The BitTorrent protocol can be used to reduce the server and network impact of distributing large files. Rather than downloading a file from a single source server, the BitTorrent protocol allows users to join a "swarm" of hosts to upload or download from each other simultaneously.

What is BitTorrent

Several basic computers can replace large servers while efficiently distributing files to many recipients using the BitTorrent protocol. In addition, this lower bandwidth helps prevent large spikes in internet traffic in a given area, keeping internet speeds higher for all users, regardless of whether or not they use the BitTorrent protocol.

The first release of the BitTorrent client had no search engine and no peer exchange, so users who wanted to upload a file had to create a small torrent descriptor file that they would upload to a torrent index site. The first uploader acted as a seed, and downloaders would initially connect as peers. Those who want to download the file would download the Torrent, which their client would use to connect to a tracker which had a list of the IP addresses of other seeds and peers in the swarm. Once a peer downloaded the entire file, it could function as a seed.

Components of BitTorrent

BitTorrent distributes a file by separated it into pieces and distributing the pieces amongst its peers. BitTorrent usually consists of the following components:

What is BitTorrent

1. Tracker

A BitTorrent tracker is server software that coordinates the transfer of files among users. The tracker does not contain a copy of the file and helps peers discover each other.

The tracker and the client exchange information using a simple protocol on top of HTTP. The clients inform the tracker regarding the file they want to download, their IP, and port, and the tracker responds with a list of peers downloading the same file and their contact information. This list of peers that all share the same Torrent represents a swarm. The tracker is necessary for peers to find each other and transfer data. Because of the presence of this central entity, BitTorrent protocol is considered a Hybrid P2P implementation.

2. Metainfo file

The metainfo file is also called a torrent file and has a .torrent extension. This file mainly contains encoded information regarding the URL of the tracker, the name of the file, and hashes of the pieces of the file for verifying downloaded pieces of the file.

These torrent files are generally created using client software. A list of trackers and the original file are required to create this torrent file. Once the file is created, it can be shared using regular email, file-sharing websites, etc.

So to distribute a new version of Linux, the developers would input the tracker URL and the new Linux iSO image they created into the BitTorrent client and get a .torrent file. This file is generally shared on their website.

3. Seeders

The original downloader is a peer with the whole file, also known as a seeder. The seeder must keep uploading the file until a complete copy has been distributed among the downloader. As long as there is a complete copy collectively present among the peers, the download will continue for all.

The developers providing the Linux iSO image who have the entire file will be called seeders.

4. Leechers

The peers without a complete copy of the file are known as leechers. Leechers will get the list of peers from the tracker, which has the pieces that the leecher requires. The leecher then downloads the required piece from one of those peers.

A leecher can also distribute the pieces that it has completed downloading even before it completes downloading the whole file. Once a Leecher has all the pieces, it is called a seeder. As a leecher receives the pieces, it validates them against the hashes present in the metainfo file.

Any user downloading the file through BitTorrent will be called a leecher. Once they have an entire file, they can be called seeders.

BitTorrent uses a piece selection algorithm to decide which piece to download to achieve maximum piece replication.

How BitTorrent Works

Torrent doesn't depend on a centralized server for storing files. Instead, bits of data from individual large files are saved in participating computers (peers) in a network (swarm) to facilitate the file-sharing process.

A P2P communication protocol like BitTorrent breaks down the files into pieces. Then, it moves them from seeders to leechers via a torrent client (a separate program that reads all the information in the .torrent file and connects users to exchange data).

What is BitTorrent

Anyone who wants the file uses a program called a BitTorrent client to request it from a seed. The client is sent one of the pieces and gets all the remaining pieces, over a while, from other people's computers through P2P communication. At any given moment, each computer is downloading some parts of the file from some of these peers and uploading other parts of the file to other peers. All the computers cooperating in this way at any time are called a swarm. The more popular a file is, the more computers there are in the swarm and the quicker the process is all around.

A system of checks and balances described below is applied to make the torrent process a bit-perfect:

  • A torrent file (.torrent) contains information telling users which computers are part of the file-sharing process. It may also provide some details on the files and folders that a user is downloading.
  • The torrent client connects to a tracker, which holds the IP addresses of the devices in a swarm. The tracker forwards the IP addresses to all torrent clients to ensure all peers are connected.
  • The torrent client starts the download. Once it receives sufficient bits of data, it also begins to upload the file for the benefit of other users.

Uses of BitTorrent

While torrent sites have become a hub for digital pirates and infringers, they can be helpful:

  • For syncing large chunks of files and sharing media, you own the rights to.
  • Social media giants like Facebook and Twitter use a similar protocol to upload large files to their servers to conserve bandwidth.
  • A torrent client may also be integrated into a game to deploy software updates, as in Starcraft's case.
  • Some government agencies also use torrents to share large images and documents to the public that could otherwise put a strain on their servers.

What is Torrent Tracker?

A torrent tracker is a server that helps users communicate with other peers faster by monitoring which peer machines keep specific files. It works like Tinder and other dating apps that match users based on the preferences they input. So when two people decide to meet in person or communicate through another platform, they can do so without Tinder.

Similarly, when a torrent user requests a specific file, the torrent tracker connects him or her to the appropriate peer machine. Once the P2P download has started, the connection to the tracker is no longer necessary.

How to Use Torrents

You can use Torrent in the following easy steps, such as:

Step 1: Choose and Download a Torrent Client

Before you can start sharing or downloading files, you need to choose and install a torrent client. Choose carefully, as some come with adware that can cause issues with your computer or device.

Best to download directly from the client's website so you can avoid downloading malware from third-party sites. While there are free-for-download clients, going for a premium client is ideal if you want security features.

Step 2: Install a Tracker Site

Once you've installed a torrent client, you also need to download a tracker site containing listings of torrent files. However, they are only a repository for torrent files and do not host content on their servers.

There are two types of trackers sites. One is a public tracker site, accessible to all users. The other is a private tracker site containing specialized torrent websites that host unique niches of files. Registration to a private tracker site is often exclusive and by invite only. It also requires users to seed torrents after each download.

Step 3: Search Content for Download

Next, you can search for the content you want to download. Search results often return several files. Choose the ones with many seeders, so your download goes faster. Before downloading, check if you can run the file.

Step 4: Download the Content

Once you know if the file is compatible with your installed programs, you can download the content. You can download multiple files as well.

Advantages of BitTorrent

BitTorrent has the following advantages:

  • Distributing large files like Linux iSO images.
  • Distributing Software patches and updates.
  • As being done by Blizzard Entertainment Inc, to distribute updates for the world of Warcraft.
  • Distributing popular files which have high traffic for relatively short periods.
  • Unlike traditional server or client downloads, high traffic leads to more efficient file sharing via BitTorrent.

Disadvantages of BitTorrent

BitTorrent has the following disadvantages, and it also has some security issues, such as:

  • An easy distribution method for pirated or illegal content.
  • It cannot modify or update the file to newer versions once the Torrent has been distributed.
  • The IP of all peers and the info of files they are downloading are publicly available on trackers.
  • The tracker is a critical component, and if it fails, it can disrupt the distribution of all the files it has tracking.

What is BitTorrent v2?

BitTorrent v2 is intended to work seamlessly with previous versions of the BitTorrent protocol. The main reason for the update was that the old cryptographic hash function, SHA-1, is no longer considered safe from malicious attacks by the developers, and as such, v2 uses SHA-256.

To ensure backward compatibility, the v2 .torrent file format supports a hybrid mode where the torrents are hashed through both the new method and the old method, with the intent that the files will be shared with peers on both v1 and v2 swarms.

Another update to the specification is adding a hash tree to speed up the time from adding a torrent to download files and allow more granular checks for file corruption. In addition, each file is now hashed individually, enabling files in the swarm to be reduplicated so that if multiple torrents include the duplicate files. However, seeders are only seeding the file from some, and the downloader of the other torrents can still download the file. Magnet links for v2 also support a hybrid mode to ensure support for legacy clients.


Next TopicWhat is DVT





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA