Optimal File Distribution in Peer-to-Peer Networks Kai-Simon - - PowerPoint PPT Presentation

optimal file distribution in peer to peer networks
SMART_READER_LITE
LIVE PREVIEW

Optimal File Distribution in Peer-to-Peer Networks Kai-Simon - - PowerPoint PPT Presentation

Optimal File Distribution in Peer-to-Peer Networks Kai-Simon Goetzmann Technische Universitt Berlin goetzmann@math.tu-berlin.de joint work with Tobias Harks, Max Klimm, and Konstantin Miller ISAAC 2011, Yokohama Motivation Motivation


slide-1
SLIDE 1

Optimal File Distribution in Peer-to-Peer Networks

Kai-Simon Goetzmann

Technische Universität Berlin goetzmann@math.tu-berlin.de joint work with Tobias Harks, Max Klimm, and Konstantin Miller ISAAC 2011, Yokohama

slide-2
SLIDE 2

Motivation

slide-3
SLIDE 3

Motivation

Question:

How can peer-to-peer downloads be scheduled optimally?

slide-4
SLIDE 4

Outline

⊲ Part I: Problem Statement ⊲ Part II: Hardness ⊲ Part III: Approximation

slide-5
SLIDE 5

Part I Problem Statement

slide-6
SLIDE 6

Problem Statement

core 1 2 . . . n cu cu

1

cd

1

cu

2

cd

2

cu

n

cd

n

Instance I = (N, cd

N, cu N)

⊲ set N = {1, . . ., n} of peers ⊲ peer 0 (server) owns file of unit size at time 0 ⊲ download capacity cd

i of peer i

⊲ upload capacity cu

i of peer i

⊲ si,j :

R≥0 → R≥0 (integrable) sending rate function

⊲ xi(t) =

t

  • k∈N sk,i(τ)dτ fraction of file owned by i at t
slide-7
SLIDE 7

Problem Statement

core 1 2 . . . n cu cu

1

cd

1

cu

2

cd

2

cu

n

cd

n

Instance I = (N, cd

N, cu N)

⊲ set N = {1, . . ., n} of peers ⊲ peer 0 (server) owns file of unit size at time 0 ⊲ download capacity cd

i of peer i

⊲ upload capacity cu

i of peer i

⊲ si,j :

R≥0 → R≥0 (integrable) sending rate function

⊲ xi(t) =

t

  • k∈N sk,i(τ)dτ fraction of file owned by i at t

Symmetric peers: cd

i = cu i =: ci for all i ∈ N.

slide-8
SLIDE 8

Feasible solution

Feasible solution S = (si,j)i,j∈N ⊲ si,j :

R≥0 → R≥0 is an integrable function

⊲ unique sender: ∀i ∈ N ∃p(i) ∈ N : sk,i ≡ 0 ∀k p(i) ⊲ download completed: si,j(t) = 0 ∀i, j ∈N\{0}, t ∈

R≥0 : xi(t)dτ < 1

⊲ upload capacity:

j∈N si,j(t) ≤ cu i

∀i ∈ N, t ∈

R≥0

⊲ download capacity: sp(j),j(t) ≤ cd

j

∀j ∈ N, t ∈

R≥0
slide-9
SLIDE 9

Feasible solution

Feasible solution S = (si,j)i,j∈N ⊲ si,j :

R≥0 → R≥0 is an integrable function

⊲ unique sender: ∀i ∈ N ∃p(i) ∈ N : sk,i ≡ 0 ∀k p(i) ⊲ download completed: si,j(t) = 0 ∀i, j ∈N\{0}, t ∈

R≥0 : xi(t)dτ < 1

⊲ upload capacity:

j∈N si,j(t) ≤ cu i

∀i ∈ N, t ∈

R≥0

⊲ download capacity: sp(j),j(t) ≤ cd

j

∀j ∈ N, t ∈

R≥0

Definition

completion time: Ci = inf{t ∈

R≥0 : xi(t) = 1}

makespan: M = maxi∈N Ci

slide-10
SLIDE 10

Part II Hardness

slide-11
SLIDE 11

Capacity Expansion Lemma

For a peer i and a time interval [t1, t2], ⊲ total upload of i in [t1, t2]: ui(t1, t2) =

t2

t1

  • j∈N si,j(τ)dτ

⊲ idleness of i in [t1, t2]: zi(t1, t2) = ci(t2 − max{Ci, t1}) − ui(t1, t2) For t ≥ 0, ⊲ X(t) =

i∈N xi(t)

⊲ Z(t) =

i∈N zi(0, t)

Lemma (Capacity Expansion Lemma)

