Torrents

Dulith Senanayake
5 min readMay 20, 2020

Modern software industry and technology getting advanced and more complex with the rapid development. With the rapid development of software industry, downloading a file over the internet has become more important. Downloading a file can done in many ways. Among them torrents play an important role.

This article will be demonstrating about the torrents including the usage of torrents, it’s distributed system and how the torrents preserve the common features a distributed system.

Introduction

Torrents were developed in year 2001. But in today torrents play an important role when downloading over the internet.

Torrents are small text files that has a size not greater than a few kilobytes of data, containing just a few pieces of information on how to download their particular payload over the Internet. To put it another way, a torrent file provides a means of downloading a torrent’s payload from where and how. These tiny files will start downloading even larger files, however, and this is done by one program. The payload of a torrent is a selection of one or more digital objects ranging from full-length videos, music files, video clips, ebooks, documents, games, software programs, photos to virtually any digital material.

Usage

When we are downloading a file from the internet, two parties are involved. One is a server, and the other a client. Server is a computer that stores data where one is processing data as a client computer. But there is no server in case of torrents all the parties are client computers. Client gets data from another client.

Let’s go through a simple example of the usage of torrents.

Suppose that we need to share a movie file in our computer with someone else. We can use torrents to do it. First we need to create a torrent file of the movie with .torrent extension. This file is of small size and this contains all the information about the data(movie) being transmitted. Then we need to give this torrent file to the person whom we are going to share with. Once he opens the torrent file using a torrent software downloading process starts. At the same time our computer need to on with active internet connection otherwise he will not be able to download the file. This means that downloading & uploading processes occurs simultaneously. Both the computers are client computers and the file is moved from one client computer to another.

Download using Torrents

Basically there are 2 common terms that needs to understand.

  • Seed — seed is the client computer who is uploading the file.
  • Peer — peer is the client computer who is downloading the file.

The number of peers and seeds may be several. When there is more seed number then the download speed would be higher. If the number of peers is greater than the number of seeds it will not be higher to download speed.

As the internet is so huge, it has billions of IP addresses. people need to get to know whom to go and ask for the file. This is where the torrent tracker server comes to the play. This server keeps track of all the people who are currently seeding the particular file. This information is also embedded in the torrent file that generally download from various sources.

Distributed system in torrents

The distributed system of torrents is the peer to peer technology. That is there are no additional machines used to provide services or manage resources. That means in torrents we don’t downloading the file from the particular server which many computers are either downloading or uploading. We download from a person who might be uploading data in the torrent file. Both the computers are peers. Downloading and uploading processes are distributed among those peers in the system.

Peer to peer architecture in torrents

Preservation of common features

Fault-tolerant

Fault tolerant is it can recover from component failures without performing incorrect actions.

  • When peers unexpectedly appear or disappear the mechanism is not greatly affected as long as there is at least one seeder.
  • There are always one or more trackers to propagate information about the peers.
  • There are implementations where trackers aren’t needed.

Highly available

Highly available is it can restore operations, permitting it to resume providing services even when some components have failed.

  • If seeders are numbered to zero, peers keep sharing the portions of the files they have. This could mean the file(s) may be incomplete. As soon as a seeder reappears all peers will be able to catch up and get the entire file(s).

Recoverable

Recoverable is failed components can restart themselves and rejoin the system, after the cause of failure has been repaired.

  • If the internet connectivity of client computer which is uploading the torrent file or the client computer which is downloading the torrent file has lost , it will restart the uploading and downloading processes and joining the system once it gets an active internet connection.

Consistent

Consistent is the system can coordinate actions by multiple components often in the presence of concurrency and failure. This underlies the ability of a distributed system to act like a non-distributed system.

  • Each peer is both a client and server. If there is number of seeds which are uploading the torrent file and if one of the torrent file uploading seed’s internet connectivity get lost, uploading process can be carried out by other seeds without any failure.

Scalable

Scalable is it can operate correctly even as some aspect of the system is scaled to a larger size.

  • Peers can be seamlessly added or removed, without affecting the system’s reliability in torrents.
  • New trackers can be added and old ones can disappear to the entire system without much effect.

Predictable performance

Predictable performance is the ability to provide desired responsiveness in a timely manner.

  • Predictable performance in torrents can be increased by increasing the number of seeds in the system. When there is more number of seeds then the download speed would be higher. Alternatively if the number of peers is greater than the number of seeds the download speed gets lower.

Secure

Secure is that the system authenticates access to data and services.

  • In torrents to authenticates the access to data and services it uses servers called torrent track servers. This server keeps the track of all the people who are currently seeding the particular file.
  • In torrents it can enable encryption to allow only the incoming legal connections.

In this post, I have demonstrated how to use the torrents to download a file over the internet, distributed architecture of the torrents and preservation of the features of distributed system by torrents.

--

--

Dulith Senanayake

Full Stack Developer | BSc. (Hons.) in Software Engineering | University of Kelaniya, Sri Lanka