06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf ·...

141
Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing protocols Fundamentals of Communication Networks

Transcript of 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf ·...

Page 1: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione

06 Routing protocols

Fundamentals of Communication Networks

Page 2: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Topics

o Routing basics o Routing algorithms (Bellman-Ford,

Dijkstra) o Distance Vector protocols o  Link State protocols o  Examples of Internet routing

protocols (RIP, OSPF, BGP) o Multicasting

2

Page 3: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione

Routing basics

Page 4: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Unicast Routing o  Routing functionalities are fundamental for

internetworking o  In TCP/IP networks o  Routing allows the communication of two

nodes A and B not directly connected

A

B

4

Page 5: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Unicast Routing o  Layer 3 entities along the path route (choose the

exit SAP) packets according to the destination address

o  The correspondence Exit SAP – destination address is stored in the routing table

Entity A Routing one Entity C Entity B

5

Page 6: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Routing Protocol

o Comprises two different functionalities n  Info exchange on network topology,

traffic, etc. (1) n  routing table creation and maintenance

(2) o  Formally (1) is the routing protocol o  Practically, (1) and (2) are joint

phases. The way the routing tables are created depends on the routing message exchange and viceversa

6

Page 7: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Routing Algorithms

o A routing algorithm defines the criteria on how to choose a path between a source and a destination…

o …and builds the routing tables o  The choice criteria depend on the

type of network (datagram, virtual circuit)

7

Page 8: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Routing and Network Capacity

o  In broadcast networks no need of routing

o  Thus the maximum supported traffic depends on the capacity of the channel

o  In meshed IP networks multiple links can be used at the same time

o  Thus, WHAT links are used impact on the Network capacity

8

Page 9: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Routing and Capacity

o Dumb Routing Planning

S1

D1 S2

D2

Link Capacity = C Max Traffic = C

9

Page 10: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Routing and Capacity

o Wise routing planning

S1

D1 S2

D2

Link Capacity = C Max Traffic = 3C

10

Page 11: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Routing in the Internet

o  The type of forwarding impacts the routing policy o  IP forwarding is:

n  destination-based n  next-hop based

o  Consequence: n  All the packs destined to D arriving at router R follow

the same path after R

R D

11

Page 12: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Routing in the Internet o  Thus, we have the following constraints on the

routing: n  All the paths from all the sources to a destination D

must form a tree, for each D

n  Couples Source-Destination cannot be routed independently from other couples.

S5

D

S1 S2

S3

S4

S6

12

Page 13: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Shortest Path Routing o  TCP/IP Routing: the shortest path to a

destination is chosen o  The computation of the shortest path is

performed on the graph representing the network (device=vertex, link=edge, edge weight=metrics)

o  Shortest Path properties: n  All the paths to a destination form a tree n  Easy and simple algorithms (polynomial

complexity, even distributed)

13

Page 14: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione

Routing Algorithms

Page 15: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Some Definition on Graphs

15

o  digraph G(N,A) n  N nodes n  A={(i,j), i∈N, j∈N} edges (ordered couple of nodes)

o  path: (n1, n2, …, nl) set of nodes with (ni, ni+1) ∈A, without repeated nodes

o  cycle: route with n1= nl o  Connected digraph: for each couple i and j at

least one path from i to j exists o  Weighted digraph: dij weights associated to the

edge (i,j) ∈A o  Path (n1, n2, …, nl) length : dn1, n2+ dn2,n3+…+dn(l-1), nl

Page 16: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Finding the Shortest Path

16

o  The problem has polynomial complexity in the number of nodes

Given G(N,A) and two nodes i and j, find the path with minimum length

Property: If node k is traversed by the shortest path from i to j, also the path from i to k is the shortest

Page 17: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Bellman-Ford Algorithm

o Assumptions: n  Positive-negative weights n  No negative cycles

o  Target: n  Find the shortest paths from a source to

all the other nodes n  Find the shortest paths from all the

nodes to a destination

17

Page 18: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Bellman-Ford Algorithm o  Variables:

n  Di(h) length of the shortest path from the source

(assumed to be node 1) and node i with a number of hops ≤ h

o  Initialization:

o  Iterations:

o  The algorithm stops after N-1 iterations

18

( )⎥⎦⎤

⎢⎣⎡ +=+

jihjj

hi

