Bittorrent Explained

In a previous post, I introduced the Bittorrent application when defining the TCP bidirectional bytestream

  • The torrent file is a torrent descriptor file.
  • The torrent file contains:
    • “info” section: contains the hash codes, the lengths and the names of the pieces of the file and the Tracker URL
    • “announce” section
  • When a torrent client executes a torrent file, it reads its metadata to determine the Tracker. The Tracker maintains a list of peers that have pieces of the requested file (called the swarm). So the Bittorrent client joins the swarm. To download the file, the file is segmented into equal-sized pieces. the size of the pieces vary. A consequence of this feature is that a file download can be paused or halted without losing previous downloaded pieces.
  • each file piece is associated with a SHA-1 hash. The hash code ensures that the piece is neither maliciously altered nor accidently modified.
  • each SHA-1 hash identifies a one and only piece
  • “Rarest first” policy: a torrent download policy where a torrent client requests the rarest piece of a file first
  • The Bittorrent protocol provides no security mechanisms for its users. Client IP addresses can be obtained.
  • a seeder is a peer that has the complete file.
  • Torrent Health is determined by the number of seeders for a particular file.
  • A method that does not use Trackers is called Distributed Hash Table (DHT) where each peer acts as a Tracker. This method has been introduced by Vuze and has not been officially adopted yet.
  • The “Tit-for-Tat” policy is when a peer sends data to its tiny list of top downloaders (the peers from whom it has received data), which encourage fair trade. This behaviour creates a lot of choked clients and poses a problem for new peers that join the swarm. Since they do not have pieces, they may not be able to exchange data with older peers.
    • a solution called “Optimistic Unchoking” has been implemented by the original Bittorrent client which consists of reserving an amount of the bandwidth to send data to random peers, periodically. This action allows for the growth of the list of preferred peers, by discovering new ones
  • clients behind NAT can make peer pairs with external clients, because they can initiate connections from the inside to the outside



Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *