Fixed Internetworking Protocols and Networks

smashlizardsNetworking and Communications

Oct 29, 2013 (3 years and 5 months ago)

61 views

1| 2011 | ITIFN
Fixed Internetworking
Protocols and Networks
Link-state protocols and Open Shortest
Path First (OSPF)
Rune Hylsberg Jacobsen
Aarhus School of Engineering
rhj@iha.dk
2| 2011 | ITIFN
Objectives 
Describe the basic features & concepts of link-state
routing protocols.

List the benefits and requirements of link state routing
protocols and compare with distance vector protocols.

Describe the basic operation of link state protocol such
as neighbor discovery, flooding, exchange.

Learn to calculate routes by SPF algorithm.

Describe the background and basic features of OSPF.
3| 2011 | ITIFN
Distance vector versus link state routing 
With distance vector routing, each node has information
only about the next hop:

Node A: to reach F go to B

Node B: to reach F go to D

Node D: to reach F go to E

Node E: go directly to F

Distance vector routing makes
poor routing decisions if
directions are not completely
correct (e.g., because a node is down).

If parts of the directions is incorrect,
the routing may be incorrect until the
routing algorithms has re-converged.
A
B
C
E
F
D
4| 2011 | ITIFN
Distance vector versus link state routing 
In link state routing, each node has a complete map of
the topology.

If a node fails, each
node can calculate
the new route.

Challenge:
All nodes need
to have a consistent view
of the network.
A
B
C
D
E
F
A
B
C
D
E
F
A
B
C
D
E
F
A
B
C
D
E
F
A
B
C
D
E
F
A
B
C
D
E
F
A
B
C
E
F
D
5| 2011 | ITIFN
Classification of routing protocols

Link state routing protocols

Also known as shortest path first algorithms

These protocols built around Dijkstra’sSPF algorithm
Distance vector
routingprotocols
Link state routing
protocols
Exterior gateway
protocols path
vectors
RIPIGRPEGP
RIPv2EIGRPOSPFv2IS-ISBGPv4
RIPngEIGRP for
IPv6
OSPFv3IS-IS for
IPv6
BGPv4 for
IPv6
Classful
Classless
IPv6
6| 2011 | ITIFN
Link state routing: basic principles
1.
Each router establishes a relationship (“
adjacency
”)
with its neighbors (link state routers).
2.
Each router generates
link state advertisements
(LSAs)
which are distributed to all routers
1.
LSA = (link id, state of the link, cost, neighbors of the link).
3.
Each router maintains a database of all received LSAs
(
topological database
or
link state database
), which
describes the network as a graph with weighted edges.
4.
Each router uses its link state database to run a
shortest
path algorithm
(Dijikstra’salgorithm) to produce the
shortest path to each network.
7| 2011 | ITIFN
Link-state routing process 
Link state routing protocols reach convergence:

Each routers learns about its own directly connected networks.

Link state routers exchange hello packet to “meet” other
directly.

Connected link state routers.

Each router builds its own
Link State Packet
(LSP) which includes
information about neighbors such as neighbor ID, link type, &
bandwidth.

After the LSP is created the router
floods
it to all neighbors who
then store the information and then forward it until all routers
have the same information.

Once all the routers have received all the LSPs, the routers then
construct a
topological map
of the network which is used to
determine the best routes to a destination.
8| 2011 | ITIFN
Link state information
2
5
20
10
2
2010
10
2
2
R2
R1
R3
R4
R5

A
link
is attached to an interface on a router

