hanoch/courses/p2p-course/1112/p2p …  · web viewdefine p i = pr [i packets in queue] f i = pr...

14
R R R R R R Packet size Arrival time Peer to Peer Networks Lecture notes – 1 Introduction and Motivation: A client who wants to receive data from a server connects to the internet network through LANs and routers. The data transfer is done using packets in a store and forward manner; each node becomes as a collection of queues. Delays and waiting times are mentioned with respect to these queues. Different applications have different requirements on transfer time. For example VOIP applications need higher transfer rate as delays are more noticeable to the user. Assuming there were no queues on the path from client to server, data could’ve crossed the net at the speed of light (assuming no packet loss) - the delay is mostly in the routers’ queues. We’ll discuss those queues as part of Queueing Theory- it is applicable to packets queues as well as other queues. We’ll discuss different aspects of queues such as waiting time, number of waiting items, and the mean value of both. We’ll use stochastic models and random variables during our analysis. Stochastic Models inputs: The random variable has two parameters: (a) packet size/effort/service time, and (b) arrival time. Each may have different distribution parameters. The queue itself may have different behaviors/policies: LIFO, FIFO, Priority Queue etc. All these are inputs to the model. Stochastic Models outputs:

Upload: others

Post on 27-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: hanoch/Courses/P2P-course/1112/P2P …  · Web viewDefine P i = Pr [i packets in queue] f i = Pr [i packets in queue] (indexes are discrete). Note that F 1 = ∑ n=0 ∞ f n . so

RR

R

RR

R

Packet size Arrival time

Peer to Peer NetworksLecture notes – 1

Introduction and Motivation:

A client who wants to receive data from a server connects to the internet network through LANs and routers. The data transfer is done using packets in a store and forward manner; each node becomes as a collection of queues. Delays and waiting times are mentioned with respect to these queues.

Different applications have different requirements on transfer time. For example VOIP applications need higher transfer rate as delays are more noticeable to the user. Assuming there were no queues on the path from client to server, data could’ve crossed the net at the speed of light (assuming no packet loss) - the delay is mostly in the routers’ queues.We’ll discuss those queues as part of Queueing Theory- it is applicable to packets queues as well as other queues. We’ll discuss different aspects of queues such as waiting time, number of waiting items, and the mean value of both. We’ll use stochastic models and random variables during our analysis.

Stochastic Models inputs:The random variable has two parameters: (a) packet size/effort/service time, and (b) arrival time. Each may have different distribution parameters.The queue itself may have different behaviors/policies: LIFO, FIFO, Priority Queue etc.All these are inputs to the model.

Stochastic Models outputs:We’re interested in understanding the overall queue performance. Particularly we’re interested in delay, utilization and queues sizes. We’ll come to see these outputs are highly correlated.

One of the tools we’ll use is generating functions. We’d like to transform the ‘distributed world’ to the ‘generating functions world’ since mathematical operations are easier to perform on generating functions. Then we’ll convert the result back and get the final output wanted.

(*) generating functions can be found at Appendix I of the course book Queuing systems, Vol 1 By Kleinrock.

Page 2: hanoch/Courses/P2P-course/1112/P2P …  · Web viewDefine P i = Pr [i packets in queue] f i = Pr [i packets in queue] (indexes are discrete). Note that F 1 = ∑ n=0 ∞ f n . so

Discrete Generating Functions:

Giving a set of functions f 0 , f 1 , f 2…f n sequence f 0 , f 1 , f 2 ,… the generating function would be defined as:

F (Z )=∑n=0

f n ∙ Zn

This function is also known as Z-Transform.

Note that f n has to converge in order for F (Z ) to be defined: for some a, limn→∞

¿ f n∨ ¿an→0¿

We use the term ‘match’ to describe the connection between the sequence function and its

transform and use the notation: F (Z )❑⇔f n .

Examples for Discrete functions:Generationg functions examples:

Define Pi=Pr [ i packets∈queue ] f i=Pr [ i packets∈queue] (indexes are discrete).

Note that F (1 )=∑n=0

f n .

so when discussing distribution functions F (1 )=1.

But f i is a distribution sequence. Therefore F (1 )=1

Page 3: hanoch/Courses/P2P-course/1112/P2P …  · Web viewDefine P i = Pr [i packets in queue] f i = Pr [i packets in queue] (indexes are discrete). Note that F 1 = ∑ n=0 ∞ f n . so