hi dDDD )()()1( min,min

1

0)0(

)(1

≠∀∞=

∀=

iDhD

i

h

Page 19: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

An Example

o  Initialization n  Ds

h=0 n  D1

0=inf n  D2

0=inf o  First Iteration

n  D11=min (D1

0 , Ds0+1)=1, NH:S

n  D21=min (D2

0 , Ds0+3)=3, NH:S

o Second Iteration n  D1

2=min (D11 , D2

1+1)=1, NH:S n  D2

2=min (D21 , D1

1+1)=2, NH:1

S 1

2

1

1 3

19

Page 20: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distributed Bellman-Ford o  It can be shown that the algorithm does

converge in a finite number of iterations even in its distributed form

o  Nodes periodically send out their estimation of the shortest path and update such estimation according to the rule:

20

( )⎥⎦⎤

⎢⎣⎡ += jijjii dDDD min,min:

Dj

Page 21: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Bellman-Ford in practice

o  Each node is assigned a label (n, L) where n is the next hop on the path and L is the path length

o  Each node updates its label looking at its neighbors’ labels

o When the labels do not change any longer the shortest path tree can be built

21

Page 22: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Example: Bellman-Ford

22

2

2 1

5

3

1

1

2

4

(-, ∞) (-, ∞)

(-, ∞) (-, ∞)

(-, ∞) (1, 0) 1

2 3

6

4 5

(1, 2) (1, 5)

(1, 1) (-, ∞)

(-, ∞) (1, 0) (3, 9)

(4, 2)

(1, 5) (1, 2)

(1, 0)

(1, 1)

(5, 4)

(5, 3) (1, 2)

(4, 2) (1, 1)

(1, 0)

Page 23: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Dijkstra Algorithm

o Assumptions: n  Positive weighted edges

o  Target: n  Find out the shortest paths form a source

(1) and all the other nodes o  Initialization:

n  dij=∞ if the edge i-j does not exist

{}1 ,0

,1

1)0(

1 ≠∀==

=

jdDDP

jj

23

Page 24: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Dijkstra Algorithms

{ }

( )[ ]1. To Go 3.

: setP in nodeany of neighbor each for 2.

STOP.then , If setand

: find 1.

kjkkjj

j)PN(ji

dDmin,DminD(N-P)j

NP.iPP:

DminD(N-P)i

+=

=∪=

=

−∈

24

Page 25: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Dijkstra in practice

o  Same label criteria as Bellman-Ford o  Label can be temporary or permanent o  In the beginning the only permanent label

is the one of the source o  At each iteration the temporary label with

the lowest cost of the path is made permanent

25

Page 26: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Example: Dijkstra

26

2

2 1

5

3

1

1

2

4

(-, ∞) (-, ∞)

(-, ∞) (-, ∞)

(-, ∞) (1, 0) 1

2 3

6

4 5

(1, 2) (1, 5)

(1, 1) (-, ∞)

(-, ∞) (1, 0) (3, 9)

(4, 2)

(1, 5) (1, 2)

(1, 0)

(1, 1)

(5, 4)

(5, 3) (1, 2)

(4, 2) (1, 1)

(1, 0)

Page 27: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

On Complexity

o  Bellman-Ford: n  N-1 iterations n  N-1 nodes to be checked each iteration n  N-1 comparisons per node

o  Complexity: O(N3)

o  Dijkstra: n  N-1 iteration n  N operations each iteration on average

o  Complexity: O(N2)

o  Dijkstra is generally more convenient

27

Page 28: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Routing IP

o Sends packet on the shortest path to the destination

o  The length of the path is measured according to a given metrics

o  The shortest path computation is implemented in a distributed way through a routing protocol

o  In the routing table the next hop only is stored, thanks to the property that sub-paths of a shortest path are shortest themselves.

28

Page 29: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Routing Protocols

o  Handle the message exchange among routers to compute the paths to a destination

o  Two classes n  Distance Vector (RIP, IGRP) n  Link State (OSPF,IS-IS)

o  Differences n  Type of metrics n  Type of messages exchanged n  Type of procedures used to exchange messages

29

Page 30: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione

Distance Vector Routing Protocols

Page 31: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Protocols

o Routers exchange specific connectivity information: the Distance Vector (DV): [destination address, distance]

o DV is sent to directly connected routers only

o DV is sent periodically and/or whenever the network topology changes

o Distance estimation is performed using Bellman-Ford distributed algorithm

31

Page 32: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: Algorithm

o  DV reception 1.  Increase the distance to the specified

destination of the current link cost 2.  For each specified destination

n  If the destination is not in the routing table o  Add destination/distance

n  Otherwise o  If the next hop in the routing table is the DV sender

n  Update the stored information with the new one o  Otherwise

n  If the stored distance to the destination is bigger to the one specified in the DV §  Update the stored info with the new one

3.  End

32

Page 33: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector

o DV is sent n  periodically n  Whenever something changes upon the

reception of another DV o Routers calculate distances if:

n  A new DV is received n  Something changes in the local network

topology (local link failure)

Computation: Dj’ = mink [ Dk + dkj ] K, Dk

J, Dj

dkj

33

Page 34: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Routing Tables Update

34

Page 35: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Example (1) o Simple Network Topology:

■  Assume each link has cost = 1

A B

E D

C 1 2

3

6

5 4

35

Page 36: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Example (2)

o Assume all the nodes wake up at the same time F cold start procedure

o  Each node knows its local connectivity situation (directly connected links and interfaces)

o Start Up routing table for node A:

From A To Link CostA local 0

36

Page 37: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Example (3) o A sets up its Distance Vector

A=0 and sends it out to all of its neighbors (on local links)

o B and D receive the DV and enlarge their knowledge of the network

A B

E D

C 1 2

3

6

5 4

37

Page 38: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Example (4)

o  node B, upon reception of the Distance Vector, updates the distance adding the link cost (A=1) and checks the DV against its routing table. A is still unknown, thus routing table update

o  The same thing for node D

From B To Link CostB local 0A 1 1

38

Page 39: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Example (5) o  Node B sets its DV

B=0, A=1 and fires it through its local links

o  The same for node D: D=0, A=1

A B

E D

C 1 2

3

6

5 4

39

Page 40: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Example (6)

o  The DV from B is received by A,C and E whilst that from D is received by A and E

o  A receives the two DVs From B: B=0, A=1 From D: D=0, A=1

… and updates its routing table

From A to Link CostA local 0B 1 1D 3 1

A B

E D

C 1 2

3 6

5 4

40

Page 41: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Example (7) o  C receives from B on link 2

B=0, A=1 … and updates its routing table :

From C to Link CostC local 0B 2 1A 2 2

A B

E D

C 1 2

3 6

5 4

41

Page 42: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Example (8) o  Node E receives from B on link 4

B=0, A=1 and from D on link 6 D=0, A=1 … and updates its routing table

o  The distance to A is the same through link 4 and 6

From E To Link CostE local 0B 4 1A 4 2D 6 1

A B

E D

C 1 2

3 6

5 4

42

Page 43: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Example (9) o  The nodes A,C and E have updated their

routing tables thus they transmit their own DVs: node A: A=0, B=1, D=1 node C: C=0, B=1, A=2 node E: E=0, B=1, A=2, D=1

A B

E D

C 1 2

3

6

5 4

43

Page 44: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Example (10)

o  Node B:

o  Node D:

o  Node E

B local 0 A 1 1

A: A=0, B=1, D=1 C: C=0, B=1, A=2 E: E=0, B=1, A=2, D=1

From B To Link CostB local 0A 1 1D 1 2C 2 1E 4 1

D local 0 A 3 1

A: A=0, B=1, D=1 E: E=0, B=1, A=2, D=1

From D To Link CostD local 0A 3 1B 3 2E 6 1

E Local 0B 4 1A 4 2D 6 1

C: C=0, B=1, A=2

From E verso Link CostE local 0B 4 1A 4 2D 6 1C 5 1 44

Page 45: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Example (11)

o  The nodes B,D and E transmit their own DVs: node B: B=0, A=1, D=2, C=1, E=1 node D: D=0, A=1, B=2, E=1 node E: E=0, B=1, A=2, D=1, C=1

A B

E D

C 1 2

3

6

5 4

45

Page 46: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Example (12) o  Node A:

o  Node C:

o  Node D

A local 0 B 1 1 D 3 1

B=0, A=1, D=2, C=1, E=1 D: D=0, A=1, B=2, E=1

C local 0 B 2 1 A 2 2

B=0, A=1, D=2, C=1, E=1 E=0, B=1, A=2, D=1, C=1

D Local 0A 3 1B 3 2E 6 1

E=0, B=1, A=2, D=1, C=1

From A To Link CostA local 0B 1 1D 3 1C 1 2E 1 2

From C To Link CostC local 0B 2 1A 2 2E 5 1D 5 2

From D To Link CostD local 0A 3 1B 3 2E 6 1C 6 2

Page 47: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Example (13)

o  The algorithm has reached convergence o  The nodes keep transmitting their DVs

periodically but the routing tables do not change

A B

E D

C 1 2

3

6

5 4

47

Page 48: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: Link 1 Failure

o  Link 1 goes down

o  Nodes A and B get aware of the link failure o  …and update their routing table assigning

cost = infinity to link 1

A B

E D

C 1 2

3

6

5 4

48

Page 49: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: Link 1 Failure

49

o New DVs are sent: node A: A=0, B=inf, D=1, C=inf, E=inf node B: B=0, A=inf, D=inf, C=1, E=1

From A To Link CostA local 0B 1 1⇒infD 3 1C 1 2⇒infE 1 2⇒inf

From B To Link CostB local 0A 1 1⇒infD 1 2⇒infC 2 1E 4 1

Page 50: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: Link 1 Failure

50

o  The DV from A is received by D which compares it against its routing table

o  All the costs specified in the DV are greater or equal than the ones stored in the routing table, but node D updates its routing table since the link it receives the DV from is the one it uses to reach all the destinations

A B

E D

C 1 2

3

6 5

4 From D to Link CostD local 0A 3 1B 3 2⇒infE 6 1C 6 2

Page 51: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

o Also C and E update their tables

From C to Link CostC local 0B 2 1A 2 2⇒infE 5 1D 5 2

From E to Link CostE local 0B 4 1A 4 2⇒infD 6 1C 5 1

Distance Vector: Link 1 Failure

51

Page 52: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

o  nodes D, C and E transmit their DVs node D: D=0, A=1, B=inf, E=1, C=2 node C: C=0, B=1, A=inf, E=1, D=2 node E: E=0, B=1, A=inf, D=1, C=1

A B

E D

C 1 2

3

6

5 4

Distance Vector: Link 1 Failure

52

Page 53: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: Link 1 Failure

o  These DVs update the tables of A,B,D and E

From A to Link CostA local 0B 1 infD 3 1C 1⇒3 inf⇒3E 1⇒3 inf⇒2

From B To Link CostB local 0A 1 infD 1⇒4 inf⇒2C 2 1E 4 1

From D To Link CostD local 0A 3 1B 3⇒6 inf⇒2E 6 1C 6 2

From E To Link CostE local 0B 4 1A 4⇒6 inf⇒2D 6 1C 5 1

53

Page 54: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: Link 1 Failure

o  Nodes A,B,D and E transmit the new DVs node A: A=0, B=inf, D=1, C=3, E=2 node B: B=0, A=inf, D=2, C=1, E=1 node D: D=0, A=1, B=2, E=1, C=2 node E: E=0, B=1, A=2, D=1, C=1

o  A, B and C update their tables From A To Link Cost

A local 0B 1⇒3 inf⇒3D 3 1C 3 3E 3 2

From B To Link CostB local 0A inf⇒4 inf⇒3D 4 2C 2 1E 4 1

From C To Link CostC local 0B 2 1A 2⇒5 inf⇒3E 5 1D 5 2

■  The algorithm has reached a new steady state !!!

54

Page 55: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: Main Features

55

o  PROs: n  Very easy

o CONs: n  High time to convergence n  Limited by the lowest node n  Possible loops n  Instability in big networks

(counting to infinity)

Page 56: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Convergence Time

o Grows proportionally with the number of nodes (Low Scalability)

56

Page 57: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: counting to infinity

57

o Suppose link 6 goes down

A B

E D

C 2

3

6

5 4

Page 58: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: counting to infinity

58

o Node D detects link 6 failure and updates its routing table

o  if D immediately transmits the new DV, node A updates its routing table (the only reachable node is D)

From D To Link CostD local 0A 3 1B 6 2⇒infE 6 1⇒infC 6 2⇒inf

Page 59: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: counting to infinity

59

o  If node A transmits its DV node A: A=0, B=3, D=1, C=3, E=2 node D updates its routing table

o  loop between node A and D o  The algorithm does not reach convergence o  At each step the distances to B, C and E

grows by 2 Ecounting to infinity

From D To Link CostD local 0A 3 1B 6⇒3 inf⇒4E 6⇒3 inf⇒3C 6⇒3 inf⇒4

Page 60: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

o  Hop Count Limit: n  The counting to infinity is broken if infinity is

represented by a finite value n  Such value must be bigger than the length of the

longest path in the network n  When any distance reaches such value the

corresponding node is declared unreachable n  During the counting to infinity :

o  Packets loops o  Congested links o  High packet loss probability (including routing

packets) E Convergence may be very slow

Counting to infinity: Remedies

60

Page 61: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Counting to infinity: Remedies

61

o  Split-Horizon: n  if node A sends to D the packets meant for X,

it’s pointless for A to announce X in its own DV to D

n  node A does not advertise to D the destination X

A D X

Page 62: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: Split Horizon

o  Node A sends different DV on different local links

o  Two Flavors of Split Horizon: n  Basic: the node omits any information on

the destination which it reaches through the link it is using

n  Poisonous Reverse: the node includes all the destinations, setting to infinity the distance to those reachable through the link it is using

o  SH does not work with some topologies

62

Page 63: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: Split Horizon

63

o  when link 6 goes down this is the situation of nodes B,C and E

From Link CostB to D 4 2C to D 5 2E to D 6 1⇒inf

A B

E D

C 2

3

6

5 4

Page 64: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: Split Horizon

o Node E advertises on links 4 and 5 that the distance to D is infinity

o Suppose that such message is received by B but not (error) by C

64

From Link CostB to D 4 2⇒infC to D 5 2E to D 6 inf

Page 65: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: Split Horizon

65

o  Node C fires its DV (Split Horizon with Poisonous Reverse On) n  To node E: C=0, B=1, A=inf, E=inf, D=inf

o  On link 5 to reach D costs infinity n  to node B: C=0, B=inf, A=3, E=1, D=2

o  On link 2 to reach D costs 2

A B

E D

C 2

3

6

5 4

Page 66: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector: Split Horizon

66

o  B updates its routing table and sends its DV (Split Horizon Poisonous Reverse On): n  on link 2 D is reachable with cost = infinity n  on link 4 D is reachable with cost 3

o  nodes B,C and E:

o  loop among nodes B,C and E until the cost threshold is reached

o AGAIN counting to infinity

From Link CostB to D 4⇒2 inf⇒3C to D 5 2E to D 6⇒4 inf⇒4

Page 67: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

o Use of Counters/Timers (Hold down) n  If for Tinvalid no info from the first hop to

a specific destination, destination is no longer valid (not advertised in the DVs, DVs from other nodes skipped)

n  after Tflush the route is flushed n  Tinvalid - Tflush must be set so that the new

information propagate within the whole network

n  Invalid routes advertised with distance = infinity

n  Nodes receiving an invalid route set the route as invalid themselves

Counting to infinity: remedies

67

Page 68: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

o  Triggered Update n  Explicit advertisement of the changes in

the topology n  Speed up convergence n  Prompt failures discovery

Counting to infinity: remedies

68

Page 69: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione

Link State Routing Protocols

Page 70: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

o  Each node knows neighboring nodes and the relative costs to reach them

o  Each node sends to ALL the other nodes such information (flooding) through Link State Packet (LSP)

o All the nodes keep a LSP data base and a complete map of the network topology (graph)

o On the complete graph shortest paths are computed using Dijkstra

Link State Routing Protocols

70

Page 71: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Link State: PROs

o  Flexibility and Optimality in the path definition (complete map of the network topology)

o  LSP information is not sent periodically but only when something changes

o All the nodes get promptly aware of any change in the network topology

71

Page 72: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Link State: CONs

o Signaling protocol required to keep the topological information (Hello)

o  flooding needed o LSP must be acknowledged o Difficult to implement

72

Page 73: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Link State: example

73

R1

R2

R4

R5

R3

a

b

c a 1 b 1 c 1 R2 0 R1 2 R3 4

2 4 1

LSP generated by R2

Page 74: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Flooding

o  Each entering packet is transmitted through all the interfaces except the incoming one

o  possible loops and consequent traffic congestion

o  Sequence number (SN) + SN database in each node to avoid multiple transmissions of the same packet

o  Hop counter (same as TTL in IP)

74

Page 75: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Example

o  Each node owns a LSP data base

A B

E D

C 1 2

3

6

5 4

75

Page 76: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Example o  The LSP data base represents the network topology

o  Each node can easily calculate the shortest path to all the other nodes in the network

From To Link Cost Sequence NumberA B 1 1 1A D 3 1 1B A 1 1 1B C 2 1 1B E 4 1 1C B 2 1 1C E 5 1 1D A 3 1 1D E 6 1 1E B 4 1 1E C 5 1 1E D 6 1 1

76

Page 77: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Upon reception of an LSP

77

o  If the LSP has not been received yet or if the SN is greater than the one already stored: n  Store the new LSP n  Apply the flooding

o  If the LSP has the same SN of the one stored n  Do nothing

o  If the LSP is older than the one stored n  Transmit the newer one to the sender

Page 78: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Link State: Example o  The routing protocol must update the network topology

whenever something changes

o  link 1 failure is detected by nodes A and B which send an LS update packet on links 3, 2 and 4

node A: From A, To B, Link 1, Cost=inf, Number=2 node B: From B, To A, link 1, Cost= inf, Number=2

A B

E D

C 1 2

3

6

5 4

78

Page 79: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Link State: Example o  The messages are received by nodes D,E

and C which update their data base and flood on the local links

o  The new data base after flooding is: From To Link Cost Sequence Number

A B 1 1⇒inf 1⇒2A D 3 1 1B A 1 1⇒inf 1⇒2B C 2 1 1B E 4 1 1C B 2 1 1C E 5 1 1D A 3 1 1D E 6 1 1E B 4 1 1E C 5 1 1E D 6 1 1

79

Page 80: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione

Examples of Internet routing protocols

Page 81: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

o  Autonomous System: portion of Network managed by a single organization

backbone

AS AS

AS Autonomous System

Exterior Gateway

Interior Gateway

o  EGP - Exterior Gateway Protocol

o  IGP - Interior Gateway Protocol

Routing in Internet

81

Page 82: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

o  Routing Domain (RD): portion of an AS running a single routing protocol

o  some routers belonging to multiple RDs implement multiple routing protocols

AS

RD

RD

RD

Routing Domains

82

Page 83: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

o  Multiple RD routers must act as routing protocols gateways

o  Translation from Prot. A to Prot. B depends on the implementation of A and B

o  Prot A and B may be one IGP and one EGP (distribution criteria are defined)

RD RD

Prot. A Prot. B

Routing Distribution

83

Page 84: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

The most common routing protocols

84

o  IGP n  RIP (Routing Information

Protocol), version 1 and 2 n  IGRP (Interior Gateway Routing

Protocol) CISCO proprietary n  IS-IS (Intermediate System

Intermediate System) n  OSPF (Open Shortest Path First)

o  EGP n  BGP (Border Gateway Protocol)

Link State

Distance Vector

Path Vector

Page 85: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

o  Designed at Berkeley (1982) and standardized in RFC 1058

o  IGP o  Distance Vector, uses Bellman-Ford to compute

shortest paths o  Metrics: number of hops o  Limited to 16 hops o  RIP messages are encapsulated into UDP

segments (port: 520)

RIP Version 1

85

Page 86: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

RIP v1: message format

o RIPv1 messages can be: n  Requests n  Responses (stimulated/non stimulated)

Source: TCP/IP Protocol Suite, B. Forouzan

86

Page 87: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Request Messages

o  Requests may come from n  “Just-Switched-on” router n  A router having some destination out of date

o  Requests may deal with n  All the destinations n  Specific destinations

Source: TCP/IP Protocol Suite, B. Forouzan

87

Page 88: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Response Messages

Includes the DV

Source: TCP/IP Protocol Suite, B. Forouzan

88

Page 89: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

RIP v1: timing o  routing update timer (default 30 s)

n  Period of time between two contiguous DVs

o  route invalid (or duration) timer (default 180 s) n  If no DV is received from an interface in this

interval, the routes are declared invalid and its distance is set to 16

o  route flush timer or garbage collection timer (default 270 s) n  Time interval after which a route is erased (if

other DVs arrive from other interfaces they are accepted)

89

Page 90: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

RIP Version 2 o  Standardized in RFC 1723 o  Added Functionalities

n  Info on connectivity (router tag + next hop address) n  Authentication n  Classless routing (subnet mask) n  Multicasting: uses address 224.0.0.9

Source: TCP/IP Protocol Suite, B. Forouzan 90

Page 91: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

RIPv2: Authentication

Source: TCP/IP Protocol Suite, B. Forouzan

91

Page 92: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

OSPF (Open Shortest Path First)

o  RFC 1247, 1583 o  Link state o  Hierarchical routing o  Hello protocol

o  LSA (link state advertisement)

92

Page 93: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

OSPF: routers classification

Source: Computer Networking, J. Kurose

93

Page 94: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

OSPF: Types of links

Source: TCP/IP Protocol Suite, B. Forouzan

94

Page 95: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

OSPF: Topology Representation

Network as represented by OSPF

Real Network

Source: TCP/IP Protocol Suite, B. Forouzan 95

Page 96: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

OSPF: Packets

o Routing Packets are acknowledged

Source: TCP/IP Protocol Suite, B. Forouzan

96

Page 97: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Version (1) Type Message Length

Source Gateway IP address

Checksum

Authentication

1 4 8 16 19 32

Area ID

Authentication type

Authentication

OSPF: Common Header

97

Page 98: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

o  Type field: type of OSPF packets n  HELLO: neighboring nodes detection n  DATABASE DESCR IPT ION : l i n k s t a t e

broadcasting

n  LINK STATUS REQUEST n  LINK STATUS UPDATE n  LINK STATUS ACKNOWLEDGE: ack for the LSU

packets

o  Source gateway IP address IP address of the sender

o  Area ID indicates the area

OSPF: Packets

98

Page 99: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

OSPF: Types of LSA o  Type 1: router links advertisement

n  Within the same area (classical LSP) o  Type 2: network links advertisement

n  Generated by a LAN pseudo-Node (DR) o  Type 3: network summary link advertisement

n  Generated by area border routers to summarize the info regarding an area

o  Type 4: boundary routers summary link advertisement n  Generated by the area border routers, indicates

the presence of a AS boundary router in the area and the associated cost

o  Type 5: AS external link advertisement n  Generated by AS boundary routers and propagated

to all the routers of all the areas with info on external destinations and the associated costs 99

Page 100: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

o  The area border router propagates in every area routing info regarding all the other areas they are connected to n  distance vector contamination

As seen in area 2

OSFP: border routers

100

Page 101: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

o OSPF sends periodically HELLO messages to test if neighbors are reachable

o  database description messages are used to initialize the topology data base

o Data on link metrics are broadcast through the link status update messages

OSFP

101

Page 102: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

OSPF: Hello Packets

o Used for n  Neighbors discovery n  Select a designated router

Network Mask

Dead Interval

Backup Designated Router IP

Hello Interval All 0’s E T Priority

Neighbor IP address

Designated Router IP

Common Header 24 bytes Type:1

Set to 1 when the network is a stub

Set to 1 If the sender uses Multiple metrics

102

Page 103: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

OSPF: LSU Packets

o  LSU packets have a common header + Link State common header + payload

103

Page 104: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

OSPF: Router Link LSA

o  Link ID (link address) o  Link data/Link Type: depends on the link

type (point to point, stub, network) 104

Page 105: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Router Link LSA: Example 10.24.7.14

10.24.7.15 10.24.7.16 10.24.7.0/24

Metrica:4

Metrica:6 Metrica:2

10.24.7.14 1

4 1

OSPF Header Type: 4 LSA Header Type:1

10.24.7.15 2

6 1

10.24.7.0 255.255.255.0

2 3

105

Page 106: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

OSPF: Network Link LSA

o Network Mask o Attached Router: all the routers

connected to the network

106

Page 107: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Network Link LSA: example

o  Only the Designated Router (one of the three routers) signals the presence of all the other routers

o  Network address is not advertised (can be obtained form the header info)

OSPF Header Type:4

255.255.255.0

10.24.7.15

LSA Header Type:2

10.24.7.16

10.24.7.14 10.24.7.14 10.24.7.15 10.24.7.16

107

Page 108: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

OSPF: Summary Link to Network LSA

o Used to advertise networks outside an area of a AS

o  1 message for 1 network (multiple messages needed to address more networks)

108

Page 109: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

OSPF: Summary Link to AS Boundary Router LSA

o Defines the network a border router is connected to

109

Page 110: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

OSPF: External Link LSA

o Defines external networks o  Forwarding Address: to route packets

meant for external destinations 110

Page 111: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Template Activity o  Given the network below with routers, networks and

costs associated to the interfaces

R2

N1

R1

R3 R4

R5 R6

R7 N9

N8

N4

N2

2

1

R8 R9 R10

N5

N6 N7

N10 N12

1 1 1

2

2

2

1

1

2 2 1

2

2 1

1 1 1

1

111

Page 112: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Template Activity o  Assuming the AS runs OSPF

a)  Sketch the graph of the network as represented by OSPF assuming one single area