Link state
is the information about the state of the links
eth0
sl0
sl1
sl2
10.1.0.0/16
10.2.0.0/16
10.3.0.0/16
10.4.0.0/16
Link 1:Network: 10.1.0.0./16
Type of network: Ethernet
Cost of that link: 2
Neighbor routers: None
Link 2:Network: 10.2.0.0./16
Type of network: Serial
Cost of that link: 20
Neighbor routers: R2
Link 4:Network: 10.4.0.0./16
Type of network: Serial
Cost of that link: 20
Neighbor routers: R4
Link 3:Network: 10.3.0.0./16
Type of network: Serial
Cost of that link: 5
Neighbor routers: R3
The numbers on each
link shows the cost for
that link
9| 2011 | ITIFN
Link state database (DB) 
The collection of all LSAs is called the link state database.

Each router has and identical link state database and hence a
complete description of the network.

When neighboring routers discover each other for the first time,
they will exchange their link state databases

The link-state databases are synchronized using reliable flooding.
Receiveddatabase
entry (LSAs)
IP routing
table
SPF
calculation
LSAs are flooded
to other interfaces
Link state
database
10| 2011 | ITIFN
Discovery of neighbors 
Routers multicasts
Hello packets
on all interfaces
running the link state routing protocol.

If two routers share a link, they can become neighbors,
and establish an adjacency.

After becoming a neighbor, routers
exchange
their link
state databases.
11| 2011 | ITIFN
B
A
1
1
1
Flooding
A
D
B
C
E
Link 3
Link 1
Link 2
Link 4
Link 6
AD: From A, to B, link 1, infinite, number = 2
DE: Updates its DB and relays A’s message to E
EC,B:Updates its DB and relay A’s message C & B
CB:Updates its DB and relay A’s message to B
BE:No update, number≤ number in B’s DB; relay to E
ED: No update, number ≤ number in E’s DB; relay to D
DA:No update, number ≤ number in B’s DB; relay to D
A:Update message number and triggers new
route calculation. No further flooding
From
To
Link
Dist.
Num.
All links
have
cost = 1
A
D
3
1
B
C
2
1
C
B
2
1
D
A
3
1
E
B
4
1
E
D
6
1
B
E
4
1
C
E
5
1
D
E
6
1
E
C
5
1
A’s link state database
Link 1 breaks. A and B notice. The information is flooded in the network
1
B
A
1

1
1
1
1
1
1
1
1
1
1
1
A
B
1
1
1
A
B
1

1
A
B
1

2
B
A
1

2
12| 2011 | ITIFN
Shortest path (1)

Uses a calculation of “shortest” paths based on a
“distributed map” of the network topology
2
5
20
10
2
2010
10
2
2
The shortest path for host on R2 LAN to reach host on R3 LAN:
R2 to R1 (20) + R1 to R3 (5) + R3 to LAN (2) = 27
R2
R1
R3
R4
R5
13| 2011 | ITIFN
Shortest path (2)

The shortest path to a destination is not necessarily the
path with the least number of hops
2
5
20
10
2
2010
10
2
2
DestinationShortestpathCost
R2 LANR1 to R222
R3 LANR1 to R37
R4 LANR1 to R3to R417
R5 LANR1 to R3 to R4
to R5
27
R2
R1
R3
R4
R5
From source node: R1
Shortest path is 3 hops
14| 2011 | ITIFN
Dijkstra’s algorithm

E: represents a set of nodes for which shortest path already found.

Initialization
: (Start with source node S)

E = {S}, D
s
= 0, “Shas distance zero from itself”

Dj
= C
sj
for all j

S, where Csj
represents link cost for directly
connected neighbors j

Step 1
:
find next closest nodei

Find i

Esuch that Di
= min (Dj) for j

E

Add ito E

If Econtains all the nodes, terminate the algorithm

Step 2
:
update minimum costs

For each node j

E

Dj
= min (Dj, D
i+C
ij
)Dj
becomes the minimum distance from s to j
through node i in E.

Go to Step 1
15| 2011 | ITIFN
Execution of Dijkstrasalgorithm
IterationED2
D3
D4
D5
D6
Initial{1}325
∞∞
1{1,3}3
24