Let I be an instance with c = maxi∈N ci, Then, for all solutions

  • 1. ui(t1, t2) + zi(t1, t2) ≤ max{0, (t2 − t1)ci − 1 + xi(t1)}
  • 2. X(k/c) + Z(k/c) ≤ 2k for all k ∈
N

Proof

slide-12
SLIDE 12

Hardness

Theorem

The peer-to-peer file distribution problem for heterogeneous symmetric peers is strongly NP-hard.

Proof.

By reduction from 3-Partition.

Details

slide-13
SLIDE 13

Part III Approximation

slide-14
SLIDE 14

Algorithmic Idea

⊲ need combinatorial lower bound

◮ ui(t1, t2) + zi(t1, t2) ≤ max{0, (t2 − t1)ci − 1 + xi(t1)}

⊲ Algorithmic Idea: let algorithm satisfy this inequality for all peers with xi(t1) > 0 with equality

◮ Every peer downloads at full download rate

⇒ complete peers in order 1, . . . , n where c1 ≥ · · · ≥ cn

◮ no idleness as long not every download started

⊲ Problem: This might not be possible ⊲ Solution: Time-varying resource augmentation

◮ allow to violate upload and download constraints by a

factor of √ 2

slide-15
SLIDE 15

Scale-Fit Algorithm

⊲ Sort peers such that c1 ≥ · · · ≥ cn (Peer 0 has unused upload capacity c at time 0) ⊲ Consider next point in time t where some peer i has unused upload capacity c

◮ Choose downloaders: Choose next k peers i1, . . . , ik such

that c/ √ 2 ≤

j=i1,...,ik cj ≤

√ 2c

◮ Resource augmentation: ◮ If c < cj, augment upload capacity s.t. c = cj ◮ If cj < c, augment download capacities s.t. c = cj ◮ Peers j = i1, . . . , ik download from i with full capacity ◮ Release capacity: For j = i1, . . . , ik, at time t +

1 αcj

◮ Peer j has unused capacity cj ◮ Peer i has unused capacity cj · c/

j′ cj′

⊲ When all downloads are finished, stop.

slide-16
SLIDE 16

Scale-Fit Example

Example

c0 = 5, c1 = 3, c2 = 3, c3 = 5/2, c4 = 2, and c5 = 2.

slide-17
SLIDE 17

Scale-Fit Example

Example

c0 = 5, c1 = 3, c2 = 3, c3 = 5/2, c4 = 2, and c5 = 2. time

1 3 11 15 5 6

c0

slide-18
SLIDE 18

Scale-Fit Example

Example

c0 = 5, c1 = 3, c2 = 3, c3 = 5/2, c4 = 2, and c5 = 2. time

1 3 11 15 5 6

c0 peer 1

slide-19
SLIDE 19

Scale-Fit Example

Example

c0 = 5, c1 = 3, c2 = 3, c3 = 5/2, c4 = 2, and c5 = 2. time

1 3 11 15 5 6

c0 peer 1 peer 2

slide-20
SLIDE 20

Scale-Fit Example

Example

c0 = 5, c1 = 3, c2 = 3, c3 = 5/2, c4 = 2, and c5 = 2. time

1 3 11 15 5 6

c0 peer 1 peer 2 c1

slide-21
SLIDE 21

Scale-Fit Example

Example

c0 = 5, c1 = 3, c2 = 3, c3 = 5/2, c4 = 2, and c5 = 2. time

1 3 11 15 5 6

c0 peer 1 peer 2 c1 peer 3

slide-22
SLIDE 22

Scale-Fit Example

Example

c0 = 5, c1 = 3, c2 = 3, c3 = 5/2, c4 = 2, and c5 = 2. time

1 3 11 15 5 6

c0 peer 1 peer 2 c1 peer 3 peer 4

slide-23
SLIDE 23

Scale-Fit Example

Example

c0 = 5, c1 = 3, c2 = 3, c3 = 5/2, c4 = 2, and c5 = 2. time

1 3 11 15 5 6

c0 peer 1 peer 2 c1 peer 3 peer 4

slide-24
SLIDE 24

Scale-Fit Example

Example

c0 = 5, c1 = 3, c2 = 3, c3 = 5/2, c4 = 2, and c5 = 2. time

1 3 11 15 5 6

c0 peer 1 peer 2 c1 peer 3 peer 4 peer 5

slide-25
SLIDE 25

Scale-Fit Example

Example

c0 = 5, c1 = 3, c2 = 3, c3 = 5/2, c4 = 2, and c5 = 2. time

1 3 11 15 5 6