b)  Assuming the AS divided in areas as in the figure (area 0, area 1 and area 2) sketch the graphs of the AS as seen by routers R1, R7 and R10

112

Page 113: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Solution N1

R1 R2 R4 R3

N6 N7 N2

R5 R6

N4

N5

R7

N8

N11

N10 R10 R9 R8

N9

N12 2

2

2

1 1

1

1

2

2 2

1

1

1 1 2

1 1 1

1

2

a)

113

Page 114: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Solution N1

R1 R2 R4

R3 N6 N7

N2

N4 N5

N8

N11

N10

N9

N12

2

8

5 7

9 6

1 1

2

1 1 1

1

9

b) As seen by R1

R2

N1

R1 R3 R4

R5 R6

R7 N9 N8

N4

N2

2

1

R8 R9 R10

N5 N6 N7

N10 N12

1 1 1

2

2

21

1

2 2 1

2

2 1

1 1 1

1

114

Page 115: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Solution N1

R3 N6

N7

N2

R5 R6

N4

N5

R7

N8

N11 N10

N9

N12

2

2 2

1

1

2

2

b) As seen by R7 1

3

3

4 9

7

10

R2

N1

R1 R3 R4

R5 R6

R7 N9 N8

N4

N2

2

1

R8 R9 R10

N5 N6 N7