3
2{1,2,3}
324
73
3{1,2,3,6}
324
5
3
4{1,2,3,4,6}
324
5
3
5{1,2,3,4,5,6}
32453
1
2
4
5
6
1
1
2
3
2
3
5
2
4
3
1
2
4
5
6
1
1
2
3
2
3
5
2
4
3





3
1
2
4
5
6
1
1
2
3
2
5
2
3
3
4
1
2
4
5
6
1
1
2
3
2
3
5
2
4
3
3
1
2
4
5
6
1
1
2
3
2
5
2
3
3
4
3
1
2
4
5
6
1
1
2
3
2
3
5
2
4
3
3
1
2
4
5
6
1
1
2
3
2
5
2
3
3
3
4
A
shortest path three
from
node 1 to all othernodes has
been calculated.
A
shortest path three
from
node 1 to all othernodes has
been calculated.
16| 2011 | ITIFN
Equal multi-path cost 
Equal cost metric
is a condition where a router has
multiple paths to
the same destination
that all have the same metric.

To solve this dilemma, a router will
use Equal Cost Load Balancing
-
this means the router sends packets over the multiple exit interfaces
listed in the routing table.
17| 2011 | ITIFN
Link state routing protocol requirements 
Requirements for using a link state routing protocol

Memory requirements

Typically link state routing protocols use more memory

Processing requirements

More CPU processing is required of link state routing protocols

Bandwidth requirements

Initial startup of link state routing protocols can consume lots of
bandwidth
Generally link state routers have to be more powerful devices compared to
distance vector routers. In practice, both distance vector and link state
routing protocols are supported in modern routers.
18| 2011 | ITIFN
Multiple areas 
Need for network
hierarchy
due to large memory
requirement, demanding
route computation and high
transmission overhead for
large networks.

Areas
act as independent
networks.

Area border routers (ABR)
summarizes routing
information.

Summary records
represents
the link between ABR and a
network in the backbone
area.
Area1
Area4
Area0
BackboneArea
Area2
Area3
Inter-area
routes
Intra-area routes
To another AS
IR
Router classification

Internal Router (IR)

Area Border Router (ABR)

Backbone Router (BR)

Autonomous System Border
Router (ASBR)
Router classification

Internal Router (IR)

Area Border Router (ABR)

Backbone Router (BR)

Autonomous System Border
Router (ASBR)
IR
IR
ABR
ABR
BR
ABR
IR
IR
ABR
ABR
ASBR
External
routes
19| 2011 | ITIFN
Open Shortest Path First (OSPF) protocol 
The OSPF routing protocol is the most important link
state routing protocol on the Internet.

The complexity of OSPF is significant.

Features

Provides authentication of routing messages.

Enables load balancing by allowing traffic to be split evenly
across routes with equal cost.

Type-of-Service (TOS) routing allows to setup different routes
dependent on the TOS field.

Supports subnetting.

Supports multicasting.

Allows hierarchical routing.
20| 2011 | ITIFN
OSPF development timeline 
Background of OSPF

Specification work began in 1987

1989 OSPFv1 released in RFC 1131

This version was experimental & never deployed

1991 OSPFv2 released in RFC 1247

1998 OSPFv2 updated in RFC 2328

1999 OSPFv3 published in RFC 2740
21| 2011 | ITIFN
OSPF packet format
22| 2011 | ITIFN
OSPF packet format
23| 2011 | ITIFN
OSPF LSA format
LSA
LSA
Header
LSA
Data
LSA
Header
Link 1
Link 2
Messagetype specification data
Contains number of links
24| 2011 | ITIFN
“Lollipop” sequence space

The link state sequence number is increase in
accordance with the “lollipop” sequence space.

N = 2
31
-N+1
N-2
N/2
0
25| 2011 | ITIFN
Example network
26| 2011 | ITIFN
Neighbor discovery
27| 2011 | ITIFN
OSPF’s hello packages 
Hello packets

Discover OSPF neighbors & establish
adjacencies