c0 peer 1 peer 2 c1 peer 3 peer 4 peer 5 time

5 12 11 12 25 24

Scaling factor: 5/4 c0

slide-26
SLIDE 26

Scale-Fit Example

Example

c0 = 5, c1 = 3, c2 = 3, c3 = 5/2, c4 = 2, and c5 = 2. time

1 3 11 15 5 6

c0 peer 1 peer 2 c1 peer 3 peer 4 peer 5 time

5 12 11 12 25 24

Scaling factor: 5/4 c0 peer 1

slide-27
SLIDE 27

Scale-Fit Example

Example

c0 = 5, c1 = 3, c2 = 3, c3 = 5/2, c4 = 2, and c5 = 2. time

1 3 11 15 5 6

c0 peer 1 peer 2 c1 peer 3 peer 4 peer 5 time

5 12 11 12 25 24

Scaling factor: 5/4 c0 peer 1 peer 2

slide-28
SLIDE 28

Scale-Fit Example

Example

c0 = 5, c1 = 3, c2 = 3, c3 = 5/2, c4 = 2, and c5 = 2. time

1 3 11 15 5 6

c0 peer 1 peer 2 c1 peer 3 peer 4 peer 5 time

5 12 11 12 25 24

Scaling factor: 5/4 c0 peer 1 peer 2 peer 3 peer 4 c1 peer 5

slide-29
SLIDE 29

Analysis of Scale-Fit I

Theorem

If c0 ≥ ci ∀i ∈ N, then Scale-Fit is a 2 √ 2-approximation. = M n

slide-30
SLIDE 30

Analysis of Scale-Fit I

Theorem

If c0 ≥ ci ∀i ∈ N, then Scale-Fit is a 2 √ 2-approximation. n ≤ M∗

slide-31
SLIDE 31

Analysis of Scale-Fit I

Theorem

If c0 ≥ ci ∀i ∈ N, then Scale-Fit is a 2 √ 2-approximation. n ≤ M∗ T0

slide-32
SLIDE 32

Analysis of Scale-Fit I

Theorem

If c0 ≥ ci ∀i ∈ N, then Scale-Fit is a 2 √ 2-approximation. n ≤ M∗ T0

!

≤ M∗

slide-33
SLIDE 33

Analysis of Scale-Fit I

Theorem

If c0 ≥ ci ∀i ∈ N, then Scale-Fit is a 2 √ 2-approximation.

  • X(T0)

n T0 ⊲ Assume X ∗(T0) = n > X(T0)

slide-34
SLIDE 34

Analysis of Scale-Fit I

Theorem

If c0 ≥ ci ∀i ∈ N, then Scale-Fit is a 2 √ 2-approximation. n T0 k0 T1 ⊲ Assume X ∗(T0) = n > X(T0) ⊲ T1 = T0 − 1/ck0

slide-35
SLIDE 35

Analysis of Scale-Fit I

Theorem

If c0 ≥ ci ∀i ∈ N, then Scale-Fit is a 2 √ 2-approximation.

  • X(T1)

n T0 k0 T1 ⊲ Assume X ∗(T0) = n > X(T0) ⊲ T1 = T0 − 1/ck0 ⊲ X(T1) < X ∗(T1) . . .

slide-36
SLIDE 36

Analysis of Scale-Fit I

Theorem

If c0 ≥ ci ∀i ∈ N, then Scale-Fit is a 2 √ 2-approximation. n T0 k0 T1 Tℓ kℓ ⊲ Assume X ∗(T0) = n > X(T0) ⊲ T1 = T0 − 1/ck0 ⊲ X(T1) < X ∗(T1) . . . ⊲ X(Tℓ) < X ∗(Tℓ), kℓ = 1 Contradiction!

slide-37
SLIDE 37

Scale-Fit

Theorem

For the peer-to-peer file distribution problem with heterogeneous symmetric peers, the following holds

  • 1. If c0 ≥ c1, Scale-Fit is a 2

√ 2-approximation

  • 2. If c0 < c1, uploading the file to peer 1 and applying

Scale-Fit is a (1 + 2 √ 2)-approximation.

slide-38
SLIDE 38

Conclusion

⊲ Optimal peer-to-peer file distribution with heterogenous symmetric peers is strongly NP-hard ⊲ There is a (1 + 2 √ 2)-approximation Not in this talk: ⊲ Homogenous symmetric peers are easy (even if the server has a different capacity) ⊲ Fixed number of peers is easy Open problems: ⊲ better approximation factor, PTAS, asymmetric peers, restricted connectivity, file divided in chunks...

slide-39
SLIDE 39

Conclusion