First we examine Un described as: U n={ 1 if n=00 otherwiseit’s easy to see that the matching function would be F (Z )=1 .

Define a selective-function(sequence) U n−k={ 1 if n=k0 otherwise

it’s easy to see that the matching function would be F (Z )=Zk

Define δn to beδn=1 for every n∈Nunder some constraints on Z and using the geometric series equation we get:

F (Z )=∑n=0

1 ∙ Zn= 11−Z

Define f n=A ∙αn - a function sequence with geometric factor α n results:

F (Z )=∑n=0

A ∙α n ∙ Zn= A1−αZ

Page 4: hanoch/Courses/P2P-course/1112/P2P …  · Web viewDefine P i = Pr [i packets in queue] f i = Pr [i packets in queue] (indexes are discrete). Note that F 1 = ∑ n=0 ∞ f n . so

Selected Z transforms -- OPERATORS:

Convolution:We say hn is a convolution of f n and gn if hn=f n⊛ gn define the convolution operator as:

hn=f n⊛ gn=∑k=0

n

f n−k ∙ gk

It’s interesting to see that the matching generating function is:

H (Z )=∑n=0

hn ∙ Zn=¿∑

n=0

Zn∑k=0

n

f n−k ∙ gk=¿∑n=0

∑k=0

n

f n−k ∙ gk ∙ Zn=∑

k=0

∑n=k

f n−k ∙ gk ∙ Zn=¿¿¿¿

¿∑k=0

Zk∑n= k

f n−k ∙ gk ∙ Zn−k=¿∑

k=0

Zk ∙ gk∑n=k

f n−k ∙ Zn−k=¿¿

¿∑k=0

Z k ∙ gk∑u=0

f u ∙ Zu=G (Z )⋅F (Z)

Concluding convolution matches multiplication on the Z plane:

f n⊛ gn❑⇔F(Z)⋅G(Z)

f n+1 matching function:

∑n=0

f n+1 ∙ Zn=∑

n=0

f n+1 ∙ Zn=1

Z∑n=0∞

f n+1 ∙ Zn+1= 1

Z∑u=1∞

f u ∙ Zu= 1

Z (F (Z )−f 0 )

f n+1❑⇔ 1Z

(F (Z )−f 0)

Derivation match:

dF (Z )dZ

=∑n=0

n ∙ f n ∙ Zn−1=¿ 1

Z∑n=0∞

n ∙ f n∙ Zn ¿❑

⇒Z dF (Z)

dZ=∑

n=0

n ∙ f n∙ Zn

concluding that

Page 5: hanoch/Courses/P2P-course/1112/P2P …  · Web viewDefine P i = Pr [i packets in queue] f i = Pr [i packets in queue] (indexes are discrete). Note that F 1 = ∑ n=0 ∞ f n . so

n ∙ f n❑⇔Z ∙ dF (Z)

dZ

note that when Z=1 result the sum: dF (Z )dZ

=∑n=0

n ∙ f nwhich is similar to the mean value

when f n is a density function:

E=dF(Z)dZ

¿z=1

Giving the last property By the calculation given in the last equation we can easily find the fn series sequence item by item:

F0=f 0 and f 1=dF (Z )dZ

¿z=0 … or in general,

f n=1n !∙ d

nF (Z )d Zn ¿z=0

Discrete Inverse:

Goal: Given F (Z ), how can we find f n?

Method I: Using line 18 of table I – the derivation property – we could find the elements one by

Page 6: hanoch/Courses/P2P-course/1112/P2P …  · Web viewDefine P i = Pr [i packets in queue] f i = Pr [i packets in queue] (indexes are discrete). Note that F 1 = ∑ n=0 ∞ f n . so

one by the following formula: f n=1n !∙ d

nF (Z )d Zn ¿z=1. This method is less preferable due to the

complexity of high order derivation.

Method II: Given F (Z )=N (Z )D(Z )

presented as a polynomial quotient, we can present both

polynomials as multiplication of simple polynomials of the form(1−α1Z )k1(1−α 2Z)k2…

Therefore we could get the quotient to the form: A1

(1−α 1Z )k1+

A2(1−α1Z )k2

+…

Finally we can use the match from the table In most of our cases, we will use the following identity to find the original sequence :

A ∙αn❑⇔ A1−αZ

The table actually also provides solution for the quadratic case as wellA

(1−αZ )2.

(*) full table of more interesting connections can be found in the course book: Table I.2

Example (from course book)Given G(Z ) find gn.

G (Z )= 4 ∙ (1−8Z )(1−4 Z )¿¿

We first want to factorize G(Z) to a sum of first and second degree polynomial.

G (Z )=A11

(1−4 Z )+

A22(1−2Z )

+A21

(1−2Z )2

The book gives a formula to calculate the coefficients:A11=G (Z ) (1−4 Z ) ¿

z=14

=−16 ; A21=G (Z )¿

And so the final result is:

G (Z )= −16(1−4 Z )

+ 8(1−2Z )

+ 12(1−2Z )2

❑⇔gn=−16 ∙4n+12 (n+1 ) ∙2n+8 ∙2n

Page 7: hanoch/Courses/P2P-course/1112/P2P …  · Web viewDefine P i = Pr [i packets in queue] f i = Pr [i packets in queue] (indexes are discrete). Note that F 1 = ∑ n=0 ∞ f n . so

Example summary:1. factorize to polynomial2. Use each factor as the denominator in a sum of products equation3. Find coefficients using the formula from the book.

4. Use the known relation A ∙αn❑⇔ A1−αZ to form a close phrase that describes all the

series elements.

Page 8: hanoch/Courses/P2P-course/1112/P2P …  · Web viewDefine P i = Pr [i packets in queue] f i = Pr [i packets in queue] (indexes are discrete). Note that F 1 = ∑ n=0 ∞ f n . so

Continuous Generating functions - Laplace transform f (t )(−∞,∞ )

Definition:

F ¿ (s )=∫−∞

f ( t ) ∙ e−st dt

Back to distribution world – we won’t have negative times, so we can use a simpler definition:

Page 9: hanoch/Courses/P2P-course/1112/P2P …  · Web viewDefine P i = Pr [i packets in queue] f i = Pr [i packets in queue] (indexes are discrete). Note that F 1 = ∑ n=0 ∞ f n . so

F ¿ (s )=∫0

f (t) ∙ e−st dt

Selected Laplace transforms:

Once again we start with a simple case: F ¿ (0 )=∫−∞

f (t)dt

if f is a density function, F ¿ (0 )=1

this may be highly useful for self checking:

(a) transformed correctly and (b) found a true density function, by assigning s=0.

f (t )=A ∙e−αt

F ¿ (s )=∫0

A ∙e−αt ∙ e−st dt=A∫0

e−(α+ s)tdt= Aα+s

Note: while in discrete plane we used the form A

1−αZ - in the continuous plane we will use

the form Aα+s

.

Convolution:

h ( t )= f ( t )⊛g ( t )=∫0

t

f ( t−x ) g(x )dt dx

as before – we see that:

f (t )⊛g ( t )❑⇔F (s)∙G(s)

Mean value:as in the discrete case, the mean value in the continuous case could be retrieved by deriving the transformed function:

−d F ¿(s)ds

¿s=0=∫0

t ∙ f ( t )dt

This is the expected value.

Page 10: hanoch/Courses/P2P-course/1112/P2P …  · Web viewDefine P i = Pr [i packets in queue] f i = Pr [i packets in queue] (indexes are discrete). Note that F 1 = ∑ n=0 ∞ f n . so

Note: Tables 3+4 in the book show additional useful examples which are similar to tables 1+2 mentioned in the discrete case.

Continuous Inverse: Technique is going to be very similar to the discrete case:

F ¿ (s )=N ¿(s)D¿(s)

→(…)

(… ) (… )(…)→

A1α1+s

+A2

α 2+s+…

From the last stage it is easy to inverse the function using the transform tables.

Page 11: hanoch/Courses/P2P-course/1112/P2P …  · Web viewDefine P i = Pr [i packets in queue] f i = Pr [i packets in queue] (indexes are discrete). Note that F 1 = ∑ n=0 ∞ f n . so
Page 12: hanoch/Courses/P2P-course/1112/P2P …  · Web viewDefine P i = Pr [i packets in queue] f i = Pr [i packets in queue] (indexes are discrete). Note that F 1 = ∑ n=0 ∞ f n . so