N10 N12

1 1 1

2

2

21

1

2 2 1

2

2 1

1 1 1

1

115

Page 116: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Solution

N1

R4

N6

N7

N2

N4

N5

N8

N11

N10 R10 R9 R8

N9

N12 2

2

2

1 1

1

1

1

b) As seen by R10

3

3

4

11

11

8 R2

N1 R1

R3 R4

R5 R6

R7 N9 N8

N4

N2

2

1

R8 R9 R10

N5 N6 N7

N10 N12

1 1 1 2

2

21

1 2 2

1

2

2 1 1 1 1

1

116

Page 117: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

BGP o  Most used EGP (standard de facto) o  Inter AS routing is different from intra AS one

n  Route decisions criteria are not based on metrics n  Backbone managers choose the routes according

to a policy n  Routing choice may need to exploit full

knowledge of the path to destination o  Thus:

n  DV does not fit since it has no knowledge of all the path

n  LS does not fit since it will need to build up a database of the entire internet

117

Page 118: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

BGP: Path vector o BGP is similar to distance vector,

but; n  the PVs do not report a “distance to

destination”, but the entire path to destination

Network

Next Router Path

N01 R01 AS2,AS5,AS7,AS12 N02 R07 AS4,AS13,AS6,AS9 N03 R09 AS11,AS12,AS8,AS6 … … …

