Java Bit Torrent Client



Similar documents
Lecture 6 Content Distribution and BitTorrent

The BitTorrent Protocol

CNT5106C Project Description

Peer-to-Peer Networks. Chapter 2: Initial (real world) systems Thorsten Strufe

P2P File Sharing: BitTorrent in Detail

Incentives Build Robustness in BitTorrent

From Centralization to Distribution: A Comparison of File Sharing Protocols

Seminar RVS MC-FTP (Multicast File Transfer Protocol): Simulation and Comparison with BitTorrent

SE4C03: Computer Networks and Computer Security Last revised: April Name: Nicholas Lake Student Number: For: S.

The Impact of Background Network Traffic on Foreground Network Traffic

Lab 5: BitTorrent Client Implementation

apt-p2p: A Peer-to-Peer Distribution System for Software Package Releases and Updates

How To Test The Speed Of Bittorrent On A Bitt Client And Torrent On A Pc Or Ipad (For Free) On A Microsoft Flash Get 2.5 (For A Free) Computer (For Pc Or Mac) On An Ip

DDoS Vulnerability Analysis of Bittorrent Protocol

Evaluating the Effectiveness of a BitTorrent-driven DDoS Attack

MC-FTP (Multicast File Transfer Protocol): Implementation and Comparison with

BitTorrent Peer To Peer File Sharing

Performance Analysis of Web based Applications on Single and Multi Core Servers

Windows Server Performance Monitoring

A Comparison of Mobile Peer-to-peer File-sharing Clients

The Algorithm of Sharing Incomplete Data in Decentralized P2P

A Comparative Study on Vega-HTTP & Popular Open-source Web-servers

Peer-to-peer filetransfer protocols and IPv6. János Mohácsi NIIF/HUNGARNET TF-NGN meeting, 1/Oct/2004

JBoss Data Grid Performance Study Comparing Java HotSpot to Azul Zing

Attacking a Swarm with a Band of Liars evaluating the impact of attacks on BitTorrent

Peer-to-Peer Data Management

Should Internet Service Providers Fear Peer-Assisted Content Distribution?

Scaling Objectivity Database Performance with Panasas Scale-Out NAS Storage

Globus Striped GridFTP Framework and Server. Raj Kettimuthu, ANL and U. Chicago

Grid Scheduling Dictionary of Terms and Keywords

Performance Comparison of Database Access over the Internet - Java Servlets vs CGI. T. Andrew Yang Ralph F. Grove

Cloud Storage. Parallels. Performance Benchmark Results. White Paper.

System Requirement Specification for A Distributed Desktop Search and Document Sharing Tool for Local Area Networks

Development of Monitoring and Analysis Tools for the Huawei Cloud Storage

ANALYSIS OF GRID COMPUTING AS IT APPLIES TO HIGH VOLUME DOCUMENT PROCESSING AND OCR

SAN Conceptual and Design Basics

Oracle Database Scalability in VMware ESX VMware ESX 3.5

Performance Analysis of webmethods Integrations using Apache JMeter Information Guide for JMeter Adoption

CentOS Linux 5.2 and Apache 2.2 vs. Microsoft Windows Web Server 2008 and IIS 7.0 when Serving Static and PHP Content

Optimizing and Balancing Load in Fully Distributed P2P File Sharing Systems

CS5412: TORRENTS AND TIT-FOR-TAT

Achieving Nanosecond Latency Between Applications with IPC Shared Memory Messaging

An objective comparison test of workload management systems

RED HAT ENTERPRISE LINUX 7

11.1 inspectit inspectit

An apparatus for P2P classification in Netflow traces

AgencyPortal v5.1 Performance Test Summary Table of Contents

Giving life to today s media distribution services

The Internet is Flat: A brief history of networking over the next ten years. Don Towsley UMass - Amherst

CS423 Spring 2015 MP4: Dynamic Load Balancer Due April 27 th at 9:00 am 2015

