Vous êtes sur la page 1sur 49

11/28/2016

Digital Routing
ROUTING IN IP NETWORKS

11/28/2016

DR. PHUONG NGA TRAN - EEIT

Content
Introduction
Single path routing
Broadcast

11/28/2016

DR. PHUONG NGA TRAN - EEIT

11/28/2016

Introduction
Routing determines the communication paths to be used for
the communication between any two parties.
We consider traffic flow 1 4 and 3 6.
Direct link

No routing problem as long as traffic intensities (load) are


below the link capacity (5)
1

11/28/2016

6
3

DR. PHUONG NGA TRAN - EEIT

Introduction
Routing classification:
Single path routing
Multipath (bifurcated routing)
Broadcast
1

5
5

5
5

4
11/28/2016

5
DR. PHUONG NGA TRAN - EEIT

6
4

11/28/2016

Introduction
Routing decisions are implemented as routing tables in
network nodes.
A distinction has to be made whether or not we are

considering:

a connectionless or
a connection-oriented service.

For datagram operation the packet contains the full

destination address in the packet header.

The routing table:


contains all possible destination addresses as entries;
the content is the port to which the packet should be output.
DR. PHUONG NGA TRAN - EEIT

11/28/2016

Routing table
2

Destination node

Next node

Routing table for node 4


11/28/2016

DR. PHUONG NGA TRAN - EEIT

11/28/2016

Routing table
The entries have been generated upon evaluation of a routing
algorithm.
Idea: Try to optimize some cost function for effective use of
resources in the network.
Performance criterion

Euclidian distance
number of hops
throughput
delay
costs (e.g. for the utilization of transmission links)
11/28/2016

DR. PHUONG NGA TRAN - EEIT

Routing Algorithm
Major concerns when developing such an algorithm:
correctness
complexity
stability
fairness

Information used in the algorithm

none
only local information
from adjacent nodes
from a subset of nodes
from all nodes

11/28/2016

DR. PHUONG NGA TRAN - EEIT

11/28/2016

Routing Algorithm
Routing strategy

Decision place

static

each node

adaptive, updates:

central node

continuous

source node

periodic

subset of nodes

upon major load change


upon topology change

Decision time
packet (datagram)
session (virtual circuit)

11/28/2016

DR. PHUONG NGA TRAN - EEIT

10

Algorithms to determine shortest paths


These algorithms in general try to minimize a cost function.
"Costs" can be anything which is sensible to minimize as
seen by the operator of the network, e.g.:

Euclidian distance
number of hops
tariffs for links, etc.
link utilization
or any other measure derived from the above.

The costs are then condensed in a cost matrix obeying the


following rules:
cii = 0
cij = ; if i and j are not adjacent nodes.
11/28/2016

DR. PHUONG NGA TRAN - EEIT

10

11/28/2016

11

Algorithms to determine shortest paths


5
3

3
Network topology
Note! The cost matrix is in general symmetric with
respect to its main diagonal.

Cost matrix

11/28/2016

DR. PHUONG NGA TRAN - EEIT

11

12

Algorithms to determine shortest paths


An optimal route (shortest path) from a node 1 to a node k is a
sequence of links (pq): 1a,..., ji ,..., mk
such that

costs Min

links

All algorithms make use of Bellmann's optimality principle:

Assume that the optimal path S1k from node 1 to node k has been
found.
Let i be a node on this path; then S1i and Sik are also optimal!
11/28/2016

DR. PHUONG NGA TRAN - EEIT

12

11/28/2016

13

Algorithms to determine shortest paths


We conclude:
Let

be the minimal distance from node 1 to node .

Let

be the minimal distance to node with j being a direct

neighbor of
From Bellmann's principle we then derive the following equations:
D1 0
D i min [ D j c ji ], i 1
j N ( i )

( ) is the set of neighbours of .


The equation lends itself to an iteration and different algorithms
differ in the way of how the iteration is organized.
11/28/2016

13

DR. PHUONG NGA TRAN - EEIT

14

Dijkstra's Algorithm
Assume that we want to find shortest path from node 1 to all
other nodes
(p,d)= (predecessor,
distance to 1)
M = {}

Step 1
Initialization
5

(-1,)

(-1,)
3

3
(-1,)

(-1,0)
1

11/28/2016

(-1,)

(-1,)

DR. PHUONG NGA TRAN - EEIT

114

11/28/2016

15

Dijkstra's Algorithm
Min Dj = D1=0
M={1}
Dj=min (,0+c1j)= c1j

Step 2
After first iteration
5

(1,5)

(1,2)
3

(-1,)
1

(-1,0)
1

4
(1,1)

11/28/2016

(-1,)

15

DR. PHUONG NGA TRAN - EEIT

16

Dijkstra's Algorithm
Consider node j, which has the lowest distance to 1 so far
Step 3
After second iteration
5

(4,4)

(1,2)
3

