Energy Efficient BitTorrent for Green P2PFile Sharing
Giuseppe Anastasi
Pervasive Computing & Networking Lab (Perlab)
Dept. of Information Engineering, University of Pisa
E-mail: giuseppe.anastasi@iet.unipi.it
Website: www.iet.unipi.it/~anastasi/
Based on Joint work withIlaria Giannetti, University of Pisa, Italy
Marco Conti, Andrea Passarella, IIT-CNR, Italy

Dept. of Computing, Hong Kong Polytechnic University, April 1, 2011

PerLabAcknowledgments
PerLab ICT Action IC0804
 Energy Efficiency in Large-Scale Distributed Systems Starting date : 23/01/2009
 End of action : 04/05/2013
 Additional info at

http://www.irit.fr/cost804/
6

OverviewPerLab Introduction
 Motivations for Energy Efficient Internet Energy Efficient P2P File Sharing

 EE-BitTorrent
 Experimental Analysis
 Real testbed

 Conclusions

7

The Energy Problem
PerLab Dramatic increase in the global energy consumption
 Energy: not renewable and limited resource
 Environmental pollution and planetary overheating Energy consumption of Internet
 74TWh/year in US (equivalent to $ 6 billions)
 2-3% of the total energy consumption in US About 1/3 of this energy could be saved by simple power
management techniques(Source: Lawrence Berkeley National Laboratory, USA, 2006)

8

Where Energy is consumed
PerLab Internet Core Routers , Switches, Access Points, Links

 Data Centers
 Servers

 User Devices
 PCs, Printers, Displays, …

9Energy Efficiency in the Internet Core
PerLab Re-Engineering More energy-efficient network devices through Energy-Efficient Silicon Complexity Reduction

 Dynamic Adaptation
 The capacity of network elements id dynamically modulated so as tomeet actual traffic loads
 Performance Scaling Idle Logic

 Sleeping/Standby Unused network/device portions are put in low-power mode
R. Bolla, R. Bruschi, F. Davoli, F. Cucchietti, Energy Efficiency in the Future Internet: A
Survey of Existing Approaches and Trends in Energy-Aware Fixed Network
Infrastructures, IEEE Communications Surveys and Tutorials, To appear. Available at
http://tnt.reti.dist.unige.it/index.php/en/publications
10

Edge DevicesPerLab Overall Energy Consumption
 Data Centers: 2 TWh per year User Devices: 16 TWh per year User devices are widespread and very numerous
 User devices are often left powered on even if idle
 People typically do not pay attention to energy issues(Source: Lawrence Berkeley National Laboratory, USA, 2006)11

Edge devices (cont’d)
PerLab

 Some statistics about people behavior
 43,5% of UK population uses PC at work and 18% never powers it off
 16% sometimes powers it off
 Energy wastage corresponding to 153 millions of €
 700.000 tons of CO2

 Motivations for not powering off
 It is no so important It takes some time and I am always in a hurry I simply forget to power off I don’t want to lose my work
 Nobody else turns PC off , so …
 ….
(Source: National Energy Foundation, UK, 2007)12

Causes for energy wastes
PerLab PCs left on for Laziness, Omissions, …

 PCs intentionally left on for maintaining connectivity
 Remote login
 Automatic software upgrades PCs intentionally left on for P2P file sharing applications

13

Possible Solutions
PerLab

 Centralized Shutdown Already used in data centers and labs
 No flexibility

LazinessOmissions

 Power Manager [Chi10]
 Better flexibility
 Luca Chiaraviglio, Marco Mellia, PoliSave: Efficient Power Management of Campus
PCs, IEEE SoftCOM - 18th International Conference on
Software, Telecommunications and Computer Networks, Bol, Croatia, September
2010 Context-aware Power Management [Har05]
 Uses low-power sensors/devices to predict the user’s
intention to use/not use the PC
 [Har05] C. Harris, V. Cahill, Power Management for Stationary Machines in a
Pervasive Computing Environment, Proc. 38th Hawaii International Conference onSystem Sciences, 2005.
14

Possible Solutions
PerLab Network Connectivity Proxy (NCP) [Jim08]
 Based on proxying + Magic Packet
 Somniloquy [Aga09]
 Sleep Server [Aga10]PermanentConnectivity[Jim08] M. Jimeno, K. Christensen, B. Nordman, A Network Connection Proxy to Enable Hosts toSleep and Save Energy, Proc. IEEE International Performance Computing and Communications
Conference, pp. 101-110, December 2008.
[Aga09] Y. Agarwal, S. Hodges, J. Scott, R. Chandra, P. Bahl, R. Gupta, Somniloquy: Augmenting
Network Interfaces to Reduce PC Energy Usage, Proceedings USENIX Symposium on Networked
System Design and Implementation (NSDI, 2009), Boston, MA, USA, April 22-24, 2009.
[Aga10] Y. Agarwal, S. Savage, and R. Gupta, SleepServer: Energy Savings for Enterprise PCs byAllowing them to Sleep, Proceedings of the USENIX Annual Technical Conference, June 2010.

 Energy-aware Applications and Protocols
