Sie sind auf Seite 1von 160

Advanced Interworking

Network Theory
15 January, 2018
Kevin Worrall
k.worrall@rave.ac.uk
Network Theory 1

• Most subjects have a body of knowledge that underpin the practical


implementation of a subject
• This was very true of telephony and the implementation of the early
telephone network
• Much of this theory has a mathematical framework drawn from different
branches of mathematics
• Whilst not important to understand the proofs and details of some of
these theories, it is useful to gain an insight into where these theories
are derived from and where the results are used in network engineering

Advanced Interworking 2
Network Theory 2
• In the early days of packing switching the main solution to providing
bandwidth was to increase the size of links and add equipment.
• As networks grew in size and complexity it became clear that more cost
effective and efficient ways were needed to engineer networks
• This required the ability to predict and manage traffic. The prediction
required a look at probability. The control of traffic became important
with elements of queuing theory becoming useful. It became apparent
that routing packets through low cost or optimal routes was necessary
both for performance and economics. Here graph theory played its part.
• To help design networks, simulation became important, to simulate a
network requires modelling and modelling requires a mathematical
foundation, these next 2 lectures will discuss some of these foundations

Network Design 3
Network Theory 3
• There are a range of mathematical foundations that underpin computer
networks, some we have touched on in previous units. The areas in
general are
• Discrete Mathematics – used in computing science, includes the study of
algorithms and draws on graph theory and logic.
• Combinatorics - Looks at finite structures, a graph is an example of this.
• Graph Theory – Graph Theory is used widely in networks. It is the study
of graphs, which are in turn mathematical structures. We will look at this
area in more detail since it relates a lot to routing.
• Probability – Designers and operators of networks need to think
probabilistically to allow them to think about anticipating traffic needs or
cache rates. It is also a necessary foundation for statistics, game theory
and information theory.
Network Design 4
Network Theory 4
• Statistics – Statistics is used extensively in network performance and
management calculations and we will look at some of the associated
areas required.
• Linear Algebra – The areas of interest for networking are vectors and
matrices. We will not delve too deeply into this area but will discuss the
stochastic matrices that are extensively used is modelling computer
networks
• Optimisation – This can be thought of as a set of mathematical
techniques used to improve the performance of systems. Again used
extensively in modelling of systems.
• Signals, Systems and Transforms – This area covers the study of signals.
It includes complex numbers, Eulars formula, Fourier series, Fourier
transformations, Laplace transforms and Z transforms. This has been
touched on in other units.
Network Design 5
Network Theory 5
• Stochastic Processes and Queuing theory – Queues are a natural
consequence of entities demanding services. Since no service provision
is infinite, a wait is often required. Queuing theory looks at the
mathematics behind this, allowing us to compute various parameters
associated with queues. It should be apparent that this has application in
many areas of networks.
• Game Theory – Originated from the mathematical study of games such
as chess and bridge it now gives deep insights into the working of the
Internet. It is particular useful when a scarce resource is in demand by
many entities…a situation that frequently occurs in networks.
• Control Theory – A computer network is an engineered system. We
design to meet certain design goals, 2 of these goals are almost always
responsiveness and stability. Control theory provides tools to allow us to
build such systems.
Network Design 6
Network Theory 6
• Information Theory – For completeness I include information theory, we
have touched on this in the second year units. As you will recall this gives
us a mathematical model for communication.

• The above are the main areas that provide a mathematical foundation
for networking and between the subject areas they allow design,
modelling, simulation, measurement and management of complex
interconnected networks.
• They allow us to gain insight into the behaviour of the Internet and other
complex networks, this in turn helps us design and build better
networks.
• We will now look at some of these areas and their relevance to
networks.
Network Design 7
• Information Theory – For completeness I include information theory, we
have touched on this in the second year units. As you will recall this gives
us a mathematical model for communication.

• The above are the main areas that provide a mathematical foundation
for networking and between the subject areas they allow design,
modelling, simulation, measurement and management of complex
interconnected networks.
• They allow us to gain insight into the behaviour of the Internet and other
complex networks, this in turn helps us design and build better
networks.
• We will now look at these areas and their relevance to networks.

Network Design 8
Graph Theory

Network Design 9
What is a Network?

Network = graph
Informally a graph is a set of nodes joined by a set of lines or
arrows.

1 1 2 3
2 3

4 5 6 4 5 6
What is Graph Theory?

Definition: The mathematical theory of the properties and


applications of graphs.

Used to understand and solve


many of mathematical and path
problems.
Graph-based representations

 Representing a problem as a graph can


provide a different point of view
 Representing a problem as a graph can
make a problem much simpler
 More accurately, it can provide the
appropriate tools for solving the problem
For example…

Mathematical
The cells of a GSM problem
mobile phone network
Music
Other examples:

• Electrical eng.
• Biochemistry
• Computer science
• Physics
Applications in computer Science

Networks: Graph theory can be used in computer


networks, for security purpose or to schematize
network topologies, for example.
Graph Theory - History

Leonhard Euler's paper on “Seven


Bridges of Königsberg” ,
published in 1736.
Laid the foundations of graph
theory and topology. The problem
was to devise a walk through the
city crossing the seven bridges
only once.
Graph Theory - History
Cycles in Polyhedra

Thomas P. Kirkman (1806 – 1895) William R. Hamilton (1805 – 1865)

Hamiltonian cycles in Platonic graphs found paths that visit each vertex once
Graph Theory - History
Trees in Electric Circuits

Gustav Kirchhoff (1824 – 1887)


Definition: Graph

G is an ordered triple G:=(V, E, f)

V is a set of nodes, points, or vertices.

E is a set, whose elements are known as edges or lines.

f is a function maps each element of E to an unordered pair of


