File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis...

39
File Fragmentation over an Unreliable Channel Martin Andreasson [email protected] Introduction Model and method Conclusion Acknowledgments File Fragmentation over an Unreliable Network Bachelor Thesis Martin Andreasson [email protected] Royal Institute of Technology September 7, 2009

Transcript of File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis...

Page 1: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

File Fragmentation over an UnreliableNetwork

Bachelor Thesis

Martin [email protected]

Royal Institute of Technology

September 7, 2009

Page 2: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Imagine yourself playing an action game

Page 3: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

There is always a risk of getting caught, which increasesby time

Page 4: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

AcknowledgmentsIf you get caught, you have to start over where you lastsaved

But saving very frequently would cost too much time

Page 5: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

AcknowledgmentsIf you get caught, you have to start over where you lastsaved

But saving very frequently would cost too much time

Page 6: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Basic model

A file is sent over an unreliable network

Large files are more likely to be corrupted than small

If a file is corrupted, the whole file needs to be resent

Page 7: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Basic model

A file is sent over an unreliable network

Large files are more likely to be corrupted than small

If a file is corrupted, the whole file needs to be resent

Page 8: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Basic model

A file is sent over an unreliable network

Large files are more likely to be corrupted than small

If a file is corrupted, the whole file needs to be resent

Page 9: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Large files are likely to be corrupted

Page 10: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Basic model

To prevent file losses and heavy-tailes, large files can befragmented

Smaller fragments are less likely to be corrupted

Page 11: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Basic model

To prevent file losses and heavy-tailes, large files can befragmented

Smaller fragments are less likely to be corrupted

Page 12: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Fragmentation prevents corruption

Page 13: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Packets however, carry an overhead

This makes too small packet sizes inefficient

Page 14: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Thesis

What is the optimal fragment size?

Page 15: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Mathematical model

xi + φ denotes the packet size (xi data size, φ overheadsize)

Transmission will succeed if Ai ≥ xi + φ (Ai randomvariable with distribution f)

Page 16: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Mathematical model

xi + φ denotes the packet size (xi data size, φ overheadsize)

Transmission will succeed if Ai ≥ xi + φ (Ai randomvariable with distribution f)

Page 17: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Expected transmission time

J =M−1∑i=0

xi + φ

F̄ (xi + φ)=

M−1∑i=0

h(xi ) F̄ (x) = P(Ai > x) (1)

Want to minimize J over M and xi

Page 18: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Expected transmission time

J =M−1∑i=0

xi + φ

F̄ (xi + φ)=

M−1∑i=0

h(xi ) F̄ (x) = P(Ai > x) (1)

Want to minimize J over M and xi

Page 19: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Minimizing J

The KKT condition for (1) is

h′(xi ) =1

F̄ (xi + φ)+ (xi + φ)

f (xi + φ)(F̄ (xi + φ)

)2 = λ

M−1∑i=0

xi = L (2)

Lemma

If the failure rate (failure risk) f (x)/F̄ (x) is increasing:

The optimization over xi is convex

The solution is x∗i = x∗ for all i (packet sizes are equal)

Page 20: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Minimizing J

The KKT condition for (1) is

h′(xi ) =1

F̄ (xi + φ)+ (xi + φ)

f (xi + φ)(F̄ (xi + φ)

)2 = λ

M−1∑i=0

xi = L (2)

Lemma

If the failure rate (failure risk) f (x)/F̄ (x) is increasing:

The optimization over xi is convex

The solution is x∗i = x∗ for all i (packet sizes are equal)

Page 21: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Minimizing J

The KKT condition for (1) is

h′(xi ) =1

F̄ (xi + φ)+ (xi + φ)

f (xi + φ)(F̄ (xi + φ)

)2 = λ

M−1∑i=0

xi = L (2)

Lemma

If the failure rate (failure risk) f (x)/F̄ (x) is increasing:

The optimization over xi is convex

The solution is x∗i = x∗ for all i (packet sizes are equal)

Page 22: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Minimizing J

The KKT condition for (1) is

h′(xi ) =1

F̄ (xi + φ)+ (xi + φ)

f (xi + φ)(F̄ (xi + φ)

)2 = λ

M−1∑i=0

xi = L (2)

Lemma

If the failure rate (failure risk) f (x)/F̄ (x) is increasing:

The optimization over xi is convex

The solution is x∗i = x∗ for all i (packet sizes are equal)

Page 23: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Minimizing J

Seek minimizer M∗ by inserting x∗ = L/M into (1):