15

P2P Applications
 Require permanent connectivity
 P2P Traffic in Internet

Source: Ipoque 2008 / 2009

PerLab16

P2P Applications (Cont’d)
PerLab P2P Traffic originated by BitTorrent

Source: Ipoque 2008 / 200917

BitTorrent
PerLabpeer: node of theBitTorrent overaly❒ P2P filedistribution

tracker: tracks peersinvolved in the torrent

torrent: group ofpeers exchanging
chunks of a fileBitTorrent Protocol
PerLab File divided into 256KB chunks.
 Peers download chunks from a multitude of other peers
 Instead from a single server, as in the traditional C/S approach While downloading, peers upload chunks to other peers.
 Once a peer has entire file, it may (selfishly) leave or(altruistically) remain Peers may come and go

BitTorrent Protocol
PerLabtorrent server:
contains .torrent files
tracker: tracks peersparticipating in torrent

Tit-for-Tat Policy
PerLab A peer continuously measures the bit rate achievedby each of its neighbors
 And uploads chunks to the 4 neighbors from which itis achieving the highest bit rate
 re-evaluate top 4 every 10 secs

 Every 30 secs: randomly select another peer, starts
sending chunks
 newly chosen peer may join top 4
 “optimistically unchoke”

Rarest First Policy
PerLab At any given time, different peers have different
file chunks
 Periodically, a peer asks each neighbors for thelist of chunks they have.
 And sends requests for missing chunks, giving
priority to chunks that are less spread rarest first

BitTorrent and Energy Efficiency
PerLab

 BitTorrent is not “energy friendly”
 BT peers must remain connected during the entire
download process Powering off a peer stops the download process Coordinated strategies for energy efficiency areunfeasible
 They would be in contrast with the BT design paradigm

23

BitTorrent and Energy Efficiency
PerLab Energy Efficiency in BitTorrent has not receivedsignificant attention so far
 Most of the proposed optimizations are aimed atimproving performance Only indirectly address energy efficiency

 Energy-Efficient Mobile BitTorrent Targeted to mobile devices
I. Kelenyi, A. Ludanyi, J. Nurminen, I. Pusstinen, Energy-efficient Mobile BitTorrent
with Broadband Router Hosted Proxies, Proc. IFIP Wireless and Mobile Networking
Conference (WMNC 2010), Budapest, Hungary, October 13-15, 2010.
I. Kelenyi, A. Ludanyi, J. Nurminen, BitTorrent on Mobile Phones – Energy
Efficiency of a Distributed Proxy Solution, Proc. International Green Computing
Conference (IGCC 2010), Chicago, USA, August 15-18, 2010.

24

Our Proposal
PerLab EE-BitTorrent
 Proxy-based version of BitTorrent
 One BT Proxy for a large number of peers (PCs)25Architecture
PerLabBT Peer
TCP/IP
EE-BT Daemon
BT Peer
EE-BT

EE-BT

ClientServer

TCP/IP

TCP/IP

BT Peer

BitTorrent Overlay Network

TCP/IP

TCP/IP
BT Peer
TCP/IP

User’s PC

BitTorrent Proxy

BitTorrent Overlay Network

 EE-BitTorrent (EE-BT)
 Clients and Proxy (clients side) Client/Server scheme Traditional BitTorrent (BT Peer) Proxy (P2P Network side)26

EE-BT Protocol – version 1
PerLabUser's PC

Torrent Server

BitTorrent Proxy

BitTorrent Overlay(1) GET .torrent file(2) PUT .torrent file(5) Switch off(3) DOWNLOAD filename(6) file do(4) ACK(7) Dwnload req

ATA

(7) D

(8) Switch onuest

ATA(9) CHECK filename(10) STATUS filename(11) GET filename(12) PUT filename27

EE-BT Protocol – version 2
PerLabUser's PC

Torrent Server

BitTorrent Proxy

BitTorrent Overlay(1) GET .torrent file(2) PUT .torrent file(5) sleep(3) DOWNLOAD filename(6) file do(4) ACK(7) Dwnload requestATA(7) DATA(8) MAGIC PACKET(9) wakeup(10) PUT filename28

ImplementationPerLab Energy Efficient BitTorrent modules
 Client – Server scheme Server (Proxy) Client (user PC)

 Programming language: Python
 Libtorrent Rasterbar: library for BitTorrent
 Command-line BitTorrent client29Performance Metrics
PerLab

 Relative Energy Saving

EPS = 1−EL Absolute Energy Saving∆E = E L − E P30Performance metrics (cont’d)
PerLab Assumption:
 All PCs and proxy have the same power consumption
 Energy Consumption proportional to power-on time31Performance metrics (cont’d)
PerLab Relative Energy Savings
The proxy is a multi-server machine

The proxy is a dedicated machinen∑ t (i ) + t (i )12S ′(n ) = 1 − i =1 n

S ′′(n ) = 1 −∑ d (i )
i =1

Ldmax
Pn+ ∑ t1 (i ) + t 2 (i )i =1n

