Network Planning VITMM215 Practice Markosz Maliosz PhD 21/9/2016 - - PowerPoint PPT Presentation

network planning
SMART_READER_LITE
LIVE PREVIEW

Network Planning VITMM215 Practice Markosz Maliosz PhD 21/9/2016 - - PowerPoint PPT Presentation

Network Planning VITMM215 Practice Markosz Maliosz PhD 21/9/2016 Department of Telecommunication and Media Informatics Basic algorithms 2 Algorithms Algorithm: a sequence of step-by-step instructions for solving a problem Problem:


slide-1
SLIDE 1

Network Planning

VITMM215

Practice Markosz Maliosz PhD 21/9/2016

Department of Telecommunication and Media Informatics

slide-2
SLIDE 2

Basic algorithms

2

slide-3
SLIDE 3

3

Algorithms

 Algorithm: a sequence of step-by-step instructions for

solving a problem

 Problem:

– Given:

  • input data
  • a query about input data

– Algorithm:

  • Most important: depending on the size of the input data (n) how

many steps are required to solve a problem

– “fast”: polynomial – number of steps ~ nk – “slow” : e.g. exponential – number of steps ~ an or factorial ~ n!

– Complexity: characterizes the problem

  • problem classes:

– P: polynomial time algorithm exists for solving – NP (nondeterministic polynomial time) hard: no polynomial time algorithm is known to solve the problem

– Exhaustive search  “endless” time

slide-4
SLIDE 4

4

Algorithms

 How to solve NP hard problems in

practice?

– for a special case can exist a polynomial time algorithm – if the input data is not huge, then the solving time can be acceptable – if the solution is not time-critical, then maybe an exponential running time is acceptable – we do not insist on the optimum: approximation methods, heuristics

slide-5
SLIDE 5

5

Algorithms

 Example:

– N nodes – N*(N-1)/2 possible links – 2 N*(N-1)/2 possible topologies

  • however some of them

are not connected

 Goal: to reduce the

number of possibilities to choose from

 Example: greedy

algorithm

Number

  • f nodes

Number of possible topologies Number of connected topologies 1 1 1 2 2 1 3 8 4 4 64 38 5 1 024 728 6 32 768 26 704 7 2 097 152 1 866 256 8 268 435 456 251 548 592 9 68 719 476 736 66 296 291 072 10 35 184 372 088 832 34 496 488 594 816

slide-6
SLIDE 6

Greedy Algorithms

 At each step the best choice is chosen

– it never steps back

 Advantage: generally simple  Disadvantage: does not reach the

  • ptimum in many cases

6

slide-7
SLIDE 7

7

Example

A – E path?

slide-8
SLIDE 8

8

Example

 Naïve greedy algorithm based on local information

– Path: A – C – D – B – E – Cost: 2 + 2 + 1 + 5 = 10

slide-9
SLIDE 9

9

Example

 Optimal min-cost path

– Path: A – D – E – Cost: 3 + 3 = 6

slide-10
SLIDE 10

Finding Shortest Paths

 Polynomial greedy algorithm that finds the

  • ptimum for the shortest path problem:

Dijkstra’s algorithm

 Common approach: routing uses shortest

paths

10

slide-11
SLIDE 11

11

Dijkstra’s shortest path algorithm

 E. W. Dijkstra, Dutch computer scientist  lowest cost = shortest path  shortest path in a graph with non-negative edge

weights

– directed or undirected graph – from a selected source – to all other nodes, as destinations

 it builds a spanning tree from the source node  used in network routing protocols, e.g. IS-IS and

OSPF (Open Shortest Path First)

slide-12
SLIDE 12

12

Dijkstra’s algorithm

 Given: G = (V, E):  Form two sets of nodes:

– S: nodes, we already determined the shortest path from the source – V-S: all the other nodes

 Store two values at each nodes:

– d: the length of the shortest path leading from the source to this node in the current state (distance) – p: the predecessor node in the shortest path according to the current state

slide-13
SLIDE 13

13

Dijkstra’s algorithm

The steps:

1.

Initialize d and p

– source node: d=0, other nodes: d=∞ – p: invalid for all nodes

2.

S = {} /empty set/

3.

While V-S is not empty,

– Sort nodes in V-S set according to shortest paths – Move the nearest u node from V-S to S set – For the nodes, that are in V-S and are connected to u:

  • recalculate d; if it is less then the previous value, then update it
  • if d was updated: set p to u
slide-14
SLIDE 14

14

Dijkstra’s algorithm - example

Starting point:

– directed graph – source: s – S={} – V-S = V (thin framing) – numbers on edges: weights – numbers in nodes: d

  • s: 0
  • other: ∞
slide-15
SLIDE 15

15

Dijkstra’s algorithm - example

First step