The Role and uses of Peer-to-Peer in file-sharing. Computer Communication & Distributed Systems EDA 390

Revisiting P2P content sharing in wireless ad hoc networks

SOLUTION BRIEF: SLCM R12.8 PERFORMANCE TEST RESULTS JANUARY, Submit and Approval Phase Results

Performance and scalability of a large OLTP workload

Communication Protocol

Why Computers Are Getting Slower (and what we can do about it) Rik van Riel Sr. Software Engineer, Red Hat

VirtualCenter Database Performance for Microsoft SQL Server 2005 VirtualCenter 2.5

Shared Parallel File System

Using the Windows Cluster

The Bittorrent P2P File-sharing System: Measurements And Analysis J.A. Pouwelse, P. Garbacki, D.H.J. Epema, H.J. Sips Department of Computer Science,

Understanding the Benefits of IBM SPSS Statistics Server

Web DNS Peer-to-peer systems (file sharing, CDNs, cycle sharing)

Benchmarking Cassandra on Violin

Department of Computer Science Institute for System Architecture, Chair for Computer Networks. File Sharing

Sync Security and Privacy Brief

Bit Chat: A Peer-to-Peer Instant Messenger

Peer-to-peer data storage software Specification and source code

1. The Web: HTTP; file transfer: FTP; remote login: Telnet; Network News: NNTP; SMTP.

UserLock advanced documentation

Microsoft Windows Server 2003 with Internet Information Services (IIS) 6.0 vs. Linux Competitive Web Server Performance Comparison

AN APPLICATION OF INFORMATION RETRIEVAL IN P2P NETWORKS USING SOCKETS AND METADATA

PARALLELS CLOUD STORAGE

Oracle WebLogic Server 11g Administration

Application Layer. CMPT Application Layer 1. Required Reading: Chapter 2 of the text book. Outline of Chapter 2

Distributed File System. MCSN N. Tonellotto Complements of Distributed Enabling Platforms

SIGMOD RWE Review Towards Proximity Pattern Mining in Large Graphs

.NET 3.0 vs. IBM WebSphere 6.1 Benchmark Results

Violin Memory 7300 Flash Storage Platform Supports Multiple Primary Storage Workloads

P2P: centralized directory (Napster s Approach)

Web Server Software Architectures

Performance Characteristics of VMFS and RDM VMware ESX Server 3.0.1

Red Hat Network Satellite Management and automation of your Red Hat Enterprise Linux environment

Optimizing Shared Resource Contention in HPC Clusters

Red Hat Satellite Management and automation of your Red Hat Enterprise Linux environment

Modeling and Analysis of Bandwidth-Inhomogeneous Swarms in BitTorrent

CGHub Client Security Guide Documentation

- An Essential Building Block for Stable and Reliable Compute Clusters

DELL. Virtual Desktop Infrastructure Study END-TO-END COMPUTING. Dell Enterprise Solutions Engineering

Middleware and Distributed Systems. Peer-to-Peer Systems. Martin v. Löwis. Montag, 30. Januar 12

Transcription:

