Intro+Lecture 1

advertisement
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.
R
R
R
R
R
R
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.
Packet size
Arrival time
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.
Discrete Generating Functions:
Giving a set of functions ๐‘“0 , ๐‘“1 , ๐‘“2 … ๐‘“๐‘› sequence ๐‘“0 , ๐‘“1 , ๐‘“2 , … the generating function would be
defined as:
∞
๐น(๐‘) = ∑ ๐‘“๐‘› โˆ™ ๐‘ ๐‘›
๐‘›=0
This function is also known as Z-Transform.
|๐‘“๐‘› |
๐‘›→∞ ๐‘Ž ๐‘›
Note that ๐‘“๐‘› has to converge in order for ๐น(๐‘) to be defined: for some a, lim
→0
We use the term ‘match’ to describe the connection between the sequence function and its
transform and use the notation: ๐น(๐‘) ⇔ ๐‘“๐‘› .
Examples for Discrete functions:
Generationg functions examples:
๏‚ท
Define ๐‘ƒ๐‘– = Pr[๐‘– ๐‘๐‘Ž๐‘๐‘˜๐‘’๐‘ก๐‘  ๐‘–๐‘› ๐‘ž๐‘ข๐‘’๐‘ข๐‘’] ๐‘“๐‘– = Pr[๐‘– ๐‘๐‘Ž๐‘๐‘˜๐‘’๐‘ก๐‘  ๐‘–๐‘› ๐‘ž๐‘ข๐‘’๐‘ข๐‘’] (indexes are discrete).
Note that ๐น(1) = ∑∞
๐‘›=0 ๐‘“๐‘› .
๏ƒจso when discussing distribution functions ๐น(1) = 1.
But ๐‘“๐‘– is a distribution sequence. Therefore ๐น(1) = 1
๏‚ท
1
๐‘–๐‘“ ๐‘› = 0
First we examine Un described as: ๐‘ˆ๐‘› = {
0 ๐‘œ๐‘กโ„Ž๐‘’๐‘Ÿ๐‘ค๐‘–๐‘ ๐‘’
it’s easy to see that the matching function would be ๐‘ญ(๐’) = ๐Ÿ.
๏‚ท
1
๐‘–๐‘“ ๐‘› = ๐‘˜
Define a selective-function(sequence) ๐‘ˆ๐‘›−๐‘˜ = {
0 ๐‘œ๐‘กโ„Ž๐‘’๐‘Ÿ๐‘ค๐‘–๐‘ ๐‘’
it’s easy to see that the matching function would be ๐‘ญ(๐’) = ๐’๐’Œ
๏‚ท
Define δ๐‘› to be δ๐‘› = 1 ๐‘“๐‘œ๐‘Ÿ ๐‘’๐‘ฃ๐‘’๐‘Ÿ๐‘ฆ ๐‘› ∈ ๐‘ต
under some constraints on Z and using the geometric series equation we get:
∞
๐Ÿ
๐น(๐‘) = ∑ 1 โˆ™ ๐‘ ๐‘› =
๐Ÿ−๐’
๐‘›=0
๏‚ท
Define ๐‘“๐‘› = ๐ด โˆ™ ๐›ผ ๐‘› - a function sequence with geometric factor ๐›ผ ๐‘› results:
∞
๐‘จ
๐น(๐‘) = ∑ ๐ด โˆ™ ๐›ผ ๐‘› โˆ™ ๐‘ ๐‘› =
๐Ÿ − ๐œถ๐’
๐‘›=0
Selected Z transforms -- OPERATORS:
๏‚ท
Convolution:
We say โ„Ž๐‘› is a convolution of ๐‘“๐‘› and ๐‘”๐‘› if โ„Ž๐‘› = ๐‘“๐‘› โŠ› ๐‘”๐‘› define the convolution
operator as:
๐‘›
โ„Ž๐‘› = ๐‘“๐‘› โŠ› ๐‘”๐‘› = ∑ ๐‘“๐‘›−๐‘˜ โˆ™ ๐‘”๐‘˜
๐‘˜=0
It’s interesting to see that the matching generating function is:
๐ป(๐‘)
∞
= ∑ โ„Ž๐‘› โˆ™ ๐‘ ๐‘›
๐‘›=0
∞
๐‘›
∞
๐‘›
∞
๐‘›
∞
๐‘›
= ∑ ๐‘ ∑ ๐‘“๐‘›−๐‘˜ โˆ™ ๐‘”๐‘˜ = ∑ ∑ ๐‘“๐‘›−๐‘˜ โˆ™ ๐‘”๐‘˜ โˆ™ ๐‘ = ∑ ∑ ๐‘“๐‘›−๐‘˜ โˆ™ ๐‘”๐‘˜ โˆ™ ๐‘ =
๐‘›=0
∞
๐‘›
๐‘˜=0
∞
๐‘›=0 ๐‘˜=0
๐‘˜=0 ๐‘›=๐‘˜
∞
∞
= ∑ ๐‘ ๐‘˜ ∑ ๐‘“๐‘›−๐‘˜ โˆ™ ๐‘”๐‘˜ โˆ™ ๐‘ ๐‘›−๐‘˜ = ∑ ๐‘ ๐‘˜ โˆ™ ๐‘”๐‘˜ ∑ ๐‘“๐‘›−๐‘˜ โˆ™ ๐‘ ๐‘›−๐‘˜ =
๐‘˜=0
∞
๐‘›=๐‘˜
๐‘˜=0
∞
๐‘›=๐‘˜
= ∑ ๐‘ ๐‘˜ โˆ™ ๐‘”๐‘˜ ∑ ๐‘“๐‘ข โˆ™ ๐‘ ๐‘ข = ๐บ(๐‘) ⋅ ๐น(๐‘)
๐‘˜=0
๐‘ข=0
Concluding convolution matches multiplication on the Z plane:
๐’‡๐’ โŠ› ๐’ˆ๐’ ⇔ ๐‘ญ(๐’) ⋅ ๐‘ฎ(๐’)
๏‚ท
๐‘“๐‘›+1 matching function:
∞
∞
∞
∞
๐‘›=0
๐‘ข=1
1
1
1
∑ ๐‘“๐‘›+1 โˆ™ ๐‘ = ∑ ๐‘“๐‘›+1 โˆ™ ๐‘ = ∑ ๐‘“๐‘›+1 โˆ™ ๐‘ ๐‘›+1 = ∑ ๐‘“๐‘ข โˆ™ ๐‘ ๐‘ข = (๐น(๐‘) − ๐‘“0 )
๐‘
๐‘
๐‘
๐‘›
๐‘›=0
๐‘›
๐‘›=0
๐’‡๐’+๐Ÿ ⇔
๐Ÿ
(๐‘ญ(๐’) − ๐’‡๐ŸŽ )
๐’
๏‚ท
Derivation match:
∞
∞
๐’…๐‘ญ(๐’)
1
๐‘›−1
= ∑ ๐‘› โˆ™ ๐‘“๐‘› โˆ™ ๐‘
= ∑ ๐‘› โˆ™ ๐‘“๐‘› โˆ™ ๐‘ ๐‘›
๐’…๐’
๐‘
๐‘›=0
๐‘›=0
∞
๐‘‘๐น(๐‘)
⇒ ๐‘
= ∑ ๐‘› โˆ™ ๐‘“๐‘› โˆ™ ๐‘ ๐‘›
๐‘‘๐‘
๐‘›=0
concluding that
๐’ โˆ™ ๐’‡๐’ ⇔ ๐’ โˆ™
note that when Z=1 result the sum:
value when ๐‘“๐‘› is a density function:
๏‚ท
๐’…๐‘ญ(๐’)
๐’…๐’
๐‘‘๐น(๐‘)
๐‘‘๐‘
= ∑∞
๐‘›=0 ๐‘› โˆ™ ๐‘“๐‘› which is similar to the mean
๐‘ฌ=
๐’…๐‘ญ(๐’)
|
๐’…๐’ ๐’›=๐Ÿ
Giving the last property By the calculation given in the last equation we can easily find
the fn series sequence item by item:
๐‘ญ๐ŸŽ = ๐’‡๐ŸŽ and ๐’‡๐Ÿ =
๐’…๐‘ญ(๐’)
|
๐’…๐’ ๐’›=๐ŸŽ
… or in general,
๐Ÿ ๐’…๐’ ๐‘ญ(๐’)
๐’‡๐’ =
โˆ™
|
๐’! ๐’…๐’๐’ ๐’›=๐ŸŽ
Discrete Inverse:
Goal: Given ๐น(๐‘), how can we find ๐‘“๐‘› ?
Method I: Using line 18 of table I – the derivation property – we could find the elements one by
๐Ÿ
one by the following formula: ๐’‡๐’ = ๐’! โˆ™
complexity of high order derivation.
๐’…๐’ ๐‘ญ(๐’)
| .
๐’…๐’๐’ ๐’›=๐Ÿ
This method is less preferable due to the
๐‘(๐‘)
Method II: Given ๐น(๐‘) = ๐ท(๐‘) presented as a polynomial quotient, we can present both
polynomials as multiplication of simple polynomials of the form (1 − ๐›ผ1 ๐‘)๐‘˜1 (1 − ๐›ผ2 ๐‘)๐‘˜2 …
๐ด
๐ด
Therefore we could get the quotient to the form: (1−๐›ผ 1๐‘)๐‘˜1 + (1−๐›ผ 2๐‘)๐‘˜2 + โ‹ฏ
1
1
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 :
๐‘จ โˆ™ ๐œถ๐’ ⇔
๐‘จ
๐Ÿ − ๐œถ๐’
๐‘จ
The table actually also provides solution for the quadratic case as well(๐Ÿ−๐œถ๐’)๐Ÿ.
(*) full table of more interesting connections can be found in the course book: Table I.2
Example (from course book)
Given G(๐‘) find ๐‘”๐‘› .
๐บ(๐‘) =
4 โˆ™ (1 − 8๐‘)
(1 − 4๐‘)(1 − 2๐‘)2
We first want to factorize G(Z) to a sum of first and second degree polynomial.
๐ด11
๐ด22
๐ด21
๐บ(๐‘) =
+
+
(1 − 4๐‘) (1 − 2๐‘) (1 − 2๐‘)2
The book gives a formula to calculate the coefficients:
๐ด11 = ๐บ(๐‘)(1 − 4๐‘)| 1 = −16;
๐ด21 = ๐บ(๐‘)(1 − 2๐‘)2 |
๐‘ง=
4
๐‘ง=
1
2
= 12;
๐ด22 = โ‹ฏ = 8
And so the final result is:
−16
8
12
๐บ(๐‘) =
+
+
⇔ ๐‘”๐‘› = −16 โˆ™ 4๐‘› + 12(๐‘› + 1) โˆ™ 2๐‘› + 8 โˆ™ 2๐‘›
(1 − 4๐‘) (1 − 2๐‘) (1 − 2๐‘)2
Example summary:
1. factorize to polynomial
2. Use each factor as the denominator in a sum of products equation
3. Find coefficients using the formula from the book.
๐‘จ
4. Use the known relation ๐‘จ โˆ™ ๐œถ๐’ ⇔ ๐Ÿ−๐œถ๐’ to form a close phrase that describes all the
series elements.
Continuous Generating functions - Laplace transform ๐’‡(๐’•)(−∞, ∞)
Definition:
∞
๐น
∗ (๐‘ )
= ∫ ๐‘“(๐‘ก) โˆ™ ๐‘’ −๐‘ ๐‘ก ๐‘‘๐‘ก
−∞
Back to distribution world – we won’t have negative times, so we can use a simpler definition:
∞
๐น ∗ (๐‘ ) = ∫ ๐‘“(๐‘ก) โˆ™ ๐‘’ −๐‘ ๐‘ก ๐‘‘๐‘ก
0
Selected Laplace transforms:
∞
๏‚ท Once again we start with a simple case: ๐น ∗ (0) = ∫−∞ ๐‘“(๐‘ก) ๐‘‘๐‘ก
if f is a density function, ๐‘ญ∗ (๐ŸŽ) = ๐Ÿ
this may be highly useful for self checking:
(a) transformed correctly and
(b) found a true density function, by assigning s=0.
๏‚ท
๐‘“(๐‘ก) = ๐ด โˆ™ ๐‘’ −๐›ผ๐‘ก
∞
∞
๐น ∗ (๐‘ ) = ∫ ๐ด โˆ™ ๐‘’ −๐›ผ๐‘ก โˆ™ ๐‘’ −๐‘ ๐‘ก ๐‘‘๐‘ก = ๐ด ∫ ๐‘’ −(๐›ผ+๐‘ )๐‘ก ๐‘‘๐‘ก =
0
0
Note: while in discrete plane we used the form
form
๏‚ท
๐ด
๐›ผ+๐‘ 
๐ด
1−๐›ผ๐‘
๐ด
๐›ผ+๐‘ 
- in the continuous plane we will use the
.
Convolution:
๐’•
โ„Ž(๐‘ก) = ๐‘“(๐‘ก) โŠ› ๐‘”(๐‘ก) = ∫ ๐‘“(๐‘ก − ๐‘ฅ)๐‘”(๐‘ฅ) ๐‘‘๐‘ก๐‘‘๐‘ฅ
0
as before – we see that:
๐‘“(๐‘ก) โŠ› ๐‘”(๐‘ก) ⇔ ๐น(๐‘ ) โˆ™ ๐บ(๐‘ )
๏‚ท
Mean value:
as in the discrete case, the mean value in the continuous case could be retrieved by deriving
the transformed function:
−
๐‘‘๐น ∗ (๐‘ )
๐‘‘๐‘ 
∞
|๐‘ =0 = ∫0 ๐‘ก โˆ™ ๐‘“(๐‘ก) ๐‘‘๐‘ก
This is the expected value.
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:
๐‘ ∗ (๐‘ )
(… )
๐ด1
๐ด2
→
→
+
+โ‹ฏ
∗
(…
)(…
)(…
๐ท (๐‘ )
)
๐›ผ1 + ๐‘ 
๐›ผ2 + ๐‘ 
From the last stage it is easy to inverse the function using the transform tables.
๐น ∗ (๐‘ ) =
Download