25
Improving ISP Locality Improving ISP Locality in BitTorrent Traffic in BitTorrent Traffic via Biased Neighbor via Biased Neighbor Selection Selection Ruchir Bindal, Ruchir Bindal, Pei Cao Pei Cao , , William Chan William Chan Stanford University Stanford University Jan Medved, George Suwala, Jan Medved, George Suwala, Tony Bates, Amy Zhang Tony Bates, Amy Zhang Cisco Systems, Inc. Cisco Systems, Inc.

Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Improving ISP Locality in Improving ISP Locality in BitTorrent Traffic via Biased BitTorrent Traffic via Biased

Neighbor SelectionNeighbor Selection

Ruchir Bindal, Ruchir Bindal, Pei CaoPei Cao, William , William ChanChan

Stanford UniversityStanford UniversityJan Medved, George Suwala, Tony Jan Medved, George Suwala, Tony

Bates, Amy ZhangBates, Amy ZhangCisco Systems, Inc.Cisco Systems, Inc.

Page 2: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

P2P and ISPs: Not FriendsP2P and ISPs: Not Friends

• P2P applications are notoriously P2P applications are notoriously difficult to “traffic engineer”difficult to “traffic engineer”– ISPs: different links have different ISPs: different links have different

monetary costsmonetary costs– P2P applications: P2P applications:

•Peers are all equalPeers are all equal

•Choices made based on measured Choices made based on measured performanceperformance

•No regards for underlying ISP topology or No regards for underlying ISP topology or preferencespreferences

Page 3: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

P2P and ISPs: Can’t Be FoesP2P and ISPs: Can’t Be Foes

• ISPs: need P2P for customersISPs: need P2P for customers

• P2P: need ISPs for bandwidthP2P: need ISPs for bandwidth

• Current state of affairs: a clumsy co-Current state of affairs: a clumsy co-existenceexistence– ISPs “throttle” P2P traffic along high-cost ISPs “throttle” P2P traffic along high-cost

linkslinks– Users sufferUsers suffer

Page 4: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Can They Be Partners?Can They Be Partners?

• ISPs inform P2P applications of its ISPs inform P2P applications of its preferencespreferences

• P2P applications schedule traffic in P2P applications schedule traffic in ways that benefit both Users and ISPsways that benefit both Users and ISPs

This paper gives an example for This paper gives an example for BitTorrentBitTorrent

Page 5: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

OutlineOutline

• Review of BitTorrent Review of BitTorrent

• Biased Neighbor Selection: Biased Neighbor Selection: – Design and ImplementationsDesign and Implementations– EvaluationsEvaluations

• Comparison with AlternativesComparison with Alternatives

Page 6: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

BitTorrent File Sharing BitTorrent File Sharing NetworkNetwork

Goal: replicate K chunks of data Goal: replicate K chunks of data among N nodesamong N nodes

• Form neighbor connection graphForm neighbor connection graph

• Neighbors exchange dataNeighbors exchange data

Page 7: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

BitTorrent: Neighbor BitTorrent: Neighbor SelectionSelection

Trackerfile.torrent1Seed

Whole file

A

52

3

4

Page 8: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

BitTorrent: Piece ReplicationBitTorrent: Piece Replication

Trackerfile.torrent1Seed

Whole file

A

3

2

Page 9: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

BitTorrent: Piece Replication BitTorrent: Piece Replication AlgorithmsAlgorithms

• ““Tit-for-tat” (choking/unchoking):Tit-for-tat” (choking/unchoking):– Each peer only uploads to 7 other peers at a timeEach peer only uploads to 7 other peers at a time– 6 of these are chosen based on amount of data 6 of these are chosen based on amount of data

received from the neighbor in the last 20 secondsreceived from the neighbor in the last 20 seconds– The last one is chosen randomly, with a 75% bias The last one is chosen randomly, with a 75% bias

toward new comerstoward new comers

• (Local) Rarest-first replication:(Local) Rarest-first replication:– When peer 3 unchokes peer A, A selects which When peer 3 unchokes peer A, A selects which

piece to downloadpiece to download

Page 10: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Performance of BitTorrentPerformance of BitTorrent

• Conclusion from modeling studies: Conclusion from modeling studies: BitTorrent is nearly optimal in BitTorrent is nearly optimal in idealized, homogeneous networksidealized, homogeneous networks– Demonstrated by simulation studiesDemonstrated by simulation studies– Confirmed by theoretical modeling Confirmed by theoretical modeling

studiesstudies• Intuition: in a random graph, Intuition: in a random graph,

Prob(Peer A’s content is a subset of Peer B’s) ≤ Prob(Peer A’s content is a subset of Peer B’s) ≤ 50%50%

Page 11: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Random Neighbor SelectionRandom Neighbor Selection

• Existing studies all assume random Existing studies all assume random neighbor selectionneighbor selection– BitTorrent no longer optimal if nodes in BitTorrent no longer optimal if nodes in

the same ISP only connect to each otherthe same ISP only connect to each other

• Random neighbor selection Random neighbor selection high high cross-ISP trafficcross-ISP traffic

Q: Can we modify the neighbor selection Q: Can we modify the neighbor selection scheme without affecting scheme without affecting performance?performance?

Page 12: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Biased Neighbor SelectionBiased Neighbor Selection

• Idea: of N neighbors, choose N-k from Idea: of N neighbors, choose N-k from peers in the same ISP, and choose k peers in the same ISP, and choose k randomly from peers outside the ISPrandomly from peers outside the ISP