vertices in V.
Definitions

Vertex

Basic Element
Drawn as a node or a dot. (Think Router)
Vertex set of G is usually denoted by V(G), or V

Edge

A set of two elements


Drawn as a line connecting two vertices, called end vertices, or
endpoints. (Think Communication Link)
The edge set of G is usually denoted by E(G), or E.
Example

V:={1,2,3,4,5,6}
E:={{1,2},{1,5},{2,3},{2,5},{3,4},{4,5},{4,6}}
Simple Graphs

Simple graphs are graphs without multiple edges or self-


loops.
Directed Graph (digraph)
Edges have directions
An edge is an ordered pair of nodes

loop
multiple arc

arc node
Weighted graphs

A weighted graph is a graph for which each edge has an


associated weight, usually given by a weight function w: E 
R. (Think Cost)

1.2 2
1 2 3 1 2 3
.2
.5 1.5 5 3
.3 1
4 5 6 4 5 6

.5
Structures and structural metrics

 Graph structures are used to isolate interesting or


important sections of a graph
 Structural metrics provide a measurement of a
structural property of a graph
 Global metrics refer to a whole graph

 Local metrics refer to a single node in a graph


Graph structures

 Identify interesting sections of a graph


 Interesting because they form a significant

domain-specific structure, or because they


significantly contribute to graph properties
 A subset of the nodes and edges in a graph that
possess certain characteristics, or relate to each
other in particular ways
Connectivity

a graph is connected if
you can get from any node to any other by following a sequence of
edges

OR

any two nodes are connected by a path.

A directed graph is strongly connected if there is a directed


path from any node to any other node.
Component

Every disconnected graph can be split up into a number of


connected components.
Degree
Number of edges incident on a node

The degree of 5 is 3
Degree (Directed Graphs)

In-degree: Number of edges entering


Out-degree: Number of edges leaving

Degree = indeg + outdeg

outdeg(1)=2
indeg(1)=0

outdeg(2)=2
indeg(2)=2

outdeg(3)=1
indeg(3)=4
Degree: Simple Facts

If G is a graph with m edges, then

 deg(v) = 2m = 2 |E |
If G is a digraph then

 indeg(v)= outdeg(v) = |E |
Number of Odd degree Nodes is even
Walks

A walk of length k in a graph is a succession of k


(not necessarily different) edges of the form

uv,vw,wx,…,yz.

This walk is denoted by uvwx…xz, and is referred to


as a walk between u and z.

A walk is closed is u=z.


Path

A path is a walk in which all the edges and all the nodes
are different.

Walks and Paths


1,2,5,2,3,4 1,2,5,2,3,2,1 1,2,3,4,6
walk of length 5 CW of length 6 path of length 4
Cycle

A cycle is a closed walk in which all the edges are


different.

1,2,5,1 2,3,4,5,2
3-cycle 4-cycle
Special Types of Graphs

Empty Graph / Edgeless graph


No edge

Null graph
No nodes
Obviously no edge
Trees

Connected Acyclic Graph

Two nodes have exactly one path


between them
Special Trees

Paths

Stars
Regular

Connected Graph

All nodes have the same


degree
Special Regular Graphs: Cycles

C3 C4 C5
Bipartite graph

V can be partitioned into 2 sets V1


and V2
such that (u,v)E implies
either u V1 and v V2
OR v V1 and uV2.
Complete Graph

Every pair of vertices are adjacent


Has n(n-1)/2 edges…
2x(2-1)/2 = 1
3x(3-1)/2= 3
5x(5-1)/2 = 10…
Complete Bipartite Graph

Bipartite Variation of Complete Graph


Every node of one set is connected to every other node on the
other set

Stars
Planar Graphs
Can be drawn on a plane such that no two edges
intersect
K4 is the largest complete graph that is planar
Subgraph

Vertex and edge sets are subsets of those of G

a supergraph of a graph G is a graph that contains G as a


subgraph.
Special Subgraphs: Cliques
A clique is a maximum complete
connected subgraph.

A B C

D E F

G H I
Spanning subgraph

Subgraph H has the same vertex set as G.


Possibly not all the edges
“H spans G”.
Spanning tree

 Let G be a connected graph. Then a


spanning tree in G is a subgraph of G
that includes every node and is also a
tree.
Representation (Matrix)
Incidence Matrix
VxE
[vertex, edges] contains the edge's data
Adjacency Matrix
VxV
Boolean values (adjacent or not)
Or Edge Weights
Matrices
1,2 1,5 2,3 2,5 3,4 4,5 4,6
1 1 1 0 0 0 0 0
2 1 0 1 1 0 0 0
3 0 0 1 0 1 0 0
4 0 0 0 0 1 1 1
5 0 1 0 1 0 1 0
6 0 0 0 0 0 0 1
1 2 3 4 5 6
1 0 1 0 0 1 0
2 1 0 1 0 1 0
3 0 1 0 1 0 0
4 0 0 1 0 1 1
5 1 1 0 1 0 0
6 0 0 0 1 0 0
Representation (List)

Edge List
pairs (ordered if directed) of vertices
Optionally weight and other data
Adjacency List (node list)
Implementation of a Graph.

Adjacency-list representation
an array of |V | lists, one for each vertex in V.
For each u  V , ADJ [ u ] points to all its adjacent vertices.
Edge and Node Lists

Edge List Node List


12 122
12 235
23 33
25 435
33 534
43
45
53
54
Edge Lists for Weighted Graphs

Edge List
1 2 1.2
2 4 0.2
4 5 0.3
4 1 0.5
5 4 0.5
6 3 1.5
Topological Distance

A shortest path is the minimum path


connecting two nodes.

The number of edges in the shortest path