Min Dj = D4=1
M={1,4}
D2=min (2,1+2) = 2
D3=min (5,1+3) = 4
D5=min (,1+1)= 2

(-1,)
1

(-1,0)
1

4
(1,1)

11/28/2016

5
(4,2)

DR. PHUONG NGA TRAN - EEIT

16

11/28/2016

17

Dijkstra's Algorithm
Consider node j, which has the lowest distance to 1 so far
Min Dj = D2=2
M={1,2,4}
D3=min (4,2+3) = 4

Step 4
After third iteration
5

(4,4)

(1,2)
3

(-1,)
1

(-1,0)
1

4
(1,1)

11/28/2016

(4,2)

17

DR. PHUONG NGA TRAN - EEIT

18

Dijkstra's Algorithm
Consider node j, which has the lowest distance to 1 so far
Step 5
After fourth iteration
5

(5,3)

(1,2)

Min Dj = D5=2
M={1,2,4,5}
D3=min (4,2+1) = 3
D6=min (,2+2) = 4

(5,4)
1

(-1,0)
1

4
(1,1)

11/28/2016

(4,2)

DR. PHUONG NGA TRAN - EEIT

18

11/28/2016

19

Dijkstra's Algorithm
Consider node j, which has the lowest distance to 1 so far
Min Dj = D63=4
=3
M={1,2,3,4,5}
M={1,2,3,4,5,6}
D6=min (4,3+5) = 4

Step 7
6
After sixth
fifth iteration
iteration
5

(5,3)

(1,2)
3

(5,4)
1

(-1,0)
1

4
(1,1)

11/28/2016

(4,2)

DR. PHUONG NGA TRAN - EEIT

19

20

Summary of Dijkstra's Algorithm


The Dijkstra algorithm will determine the shortest path from a source
to (N-1) destinations and iterates over the path length.
Starting from the source node (1) the nearest neighbour (minimal c1i)
is determined.
Then from the nearest neighbours of these two nodes that one with
the shortest distance (SD) to the source is selected.
Starting now with three nodes, again among their neighbours that one
with the SD to the source is looked for, etc.
The elected nodes with SD to the source are collected in a set M.
The algorithm terminates when the set V of all nodes is identical to M.
We update labels (p;d) for each node indicating the actual values of
predecessor node and
actual distance to node 1.
11/28/2016

DR. PHUONG NGA TRAN - EEIT

10

11/28/2016

21

Pseudo code of Dijkstra's Algorithm

N: number of nodes
V: set of all nodes
M: set of considered nodes
11/28/2016

DR. PHUONG NGA TRAN - EEIT

22

Dijkstra's Algorithm
Dijkstra's algorithm or variants of it are implemented in the
INTERNET.
Its complexity is 0(N2):
We have N-1 iterations each containing a number of operations
which is proportional to N.

If all cij are known to all nodes, each node can execute the
algorithm independently.
To proceed like this, changes in the cost matrix need to be
communicated in the whole network.
11/28/2016

DR. PHUONG NGA TRAN - EEIT

11

11/28/2016

Exercise
A network topology and the link costs are given as in the figure below.
Node A is using the Dijkstra algorithm to compute its routing table. The
following table illustrates the iterations of the algorithm. Please complete
it given that (p; d) = (predecessor; distance to A).
Iteration
B
C
D
E
Initialization (-1; ) (-1; ) (-1; ) (-1; )
1
2
3
4

M
{}

3
E

3
1

M = set of considered nodes

11/28/2016

DR. PHUONG NGA TRAN - EEIT

23

Bellman Ford Algorithm


More general than Dijkstras algorithm:
Link cost can be negative
Detects the existence of negative-cost cycle(s) reachable
from a single source.
If one negative cost cycle reachable from the source exists, there
is no cheapest path.

Applied for directed graphs

11/28/2016

DR. PHUONG NGA TRAN - EEIT

24

12

11/28/2016

Bellman-Ford Algorithm
INITIALIZATION
(1) = 1
(1) = 0
for

= 2

RELAX EDGES REPEATEDLY


=1

for

1 do

for each edge ( , ) do

do

if

<
=

= 1

() =
CHECK FOR NEGATIVE-COST CYCLE
for each edge ( , ) do

N: number of nodes
d(i): distance from I to the source
p(i): predecessor node of i on the
path from the source to i

if

<

error graph contains negative cycle

11/28/2016

25

DR. PHUONG NGA TRAN - EEIT

Bellman-Ford Algorithm
5

2
6
1

3
-2
-3

-4
2

Sequence of considered links: (1-2); (2-3); (4-3); (5-4); (5-3); (2-5); (4-1); (1-5); (2-4); (3-2)

11/28/2016

DR. PHUONG NGA TRAN - EEIT

26

13

11/28/2016

Bellman-Ford Algorithm
5

2
6
1
(Source)

11

-3

-2

-4

2
7
7