Java Bit Torrent Client Hemapani Perera, Eran Chinthaka {hperera, echintha}@cs.indiana.edu Computer Science Department Indiana University Introduction World-wide-web, WWW, is designed to access and download remote resources. But this downloading of resources becomes problematic when the size of the resource increases. Bit torrent, the peer-to-peer file sharing protocol, initially developed by Bram Cohen is slowly becoming popular as a means of sharing files over the web. The main difference of the protocol lies with the sharing method. Bit-torrent takes a large file and split in to large number of chunks and makes them available on different peers. A person, who is interested in downloading a resource, can connect to these peers who announce themselves with the pieces that they have to be downloaded. This approach provides the advantage that no single peer is overloaded with all the connections, as the downloading is distributed across large number of peers. At the same time the downloader can simultaneously connect to large number of peers and get the file much faster than getting if from a single location. Communicating with trackers, using TrackerUpdater, as and when it is required Managing the integrity and persistence of downloaded pieces, with StorageManagers Keep track of any timed out request and resend or reschedule them as needed An instance of PeerInstance class is created per each connection and handles all the communication related to its assigned peer. Peer instance does the handshake at the initialization and create a thread which keeps listening to incoming data. It has implementations for all message interactions defined in the specification and also responsible for the following. listen for incoming messages and act on those messages (e.g. Serve a requests) update the shared data structures based on the incoming messages This report presents a java based client to share files using Bit torrent protocol []. This reports share our experiences developing the client and presents test matrices we collect while tuning different parts of the implementation. Design Bit torrent system starts with starting TorrentManager, which maintains all its states in TorrentContext. TorrentManager is responsible mainly for; Managing the connected peers using PeerInstance objects Getting proper pieces effectively Figure : High level architecture Figure presents a high level view of the architecture. Each peer instance listens to the

incoming connection and updates the shared data structures. Torrent managers runs a control loop which process the data stored within shared data structures and issue high level commands to peer instances, to manage the download and upload process. Following describes the internal working of the system using high level pseudo-code.. System starts up with TorrentManager getting configurations stored within a property file.. TorrentManager initializes creating the data structure for the torrent meta info file. TorrentManager initiates the communication with the tracker and gets back the peer list. Decides on live peers by probing each one of them and decides on initial pool of peers to be contacted 5. 5. TorrentManager handshakes with each of the peers, using PeerInstances. Having received the pieces information from the peers, TorrentManager decides on an optimal peers based on the peer selection policy (e.g. by taking rarest available pieces in to consideration). TorrentManager notifies proper PeerInstances with its interest to download pieces from them. When choking messages are exchanged, TorrentManager request pieced from unchoked peers, through PeerInstances.. Pieces are requested as blocks, and when a response to requested block(s) is received, the response to next block is sent by peer instance. This is handled without direct intervention from the Torrent Manager. Having downloaded the piece, PeerInstances notifies the TorrentManager.. TorrentManager initiates the StorageManager to save the piece, after the hash check. TorrentManager continuously evaluates on the optimal peers to connect to download pieces, and request the pieces appropriately until the system completes downloading all the pieces.. Having downloaded the pieces and while downloading the pieces, TorrentManager also act as a seed for other peers. Implementation Bit torrent client implementation we have is tested with up to concurrent peers and one seeder. Also it inter-operates will widely used bit-torrent clients like Azureus []. Implementation includes following features.. The maximum number of connected peers and maximum number of concurrent downloads are configurable and controlled. It implements two peer selection algorithms as explained in peer selection section of performance evaluation. It includes an upload queue which is used to control upload rate is controlled. The upload rate can be controlled by changing the configurations. It includes two policies for request pipelining, a sliding window based and batch mode. More information is given in the performance evaluation section. 5. Manager monitors the requests and each request (e.g. request messages, interested message) has associated timestamp. Manager monitors them and re-sends or reschedules timeout requests. As a result clients are resilient to a fair amount of errors and able to recover from failure of other clients. Table presents a piece download distribution of a test run with peers and a one seed. As clearly shown by the table, the torrent download is distributed across the peers, and some peers download from up to - peers to get the pieces. Data in the table proves further that file sharing indeed reduces the load on individual peers and distributes it across the connected nodes. (This test can be recreated by running the

Peer Name JUnit test case included in test/manypeerstest.java in the submission.) 5 Pieces Numbers Downloaded From Seed 5 5 Performance Evaluation We added an initial wait and perform a reupdate from the tracker to make sure all peers know about other peers in the system before the test begins. For each peer we measured the average download rate (total data downloaded/time taken). This section presents the test matrices we collected to verify the hypothesis formed around different parts of the Bit torrent client operation. Peer Selection 5 5 5 5 5 5 5 5 We implemented two approaches for peer selection. At the start up, the peer connects to all known peers and retrieves their bit-fields. Then at each step maintains an N number of parallel connections to available peers. The two approaches implemented were two set of policies for selecting N out of all connected peers. Our two approaches are given below.. Select the N peers who have most number of interesting (Pieces the peer does not have) pieces. Rarest First - Select N peers who have rarest pieces. We varied the maximum allowed busy peer count (N) and plotted its effect on the download rate. Figure summarizes our observations. Initially with peer to connect at a given time, both starts with around KB/s and rarest first seem to have a more stable curve. Connecting to maximum interested peers had a sudden spike, but went down. Table : Piece distribution across available peers, during a torrent download Interoperability We were able to successfully inter-operate with bit-torrent client Azureus []. We tested using the Azureus client as a seed and as well as a client in two different test runs. With the rarest piece first approach the pieces will be distributed among the peers very fast and allow for more parallelism later on. We believed this approach is healthy for peer group in general. Even though this data is not sufficient to draw any firm conclusions in favor of either our observations lean towards rarest first policy.