connecting p and q is the topological
distance between these two nodes, dp,q
Distance Matrix
|V | x |V | matrix D = ( dij ) such that
dij is the topological distance between i and
j.
1 2 3 4 5 6
1 0 1 2 2 1 3
2 1 0 1 2 1 3
3 2 1 0 1 2 2
4 2 2 1 0 1 1
5 1 1 2 1 0 2
6 3 3 2 1 2 0
Applications

Network Design 55
Applications in Computer Science

Workflow: It’s sequence of processes through which a


piece of work passes from initiation to completion. Can
be also represented as directed graph.
Applications in computer Science

Webpage: can be represented by a direct graph. The


vertices are the web pages available at the website and
a directed edge from page A to page B exists if and only
if A contains a link to B.

Facebook is based in
graph theory
Applications in computer Science

Neural Networks: A series of algorithms that


attempt to identify underlying relationships in a set
of data by using a process that mimics the way
the human brain operates.
Applications in computer Science

Google Maps:
Graph Operations

Shortest Path: is the problem of finding a path


between two vertices (or nodes) in a graph such
that the sum of the weights of its constituent
edges is minimized. E.g. Dijkstra’s algorithm
Graph Operations

Minimun Spanning tree: A tree is a connected graph


without cycles with some properties:
• A graph is a tree if and only if there is one and only one
path joining any two of its vertices.

• A connected graph is a tree if and only if every one of its


edges is a bridge.

• A connected graph is a tree if and only if it has N vertices


and N; 1 edges.

E.g. Kruskal's Algorithm


Graph Operations (4)

Minimun
Spanning tree
Graph Operations

Breadth-First Search (BFS): algorithm used to


search in graphs.
Graph Operations

Depth-First Search (DFS): algorithm used to


search in graphs.
Friendship Network
Scientific collaboration network
Business ties in US biotech-industry
Transportation Networks
Internet

Network of connections between devices


within the Internet. Colours indicate
operator of network. Structure determined
by sending a storm of IP packets out
randomly across the network. Each packet
is programmed to self-destruct after a
delay, and when this happens, the packet
failure notice reports back the path the
packet took before it died.
Probability

Network Design 70
Probability

• The concept of probability pervades every aspect of our


lives. For example, weather forecasts are probabilistic, as
are economic predictions and even our own personal
decisions.
• Designers and operators of computer networks need to
often think in probabilistic terms, this could be when
anticipating future traffic workloads or computing cache
hit rates.
• To understand statistics, game theory and information
theory requires a good understanding of probability.
• In this lecture we will only present the main concepts and
how it can be used in network engineering.
Network Design 71
Probability – main concepts

• Intuitively all of us know what probability is, maybe not in


the precise mathematical language used, but we
understand probabilities.
• You can all judge how probable something is, this could be
based on past knowledge, reliability of something, even a
gut feeling. You might think or say “well that will probably
happen” or “my train will probably be on time” or “my
football team will probably lose on Saturday”. You do not
know the exact outcome but you can take a good guess.
• The above uses everyday language to describe probability,
as in all mathematics we use very precise language to
describe the theories that lay behind the mathematical
description of probability.
Network Design 72
Probability – Terms

• Probability means the degree of uncertainty about the


potential outcomes of a process.
• Given a set of distinct and mutually exclusive outcomes of
a process, denoted {𝑂1 ,𝑂2 ,…..}, this is called the sample
space S, the probability of any outcome is denoted P(𝑂𝑖) is
a real number between 0 and 1.
• 1 means the outcome is definite, 0 means it will not occur,
intermediate values reflect the confidence of the outcome.
• We assume that some element is certain to happen within
the sample space S, hence the elements of S describe all
possible outcomes and the sum of the probability of all
elements of S is always 1.
Network Design 73
Probability – Example

• Sample space and outcomes


• Imagine rolling a six sided dice, numbered 1 to 6.
• The process is the roll of the dice
• The outcome is the number shown on the upper horizontal
face.
• The outcomes are distinct and mutually exclusive, there
can only be one horizontal face corresponding to each
throw.
• The sample space is S = {1,2,3,4,5,6}, or size 6, ‫׀‬s‫=׀‬6
1 1
• Each outcome is equally probable so = = 0.1666’
𝑠 6

Network Design 74
Probability – Special Cases

• It should be noted that a sample space with an infinite


number of points has a probability of zero
• Such outcomes need to be treated with care
• It is necessary to treat the occurrence of such an event as
very small.
• This situation is dealt with in much greater detail in
probability theory.

Network Design 75
Probability – Events

• The definition of probability extends to any subsets of


elements of S, which is called an event, denoted E
• If the sample space is discrete, every event E is an element
of the set S, which is the set of all possible subsets of S.
• The probability associated with an event, denoted P(E), is a
real number between 0 and 1 (0≤P(E)≤) and is the sum of
the probabilities associated with the outcomes in the
event.

Network Design 76
Probability – Example

• Recall our dice and define an event as “the roll of a die


results in an odd numbered outcome”
• Our set of outcomes is {1,3,5}
1 1 1 1
• This has a probability of + + =
6 6 6 2

• We can write P({1,3,5}) = 0.5

• In other words you have a 50% chance of throwing an odd


number…

Network Design 77
Probability – Disjunction of events

• Consider an event E that has occurred if either or both of


events 𝐸1 or 𝐸2 occur, where both events are defined in
the same sample space.

• Then E is said to be the disjunction or logical OR of the


events, denoted E = 𝐸1 v 𝐸2 (read 𝐸1 or 𝐸2 )

Network Design 78
Probability – Example

• Let us define the events 𝐸1 = “The roll of a die results in an


odd numbered outcome” and 𝐸2 = “The roll of a die results
in an outcome numbered less than 3”, then