Sequence of considered links: (1-2); (2-3); (4-3); (5-4); (5-3); (2-5); (4-1); (1-5); (2-4); (3-2)

11/28/2016

27

DR. PHUONG NGA TRAN - EEIT

Bellman-Ford Algorithm
5

2
6
1
(Source)

-3

-2

7
7

-4

Sequence of considered links: (1-2); (2-3); (4-3); (5-4); (5-3); (2-5); (4-1); (1-5); (2-4); (3-2)

11/28/2016

DR. PHUONG NGA TRAN - EEIT

28

14

11/28/2016

Bellman-Ford Algorithm
5

2
6
1
(Source)

-3

-2

7
7

-4
-2

Sequence of considered links: (1-2); (2-3); (4-3); (5-4); (5-3); (2-5); (4-1); (1-5); (2-4); (3-2)

11/28/2016

29

DR. PHUONG NGA TRAN - EEIT

Bellman-Ford Algorithm
5

2
6
1
(Source)

-3

-2

7
7

-4

-2

Sequence of considered links: (1-2); (2-3); (4-3); (5-4); (5-3); (2-5); (4-1); (1-5); (2-4); (3-2)

11/28/2016

DR. PHUONG NGA TRAN - EEIT

30

15

11/28/2016

Exercise
Use Bellman Ford algorithm to compute the shortest path from node 1 to all other nodes

3
2

1 0
Source

11/28/2016

31

DR. PHUONG NGA TRAN - EEIT

Proof of Bellman Ford Algorithm


Lemma 1: Upper Bound Property

( )

We always have ( ) ( , ) and if we ever find


=
never changes ( , is the shortest distance from to ).

, ( )

Proof:
At iteration 0,

= 0,

Assume that after k iterations,

( ) and

( )

At iteration k+1
- By triangle inequality,
- If ( ) = ( ) +

( )

( )+

If we ever achieve ( ) = ( , ), we cannot decrease ( ) since we have


just shown that ( ) ( , ). Moreover, we cannot increase ( ) because
we only change d[v] at an iteration if ( ) decreases. Therefore, once we have
( ) = ( , ), it cannot change.
11/28/2016

DR. PHUONG NGA TRAN - EEIT

32

16

11/28/2016

Proof of Bellman Ford Algorithm


Lemma 2: Path relaxation
Assume we have a graph G with no negative cycles. Let = ( , , , . . ) be a
shortest path from to . If edges are relaxed in the order
( , ), ( , ), , (
, ),
will be the shortest distance from to
(
=
0,
) after all of these relaxations and at all times afterwards. Note
that this property holds regardless of what other relaxation calls are made before,
during, or after these relaxations.

Proof:
Base case: at iteration 0 (initialization) ( ) = 0 = ( , )
Assume that we have relaxed, in order, edges ( ,
= ( ,
).
We have

Before edge (

=
,

after relaxing edge


11/28/2016

) is relaxed,
,

), ( ,

), , (

), and

because p is the shortest path.

(upper bound property)

,
,

DR. PHUONG NGA TRAN - EEIT

33

Proof of Bellman Ford Algorithm