Advertise guidelines on which routers
must agree to become neighbors.

Used by multi-access networks to
elect a DR and a BDR

Contents of a Hello Packet router ID of
transmitting router

OSPF Hello Intervals

Usually multicast (224.0.0.5)

Sent every 30 seconds for NBMA segments

OSPF dead intervals

This is the time that must transpire before
the neighbor is considered down

Default time is 4 times the hello interval
Designated Router(DR): DR is responsible
for updating all other OSPF routers
Backup Designated Router (BDR): This
router takes over DRs responsibilities if DR
fails
28| 2011 | ITIFN
Link state advertisement (LSA)

The LSA of router 10.10.10.1 is as
follows:

Link State ID:
10.10.10.1
= Router ID

Advertising Router:
10.10.10.1
= Router ID

Number of links:
3
= 2 links plus router itself

Description of Link 1:Link ID =
10.1.1.1, Metric = 4

Description of Link 2:Link ID =
10.1.2.1, Metric = 3

Description of Link 3:Link ID =
10.10.10.1, Metric = 0
Each router sends its LSA to all routers in the network
(using a method called reliable flooding)
29| 2011 | ITIFN
Network and link state database
LS Type Link StateID Adv. Router Checksum LS SeqNo LS Age
Router-LSA 10.1.10.1 10.1.10.1 0x9b47 0x80000006 0
Router-LSA 10.1.10.2 10.1.10.2 0x219e 0x80000007 1618
Router-LSA 10.1.10.3 10.1.10.3 0x6b53 0x80000003 1712
Router-LSA 10.1.10.4 10.1.10.4 0xe39a 0x8000003a 20
Router-LSA 10.1.10.5 10.1.10.5 0xd2a6 0x80000038 18
Router-LSA 10.1.10.6 10.1.10.6 0x05c3 0x80000005 1680

Each router has a
database which
contains the LSAs
from all other routers
30| 2011 | ITIFN
Regular LSA exchanges
31| 2011 | ITIFN
32| 2011 | ITIFN
OSPF in multi-access networks 
Large networks may experience
extensive flooding
of LSAs

Solution to LSA flooding issue is the
use of

Designated router
(DR)

Backup designated router
(BDR)

DR & BDR selection

Routers are elected to send &
receive LSAs

Sending & receiving LSAs

DR others send LSAs via
multicast
224.0.0.6 to DR & BDR

DR forward LSAs via multicast
address 224.0.0.5 to all other
routers
33| 2011 | ITIFN
Summary of Interior routing protocols

Advantages of a Link-State Routing Protocol
Routingprotocol
Builds
Topological
map
Router can
independently determine the
shortest path to
every network.
ConvergenceA periodic/
event driven
routing updates
Use of
LSP
Distance vector NoNoSlowGenerally NoNo
Link StateYesYesFastGenerally YesYes
34| 2011 | ITIFN
Summary of lecture (1) 
Link state routing protocols are also known as Shortest Path First (SPF)
protocols.

Summarizing the link state process

Routers 1st learn of directly connected networks

Routers then say “hello” to neighbors

Routers then build link state packets

Routers then flood LSPs to all neighbors

Routers use LSP database to build a network topology map & calculate the best
path to each destination.

Link State

Information about an interface such as

IP address

Subnet mask

Type of network

Cost associated with link

Neighboring routers on the link
35| 2011 | ITIFN
Summary of lecture (2) 
RFC 2328 describes OSPF link state concepts and
operations

OSPF Characteristics

A commonly deployed link state routing protocol

Employs DRs & BDRs on multi-access networks

DRs & BDRs are elected

DR & BDRs are used to transmit and receive LSAs

Uses 5 packet types:

1: HELLO

2: DATABASE DESCRIPTION

3: LINK STATE REQUEST

4: LINK STATE UPDATE

5: LINK STATE ACKNOWLEDGEMENT