• 𝐸1 = {1,3,5} and 𝐸2 = {1,2}

• E = 𝐸1 v 𝐸2 = {1,2,3,5}
1 1 1 1 4
• This has a probability of + + + = = 0.66667
6 6 6 6 6

Network Design 79
Probability – Conjunction of Events

• Consider event E that is considered to have occurred only if


both of two other events 𝐸1 or 𝐸2 occur, both events are in
the same sample space.
• In this case E is said to be the conjunction, or logical AND,
of the two events denoted as E = 𝐸1 𝐸2 (read 𝐸1 and 𝐸2 )

Network Design 80
Probability – Example

• Let us define the events 𝐸1 = “The roll of a die results in an


odd numbered outcome” and 𝐸2 = “The roll of a die results
in an outcome numbered less than 3”, then

• 𝐸1 = {1,3,5} and 𝐸2 = {1,2}

• E = 𝐸1 v 𝐸2 = {1}
1
• This has a probability of = 0.166667
6

Network Design 81
Probability – Axioms
• One of the major breakthroughs in modern mathematics was the realisation
that the theory of probability can be derived from just a handful of
intuitively obvious axioms. A version of the 3 given by Kolomogorov are
given below,

• 1. 0≤P(E)≤1, the probability of an event lies between 1 and 0


• 2. P(S) = 1, it is certain that at least some event in S will occur.
• 3. Given a potentially infinite set of mutually exclusive events 𝐸1 , 𝐸2 ,…
∞ 1
• 𝑃 ሪ𝑖=1 𝐸𝑖 = σ∞
𝑖=1 𝑃 𝐸𝑖

• This is the probability that any one of the events in the set of mutually
exclusive events occurs is the sum of their individual probabilities.
Network Design 82
Probability – Example
• If we define the mutually exclusive events {1,2} and {3,4},
both have probabilities thus,
1 1 1
• P= + = Then,
6 6 3
1 1 2
• P({1,2} U {3,4}) = P({1,2} + {3,4}) = + =
3 3 3

• If we looked at the non mutual exclusive event


1
{1,2} and {2,3},
as we saw above both have probability of , then
3

• P({1,2} U {2,3}) = P({1,2} + {2,3}) - P({1,2} {2,3}) =


1 1 2 1 1
• + - P({2}) = - =
3 3 3 6 2
Network Design 83
Probability – Subjective and Objective
• The approach we have just discussed is indifferent to how the
probability of an event is determined.
• It turns out there two ways to determine the probability of an
event… in some cases we can use counting arguments.
• If we assume a dice is fair, we know there are only 6 possible
outcomes and all outcomes are equal.
• This is called objective probability
• Another way is to define the probability of an event as a the
limit of a counting process.
• In many network measurement problems we need this
approach.
• This approach is called subjective or frequentist

Network Design 84
Probability – Example 1
• Consider a measurement device that measures the packet
header types of every packet that crosses a link. Suppose that
during the course of a day the device samples 1,000,000
packets. Of these packets 450,000 are UDP and 500,000 are
TCP, the rest are from other transport protocols.
• Given the large number of underlying observations, to a first
approximation we can say that the probability that a
randomly selected packet uses the UDP protocol is
• 450,000/1,000,000 = 0.45, more precisely we can say,