J = MLM + φ

F̄(

LM + φ

) = LLM + φ

LM F̄

(LM + φ

) := L·g(

L

M

)(3)

Lemma

Under the assumption that the failure rate f (x)/F̄ (x) isincreasing, g(x) is unimodal

Page 24: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Minimizing J

Seek minimizer M∗ by inserting x∗ = L/M into (1):

J = MLM + φ

F̄(

LM + φ

) = LLM + φ

LM F̄

(LM + φ

) := L·g(

L

M

)(3)

Lemma

Under the assumption that the failure rate f (x)/F̄ (x) isincreasing, g(x) is unimodal

Page 25: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Minimizing J

Seek minimizer M∗ by inserting x∗ = L/M into (1):

J = MLM + φ

F̄(

LM + φ

) = LLM + φ

LM F̄

(LM + φ

) := L·g(

L

M

)(3)

Lemma

Under the assumption that the failure rate f (x)/F̄ (x) isincreasing, g(x) is unimodal

Page 26: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Page 27: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Page 28: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Bounding x∗

Definition

a := argminx

(g(x))

Theorem

If L > a:

a

2≤ a

1 + a/L≤ x∗(L) ≤ min

(2a,

a

1− a/L

)

Corollary

limL→∞

x∗(L) = a

Page 29: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Bounding x∗

Definition

a := argminx

(g(x))

Theorem

If L > a:

a

2≤ a

1 + a/L≤ x∗(L) ≤ min

(2a,

a

1− a/L

)

Corollary

limL→∞

x∗(L) = a

Page 30: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Bounding x∗

Definition

a := argminx

(g(x))

Theorem

If L > a:

a

2≤ a

1 + a/L≤ x∗(L) ≤ min

(2a,

a

1− a/L

)

Corollary

limL→∞

x∗(L) = a

Page 31: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Bounding x∗

Definition

a := argminx

(g(x))

Theorem

If L > a:

a

2≤ a

1 + a/L≤ x∗(L) ≤ min

(2a,

a

1− a/L

)

Corollary

limL→∞

x∗(L) = a

Page 32: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Conclusion

Under the assumption that the failure rate f (x)/F̄ (x) isincreasing,

Constant fragmentation is optimal

The fragment sizes are unique

If the file size and distribution f are known, the file canbe pre-fragmented

For large filesizes L, the optimal fragment size isindependent of L

Page 33: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Conclusion

Under the assumption that the failure rate f (x)/F̄ (x) isincreasing,

Constant fragmentation is optimal

The fragment sizes are unique

If the file size and distribution f are known, the file canbe pre-fragmented

For large filesizes L, the optimal fragment size isindependent of L

Page 34: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Conclusion

Under the assumption that the failure rate f (x)/F̄ (x) isincreasing,

Constant fragmentation is optimal

The fragment sizes are unique

If the file size and distribution f are known, the file canbe pre-fragmented

For large filesizes L, the optimal fragment size isindependent of L

Page 35: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Conclusion

Under the assumption that the failure rate f (x)/F̄ (x) isincreasing,

Constant fragmentation is optimal

The fragment sizes are unique

If the file size and distribution f are known, the file canbe pre-fragmented

For large filesizes L, the optimal fragment size isindependent of L

Page 36: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Conclusion

Under the assumption that the failure rate f (x)/F̄ (x) isincreasing,

Constant fragmentation is optimal

The fragment sizes are unique

If the file size and distribution f are known, the file canbe pre-fragmented

For large filesizes L, the optimal fragment size isindependent of L

Page 37: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Acknowledgments

Steven H. Low, Jayakrishnan Nair (Caltech) andLachlan Andrew (Swinburne)

Henrik Sandberg and Karl Henrik Johansson (KTH)

Page 38: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Acknowledgments

Steven H. Low, Jayakrishnan Nair (Caltech) andLachlan Andrew (Swinburne)

Henrik Sandberg and Karl Henrik Johansson (KTH)

Page 39: File Fragmentation over an Unreliable Network - Bachelor Thesis · 2009-10-06 · Bachelor Thesis Martin Andreasson mandreas@kth.se Royal Institute of Technology September 7, 2009.

File Fragmentationover an Unreliable

Channel

Martin [email protected]

Introduction

Model and method

Conclusion

Acknowledgments

Acknowledgments

Steven H. Low, Jayakrishnan Nair (Caltech) andLachlan Andrew (Swinburne)

Henrik Sandberg and Karl Henrik Johansson (KTH)