Figure - Peer Performance against different peer selection algorithms Pipelining Our initial implementation did wait on every request, in other words, the peer would sends a request to another peer and wait for the response to arrive to send the next request. However it is possible to do request pipelining so that peer shall send N requests without waiting for the destination peer to respond. There are two methods for a peer to send N requests. One is to wait for all N to complete or to maintain an N long sliding window of pending requests. We implemented both the approaches a took observes their effect on download rates by running both approaches while increasing the size of N. Figure summarizes our observations. For the tests we allowed peers to connect to any number of peers, therefore starting value for simplest implementation (N =) was around Kb/s. As shown clearly by the figure both forms of pipelining have improved the throughput. But pipelining with sliding window does slightly better than batch mode. That is expected as batch mode holds the request messages till batches completes and sliding window responds once a response is available. Figure - Peer Performance against different pipelining algorithms Also we could see that the download rate saturates around - KB/s and that was observed across all the test matrices we took. Optimal window size, N, was around - and curves seems to turn back slightly when the window size was improved. Figure demonstrates the affect of maximum concurrent downloads on the set of five peers. Set of five peers were selected and ran by setting different values for maximum concurrent download limit. The five graphs show how their download rates vary. The peers are named after the order they are started. We observed the peers started later usually do well because they have more opportunity to do concurrent download from the existing peers, compared to peers start early. Affect of Number of Peers on Download Rate Following graphs show the affect of number of peers on the download rate. As shown clearly by

However the effect of that on single peer is mixed, where some peers quickly achieve saturation and some showed small or no improvement. Also we noticed in all our implementations that download rate saturates about Kb/s and in a single peer setting it is about -Kb/s. Test Environment For our tests we used two machines one having peers and the seeder and the other having 5 peers. We did the test on silo.cs.indiana.edu and hager.cs.indiana.edu. Silo is a -processor.ghz Intel Xeon system running Red Hat Enterprise Linux with GB of memory. Hagar is a -processor.ghz Intel Xeon system running Red Hat Enterprise Linux with GB of memory. Figure - Effect of maximum concurrent downloads on download rates Conclusion The results on our experiment clearly show that file sharing using bit-torrent protocol indeed reduces the load on individual peers. And in addition to that it has improved the total download times of each individual peers to a very good extent. This can be further improved by looking at some other methods like, getting blocks of the same piece from different peers. The individual algorithms that can be used to tune each and every part of the system provide the users a means to optimize their download rates, depending on the environment. At the same time, this will enable most of the companies struggling to maintain their web sites, due to high bandwidth requirements, to safely reduce the cost and to maintain a high up-andrunning time. Figure 5 - Effect of peer availability on download rates the graph, average download rate increases proportional to the number of available peers. References [] : Bit torrent protocol - http://www.bittorrent.org/protocol.html [] : Azureus bit-torrent client - http://azureus.sourceforge.net