ISP

Page 13: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Implementing Biased Neighbor Implementing Biased Neighbor SelectionSelection

• By TrackerBy Tracker– Need ISP affiliations of peersNeed ISP affiliations of peers

•Peer to AS mapsPeer to AS maps•Public IP address ranges from ISPsPublic IP address ranges from ISPs•Special “X-” HTTP headerSpecial “X-” HTTP header

• By traffic shaping devicesBy traffic shaping devices– Intercept “peer Intercept “peer tracker” messages tracker” messages

and manipulate responsesand manipulate responses– No need to change tracker or clientNo need to change tracker or client

Page 14: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Evaluation MethodologyEvaluation Methodology

• Event-driven simulatorEvent-driven simulator– Use actual client and tracker codes as much as Use actual client and tracker codes as much as

possiblepossible– Calculate bandwidth contention, assume perfect Calculate bandwidth contention, assume perfect

fair-share from TCPfair-share from TCP

• Network settingsNetwork settings– 14 ISPs, each with 50 peers, 100Kb/s upload, 1Mb/s 14 ISPs, each with 50 peers, 100Kb/s upload, 1Mb/s

downloaddownload– Seed node, 400Kb/s uploadSeed node, 400Kb/s upload– Optional “university” nodes (1Mb/s upload)Optional “university” nodes (1Mb/s upload)– Optional ISP bottleneck to other ISPsOptional ISP bottleneck to other ISPs

Page 15: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Limitation of ThrottlingLimitation of Throttling

Page 16: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Throttling: Cross-ISP TrafficThrottling: Cross-ISP Traffic

0

10

20

30

40

50

Nothrottling

2.5Mbps 1.5Mbps 500kbps

Bottleneck Bandwidth

Redundancy

Redundancy: Average # of times a data chunk enters the ISP

Page 17: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Biased Neighbor Selection: Biased Neighbor Selection: Download TimesDownload Times

Page 18: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Biased Neighbor Selection: Biased Neighbor Selection: Cross-ISP TrafficCross-ISP Traffic

0

10

20

30

40

50

Regular k=17 k=5 k=1

Neighbor Selection

Redundancy

Page 19: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Importance of Rarest-First Importance of Rarest-First ReplicationReplication

• Random piece replication performs Random piece replication performs badlybadly– Increases download time by 84% - 150%Increases download time by 84% - 150%– Increase traffic redundancy from 3 to 14Increase traffic redundancy from 3 to 14

• Biased neighbors + Rarest-First Biased neighbors + Rarest-First More uniform progress of peersMore uniform progress of peers

Page 20: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Biased Neighbor Selection: Biased Neighbor Selection: Single-ISP DeploymentSingle-ISP Deployment

Page 21: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Presence of External High-Presence of External High-Bandwidth PeersBandwidth Peers

• Biased neighbor selection alone: Biased neighbor selection alone: – Average download time same as regular Average download time same as regular

BitTorrentBitTorrent– Cross-ISP traffic increases as # of “university” Cross-ISP traffic increases as # of “university”

peers increasepeers increase• Result of tit-for-tatResult of tit-for-tat

• Biased neighbor selection + Throttling: Biased neighbor selection + Throttling: – Download time only increases by 12%Download time only increases by 12%

• Most neighbors do not cross the bottleneckMost neighbors do not cross the bottleneck

– Traffic redundancy (i.e. cross-ISP traffic) same Traffic redundancy (i.e. cross-ISP traffic) same as the scenario without “university” peersas the scenario without “university” peers

Page 22: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Comparison with Comparison with AlternativesAlternatives• Gateway peer: only one peer connects to Gateway peer: only one peer connects to

the peers outside the ISPthe peers outside the ISP– Gateway peer must have high bandwidthGateway peer must have high bandwidth

• It is the “seed” for this ISPIt is the “seed” for this ISP

– Ends up benefiting peers in other ISPsEnds up benefiting peers in other ISPs

• Caching:Caching:– Can be combined with biased neighbor selectionCan be combined with biased neighbor selection– Biased neighbor selection reduces the Biased neighbor selection reduces the

bandwidth needed from the cache by an order bandwidth needed from the cache by an order of magnitudeof magnitude

Page 23: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

SummarySummary

• By choosing neighbors well, BitTorrent By choosing neighbors well, BitTorrent can achieve high peer performance can achieve high peer performance without increasing ISP costwithout increasing ISP cost– Biased neighbor selection: choose initial Biased neighbor selection: choose initial

set of neighbors wellset of neighbors well– Can be combined with throttling and Can be combined with throttling and

cachingcaching

P2P and ISPs can collaborate!P2P and ISPs can collaborate!

Page 24: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Related WorkRelated Work

• Many modeling studies of BitTorrentMany modeling studies of BitTorrent

• Simulation studiesSimulation studies

• Measurements of real torrentsMeasurements of real torrents

Page 25: Improving ISP Locality in BitTorrent Traffic via Biased Neighbor Selection Ruchir Bindal, Pei Cao, William Chan Stanford University Jan Medved, George

Future WorkFuture Work

• Implementation of tracker-side Implementation of tracker-side changes and experimentschanges and experiments

• Theoretical modeling of biased Theoretical modeling of biased neighbor selectionneighbor selection

• Dynamic biased neighbor selection Dynamic biased neighbor selection for “global congestion avoidance”for “global congestion avoidance”