What is Torrent Choking?

Choking: Calculated Resource Management

Choking is a fundamental mechanism in the BitTorrent protocol designed to regulate data flow and foster a sense of fairness in the swarm. Here’s the breakdown:

  • What it is: Choking boils down to a torrent client temporarily halting uploads to a specific peer. It’s a way to strategically redistribute bandwidth.
  • Why choke? Here’s where it gets interesting:
    • Reciprocity & Cooperation: The BitTorrent protocol champions a “tit-for-tat” philosophy. Peers who generously upload to others are more likely to be “unchoked” and receive good download speeds themselves. Choking discourages leeching, or merely downloading without contributing to the swarm.
    • Dealing with bottlenecks: Even well-intentioned peers can have limited upload bandwidth. Choking helps torrent clients focus on the peers that can maximize their download potential, prioritizing those with the resources to reciprocate.
    • Optimization: Torrent clients can’t maintain unlimited simultaneous uploads. Choking temporarily rotates connections to find the most beneficial pairings at any given time.

The Historical Motivation: Combating Greed

The BitTorrent protocol was conceived in an era when internet connections often had much slower upload speeds than downloads. This created an environment ripe for freeloaders: peers who would eagerly download, but offer little in return.

  • Unchoking Preference: BitTorrent clients typically unchoke a few peers with the fastest download rates to them, as those peers are most likely to send data back quickly. Similarly, “optimistic unchoking” provides chances to new peers, incentivizing newcomers to contribute.
  • The Greedy Leecher: Those who refuse to share risk being continually choked by multiple peers, resulting in severely hampered download speeds. This acts as a strong deterrent to purely selfish behavior.

How to Avoid Choking

  1. Seed Generously: The golden rule! By becoming a seed, or at least continuing to upload after completing a download, you solidify your reputation as a valuable member of the swarm. This makes you less likely to be choked.
  2. Tweak Client Settings: Most torrent clients have adjustable bandwidth limits. Avoid maxing out your upload capacity, leaving some headroom for sharing with the torrent swarm. If your client allows, increase the number of simultaneous upload slots for wider distribution of data.
  3. Strategic Torrent Selection: Opting for torrents with good seed-to-peer ratios improves your chances. More seeds mean a more robust environment with less reliance on any single peer for acquiring pieces.

Important Notes

  • Choking is not a punishment: It’s a resource allocation tool, and even well-intentioned peers might be temporarily choked due to bandwidth constraints or swarm dynamics.
  • Modern Clients: Torrent clients have become more sophisticated. They often use a mix of choking, unchoking, and interest-based algorithms to create a fair and efficient sharing ecosystem.

Torrent Files: What they Contain

At their core, torrent files (.torrent extension) serve as detailed blueprints for facilitating peer-to-peer (P2P) file transfers utilizing the BitTorrent protocol. Think of them as multi-faceted maps that guide torrent clients in their quest to download and share content.

Key Components Within a Torrent File

These files are encoded using the Bencoding format (a simple data serialization technique) and contain the following vital components:

  • Announce: This is the URL of the tracker – a specialized server that coordinates communication between peers involved in the torrent swarm.
  • Info: This dictionary is the heart of the torrent file, housing core metadata:
    • name: The name of the torrent (usually the filename or a directory name).
    • piece length: The size of each piece the file is fragmented into (common values are powers of 2, e.g., 256 KB, 512 KB, 1 MB).
    • pieces: A list of SHA-1 cryptographic hashes, one for each piece. These hashes ensure that downloaded data remains intact and uncorrupted.
    • length (single file mode): Total size of the file in bytes.
    • files (multi-file mode): A list of dictionaries detailing each file in a multi-file torrent:
      • length: Individual file size in bytes.
      • path: A list representing the file’s subdirectory path.

Optional Fields

  • comment: Arbitrary commentary by the torrent creator.
  • created by: The name and version of the program used to generate the torrent file.
  • creation date: Timestamp indicating when the torrent was created (often in Unix time format).
  • httpseeds: (Web Seeding) Contains a list of URLs of web servers where the file can also be obtained, supplementing P2P sources.