118

Page 119: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

BGP: messages exchange

o  Each BGP router sends its path vector to neighboring nodes (peers)

o BGP messages use TCP o  TCP connections are opened by

sending routers o BGP uses port number 179

119

Page 120: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

BGP: Path Vector o  BGP allows the distribution of paths to

specific destinations o  ..but leaves the routing choice to the

network administration (policy based routing)

120

Page 121: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Policy based routing

o A BGP router receiving a path vector from a peer may decide to: n  Add to the routing table the destination

specified in the PV n  Forward the PV to the neighbors

o On the basis of the local routing policy

121

Page 122: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Policy based routing: example 1

o B doesn’t update its routing table and doesn’t forward the PV since this goes against the local routing policy

A B

D

C

N01, RD, D

N01, RA, A-D

Net Next Router Path

N01 RD D

122

Page 123: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Policy based routing: example 2

o D does not update its routing table and does not forward the PV since its own AS is specified in the path

A B

D

Net Next Router Path

N01 RD D

N01, D, RD

Net Next Router Path

N01 RA A-D

N1, B-A-D, RB

N01, A-D, RA

123

Page 124: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

BGP: Path vector

o  path vector messages contain attributes

o Attributes may be mandatory and optional

o Mandatory attributes: n  ORIGIN: IGP protocol origin of the info

