Académique Documents
Professionnel Documents
Culture Documents
Digital Routing
ROUTING IN IP NETWORKS
11/28/2016
Content
Introduction
Single path routing
Broadcast
11/28/2016
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
11/28/2016
6
3
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.
11/28/2016
Routing table
2
Destination node
Next node
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
Routing Algorithm
Major concerns when developing such an algorithm:
correctness
complexity
stability
fairness
none
only local information
from adjacent nodes
from a subset of nodes
from all nodes
11/28/2016
11/28/2016
Routing Algorithm
Routing strategy
Decision place
static
each node
adaptive, updates:
central node
continuous
source node
periodic
subset of nodes
Decision time
packet (datagram)
session (virtual circuit)
11/28/2016
10
Euclidian distance
number of hops
tariffs for links, etc.
link utilization
or any other measure derived from the above.
10
11/28/2016
11
3
Network topology
Note! The cost matrix is in general symmetric with
respect to its main diagonal.
Cost matrix
11/28/2016
11
12
costs Min
links
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
12
11/28/2016
13
Let
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 )
13
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,)
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
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)
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
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)
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)
19
20
10
11/28/2016
21
N: number of nodes
V: set of all nodes
M: set of considered nodes
11/28/2016
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
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
11/28/2016
23
11/28/2016
24
12
11/28/2016
Bellman-Ford Algorithm
INITIALIZATION
(1) = 1
(1) = 0
for
= 2
for
1 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
<
11/28/2016
25
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
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
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
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
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
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
( )
, ( )
Proof:
At iteration 0,
= 0,
( ) and
( )
At iteration k+1
- By triangle inequality,
- If ( ) = ( ) +
( )
( )+
32
16
11/28/2016
Proof:
Base case: at iteration 0 (initialization) ( ) = 0 = ( , )
Assume that we have relaxed, in order, edges ( ,
= ( ,
).
We have
Before edge (
=
,
) is relaxed,
,
), ( ,
), , (
), and
,
,
33
34
17
11/28/2016
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
18
11/28/2016
Distributed routing
Distance vector routing protocol
Link state routing protocol
11/28/2016
37
11/28/2016
38
19
11/28/2016
39
Ford algorithm
Example
A
B
A
C
D
E
F
1
0
11/28/2016
40
20
11/28/2016
Example
Cost
Next
Hop
B
A
C
D
E
F
41
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
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).
11/28/2016
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
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
G
46
23
11/28/2016
11/28/2016
B
A
C
D
E
F
47
11/28/2016
48
24
11/28/2016
11/28/2016
49
11/28/2016
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
51
11/28/2016
for reliability
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)
11/28/2016
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
54
27
11/28/2016
55
11/28/2016
56
D i
i
Destination
1
Step 1
Initial routing
3+
2+
2
2
1+
11/28/2016
28
11/28/2016
57
D i
i
Destination
1
Step 2
First rerouting
8
1
4+
3+
2+
3
1+
11/28/2016
58
D i
i
Destination
1
Step 3
Second rerouting
6+
5+
1
2
4+
11/28/2016
3+
29
11/28/2016
59
D i
i
Destination
1
Step 4
Third rerouting
8
1
6+
5+
4+
3
1
11/28/2016
3+
Oscillatory Routing!
60
11/28/2016
30
11/28/2016
11/28/2016
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
62
31
11/28/2016
Broadcast Routing
Flooding example
5
7
6
4
2
11
10
13
12
11/28/2016
63
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
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
11/28/2016
65
11/28/2016
66
33
11/28/2016
67
Autonomous System 1
Autonomous System 3
Autonomous System 3
11/28/2016
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
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
70
35
11/28/2016
11/28/2016
71
11/28/2016
72
36
11/28/2016
11/28/2016
73
Autonomous System 3
IGP 2
Autonomous System 3
74
37
11/28/2016
75
Thus, an EGP can only report the existence of a path and not its cost
11/28/2016
76
38
11/28/2016
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
77
11/28/2016
78
39
11/28/2016
11/28/2016
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.
11/28/2016
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
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
11/28/2016
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).
83
11/28/2016
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.
11/28/2016
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
86
43
11/28/2016
11/28/2016
87
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
11/28/2016
88
44
11/28/2016
11/28/2016
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
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
91
92
46
11/28/2016
93
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
R6
R5
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
96
48
11/28/2016
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
98
49