∑ d L (i )i =1

 Absolute Energy Savings
The proxy is a multi-server machineThe proxy is a dedicated machine

nnnn



∆E ′(n ) =  ∑ d L (i ) − ∑ [t1 (i ) + t 2 (i )] ⋅ PPC ∆E ′′(n ) =  ∑ d L (i ) − ∑ [t1 (i ) + t 2 (i )] − d Pmax  ⋅ PPC
i =1
i =1
 i =1 i =132

Experimental Testbed
PerLab

 Two systems:
 Legacy BitTorrent
 EE-BitTorrent

 Connectivity:
 Ethernet LAN
 100 Mbps link

 Downloaded files
 Size: ~4GB [3.95 GB – 4.71 GB] Initial number of seeds: 200 - 800

 Experiments replicated several times per day
 in different days

33

Relative Energy Savings
PerLab Multi-server Machine  S ′(n ) Dedicated Machine  S ′′(n )100Energy Savings (%)

80
60
40
20
0-20

Dedicated Machine
Multi-server Machine
12

3

4

Number of PCs

5634

Absolute Energy Savings
PerLab Assumptions
 All PC have the same power consumption
 BT Proxy has the same power consumption of PCc

 Power Values 100 W (desktop PC), 30 W (laptop PC)
Absolute Energy Savings (kWh)2
Dedicated Machine, 100 W
Multi-server Machine,100 W
Dedicated Machine, 30 W
Multi-server Machine, 30 W

1,5

10,50-0,51

234

Number of PCs

5635

SummaryPerLab Departmental scenario
 PCs and Proxy connected to the same high-speed LAN

 In the analyzed scenario EE-BitTorrent provides asignificant reduction in energy consumption
 When the number of parallel download operations islarger than 1
 Energy Efficiency increases with the number ofparallel download operations
 The energy consumed by the proxy is shared among alarger number of users

36

Key Question
PerLabWhat about users
with residential access?

37

Additional Scenarios
PerLab Residential Access Networks
 ADSL Dowlink rate: Uplink rate:

up to 8 Mbps
up to 512 Mbps

 UMTS
 Dowlink rate: Uplink rate:

up to 7.2 Mbps
up to 2.0 Mbps

38

Additional Scenarios
PerLab Single User Legacy BitTorrent
 Proxy-based BitTorrent

 File Types:
 135 MB
 Audio CD (MP3) 350 MB
 Episode of a TV Series (AVI) 4 GB Ubuntu 10.10 Distribution (ISO)39

Performance metrics
PerLab Assumption:
 User’s PC and Proxy have same power consumption
 Energy Consumption proportional to power-on time40

ADSL Access
PerLab14000

12000
Average Download Time (s)53 minutes
10000
Proxy from BT overaly
8000
Legacy (PC)
Legacy6000

Proxy- based (Proxy)
Proxy-based
Downloadfrom(PC)
Proxy
Proxy-based

4000

2000

0135 MB350 MB

4 GB

File Size
41

ADSL Access (2)PerLab

1600

Average Download Time (s)

1400
1200
1000
800
600
400
200
0135 MB350 MB
File Size
42

UMTS Access
PerLab

7.2 days

180

Average Download Time (hours)

160140120100
Legacy (PC)
Legacy80

Proxy- based (Proxy)
Proxy-based
Downloadfrom(PC)
Proxy
Proxy-based

60

2.6 days

40200135 MB

350 MB

4 GB

File Size
43

UMTS Access (2)PerLab10

Average Download Time (hours)

98765432
10135 MB350 MB

File Size
44

Relative Energy Saving
PerLab100
80

Relative Energy Saved (%)

604020UMTS

0-20

135 MB

350 MB

4 GB

ADSL-40-60-80-100File Size
45

Where to place the BitTorrent Proxy?
PerLab Departmental Network May be placed on a machine already used for some otherservices
 Better access control (in addition to energy efficiency)

 Residential Users
 Several Options
 Provided (for free) by ISP Cloud Proxy leased to users
 Proxy maintained and shared by a group of users (Social Proxy) The proxy should have a high-speed connection
 The proxy should be as close as possible to users
46

Conclusions
PerLab Energy Efficient BitTorrent protocol
 Based on a BitTorrent Proxy Implementation
 Real testbed

 Experimental Analysis
 EE-BitTorrent provides a significant reduction in energyconsumption
 Both in dept. and residential networks

47

Reference papers
PerLab

G. Anastasi, I. Giannetti, A. Passarella, A BitTorrent Proxy for Green Internet File
Sharing: Design and Experimental Evaluation, Computer Communications, Vol. 33,
N. 7, pp. 794-802, May 2010.



G. Anastasi, M. Conti, I. Giannetti, A. Passarella, Design and Evaluation of a
BitTorrent Proxy for Energy Saving, Proceedings IEEE Symposium on Computers
and Communications (ISCC 2009), Sousse, Tunisia, July 5-8, 2009.

48

PerLabThank you for your attention!
Questions?

Email: giuseppe.anastasi@iet.unipi.it49