(e.g. OSPF, RIP, IGRP) n  AS_PATH: sequence of traversed AS n  NEXT_HOP: next router

124

Page 125: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

BGP Messages

o Common header

125

Page 126: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Open Messages o  Peering set up messages o  Routers answer with keepalive messages (common

header only)

BGP version (4)

Waiting time for a keepalive message

AS id

Sender ID

Authentication option

126

Page 127: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Update Messages

o Contain the path vector

o Used to advertise path or to cancel previously advertised paths

127

Page 128: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Notification Messages

o  To notify an error or to close a connection

128

Page 129: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione

Multicasting

Page 130: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Multicasting

o Applications may require the use of point-to-multipoint connections n  audio and video broadcast n  Network games (Quake, etc.)

130

o  multicasting can also be implemented by the source over a unicast network

Page 131: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Multicasting o  If the network supports multicasting 1

packet is enough o  Some nodes in the network must play an

active role (red routers)

131

o  Required Functionalities: n  Destinations

groups definition n  addressing n  Routing definition

Page 132: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Groups and Addresses

132

o  IP defines an addressing class for multicasting applications

o  Group addresses reduce overhead, but pose new problems: n  How to build up a

group n  How to add

members to a group

n  How to know the members’ list

11110 multicast addresses from 224.0.0.0 to 239.255.255.255