⊲ Optimal peer-to-peer file distribution with heterogenous symmetric peers is strongly NP-hard ⊲ There is a (1 + 2 √ 2)-approximation Not in this talk: ⊲ Homogenous symmetric peers are easy (even if the server has a different capacity) ⊲ Fixed number of peers is easy Open problems: ⊲ better approximation factor, PTAS, asymmetric peers, restricted connectivity, file divided in chunks... Thank you for your attention!

slide-40
SLIDE 40

AUGUST 19-24 ismp2012.org

THE 21ST INTERNATIONAL SYMPOSIUM ON MATHEMATICAL PROGRAMMING

slide-41
SLIDE 41

Capacity Expansion Lemma - Proof

ui(t1, t2)+zi(t1, t2) ≤ max{0, (t2−t1)ci −1+xi(t1)}

Proof: ⊲ peer i needs at least (1 − xi(t1))/ci time units to finish download ⊲ ui(t1, t2) + zi(t1, t2) ≤ ci(t2 − t1 − (1 − xi(t1))/ci) ≤ max{0, (t2 − t1)ci − 1 + xi(t1)}

X(k/c) + Z(k/c) ≤ 2k for all k ∈

N

Proof: ⊲ By induction over k, using the first inequality

Back

slide-42
SLIDE 42

Hardness Proof I

⊲ 3-Partition instance P = {k1, . . . , kn}, n = 3m, B = n

i=1 ki/3, w.l.o.g. m = 2ℓ

⊲ Construct instance I of peer-to-peer distribution problem

◮ m subset peers s1, . . . , sm with csi = B ◮ s1 owns the file at time 0 ◮ for each ki ◮ a master element peer pi

0 with cpi

0 = ki

◮ 2ℓki − 2 element peers pi

1, . . . , pi 2ℓki−2 with

cpi

k = ki/(ℓki − 1)

⊲ P is a yes-instance ⇔ M∗ ≤ ℓ/B + ℓ

slide-43
SLIDE 43

Hardness Proof II

"⇒":

Example

P = {3, 2, 2, 2, 2, 1} m = 21, ℓ = 1 B = 6 ℓ/B ℓ/B + ℓ

slide-44
SLIDE 44

Hardness Proof II

"⇒":

  • 1. complete all subset

peers in [0, ℓ/B]

Example

P = {3, 2, 2, 2, 2, 1} m = 21, ℓ = 1 B = 6 ℓ/B ℓ/B + ℓ

slide-45
SLIDE 45

Hardness Proof II

"⇒":

  • 1. complete all subset

peers in [0, ℓ/B]

  • 2. use partition serve all

master element peers with full rate

Example

P = {3, 2, 2, 2, 2, 1} m = 21, ℓ = 1 B = 6 ℓ/B ℓ/B + ℓ p1 p2

p3

p4 p5 p6

slide-46
SLIDE 46

Hardness Proof II

"⇒":

  • 1. complete all subset

peers in [0, ℓ/B]

  • 2. use partition serve all

master element peers with full rate

  • 3. serve all element peers

Example

P = {3, 2, 2, 2, 2, 1} m = 21, ℓ = 1 B = 6

Back to Theorem

ℓ/B ℓ/B + ℓ p1 p2

p3

p1

1

p1

2

p2

1

p4 p5 p6 p4

1

p5

1

p6

1 p1

3

p1

4

p2

2

p4

2

p5

2

p6

2

slide-47
SLIDE 47

Hardness Proof III

"⇐": Useful observations: ⊲ no element peer sends the file to another peer ⊲ suffices to show that there is no solution the subset peers and master element peers with Z(ℓ/B + ℓ) ≥

  • i∈P(2ℓki − 2)

Case 1: xsi(ℓ/B) = 1 for all subset peers si

⊲ Cap. Exp. Lemma: xi(ℓ/B) = 0 for all master element peers ⊲ P is a no-instance ⇒ not all master element peers can be served at full rate ⊲ Cap. Exp. Lemma: Z(ℓ/B + ℓ) <

i∈P(2ℓki − 2)

slide-48
SLIDE 48

Hardness Proof IV

Case 2: xi(ℓ/B) < 1 for all master element peers and one subset peer

⊲ capacity not sufficient to serve all peers ⊲ Cap. Exp. Lemma: Z(ℓ/B + ℓ) <

i∈P(2ℓki − 2)

Case 3: xpi

0(ℓ/B) = 1 for a master element peer

⊲ Inequality 2. of Cap. Exp. Lemma is strict ⇒ Z(ℓ/B + ℓ) <

i∈P(2ℓki − 2)

Back to Theorem