Lemma 3: Bellman-Ford Correctness
Assume we have a graph with no negative cycles reachable by . Then after
running Bellman-Ford, we have ( ) = ( , ) for all reachable from .
Proof:
If is reachable from then there must exist an acyclic shortest path =
( , , , . . ) where
= . Now, since is acyclic, can contain no more
than vertices and therefore no more than | | 1 edges.
At each iteration of Bellman-Ford, we relax every edge. Therefore, we relax
( , ) on the first iteration, ( , ) on the second iteration, etc (we also relax
( , )on the first iteration, of course, but we cannot guarantee that relaxation
comes after the relaxation of( , ). By the time we have reached the | |
1 iteration, we must have relaxed every edge in in order. Therefore, by the
path relaxation property, we have ( ) = ( , ) when we have done | |
1 iterations
11/28/2016

DR. PHUONG NGA TRAN - EEIT

34

17

11/28/2016

Summary of Bellman Ford Algorithm


Like Dijkstra algorithm, Bellman Ford is based on the principle
of relaxation, in which an approximation to the correct distance is
gradually replaced by more accurate values until eventually
reaching the optimum solution.
Bellman Ford algorithm simply relaxes all the edges and does
this 1 times ( is the number of nodes).
In each repetition, the number of nodes with correctly calculated
distances grows, from which it follows that eventually all nodes will
have their correct distances.
BellmanFord algorithm can be applied to a wider class of inputs
than Dijkstra, i.e. negative link cost.
The complexity of Bellman Ford algorithm is ( )
11/28/2016

DR. PHUONG NGA TRAN - EEIT

35

36

Distributed Routing
In a network with distributed routing each node follows a
routing algorithm (e.g. Dijkstra's) and creates his local routing
table.
This information is periodically sent to all neighbours.
After some time each node knows the shortest path to all
destinations.
The periodic updates guarantee the adaptability to failing
links or nodes.
11/28/2016

DR. PHUONG NGA TRAN - EEIT

18

11/28/2016

Distributed routing
Distance vector routing protocol
Link state routing protocol

11/28/2016

DR. PHUONG NGA TRAN - EEIT

37

Distance vector routing


Each node constructs a one-dimensional array containing the
distances or costs to all other nodes (as it relates to its
knowledge) and distributes it to its immediate neighbors.
Key thing -- each node knows the cost of links to its
neighbors.
If no link exists between two nodes, the cost of a direct link
between the nodes is infinity.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

38

19

11/28/2016

39

Distance vector routing


In distance-vector routing the information sent to the
neighbours is a set of pairs (destination, distance) of all other
nodes.
The receiving node checks:
whether for a given destination the advertised distance agrees
with its own findings or
whether a routing via the sender of the information is
advantageous.
Distance vector routing uses Bellman
11/28/2016

Ford algorithm

DR. PHUONG NGA TRAN - EEIT

Example
A

B
A

C
D

E
F

1
0

Internal Information at each node

11/28/2016

DR. PHUONG NGA TRAN - EEIT

40

20

11/28/2016

Example
Cost

Next
Hop

B
A

C
D

E
F

With the initial information,


routing table at A is as above
11/28/2016

41

DR. PHUONG NGA TRAN - EEIT

Example
Each node sends a message to neighbors
with a list of distances.
Once a node receives a message from its
neighbours, it updates the distance as
follow
= min{

B
A

C
D

E
F
11/28/2016

Cost

Next
Hop

G
DR. PHUONG NGA TRAN - EEIT

42

21

11/28/2016

Convergence
In the absence of topological changes -- few exchanges
between neighbors before complete routing table is formed.
This table is consistent.
Convergence is achieved.
Notice -- no centralized authority

11/28/2016

DR. PHUONG NGA TRAN - EEIT

43

Routing updates
When are routing updates sent ?

Periodic updates
Even if nothing has changed, send periodically. Main
reason is to let other nodes know that the sender is alive.
Refresh information that might be needed if some of the
routes were to become unavailable.

Triggered updates
When a node receives an update from one of its
neighbors which may lead to a change in its routing tables
(could be due to change in link cost).

Note: typically order of periodicity is seconds to several


minutes.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

44

22

11/28/2016

Link/Node Failures
Nodes that first notice send new lists of distances to neighbors.
How do they detect failures ?
Route updates dont arrive
Probing with test packets.

11/28/2016

45

DR. PHUONG NGA TRAN - EEIT

Example revisited
Let link from F to G fail.
F sets new distance to G to ; sends update to A.
A was ini ally rou ng to G via F. So it now sets link cost to G to .
Next update from C; A learns that C has 2 hop path to G.
A now can reach G in 3 hops via C.
A sends an update to F. Thus, F now, can reach G via A in 4 hops.
B
A

C
D

E
F
11/28/2016

DR. PHUONG NGA TRAN - EEIT

G
46

23

11/28/2016

Count to infinity problem


A discovers that link to E is lost.

The process continues


and thus, the system
does not stabilize.

If before As message (saying that link cost to


E is ) is received, if B or C adver se that
they can reach E in two hops, then A can be
confused.

This is the count to


infinity problem.

Another possibility, B gets As update


followed by Cs update which says that E is
reachable in 2 hops.
So B tells A this, and A thinks it can now
reach E via B in 3 hops.
This information reaches C who now thinks
that it can reach E in 4 hops via A.

11/28/2016

B
A

C
D

E
F

DR. PHUONG NGA TRAN - EEIT

47

Solution for Count to Infinity Problem


Split Horizon
With Poison reverse

With Split Horizon, when a node sends a routing table


update to its neighbors, it does not send those routes it
learned from a particular neighbor, back to that neighbor.
For example, node A had a route to D via C with the distance of
2. When it sends a route update to C, it does not include this.

With split horizon with poison reverse, this update is


reported but the link weight is set to .
For example A sends (D, ) to C.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

48

24

11/28/2016

Link State Routing


Initial state : similar to distance vector i.e., state of link to
neighbors known (up/down).
Goal: To find the path of least cost to destination.
Basic Idea -- Every node knows how to reach its neighbors.
If this info is dissemination to every node, every node
ultimately has the information to build the complete map
of the network.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

49

Link State Routing - Mechanism


Two mechanisms:
Reliable dissemination of link state information -- process
is called reliable flooding.
calculation of routes using the collected information -- the
computation is based on Dijkstras algorithm.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

50

25

11/28/2016

Reliable flooding
Process of making sure that all the nodes
participating in the link state routing protocol get a
copy of the link-state information from all other
nodes.
Each node sends out link-state information on its
directly connected links.
Each node that receives this, forwards it.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

51

Link State Information


Each node creates a link-state packet (LSP) that contains:
ID of the node that created LSP
a list of directly connected nodes and the cost to each node.
sequence number
TTL

11/28/2016

for reliability

DR. PHUONG NGA TRAN - EEIT

52

26

11/28/2016

Example
X receives LSP from some node Y.
X checks to see if it already has
an update from Y. If it does, it
compares the sequence number
in the new LSP to the one stored.
If New seq no < Old sequence
number, then, discard LSP.
Else -- store LSP and send the LSP
to all neighbors except the one
that sent the LSP.

(a)

(b)

(c)

(d)

If no update from Y, keep it.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

53

Dissemination of LSPs
LSPs are sent periodically (upon the expiry of a timer) or may be
triggered due to a change in topology
The only topology change that triggers the creation of a new LSP is a
change to one of the directly connected links.
Failures detected by link layer protocol by using what are known as HELLO
packets -- probes to determine if neighbor is alive.

To minimize overhead, LPSs are not created unless needed -periodicity is of the order of hours.
Sequence numbers help in identifying new info and TTL helps in
ensuring that packets dont stay in the network indefinitely.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

54

27

11/28/2016

55

Stability and convergence problems


If the distances (costs) are traffic intensity dependent,
shortest path routing will have stability problems.
However, it makes sense to route traffic to links which are
less loaded than others!

11/28/2016

DR. PHUONG NGA TRAN - EEIT

56

Stability and convergence problems


Example:

D i
i

Destination

1
Step 1
Initial routing

3+

2+

2
2

1+

11/28/2016

DR. PHUONG NGA TRAN - EEIT

28

11/28/2016

57

Stability and convergence problems


Example:

D i
i

Destination

1
Step 2
First rerouting

8
1

4+

3+

2+
3

1+

DR. PHUONG NGA TRAN - EEIT

11/28/2016

58

Stability and convergence problems


Example:

D i
i

Destination

1
Step 3
Second rerouting

6+

5+

1
2

4+

11/28/2016

3+

DR. PHUONG NGA TRAN - EEIT

29

11/28/2016

59

Stability and convergence problems


Example:

D i
i

Destination

1
Step 4
Third rerouting

8
1

6+

5+

4+
3

1
11/28/2016

3+

Oscillatory Routing!

DR. PHUONG NGA TRAN - EEIT

60

Stability and convergence problems


To damp oscillations one strategy could be to stagger the
rerouting times in such a way that only a subset of nodes is
allowed to change the routing

11/28/2016

DR. PHUONG NGA TRAN - EEIT

30

11/28/2016

Comparing Distance Vector and Link State


In distance vector depends on relative path costs -- count to
infinity problem.
However, link state suffers from oscillations.
Link state is stable since computation done at each node -distance vector could lead to problems if there are malfunctioning
routers.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

61

Broadcast Routing
Broadcast applications exist:
in the management of networks, e.g. updates of databases and
routing tables;
at application level e.g. mail applications or radio programs.
A broadcast method that does not need any new feature is to send a
distinct packet to each user. Seen from the resource consumption this
is the least desirable method.
A more suitable method might be flooding where a packet is output
to every port besides the one it entered the node.
Obviously flooding needs a termination criterion, e.g. a hop count.
Flooding also suffers from an abundant generation of packets.
11/28/2016

DR. PHUONG NGA TRAN - EEIT

62

31

11/28/2016

Broadcast Routing
Flooding example

5
7

6
4
2

11

10

13

12

11/28/2016

63

DR. PHUONG NGA TRAN - EEIT

Broadcast Routing
A more appropriate method is to use a spanning tree.
A spanning tree is a subset of a network that includes all nodes but
contains no loops
B

E
H

D
F
G
I

L
O

K
M

Each node must know some spanning tree.


With link state routing easily available!
With distance vector routing alone - not available!
11/28/2016

DR. PHUONG NGA TRAN - EEIT

64

32

11/28/2016

Broadcast Routing
Reverse path forwarding: When a broadcast packet arrives at a router,
the router checks if the packet arrived on the port that is normally
used for sending the packet to the source of the broadcast (in our
example: I).
If so, it is forwarded to all other ports.
Otherwise the packet is discarded.
B

L
O

K
M

Assume hop count metric

11/28/2016

65

DR. PHUONG NGA TRAN - EEIT

Routing in Global Internet


A routing protocol allows one router to exchange routing

information with another

However, such a scheme cannot scale to the entire Internet

if a router in the Internet attempted to exchange routing


information with all other routers, the resulting traffic would
overwhelm the Internet
To limit routing traffic

The Internet uses a routing hierarchy


Routers and networks in the Internet are divided into groups
All routers within a group exchange routing information
Then, at least one router (possibly more) in each group
summarizes the information before passing it to other groups

11/28/2016

DR. PHUONG NGA TRAN - EEIT

66

33

11/28/2016

Routing in Global Internet


How large is a group?

What protocol do routers use within a group?


What protocol do routers use between groups?
The designers of the Internet routing system did not dictate an exact
size nor did they specify an exact data representation or protocol
Instead, the designers purposefully kept the architecture flexible
enough to handle a wide variety of organizations
For example, to accommodate organizations of various size
the designers avoided specifying a minimum or maximum size for a
group
To accommodate arbitrary routing protocols
the designers decided to permit each organization to choose a routing
protocol independently
11/28/2016

67

DR. PHUONG NGA TRAN - EEIT

Routing in Global Internet

Autonomous System 1

Autonomous System 3

Autonomous System 3
11/28/2016

DR. PHUONG NGA TRAN - EEIT

68

34

11/28/2016

Autonomous System
Term Autonomous System (AS) to specify groups of routers
One can think of an AS as a contiguous set of networks and routers
all under control of one administrative authority
There is no exact meaning for administrative authority
The term is sufficiently flexible to accommodate many possibilities
For example, an AS can correspond to an ISP, an entire corporation, or
a university
Alternatively, a large organization with multiple sites may choose to
define one AS for each site
In particular, each ISP is usually a single AS, but it is possible for a large
ISP to divide itself into multiple ASs

The choice of AS size can be made for


economic, technical, or administrative reasons
11/28/2016

DR. PHUONG NGA TRAN - EEIT

69

Autonomous System
For example
consider a multi-national corporation
It may be less expensive for the corporation to divide into multiple
ASs, each of which has a connection to an ISP in a given country,
than to act as a single AS with one connection to the rest of the
Internet
Another reason for a specific size arises from the routing protocol
to be used
a protocol may generate excessive routing traffic when used on
many routers
(i.e., routing traffic may grow as the square of the number of
routers)

11/28/2016

DR. PHUONG NGA TRAN - EEIT

70

35

11/28/2016

Types of Internet Routing Protocols

Some typical routing protocols. There are in practice much more.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

71

Interior Gateway Protocols (IGPs)


Routers within an Autonomous System (AS) use an IGP
exchange routing information
Several IGPs are available
each AS is free to choose its own IGP
Usually, an IGP is easy to install and operate
IGP may limit the size or routing complexity of an AS

11/28/2016

DR. PHUONG NGA TRAN - EEIT

72

36

11/28/2016

Exterior Gateway Protocols (EGPs)


A router in one AS uses an EGP to exchange routing
information with a router in another AS
EGPs are more complex to install and operate than IGPs
but EGPs offer more flexibility and lower overhead (i.e.,
less traffic)
To save traffic
an EGP summarizes routing information from an AS before
passing it to another AS
An EGP implements policy constraints
that allow a system manager to determine exactly what
information is released outside the organization

11/28/2016

73

DR. PHUONG NGA TRAN - EEIT

Illustration of IGPs and EGPs


IGP 3
IGP 1
EGP
Autonomous System 1

Autonomous System 3

IGP 2
Autonomous System 3

two-level routing hierarchy used in the Internet


11/28/2016

DR. PHUONG NGA TRAN - EEIT

74

37

11/28/2016

Illustration of IGPs and EGPs


AS1 has chosen IGP1 to use internally, and AS2 has chosen IGP2
All routers in AS1 communicate using IGP1
All routers in AS2 communicate using IGP2
Border routers use an EGP to communicate between the two
ASs
That is, a border router must summarize information from its
AS and sends the summary to a border router of another AS.
In addition, the received summary is propagated to all
routers in an AS using its own IGP
11/28/2016

DR. PHUONG NGA TRAN - EEIT

75

IGPs vs. EGPs


IGPs and EGPs differ in an important way with respect to routing
metrics:
IGPs use routing metrics, but EGPs do not
each AS chooses a routing metric and arranges internal routing software
to send the metric with each route so receiver can use the metric to
choose optimal paths

Each AS is free to choose a routing metric


Outside an AS, an EGP does not attempt to choose an optimal path
Instead, the EGP merely finds a path

An EGP cannot make meaningful comparisons

Suppose one AS reports the number of hops along a path to destination D


and another AS reports the throughput along a different path to D
An EGP that receives the two reports cannot choose which of the two
paths has least cost because there is no way to convert from hops to
throughput

Thus, an EGP can only report the existence of a path and not its cost
11/28/2016

DR. PHUONG NGA TRAN - EEIT

76

38

11/28/2016

Border Gateway Protocol (BGP)


BGP is the most widely used EGP in the Internet
Goal of BGP is modest:
any loop free path is to be found between the source and destination

Routing Among AS
Because it is intended for use as an EGP
BGP provides routing information at the AS level
No way for BGP to provide details about the routers within each AS on
the path
Provision for Policies
BGP allows the sender and receiver to enforce policies
a manager can configure BGP to restrict which routes BGP advertises
to outsiders
11/28/2016

DR. PHUONG NGA TRAN - EEIT

77

Border Gateway Protocol (BGP)


Reliable Transport
BGP uses TCP for all communications
a BGP program on a router in one AS forms a TCP connection to a
BGP program on a router in another AS and then sends data across
the connection

BGP provides the glue that holds Internet routing together


at the center of the Internet
Tier-1 ISPs use BGP to exchange routing information and learn
about each other's customers

11/28/2016

DR. PHUONG NGA TRAN - EEIT

78

39

11/28/2016

Border Gateway Protocol (BGP)


Facilities for Transit Routing
BGP classifies each AS
as a transit system if it agrees to pass traffic through to another AS or
as a stub system if it does not

Traffic passing through on its way to another AS is classified as


transit traffic
Classification allows BGP to distinguish between ISPs and other
AS
BGP allows a corporation to classify itself as a stub
even if it is multi-homed (i.e., a corporation with multiple external
connections can refuse to accept transit traffic)

11/28/2016

DR. PHUONG NGA TRAN - EEIT

79

BGP in details
BGP supports flexibility -- paths could be chosen by a
provider based on a policy.
To configure BGP, each AS admin picks at least one node to
be the BGP speaker -- a spokesperson node for the entire
AS.
The BGP speaker establishes a BGP session with other BGP
speakers in other ASes.

Source advertises complete paths (unlike distance vector or


link state routing) -- thus loops are prevented.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

80

40

11/28/2016

Example
AS 2 says 128.96, 192.4.15, 192.4.32, 192.4.3 can be reached
via AS 2.
AS 1 advertises that these networks can be reached via <AS1,
AS2> --note full path description.
Loops are avoided.
Regional provider A
(AS 2)
Backbone network
(AS 1)
Regional provider B
(AS 3)

11/28/2016

DR. PHUONG NGA TRAN - EEIT

Customer P
(AS 4)

128.96
192.4.153

Customer Q
(AS 5)

192.4.32
192.4.3

Customer R
(AS 6)

192.12.69

Customer S
(AS 7)

192.4.54
192.4.23

81

BGP path attributes


In many cases, there will be multiple routes to the same
destination. BGP therefore uses path attributes to decide how
to route traffic to specific networks.
The easiest of these to understand is Shortest AS_Path. What
this means is the path which traverses the least number of AS
"wins."
Another important attribute is Multi_Exit_Disc (Multi-exit
discriminator, or MED). This makes it possible to tell a remote
AS that if there are multiple exit points on to your network, a
specific exit point is preferred.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

82

41

11/28/2016

BGP Messages
BGP has four types of messages
OPEN: Establish a connection with a BGP peer
Note: BGP connection is TCP based ! (Port no. 179).

UPDATE -- advertise or withdraw routes to a destination


Note --BGP speaker needs to be able to cancel previously

advertised paths if nodes or links fail. This form of negative


advertisements are said to advertise withdrawn routes.

KEEPALIVE: Inform a peer that the sender is still alive but


has no information to send.
NOTIFICATION: Notify that errors are detected.
11/28/2016

DR. PHUONG NGA TRAN - EEIT

83

Routing with BGP


For stub AS -- border router injects a default route into the
intra-domain routing protocol.
If there are more than one border router, each injects
specific routes that they have learned from outside the AS.
IBGP or Interior BGP is used to distribute the information to
all other routers in the domain (and the speaker).

11/28/2016

DR. PHUONG NGA TRAN - EEIT

84

42

11/28/2016

BGP issues
Routing table growth.
If a network operator decides to deaggregate a network that used to be a
single into multiple networks, they could potentially start advertising hundreds
of new routes. Every router on the Internet will get every new route when this
happens.

Someone will "advertise the Internet."


If some large ISP's customer suddenly decides to advertise everything, and the
ISP accepts the routes, all of the Internet's traffic will be sent to the small
customer's AS.
A solution is route filtering. It's quite simple to set up filters so that your
routers won't accept routes from customers that you aren't expecting, but
many large ISPs will still accept the equivalent of "default" from peers that
have no likelihood of being able to provide transit.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

85

BGP issues
Flapping.
BGP has a mechanism to "hold down" routes that appear to be flaky.
Routes that flap, or come and go, usually aren't reliable enough to send
traffic to. If routes flap frequently, the load on all Internet routes will
increase due to the processing of updates every time someone
disappears and reappears.
Dampening will prevent BGP peers from listening to all routing updates
from flapping peers. The amount of time one is in hold-down increases
exponentially with every flap.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

86

43

11/28/2016

Routing Information Protocol (RIP)


RIP is a simple interior gateway routing protocol
Built based on distance vector routing.
RIP is included as part of the UNIX software delivered with
most systems.
It is adequate for local area networks and is simple to
configure.
RIP selects the route with the lowest "hop count" ( metric )
as the best route

11/28/2016

87

DR. PHUONG NGA TRAN - EEIT

An Example of RIP
Routers advertise the cost of
reaching networks.
In this example, Cs update to A
would indicate that C can reach
Networks 2 and 3 with cost 0,
Networks 5 and 6 with cost 1 and
Network 4 with cost 2.

4
A

Distance vector routing

11/28/2016

DR. PHUONG NGA TRAN - EEIT

88

44

11/28/2016

Other RIP Details


Routing tables are exchanged every 30 seconds using the RIP
advertisement.
If a router does not hear from its neighbor once every 180
seconds, the neighbor is deemed unreachable.
The router that detects the failure will modify its routing
table and propagate the information.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

89

RIP implementation
RIP packets are sent using UDP.
Typically, there is a routing daemon (routed) that is an
application layer process that provides access to routing
tables.
Allows for the access of the tables.
The protocol is limited to networks whose longest path is 15
hops.
The designers believe that the basic protocol design is
inappropriate for larger networks.
11/28/2016

DR. PHUONG NGA TRAN - EEIT

90

45

11/28/2016

RIP implementation
RIP uses numerous timers to regulate its performance.
These include a routing-update timer, a route timeout, and a routeflush timer.
The routing-update timer clocks the interval between periodic
routing updates. Generally, it is set to 30 seconds, with a small
random number of seconds added each time the timer is reset to
prevent collisions.
Each routing-table entry has a route-timeout timer associated with
it. When the route-timeout timer expires, the route is marked
invalid but is retained in the table until the route-flush timer
expires.
11/28/2016

DR. PHUONG NGA TRAN - EEIT

91

Open Shortest Path First (OSPF)


Motivation
Original IGP used was RIP
Based on Bellman-Ford Algorithm
Worked well in small systems
Suffered from problems of Distance Vector Protocol
Large update packet packets
Slow response to topological changes
Slow Convergence

Need for a Link State Protocol


11/28/2016

DR. PHUONG NGA TRAN - EEIT

92

46

11/28/2016

Open Shortest Path First


OSPF is based on the link-state routing protocol
OSPF is the most widely used IGP
A hierarchy is added -- OSPF runs within a domain or
administrative region. The region is sub-divided into areas.
Router does not need to know how to get to every network
within the domain -- enough to know how to get to right
area.
Load balancing - if two paths have same cost, subdivide
traffic among paths.
11/28/2016

93

DR. PHUONG NGA TRAN - EEIT

OSPF Areas
Network is subdivided into areas
One special area called backbone area.
(Area 0).

Area 3
Area 1
Area 0
R9

R7
R8

R3

R1

R4
R2
Area 2

Within each area -- link state routing.


Link state advertisements of non border
routers do not leave area.
Packet goes from non-backbone area to
backbone area and crosses the backbone
into the Internet.

R6

R5

A router that is a member of both


the backbone and a non-backbone
area (R1, R2, R3) is called a area
router.

47

11/28/2016

Areas (continued)
Border routers summarize routing information and make it
available to other areas -- act like proxies --reflect costs to
reach networks from an area.
When there are many possible routes, routers choose cost
info to forward packets.
As a result of the hierarchy, OSPF can scale to handle much
larger AS than other routing protocols
Trade-offs -- Optimality versus scalability
All packet have to pass through the backbone area (may not be
optimal).

OSPF metrics
How does one assign link costs ?
Costs distinguish between different physical links.
Count the number of queued packets --does not take
bandwidth or latency into consideration.
Latency on the link.
Each incoming packet time-stamped. There is an associated
transmission time and propagation latency -- static for the
link.
Delay = (Depart time - Arrival time) + transmission time +
prop. latency.

11/28/2016

DR. PHUONG NGA TRAN - EEIT

96

48

11/28/2016

OSPF Hello Message


Hello messages are used to allow a router to discover other adjacent
routers on its local links and networks.
During normal operation, routers send hello messages to their
neighbors at regular intervals (the hello interval).
If a router stops receiving hello messages from a neighbor, after a set
period (the dead interval) the router will assume the neighbor has
gone down.
These intervals must be the same on all routing devices on a shared
network. By default, the routing device sends hello packets every 10
seconds (broadcast and point-to-point networks) and 30 seconds
(nonbroadcast multiple access (NBMA) networks). By default, the dead
interval is four times the default hello interval, which is 40 seconds
(broadcast and point-to-point networks) and 120 seconds (NBMA
networks).
11/28/2016

DR. PHUONG NGA TRAN - EEIT

97

Further reading
To understand more about a specific routing protocol, you
should read its RFC (Request for Comments), a formal
document from the Internet Engineering Task Force ( IETF )
that is the result of committee drafting and subsequent
review by interested parties.
https://www.ietf.org/rfc.html

11/28/2016

DR. PHUONG NGA TRAN - EEIT

98

49

Vous aimerez peut-être aussi