Page 133: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Internet Group Management Protocol (IGMP)

o  Specific routers manage the multicasting o  IGMP is used in the communications

between hosts and multicast routers o  Each host communicates with the

multicast router within its own IP subnet

133

Page 134: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Group Management

134

o  The multicast router periodically sends out multicast messages (224.0.0.1 to all the systems in the LAN)

o  Hosts answer with the list of the multicast groups currently in use by some application

IGMP Message types Sent by Purpose

membership query: general routerquery multicast groups joined by attached hosts

membership query: specific router

query if specific multicast group joined by attached hosts

membership report host

report host wants to join or is joined to given multicast group

leave group hostreport leaving given multicast group

Source: Computer Networking, J. Kurose

Page 135: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Multicast routing o  How to forward multicast

packets? o  Target: to set up a

spanning tree without cycles

o  The routers not connected to users of a given group may be excluded from the tree

o  Similar problem to the transparent bridging

135

Page 136: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

What Trees?

o One common tree FOR ALL the multicast traffic sources

o One tree FOR EACH of the multicast traffic sources

136

Group-shared tree Source-based trees

Page 137: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Group-Shared Tree o  Theoretically the minimum cost tree can be found o  Practically sub-optimal approaches are used: o  center-based approach:

n  Central router election n  Join (unicast) messages are sent to the central router n  The messages trace the branches of the multicast tree