– nearest node: s (d=0) – move it from V-S to S (thick framing) – neighbor nodes with s:

  • u and x
  • update d and set p (red arrows)
slide-16
SLIDE 16

16

Dijkstra’s algorithm - example

Second step

– nearest node: x (d=5) – move it from V-S to S (thick framing) – neighbor nodes with x:

  • u, v and y
  • update d and set p (red arrows)
slide-17
SLIDE 17

17

Dijkstra’s algorithm - example

Third step

– nearest node: y (d=7) – move it from V-S to S (thick framing) – neighbor nodes with y:

  • v
  • update d and set p (red arrows)
slide-18
SLIDE 18

18

Dijkstra’s algorithm - example

Fourth step

– nearest node: u (d=8) – move it from V-S to S (thick framing) – neighbor nodes withu:

  • v
  • update d and set p (red arrow)
slide-19
SLIDE 19

19

Dijkstra’s algorithm - example

Fifth (last) step

– the only node in V-S: v (d=9) – move it from V-S to S (thick framing)

The paths from the source to the other nodes can be backtracked with the red arrows. The red arrows (p) form a shortest path tree.

slide-20
SLIDE 20

Shortest Path – Link Weights

 What should be the link weights?

– physical distance? – delay on a link? – hop count (w=1)? – some arbitrary number?

 Cisco’s default:

– inversely proportional to its capacity – higher capacity links are “shorter” – drives traffic to higher capacity links – can lead to strange routing

20

slide-21
SLIDE 21

Link weight setting example

21

 Traffic:

– q  t : 1 – r  t : 1 – s  t : 1 – w  t : 1

slide-22
SLIDE 22

Link Weights

 The correct choice depends on objectives  Common goal: minimize delays

– if propagation delay is dominant

  • minimize physical path distance
  • weight = link distance

– if processing delay is dominant

  • minimize hop count, weight = 1

– if queuing delay is dominant

  • measure delays along links
  • calculate shortest path according to measured delay

values

22

slide-23
SLIDE 23

Tree Networks

 Connects all nodes with minimum number

  • f links

 There is one and only one path between

any node pairs

 Example applications:

– cable TV network: broadcast from one source to many – Ethernet Spanning Tree Protocol

23

slide-24
SLIDE 24

24

Spanning Tree

 Def.: subgraph, which is a tree and

contains all nodes

slide-25
SLIDE 25

25

Minimum spanning tree

 link cost  edge weights  The minimum spanning tree is the minimum cost

spanning tree among all spanning trees

 If each link has a distinct weight, there will be a

unique MST, otherwise the MST is not unique

slide-26
SLIDE 26

26

Kruskal’s Algorithm

 Greedy algorithm to find minimum spanning tree

– create a forest F (a set of trees), where each node in the graph is a separate tree – At each step, take the minimum-weight edge

  • if it connects two different trees, then add to the forest 

combine the two trees into a single tree

  • otherwise discard that edge

– If there is only one tree, the problem is solved Animation: http://visualgo.net/mst

slide-27
SLIDE 27

Prim’s Algorithm

 Greedy algorithm to find minimum spanning tree

– select an arbitrary node as initial element of the set – in each iteration, choose a minimum-weight edge (u, v), connecting a node v in the set to the node u

  • utside of the set, then node u is brought into the set

– this process is repeated until all the set will contain all nodes

 When the algorithm terminates, the edges in the

set form a minimum spanning tree Animation: http://visualgo.net/mst

27

slide-28
SLIDE 28

28

Calculating Spanning Tree

B A D C E F 5 2 4 6 10 4 6 2

Find the min-cost spanning tree in the graph!

9

slide-29
SLIDE 29

Ethernet STP

 An Ethernet network can have multiple

possible paths for reliability

 STP is intended to create a tree to avoid

loops – broadcast storm

 802.1D algorithm based on Dijkstra’s alg.

– switches are assigned numerical priorities – switch with lowest priority becomes root switch

  • tie break is lowest MAC address (are unique)

– each switch port is given a cost = link weight

  • based on bandwidth of the link

29

slide-30
SLIDE 30

STP Port Costs

 Default costs

– old version based on 1 Gbps/(link bandwidth) – new version: arbitrary table

  • port cost: integer, >0

30

Link speed Old cost New cost 10 Mbps 100 100 100 Mbps 10 19 1 Gbps 1 4 10 Gbps 1 2

slide-31
SLIDE 31

STP

 Bridge Protocol Data Units are sent

regularly

– priority, cost information and state – flooded through network

 Protocol finds min-cost path to root switch

with Dijkstra’s algorithm in a distributed way

– ports not on shortest path towards root bridge are blocked

31

slide-32
SLIDE 32

STP

 Optimization in STP

– minimizes path length for each leafs to get to the root – link weights can be arbitrary! – with default weights: pushes traffic to higher bandwidth paths

32