• 𝑝 𝑢𝐷𝑃 lim (UDPCount(t)/(TotalPacketCount(t))


𝑧→∞

Network Design 85
Probability – Example 2
• 𝑝 𝑢𝐷𝑃 lim (UDPCount(t)/(TotalPacketCount(t))
𝑧→∞
• Where,
• UDPCount(t) is the number of UDP packets seen during a
measurement interval of duration t.
• TotalPacketCount(t) is the total number of packets seen
during the same measurement interval
• Similar P(TCP) = 0.5.
• Note that in reality the mathematical limit cannot be
achieved, because no traffic trace is infinite.
• Worse still over the course of a week or a month, the
underlying workload could change, so the limit may not even
exist.
Network Design 86
Probability – Example 3
• In practice we are forced to choose “sufficiently large” packet
counts and hope that the ratio computed corresponds to a
probability.
• Further consider a device that samples on a link, suppose the
measurements show that 20% of UDP packets have a packet
size of 52 bytes, P(UDP) and P(52). Note these are from
different sample spaces, and we can say P(52 I UDP) = 0.2
• Above we computed P(UDP) = 0.45, therefore, P(UDP AND 52
= P(52 I UDP) X P(UDP) = 0.2 X 0.45 = 0,09 or 9%.
• There is a 9% chance that a UDP packet is 52 bytes long from
a random sample, however if we know it is a UDP packet
already then the probability rises to 20% of it being 52 bytes.

Network Design 87
Probability – The Poisson Distribution
• Before we finish this section I want to mention one
distribution that is encountered a lot in networking, this is the
Poisson distribution. It is usually used to model the arrival of
packets or new end to end connections to a switch or router.
• I do not intend to go into the details of the distribution, note
this example,
• Consider a link that can receive traffic from one of a 1,000
independent endpoints. Suppose the node transmits at a
uniform rate of 0.001 packets per second. What is the
probability that we see at least 1 packet on the link during an
arbitrary 1 second interval?

Network Design 88
Probability – The Poisson Distribution
• Given that each node transmits packets at the rate of 0.001
packets per second the probability that a node transmits in any
1 second interval is 𝑃𝑏𝑖𝑛𝑜𝑚𝑖𝑎𝑙 = 0.001, thus the poison
parameter λ = 1000x0.001 = 1

• The probability that we will see at least one packet on the link
during any 1 second interval is therefore,

• 1-p(0)
• = 1-𝑒 −1 10 /0!
• =1-1/e
• 0.64
• That equates to a 64% chance.
Network Design 89
Probability – Conclusion
• Our brief look at probability has given the basic ideas and
shown how these can be used to look at some problems in
networking
• These become important in how we look at measurement
and how we use these to inform simulation, bearing in mind
that there is a margin for error.

Advanced Interworking 90
Statistics

Network Design 91
Statistics – Introduction
• Statistics is a large body of mathematical work that has uses
in many areas of study.
• We will only look at some issues that are associated with
network engineering, in particular sampling and describing
data.

Advanced Interworking 92
Statistics – Sampling
• One of the critical problems in statistics is choosing a
representative sample.
• The universe of individuals under study constitutes a
population that an be characterised by its inherent
parameters, these could be range, minimum, maximum,
mean or variance. In many practical situations the population
is infinite, so we have to estimate its parameters by a carefully
chosen subset, or sample
• The parameters of a sample are called its statistics.
• In standard notation population parameters are represented
by Greek symbols, mean = μ and sample statistics are
represented by the Latin alphabet, mean = m or 𝑥.ҧ

Advanced Interworking 93
Statistics – Choice of Population
• Suppose you capture a trace of all UDP packets sent on a link
from a university router to the university ISP. from 6 a.m to 9
p.m on the 17th November 2017. What is the underlaying
population? There are many choices
• The population of UDP packets from the campus router to the
ISP from 12:00:01 a.m. to 11:59:59 a.m. on the 17th
November 2017
• The population of UDP packets from the campus router to the
ISP from 12:00:01 a.m. to 11:59:59 a.m. on Mondays
• The population of UDP packets from the campus router to the
ISP from 12:00:01 a.m. to 11:59:59 a.m. on days that are not
holidays

Advanced Interworking 94
Statistics – Choice of Population

• The population of UDP packets from the campus router to the ISP
from 12:00:01 a.m. to 11:59:59 a.m. on a typical day
• The population of UDP packets from a typical university’s campus
router to a typical university ISP from 12:00:01 a.m. to 11:59:59
a.m. on a typical day
• The population of UDP packets from a typical access router to a
typical ISP router from 12:00:01 a.m. to 11:59:59 a.m. on a typical
day
• The population of all UDP packets sent on the Internet in 2017
• The population of all UDP packets sent since 1969… the year the
Internet was created.
• Each population in the above list is a superset of the previous
population. As you go down the list, therefore, conclusions you
draw are more general.
Advanced Interworking 95
Statistics – Choice of Population

• It is true to say these conclusions are less valid. For example it is


hard to believe that a single days sample on a single link is
representative of all UDP packets sent on the Internet in 2017.
• The difficulty when setting up a measurement study is determining
a sample that is representative of the population under study
• Conversely, given a sample, you are faced with determining the
population that the sample represents.
• This sample will lay in the spectrum between the most specific
population, the sample, where your conclusions are true and the
more general population , about which usually no valid conclusion
can be drawn.
• Here the only real judgement is experience and even experts
disagree.
Advanced Interworking 96
Statistics – Sampling

• Many techniques have been developed to find representative


samples
• The first step is to identify the population to study and then
choose samples that are representative of that population.
Representative means a sample chosen such that every member
of the population is equally likely to be a member.
• If some members of the population are more likely to appear than
others then the sample is biased. Of course representativeness is
in the eye of the beholder, but stating the population and then the
sampling technique will aid in identifying and removing bias.

Advanced Interworking 97
Statistics – Sampling techniques
• Random or proportional sampling uses an unbiased decision rile
to select elements of the sample from the population, for example
“choose an element of the population with probability 0.05”
• In a stratified random approach the population is first categorised
into groups of elements that are expected to differ in significant
ways. Then each group is randomly sampled. For example you
could categorise packets on a link according to their transport
protocol (TCP, UDP, other) and then sample each in proportion to
their ratio in the population.
• The systematic approach is similar to random sampling. Here we
assume the population can be enumerated in some random
fashion, then we select every kth element. An example would be if
we expected packet arrivals to a switch to be in no particular order
with respect to the destination port, the destination port of every
100th arriving packet would constitute a systematic sample.
Advanced Interworking 98
Statistics – Sampling techniques
• Cluster sampling, like stratified sampling is appropriate when the
population naturally partitions itself into distinct groups.
• Purposive sampling, samples only elements that meet a specific
definition of the population. For example suppose we wanted to
study all IP packets that are 40 Bytes long corresponding to a zero
payload. We could set up a packet filter and capture just these
packets, this constitutes a purposive sample.
• A convenience sample involves studying the population elements
that happen to be conveniently available. For example you may
examine all traces from a co-operative cell pone operator t
estimate mean call durations.

Advanced Interworking 99
Statistics – Describing the sample
• After the sample has been collected the next task is to describe it
parsimoniously, that is wit a few well chosen statistics.
• These statics can be thought of as a model .
• Each data item can be thought of as arising from this model and
also from an unmodeled error giving

• Data = Model + Error

• The trick is to describe the data in the fewest number of


parameters.

• These parameters called be as graphs, histograms, as means


medians and other parameters, this is beyond the scope of this
brief introduction.
Advanced Interworking 100
Statistics –
• After the sample has been collected the next task is to describe it
parsimoniously, that is wit a few well chosen statistics.
• These statics can be thought of as a model .
• Each data item can be thought of as arising from this model and
also from an unmodeled error giving

• Data = Model + Error

• The trick is to describe the data in the fewest number of


parameters.

• These parameters called be as graphs, histograms, as means


medians and other parameters, this is beyond the scope of this
brief introduction.
Advanced Interworking 101
Stochastic Processes and
Queuing Theory

Network Design 102


Overview (I)

What is queuing/ queuing theory?


Why is it an important tool?
Examples of different queuing systems
Components of a queuing system
The exponential distribution & queuing
Stochastic processes
Some definitions
The Poisson process
Terminology and notation
Little’s formula
Birth and Death Processes

103
Overview (II)

• Important queuing models with FIFO discipline


– The M/M/1 model
– The M/M/c model
– The M/M/c/K model (limited queuing capacity)
– The M/M/c//N model (limited calling population)
• Priority-discipline queuing models
• Application of Queuing Theory to system
design and decision making

104
What is Queuing Theory?

• Mathematical analysis of queues and waiting times in stochastic


systems.
• Used extensively to analyze production and service processes
exhibiting random variability in market demand (arrival times) and
service times.
• Queues arise when the short term demand for service exceeds the
capacity
• Most often caused by random variation in service times and the
times between customer arrivals.

105
Why is Queuing Analysis Important?
Capacity problems are very common in industry and one
of the main drivers of process redesign
Need to balance the cost of increased capacity against
the gains of increased productivity and service
Queuing and waiting time analysis is particularly
important in service systems
Large costs of waiting and of lost sales due to waiting
Example – Hospital
Patients arrive by ambulance or by their own accord
One doctor is always on duty
More and more patients seeks help  longer waiting times
➢Question: Should another doctor position be created?

106
107
A Cost/Capacity Tradeoff Model

Total
cost
Cost
Cost of
service

Cost of waiting

Process capacity
Examples of Real World Queuing Systems?
Commercial Queuing Systems
Commercial organizations serving external customers
Ex. Dentist, bank, ATM, petrol stations, plumber, garage …
Transportation service systems
Vehicles are customers or servers
Ex. Vehicles waiting at toll stations and traffic lights, trucks or ships waiting
to be loaded, taxi cabs, fire engines, elevators, buses …
Business-internal service systems
Customers receiving service are internal to the organization providing the
service
Ex. Inspection stations, conveyor belts, computer support …
Social service systems
Ex. Judicial process, the A&E at a hospital, waiting lists for organ transplants
108
or student rooms …
Queuing in communication systems
• The arrival and service of packets at the output queue of a switch.
Packets may arrive when the output link is busy, these are now implicit
service requests, in which case the packets are queued, i.e. buffered.
• The arrival and service of HTTP requests at a web server. If the web
server is busy serving a request, incoming requests are queued.
• The arrival of telephone calls to a switch-control processor in a
telephone network. The processor may be busy and unable to service
the call, hence the call is queued.
• In general out main interests are to compute quantities of interest,
• Queuing delay – the expected wait time
• Backlog – how many service requests are awaiting service
• Utilisation factor – how busy a server is
• Drop rate – the expected fraction of service requests that must be
dropped as there is no more space left in the buffers
• The mean length of a busy or Idle period.
109
Queuing in communication systems
• Queueing theory allows us to compute the parameters outlined on the
last slide, for single and for interconnected networks.
• This is as long as the incoming traffic and the servers follow certain
simplified conditions
• Unfortunately measurements of real network traffic shows this is not
the case
• We also find that we cannot analyse most networks that are subject to
real workloads.
• However it is worth studying queues for two reasons,
• 1 It gives us an insight into the behaviour of queuing systems and the
insights apply even to mathematically intractable systems
• 2. The solutions from queuing theory are a reasonable first
approximation to reality
• We should bear in mind that results are approximate and give insights
rather than precise results.
110
Definition of a queueing system

Departure of
Customer
served customers
arrivals

Departure of
impatient customers

• A queueing system can be described as follows:


"customers arrive for a given service, wait if the service cannot start
immediately and leave after being served"

• The term "customer" can be men, products, machines, ...

111
Components of a Basic Queuing Process

Input Source The Queuing System

Served
Calling Jobs Service Jobs
Queue Mechanism
Population
leave the
system

Arrival Queue
Process Discipline
Service
Queue
Process
Configuration
112
Components of a Basic Queuing Process (II)
❖The calling population
The population from which customers/jobs originate
The size can be finite or infinite (the latter is most common)
Can be homogeneous (only one type of customers/ jobs) or heterogeneous (several
different kinds of customers/jobs)
❖The Arrival Process
Determines how, when and where customer/jobs arrive to the system
Important characteristic is the customers’/jobs’ inter-arrival times
To correctly specify the arrival process requires data collection of interarrival times and
statistical analysis.

113
Components of a Basic Queuing Process (III)

❖The queue configuration


Specifies the number of queues
Single or multiple lines to a number of service stations
Their location
Their effect on customer behavior
Balking and reneging
Their maximum size (# of jobs the queue can hold)
Distinction between infinite and finite capacity

114
115
Example – Two Queue Configurations

Multiple Queues Single Queue

Servers Servers
Multiple v.s. Single Customer Queue Configuration

Multiple Line Advantages Single Line Advantages

1. The service provided can be 1. Guarantees fairness


differentiated FIFO applied to all arrivals
Ex. Supermarket express lanes 2. No customer anxiety regarding
2. Labor specialization possible choice of queue
3. Customer has more flexibility 3. Avoids “cutting in” problems
4. Balking behavior may be 4. The most efficient set up for
deterred minimizing time in the queue
Several medium-length lines are less 5. Jockeying (line switching) is
intimidating than one very long line avoided
116
Components of a Basic Queuing Process (IV)
❖The Service Mechanism
Can involve one or several service facilities with one or several parallel service
channels (servers) - Specification is required
The service provided by a server is characterized by its service time
Specification is required and typically involves data gathering and statistical
analysis.
Most analytical queuing models are based on the assumption of exponentially
distributed service times, with some generalizations.
❖The queue discipline
Specifies the order by which jobs in the queue are being served.
Most commonly used principle is FIFO.
Other rules are, for example, LIFO, SPT, EDD…
Can entail prioritization based on customer type.
117
Classification of queueing
systems

118
Characteristics of simple queueing systems

Queuing systems can be characterised with several


criteria:

• Customer arrival processes


• Service time
• Service discipline
• Service capacity
• Number of service stages

119
Notation of Kendall

The following is a standard notation system of queueing systems

T/X/C/K/P/Z with

– T: probability distribution of inter-arrival times


– X: probability distribution of service times
– C: Number of servers
– K: Queue capacity
– P: Size of the population
– Z: service discipline

120
Customer arrival process
T/X/C/K/P/Z

• T can take the following values:


– M : markovian (i.e. exponential)
– G : general distribution
– D : deterministic
– Ek : Erlang distribution
–…

• If the arrivals are grouped in lots, we use the notation T[X] where X is the
random variable indicating the number of customers at each arrival epoch
– P{X=k} = P{k customers arrive at the same time}

• Some arriving customers can leave if the queue is too long


121
Service times
T/X/C/K/P/Z

• X can take the following values:


– M : markovian (i.e. exponential)
– G : general distribution
– D : deterministic
– Ek : Erlang distribution
–…

k exponential servers with parameter m

Erlang distribution Ek with parameter m

122
Number of servers
T/X/C/K/P/Z

In simple queueing systems, servers are identical

123
Queue capacity
T/X/C/K/P/Z

Loss of customers if
the queue is full

Capacity K

124
Size of the population
T/X/C/K/P/Z

The size of the population can be either finite or infinite

For a finite population, the customer arrival rate is a


function of the number of customers in the system:
l(n).

125
Service discipline
T/X/C/K/P/Z

Z can take the following values:


• FCFS or FIFO : First Come First Served
• LCFS or LIFO : Last Come First Served
• RANDOM : service in random order
• HL (Hold On Line) : when an important customer arrives, it takes the head
of the queue
• PR ( Preemption) : when an important customer arrives, it is served
immediately and the customer under service returns to the queue
• PS (Processor Sharing) : All customers are served simultaneously with
service rate inversely proportional to the number of customers
• GD (General Discipline)

126
The concept of customer classes

A queueing system can serve several classes of customers characterized by:


• different arrival processes
• different service times
• different costs
• service priority according to their class (preemption or no for example)

127
Simplified notation

We will use the simplified notation T/X/C when we consider a queue where:
• The capacity is infinite
• The size of the population is infinite
• The service discipline is FIFO

• Hence T/X/C = T/X/C///FIFO

128
Little's law

129
Some transient performances

THe(T) THs(T)
L(T)

W(T)
• A(T) : number of customers arrived from 0 to T
• D(T) : number of departures between 0 to T
• THe(T) = A(T)/T : average arrival rate between 0 to T
• THs(T) = D(T)/T : average departure rate between 0 to T
• L(T) : average number of customers between 0 to T
• Wk: sojourn time of k-th customer in the system
1  
AT
• W T    Wk average sojourn time between 0 to T
A T  k 1
130
Stability of the queueing system

THe(T) THs(T)
Queueing
system

Definition : A queueing system is said stable if the number of


customers in the system remains finite.

Implication of the stability:


lim TH e T   lim TH s T 
T  T 

D T 
lim 1
T  A T 
131
Little's law

For a stable and ergodic queueing system,

L = TH×W

where
• L : average number of customers in the system
• W : average response time
• TH : average throughput rate

Queueing system
TH TH
L

132
W
Single stage queueing systems

133
M/M/1 queue

N(t) : number of customers


in the system

l
Poisson
arrivals
Exponentially
distributed service tim

134
Stability condition of M/M/1 queue

The M/M/1 queue is stable if


l<m
or equivalently
r<1
where
• r  l/m is called the traffic ratio or traffic intensity.

The number of customers in the system is unlimited and hence there is no steady
state when the system is not stable.

135
Markov chain of the M/M/1 queue

When the system is stable, stationary probability


distribution exists as the continuous time markov
chain CTMC is irreducible.

Let
 n  lim P  N  t   n , n  0
t 

136
Steady state distribution of M/M/1 queue

state 0 : 1m   0 l

state 0-1:  2 m   1l
Balance equations M
state 0-1-...-n:  n 1 m   n l

M

Normalization equations:   n  1
n=0

With r  l/m,
0  1 - 
n = rn 0
137
138

M/M/C queue

Exponentially distributed
service tim

l
Poisson
N(t) : number of customers
arrivals
in the system

N(t) is a birth and death process with


• The birth rate l.
• The deadth rate is not constant and is equal to N(t)m if N(t)  C and Cm if N(t)
> C.
Stability condition : l< cm.
139

Steady state distribution of M/M/C queue

Distribution :
r l/m
n = rn/n! 0,  0 < n  C
n
r
 n C     C , n  0
C
-1
 C -1 r n rC 
0     
 n 0 n! C !1 - r C  
 

m m m m

0 1 2 3

l l l l

Markov chain of M/M/2 queue


140

Performance mesures of M/M/C queue

Ls = Number of customers in the system


= Lq + r

Ws = Sojourn time in the system


= Wq + 1/m

Lq = Average queue length


=
r C
C
1 - r C 
¨2

Wq = Average waiting time


= Lq / l

 = Average number of busy server,  = r

U = Waiting probability
= C + C+1 + ...
= C/(1-r/C)
141

M/M/C with impatient customers

• Similar to M/M/C queue except the loss of customers which arrive when all
servers are busy.

m m

0 1 2

l l

Markov chain of M/M/2 queue


with impatient customers
142

M/M/C with impatient customers


Steady state distribution :
r  l/m
Pn = rn/n! P0,  0 < n  C

-1
 C rn 
P0    
 n 0 n! 

Pourcentage of lost customers = PC

Server utilization ratio = (1 – PC) l/Cm

Insensitivity of Erlang Loss system M/GI/C without queue


(see Gross & Harris or S. Ross, proof by reserved system) :
Pn depends on the distribution of service time T only through its mean, i.e. with m =
E[T]
M/G/1 queue

Service time Ts
Poisson arrival

143
M/G/1 queue

As the service time is generally distributed, the departure of


a customer depar depends on the time it has been served.

The stochastic process N(t) is not a Markov chain.

144
M/G/1 queue: an embeded Markov chain

• Consider the stochastic process {Xk}k≥1 , the number of


customers after the departure of the k-th customer at tk

4 arrivals

{Xk}k≥1 is a CTMC and Xk+1 = (Xk -1)+ + number of


customers arrived during the service of the (k+1)-th customer.

Distribution of {Xk} is also the steady state distribution. 145


M/G/1 queue: Pollaczek-Khinchin formula

• Pollaczek-Khinchin formula or PK formula

r r2
Ls 
1- r

2 1 - r 
 cv 2
- 1

• From the PK formula, other performance measures such as Ws, Lq, Wq can be
easily derived.

• From PK formula, we observe that randomness always hurt the performances


of a system. The larger the randomness (i.e. larger cv2), the longer the queue
length is.

146
G/G/1 queue

• Inter-arrival times An between customer n and n+1 :


E[An] = 1/l
 A2  Var  An 

• Service time Tn of customer n :


E[Tn] = 1/m
 T2  Var Tn 

• Waiting time Wn in the queue of customer n (Lindley equation)

Wn+1 = max{0, Wn + Tn - An}

147
G/G/1 queue

• Bounds of Waiting time


1
l T2 -  2 - r  l  A2   T2 
m
 E W  
2 1 - r  2 1 - r 

• If E[A - t | A > t] < 1/l, then


l  A2   T2  1  r l  A2   T2 
-  E W   tightless check with Lq
2 1 - r  2l 2 1 - r 

• Waiting time approximation (Kingman's equation or VUT


equation)

E W  
  2
A   T2   r  1
 
2  1 - r  m
Varability Utilizatio Time
n 148
Queueing networks

149
Definition of queueing networks

A queueing network is a system composed of several


interconnected stations, each with a queue.

Customers, upon the completion of their service at a station,


moves to antoher station for additional service or leave the
system according some routing rules (deterministic or
probabilitic).

150
Example of deterministic routing

Shortest queue rule

151
Open network or closed network

Open network

N
customers
Closed 152

network
Multi-class network

153
A production line

Raw Finished
parts parts

154
Examples – Littles Theorem 1

Suppose you receive an email at an average rate of one message


every 5 minutes. If you read all your incoming mail instantaneously
once an hour, what is the average time that a message remains
unread?

The mean arrival time is 12 messages per hour.

You read once per hour, the mean number unread is 6 (the expected
messages received in half an hour)

By Littles theorem, this is the product of the mean arrival rate and
6
the mean waiting time for a message to be unread, = 12 ℎ𝑜𝑢𝑟𝑠 =
30 𝑚𝑖𝑛𝑢𝑡𝑒𝑠
155
Examples – Littles Theorem 2

Suppose that 10,800 HTTP requests arrive at a web server over the
course of the busiest part of the day. If the SLA says that the mean
waiting time for service must be under 6 seconds what is the largest
queue length allowed?

The arrival rate λ = 10,800/3600 = 3 requests per second

T needs to be ≤ 6. N = λT, so T = N/ λ, if T ≤ 6..

It follows that N/ λ ≤ 6 and N ≤ 6 x 3 = 18

The mean queuing length should not exceed 18. In practice the server
could return a server busy response when the queue exceeds 18, this
would mean 18 is the maximum queue length rather than the mean.
156
Example – M/M/1

Consider a link to which packets arrive as a Poisson process at a rate


of 300 packets per second such that the time taken to service a
packet is exponentially distributed. Suppose the mean packet length
is 1500 bytes and that the link capacity is 1.5Mbps. What is the
probability that the links queue has one, two and 10 packets
respectively?

157
Solution – M/M/1

The packet length is 500 bytes = 4,000 bits, so the link service rate of
1,5000,000 bits per second = 375 packets per second. The utilization
is 300/375 = 0.8.

When the link queue has one packet, it is in the state j = 2, because
one packet is being served at that time, thus we need
𝜋2∗ = (0 ⋅ 8)2 x 0.2 = 0.128.

For 2 packets (0.8)3 x 0.2 = 0.1 and for 10 packets 0.811 x 0.2 =
0.0067

So even at a utilisation of 80% the probability that the queue will


have 10 packets in it is very small
158
2 final examples

In the last example, what is the mean number of packets in the


system?

The utilisation is 0.8, so the mean number of packets in the system is


0.8/(1-0.8) = 0.8/0.2 =4, of these we would expect 1 to be in service
and three to be in the queue.

What is the mean waiting time?

For this queue μ = 375 and p = 0.8, so the mean waiting time is
(1/375)/((1-0.8) = 5/375 seconds = 13.3ms

159
Summary

• This has been a quick survey of the main elements that underpin
the some of the fundamentals of networks
• This is particularly true of design, simulation and operation of
complex networks.
• The idea of these slides is to give you an idea of the terminology
and an insight into the theories behind the techniques that we
will go on to discuss in the next lectures

• Questions?

160

Das könnte Ihnen auch gefallen