and stop either at the central router or at a router already belonging to the tree

137

Page 138: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Source-based Trees

o  It uses the shortest path tree o  Reverse Path Forwarding (RPF)

138

o  All the packets arriving from the shortest path to the source are forwarded

o  All the others are dropped

Non-multicast router may belong to the Multicast tree

Page 139: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Source-based Trees: pruning

o  Pruning to eliminate nodes from the multicast tree

o  Router can detach from the tree sending prune packet along the tree (in the opposite direction)

139

o  Problems: n  Gather info on leaf

routers (signalling needed)

n  Let new router enter the tree (explicit unprune messages or pruninig timer)

Page 140: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Distance Vector Multicast Routing Protocol (DVMRP)

o  distance vector to set up the multicasting tree

o  Each router owns a list of depending routers

o  pruning messages are sent only if all the router of the list have already been pruned

o  explicit unprune messages (grafts) o  pruning info have a time-out

140

Page 141: 06 Routing protocols - Intranet DEIBhome.deib.polimi.it/capone/fcn/06-Routing protocols.pdf · Politecnico di Milano Scuola di Ingegneria Industriale e dell’Informazione 06 Routing

Multicasting in Internet o  Only a small fraction of Internet routers

has multicast functionalities o  What happens if none of the neighboring

routers supports multicast functionalities? o  MBone (Multicast Backbone) uses

tunneling:

141