Beruflich Dokumente
Kultur Dokumente
Network Theory
15 January, 2018
Kevin Worrall
k.worrall@rave.ac.uk
Network Theory 1
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?
Mathematical
The cells of a GSM problem
mobile phone network
Music
Other examples:
• Electrical eng.
• Biochemistry
• Computer science
• Physics
Applications in computer Science
Hamiltonian cycles in Platonic graphs found paths that visit each vertex once
Graph Theory - History
Trees in Electric Circuits
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
V:={1,2,3,4,5,6}
E:={{1,2},{1,5},{2,3},{2,5},{3,4},{4,5},{4,6}}
Simple Graphs
loop
multiple arc
arc node
Weighted graphs
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
a graph is connected if
you can get from any node to any other by following a sequence of
edges
OR
The degree of 5 is 3
Degree (Directed Graphs)
outdeg(1)=2
indeg(1)=0
outdeg(2)=2
indeg(2)=2
outdeg(3)=1
indeg(3)=4
Degree: Simple Facts
deg(v) = 2m = 2 |E |
If G is a digraph then
indeg(v)= outdeg(v) = |E |
Number of Odd degree Nodes is even
Walks
uv,vw,wx,…,yz.
A path is a walk in which all the edges and all the nodes
are different.
1,2,5,1 2,3,4,5,2
3-cycle 4-cycle
Special Types of Graphs
Null graph
No nodes
Obviously no edge
Trees
Paths
Stars
Regular
Connected Graph
C3 C4 C5
Bipartite graph
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
A B C
D E F
G H I
Spanning subgraph
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
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
Network Design 55
Applications in Computer Science
Facebook is based in
graph theory
Applications in computer Science
Google Maps:
Graph Operations
Minimun
Spanning tree
Graph Operations
Network Design 70
Probability
Network Design 74
Probability – Special Cases
Network Design 75
Probability – Events
Network Design 76
Probability – Example
Network Design 77
Probability – Disjunction of events
Network Design 78
Probability – Example
• 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
Network Design 80
Probability – Example
• 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,
• 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
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,
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
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
103
Overview (II)
104
What is Queuing Theory?
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
111
Components of a Basic Queuing Process
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)
114
115
Example – Two Queue Configurations
Servers Servers
Multiple v.s. Single Customer Queue Configuration
118
Characteristics of simple queueing systems
119
Notation of Kendall
T/X/C/K/P/Z with
120
Customer arrival process
T/X/C/K/P/Z
• 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}
122
Number of servers
T/X/C/K/P/Z
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
125
Service discipline
T/X/C/K/P/Z
126
The concept of customer classes
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
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
D T
lim 1
T A T
131
Little's law
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
l
Poisson
arrivals
Exponentially
distributed service tim
134
Stability condition of M/M/1 queue
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
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
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
U = Waiting probability
= C + C+1 + ...
= C/(1-r/C)
141
• 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
-1
C rn
P0
n 0 n!
Pourcentage of lost customers = PC
Service time Ts
Poisson arrival
143
M/G/1 queue
144
M/G/1 queue: an embeded Markov chain
4 arrivals
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.
146
G/G/1 queue
147
G/G/1 queue
E W
2
A T2 r 1
2 1 - r m
Varability Utilizatio Time
n 148
Queueing networks
149
Definition of queueing networks
150
Example of deterministic routing
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
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 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
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
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