Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Chapter 13
Routing
Protocols
(RIP, OSPF, BGP)
McGraw-Hill
13-2
Flooding
Distance vector routing
Link state routing
Path Vector Routing
McGraw-Hill
SDSU
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-3
Flooding
Simple algorithm that doesn't require any information about the network:
Source transmits a copy of the packet to all of its neighbors.
Each neighbor retransmits the received packet to all of its neighboring nodes,
except to the node from which it received the packet. So does every node in the
network. After a while, the nodes will start receiving duplicates. The intermediate
nodes do not retransmit the duplicates. The destination node drops all duplicates
and keeps only the first packet received.
Refinement: The TTL field is set by the source node to some desired value
(maximum allowable number of hops), and decremented by the intermediate nodes.
When TTL reaches zero, the packet is dropped. This keeps the traffic lower.
Very robust routing strategy: it will guarantee that a packet will arrive if there is
enough connectivity. Also, there will be a packet that has arrived through a minimal
number of hops - which establishes the minimal-hop route.
Dissadvantage: the algorithm creates to much traffic.
McGraw-Hill
SDSU
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-4
Each node collects the knowledge of the entire network, and shares it periodically (e.g.
every 30 seconds) only with its neighbors. The knowledge is a sequence of messages:
McGraw-Hill
SDSU
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-5
Distance vector routing algorithm was first used in ARPANET. Since the transfer
of knowledge between nodes (one hop) takes 30 seconds, this can cause large
delays in large networks, and consequently inconsistent network status in
different parts of the network. Also, the algorithm doesn't take into account the
link length and its bandwidth.
The drawbacks of DV routing can be summarised as:
McGraw-Hill
SDSU
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-6
McGraw-Hill
13-7
Distance vector
Routing Table
13-8
Case a
Case b
McGraw-Hill
DV Routing (cont.)
13-9
Updating RT (Cont.)
4
Router X
Case a
Network N
1
Router A
Updated RT of A
A!N via X cost = 5
.................
replace
increment
X ! N cost = 5
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
DV Routing (cont.)
Updating RT
4
Router X
Case b
Router A
Network N
1
Router Y
RT of A
Updated RT of A
A!N via Y cost = 3
.................
minimize
13-10
increment
X ! N cost = 5
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
DV Routing (cont.)
13-11
Old RT of router X
McGraw-Hill
New RT of router X
DV Routing (cont.)
13-12
McGraw-Hill
13-13
More recently proposed, and more efficient than distance vector routing. It was
designed to solve its scalability problem.
This algorithm has two parts: collecting the knowledge about the network, and
creating the optimal routing table. Knowledge is shared periodically (but on larger
intervals, e.g. 30 minutes) with the entire network. The knowledge of a given node
is restricted to its neighbors only. The message it uses to share the knowledge is
called: link state packet, which has the form:
McGraw-Hill
SDSU
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-14
The link cost is here more general, and takes care of delays, link length,
bandwidth, congestion. The LS packets are sent to all nodes by flooding.
Sending the LS packets is called advertisement. For example, if a new
node is introduced, the costs of its links to its neighbors are advertised
to everybody in the network. Similarly, if a link fails its infinite cost is
advertised. If nothing happens in a longer time, the knowledge is flooded
on a periodic basis, with much longer period than in DV routing (30 minutes
or even hours). This helps reducing the traffic in network.
McGraw-Hill
SDSU
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-15
After some time each link will have a complete table that describes the entire network
(the link state database). Example:
3
From node
3
-
1
2
4
6
4
1
1
2
3
4
5
6
1
2
2
7
5
1
7
4
5
4
1
1
-
The table shows how nodes are connected to each other: the number gives the link
cost between a node and its neighbor, while " " means no direct connection. (In the
case of large networks, this matrix is very sparse, so the LS database is implemented
as alinked list.)
The second part of the algorithm builds the routing tables. Each node uses its LS
database to generate the optimal routing table. The optimization is done by the popular
Dijkstra's shortest path algorithm. The optimal routing table is also dynamically updated,
in order to reflect the current status of the LS database.
McGraw-Hill
SDSU
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
McGraw-Hill
13-16
13-17
The Costs
Cost is associated with the
router interface (port)
McGraw-Hill
13-18
Flooding of As LSP
13-19
McGraw-Hill
13-20
So far we have discussed basic routing algorithms, like flooding, DV and LS.
(Path vector routing will be discussed later.) Further implementation and usage
of these algorithms will be discussed through concrete routing protocols such
as RIP, OSPF and BGP.
McGraw-Hill
13-21
Autonomous Systems
Networks are today enormously big which makes the routing
algorithms very difficult to implement. Therefore the networks are
divided into autonomous systems (AS) groups of networks and
routers under the authority of a single administration.
Routing inside an AS is called interior routing, while routing between
ASs is called exterior routing.
Hierarchical division is a standard way to cope with the scalability
problem.
McGraw-Hill
SDSU
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-22
interior routing
exterior routing
McGraw-Hill
13-23
Large corporation
Consumer ISP
Consumer ISP
Backbone ISP
Consumer ISP
Small corporation
Large corporation
13-24
13-25
The simplest and the most widely used routing protocol in IP networks.
Uses UDP for transport over the well-known port 520.
1 request
2 - response
Destination network
(uses network rather than
router address)
Request messages
13-26
Response messages
Response can be solicited or unsolicited.
Unsolicited responses are sent periodically every 30 sec
Com: 2
McGraw-Hill
13-27
Example 1
What is the periodic response sent by router R1 in figure below?
Assume R1 knows about the whole autonomous system.
13-28
McGraw-Hill
13-29
RIP timers
Timer per router.
Controls the advertising
(time is a random number
between 25-35 sec to avoid
synchronization)
13-30
Example 2
A routing table has 20 entries. It does not receive information about
five routes for 200 seconds. How many timers are running at this
time?
Solution:
21 timers:
Periodic timer: 1
Expiration timer: 20 - 5 = 15
Garbage collection timer: 5
McGraw-Hill
13-31
Drawbacks of RIP:
Slow convergence
Too simple metric
Instability
Scalability
McGraw-Hill
SDSU
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-32
Slow convergence
Periodic advertisement every 30 seconds,
average propagation time is 30/2 = 15 seconds
n x 15 s
Suppose there is a
change in network 1
Instability
13-33
McGraw-Hill
13-34
Remedies to Instability
Triggered updates
Split horizons
Split horizons with Poisoned reverse
McGraw-Hill
SDSU
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-35
Triggered Updates
If there is a change in the router sends the update immediately
instead of waiting the update time (30 sec). Each router that
receives information about change, forwards the update
immediately.
This helps in case from the previous slide, but doesnt help in case
of a router failure (because there is no one to report such change).
McGraw-Hill
SDSU
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-36
Split horizon
Router never advertises the cost of a destination to neighbor N
if N is the current next-hop for the destination
If a router has received an update from an interface, then this same update
information must not be forwarded back to the same interface.
B has received info about Net 1 and Net 2 through its left i/f. This info is forwarded
through the right i/f only.
Router A is closer to destination (Net 1) than the router B, therefore there is not
meaningful that B supplies A with information about something that is closer to A.
McGraw-Hill
13-37
The erroneous route will be eliminated within the interval of 180 seconds.
McGraw-Hill
13-38
A
Link
failure
McGraw-Hill
SDSU
C
A tells C: cost of route A to X is 16 (Unreachable)
A tells B: cost of route A to X is 16 (Unreachable)
B tells C: cost of route B to X is 3
(Split horizon
C tells A: cost of route B to X is 3
doesnt apply)
A updates its table: cost of A to X = min(16, 3+1) = 4
A tells C: cost of route A to X is 4
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-39
RIP-v2 Format
Up to 25 routes
RIP-2 supports:
" slit horizon with poisoned reverse,
" authentication,
" triggered updates,
" multicast routing,
" classless routing (CIDR).
McGraw-Hill
13-40
Authentication
Needed to protect against unauthorized advertisement.
(password)
13-41
RFC 1583
Interior routing protocol
Based on link state routing
Newer and more efficient than RIP
More scalable than RIP
Uses arbitrary metric (instead of only hop count)
Uses autonomous systems
Adds one more level of hierarchy: divides AS into areas
The OSPF messages are encapsulated into IP datagrams (OSPF
has its own error control implemented at the application layer)
McGraw-Hill
SDSU
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-42
An AS is divided into one primary area (backbone) and several secondary areas.
Routers in primary area are called backbone routers.
The routing information is flooded inside each area. The area border routers
summarize the area info and send it to the border routers of other areas via
backbone.
McGraw-Hill
13-43
Types of links
In view of OSPF an internet consists of networks and routers. Routers can be
connected directly or via networks. Networks are connected via routers. Therefore
there are different types of connections between routers.
McGraw-Hill
13-44
Point-to-point link
Routers are directly connected
Virtual link
If an area looses connectivity with the backbone area, the administrators
must create a virtual link between routers in order to enable the functionality
of the backbone.
McGraw-Hill
Transient link
13-45
13-46
Stub link
Server
McGraw-Hill
Server
13-47
Example of an internet
point-to-point link
Transient link
Stub link
Stub links
13-48
Types of LS advertisements
LSA
1
Advertisers
Area
real
router
Where to
flood
Area
Info about
how to
reach
Other
routers/
networks
in the area
McGraw-Hill
Area
designated
router
Area
border
routers
Area
border
routers
Area
Area
Area
Other
routers
connected
to network
Networks
in AS
Describes networks in
AS (outside area)
Boundary
routers
AS boundary
router
AS
Networks
in other AS
Describes location of AS
boundary
router
The
McGraw-Hill
Companies, Inc., 2000
13-49
Advertising router
is a true router. It floods
LSAs through its area about how to reach
other routers and networks connected to it.
McGraw-Hill
13-50
R1
DR
R3
R4
R5
13-51
Area border routers are active in two areas and create routing tables
for each of the area (e.g. R1 has RT0 and RT1, while R2 has RT0 and RT2).
R1 and R2 flood areas 1 and 2 respectively about how to reach N1.
McGraw-Hill
13-52
If a router inside an area wants to send a packet outside the AS it should know a
route to AS boundary router. This summary link provides link between the area
border routers and the AS border router.
McGraw-Hill
13-53
13-54
Area
Autonomous
System
a12
AS1
Internet
a11
Area Border
Router
a21
AS2
SLN
a10
a22
SLB
EL
Backbone
Area
a20
AS Boundary
Router
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-55
Example 3
In the figure below which router(s) sends out router link LSAs?
McGraw-Hill
13-56
Example 4
In the figure below which router(s) sends out network link LSAs?
Dijkstra Algorithm
13-57
6.
Start with the local node (router): the root of the tree;
Assign a cost of 0 to this node and make it the first permanent node;
Examine each neighbor node of the node that that was the last
permanent node;
Assign a cumulative cost to each node and make it tentative;
Among the list of tentative nodes:
1. Find the node with the smallest cumulative cost and make it
permanent;
2. If the node can be reached from more than one direction
1. select the direction with the shortest cumulative cost;
Repeat steps 3 to 5 until every node becomes permanent
McGraw-Hill
SDSU
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-58
Network
Cost
N1
N2
N3
10
N4
11
N5
15
McGraw-Hill
Next Router
McGraw-Hill
13-59
McGraw-Hill
13-60
13-61
McGraw-Hill
McGraw-Hill
13-62
McGraw-Hill
13-63
13-64
Network
Cost
Next Router
N1
N2
N3
10
N4
11
N5
15
13-65
Type 1
Type 2
Type 5
Type 3
Type 4
McGraw-Hill
13-66
Current OSPF
version is 2
Area identification
Header+data
McGraw-Hill
64 bits. 0s or
8 character password
0- none
1 - password
The McGraw-Hill Companies, Inc., 2000
Hello packet
13-67
13-68
When a router is booted (first time or after failure) it needs the complete LSDB
immediately (it cant wait for LS update packets). If a neighbor hears the first
time from the router (hello message) it sends LSDB description - not LSDB itself!
The receiving router can then decide what it needs and sends the LS requeast(s) to
get the full info about the link(s).
13-69
McGraw-Hill
13-70
Used by a router to advertise the state of its links the packet contains LSAs.
LSA
Contains:
LSA header
LSA data (router, network, summary, external)
McGraw-Hill
13-71
LSA header
Number of seconds since this message
was first generated (originating router
sets it to 0, other routers (in flooding)
adds the estimated transit time.
13-72
McGraw-Hill
Link State ID
Link Data
Point-to-point link
Address of neighbor
router
Interface
numbers
Transient link
Address to designated
router
Router
address
Network address
Network
address
Virtual link
Address of neighbor
router
Router
address
13-73
LSA Data
Router link LSA
Type of service:
normal (default),
minimize cost,
maximize reliability,
Maximize throughput,
Minimize delay
McGraw-Hill
13-74
Example 5
McGraw-Hill
13-75
Solution to Example 5
metric
Link type: stub
McGraw-Hill
13-76
McGraw-Hill
13-77
Example 6
The network, for which the network link advertises, has three routers
attached. The LSA shows the mask and the router addresses.
Note that only one of the routers, the designated router, advertises the
network link.
McGraw-Hill
13-78
13-79
McGraw-Hill
13-80
McGraw-Hill
13-81
McGraw-Hill
13-82
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-83
RFC 1771
Inter-AS routing protocol
First appeared in 1989
Routing method: path vector routing
BGP uses TCP with well known port 179
BGP supports classless addressing and CIDR
Path Vector Routing Table
McGraw-Hill
SDSU
Network
Next Router
Path
N1
R01
N2
R05
N3
R06
N4
R12
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-84
AS boundary routers advertise the reachability of a network in its AS to all its neighbors.
(Two AS boundary routers are neighbors if they are connected to the same network or if
they are connected by point-to-point connections.) Each AS b. router that receives the path
vector checks if the advertised path is in agreement with its policy (policy routing), if not it
will drop the message. Loops can easily be discovered by checking if an AS is already in
the path list and eliminated (loop prevention).
NOTE: There is still room for optimization. For example if R4 receives N1 R1 AS1 it
will choose that one and drop the path vector received from R3.
McGraw-Hill
13-85
McGraw-Hill
13-86
McGraw-Hill
13-87
Open message
Used to create neighborhood relationship.
BGP opens a TCP connection with a neighbor and sends the open message.
Neighbor answers with a keep-alive message
Current BGP
version is 4
McGraw-Hill
13-88
Update message
The length of the next fiel
13-89
Local Preference
Network 160.10.0.0/16 can be reached from AS 400 via two
routers A and B. There are two possibilities which can be
resolved with local reference attribute.
AS 100
160.10.0.0/16
AS 200
AS 300
160.10.0.0/16
LOAL_PREF = 500
McGraw-Hill
SDSU
AS 400
160.10.0.0/16
LOAL_PREF = 800
13-90
AS 200
C
192.68.1.0/24
MED = 2000
Preference to
entry point
192.68.1.0/24
MED = 1000
Entry point
Entry point
B
A
191.68.1.0/24
AS 201
McGraw-Hill
SDSU
The McGraw-Hill
Companies,
Marko Vuskovic,
Inc., 2000
2004
13-91
Keepalive message
BGP routers periodically inform each other about their presence. The
keepalive time is 1/3 of hold time (see open message). Max 1 sec. Only
header sent (with type = 3).
McGraw-Hill
Notification message
13-92
Examples of errors:
Synch problem, bad message length/type, unsupported
optional parameter, authentication failure, bad hold time,
unrecognized attribute, AS routing loop, invalid path attribute,
invalid network field,
McGraw-Hill