The Torrent Workflow in Action

  1. Creation: A torrent client generates a torrent file. It divides the content into pieces, calculates SHA-1 hashes for each, and assembles the metadata.
  2. Distribution: The .torrent file is shared on tracker websites or distributed directly.
  3. Tracker Interaction: A user’s torrent client contacts the tracker listed in the “announce” field, providing its own IP address and a unique peer ID. In turn, it receives a continuously updated list of peers currently holding pieces of the desired content.
  4. Peer Exchange: The torrent client builds direct connections with peers on the received list. It utilizes a sophisticated “tit-for-tat” system involving choking/unchoking peers based on their reciprocation of upload bandwidth, thus incentivizing sharing.
  5. File Reconstruction: Pieces are downloaded (potentially out of order), their SHA-1 hashes are verified against those listed in the torrent file, and the complete, error-free file is reassembled.

Technical Considerations

  • Bencoding: Torrent files employ a simple yet efficient method of encoding data structures. A deeper understanding of Bencoding is helpful for advanced analysis.
  • Tracker vs. Trackerless: Trackers played a more crucial role in the early days of BitTorrent. Nowadays, the Distributed Hash Table (DHT) allows for trackerless torrents, further enhancing decentralization.

Torrents and Cloud Storage

Downloading files by using the filesharing protocol ‘bittorrent’ has become wildly popular in the last few years. Also, having a personal “file locker” space up in the “Cloud” is also very common. But are these two technologies incompatible or is there an easy way to use one to the other?

First, let’s clear up on what’s exactly what on each one. Are you clear on what is ‘bittorrent’, ‘torrents’, ‘magnets’ and ‘links’?

Bittorrent is a new way to share files, but it’s name applies to the “protocol”, or in layman’s terms, the way they are transferred, and how the computer knows how to download the files. It was invented by a programmer called Bram Cohen, when he focused on how would be the best ways for multiple users to share a files between themselves, and trying to do that in the fastest way possible!

Now, “Torrent file” is what we named some small files that have just the fewest necessary information to download the final files. It has all the technical info, like how many files, their sizes, and other technical stuff designed to verify that you download the right files. These are small files, usually less than 5 megabytes (the size of a common photograph file).

Now, magnets are like the the “torrent file”, it lets you tell the software which file you want, but it’s reduced to just a unique string of characters… like a web-link! But instead of using “https://www”, etc. , it begins with ‘magnet:’. Usually you find them on torrent sites with a small magnet icon, which is easy to identify.

Now, if you have not downloaded torrents, before, it’s actually quite easy. You just provide the software the ‘torrent file’, or the magnet link, and it downloads to your computer.

But what if you want to download it elsewhere, like your ‘DropBox’, or ‘Gmail Drive’ account?

So those are what are known as “Cloud Storage”, and you can get quite some space for free. But what exactly are they?

Cloud is actually just another way to say “On the Internet”, or more precisely, “On a Server available on the Internet”. So Cloud storage is just that, disk space that is on a server on the Internet. Obviously, your private files are just not there for anyone to browse through, so they are protected with a password you defined when you registered.

Most of these cloud storage spaces are designed to be a “Backup”, or a copy, of your local computer files. The software just uploads them whenever you add or change them. But there’s a few other advantages on having them on the cloud: You can access them from any computer or device that can connect to the Internet; You can download and edit files or documents; You can keep Music and Movies and see them from any device like tablets or phones; You can share files or whole folders with family and friends!

Transfer Torrents to your Cloud Drive

So now, how would you mix the two? Normally you couldn’t: You would have to download your files first to your computer, then take those files and upload them again, wasting both your upload and download bandwidth. Also, most ISPs limit their uploads speeds, so you are limited by the slowest one!

So, the best way to do this is to use a server that is on the Cloud (connected all the time to the Internet on a high-bandwidth link) that does it. But you would have to configure it, install it, and it’s actually a bit technical to have it working (and you need to send all those commands via the ‘command-line’, and how to install software by typing in commands!).

But there’s an easy way, use https://TransferCloud.io . This website allows you to download the torrents to it’s servers, and then it transfers them back to YOUR personal cloud! As it’s connected by high-speed links, this can be done even in less than a minute, for files that are quite big, like the size of a DVD!

You register first, then just paste in a magnet link, or a URL link to a torrent file… or you can upload a .torrent file. The server passes it to a Bittorrent Client and saves your files to your space. You can then download it directly from the server, or you can specify a “Save Point”. This save point is on which Folder of you Cloud Drive would you like the files put in. After transferring, it then frees the server space so you can continue downloading more.

Also, if you get an unlimited drive space, like Amazon Cloud Drive or OpenDrive, you can continue downloading indefinitely! Just paste all the links you want, and with a “Power” account, you can leave queued all the links you have!! It will download them at the fastest speed possible, and save them all for you to download later.

We’ll see that in another post, but for now, if you have any questions, please contact us.