You are on page 1of 57

Distance Vector vs.

Link
State
B

D
X

Distance-vector Routing Protocols:Distance-vector Routing Protocolsuse simple algorithms


that calculate a cumulative distance value between routers based on hop count.
Example:Routing Information Protocol Version 1 (RIPv1)and
Interior Gateway Routing Protocol (IGRP)
Link-state Routing Protocols:Link-state Routing Protocolsuse sophisticated algorithms that
maintain a complex database of internetwork topology.
Example:Open Shortest Path First (OSPF)and Intermediate System to Intermediate System (IS-IS)
Hybrid Routing Protocols:Hybrid Routing Protocolsuse a combination of distance-vector and
link-state methods that tries to incorporate the advantages of both and minimize their
disadvantages.
Example:Enhanced Interior Gateway Routing Protocol (EIGRP),
Routing Information Protocol Version 2 (RIPv2)
1

Distance Vector vs. Link


State
Distance Vector
Updates frequently
Each router is
"aware" only of its
immediate
neighbors
Slow convergence
Prone to routing
loops
Easy to configure

Link State
Updates are event
triggered
Each router is
"aware" of all other
routers in the "area"
Fast convergence
Less subject to
routing loops
More difficult to
configure
2

Comparison Continued
Distance Vector
Fewer router resources
required
Updates require more
bandwidth
Does not "understand"
the topology of the
network

Link State
More router resource
intensive
Updates require less
bandwidth
Has detailed
knowledge of distant
networks and routers

Link State
Example
OSPF
IS-IS

OSPF is used for corporate networks


IS-IS is used for ISPs

OSPF

Open Shortest Path First (OSPF)


OSPF is an open standards routing protocol
This works by using the Dijkstra algorithm
OSPF provides the following features:
Minimizes routing update traffic
Allows scalability (e.g. RIP is limited to 15 hops)
Has unlimited hop count
Supports VLSM/CIDR
Uses HELLO Packets to inform neighbors.
Does Multicast 244.0.0.5 and 224.0.0.6
Convergence is fast
Allows multi-vendor deployment (open standard)
7

Link State
There are two types of Packets
Hello
LSAs

OSPF Hello
A

When router A starts it send Hello packet


Hello packets are received by all neighbors
B will write As name in its neighbor table
C also process the same way

10

"Hello" Packets
Small frequently issued packets
Discover neighbours and negotiate "adjacencies"
Verify continued availability of adjacent
neighbours
Hello packets and Link State Advertisements
(LSAs) build and maintain the topological
database
Hello packets are addressed to 224.0.0.5.

11

Link State Advertisement


(LSA)
An OSPF data packet containing link state and
routing information that is shared among OSPF
routers
LSAs are shared only with routers with whom it
has formed adjacencies
LSA packets are used to update and maintain
the topology database.

12

Link State
There are three type of tables
Neighbor
Topology
Routing

14

Tables
Neighbor
Contain information about the neighbors
Neighbor is a router which shares a link on
same network
Another relationship is adjacency
Not necessarily all neighbors
LSA updates are only when adjacency is
established

15

Tables
Topology
Contain information about all network and path
to reach any network
All LSAs are entered in to topology table
When topology changes LSAs are generated
and send new LSAs
On topology table an algorithm is run to create
a shortest path, this algorithm is known as SPF
or dijkstra algorithm

16

Tables
Routing Table
Also knows as forwarding database
Generated when an algorithm is run on the
topology database
Routing table for each router is unique

17

OSPF Terms
Link
Router ID
Neighbours
Adjacency
OSPF Area

Backbone area
Internal routers
Area Border Router
(ABR)
Autonomous
System Boundary
Router (ASBR)

18

Link
A network or router interface assigned to a
given network
Link
(interface)
will
have
"state"
information associated with it
Status (up or down)
IP Address
Network type (e.g. Fast Ethernet)
Bandwidth
Addresses of other routers attached to
this interface
19

OSPF Term: Link

A link is a network or router interface assigned to any


given network
This link, or interface, will have state information
associated with it (up or down) as well as one or more IP
addresses

20

OSPF Term: Link State

Status of a link between two routers


Information is shared between directly connected routers.
This information propagates throughout the network
unchanged and is also used to create a shortest path first
(SPF) tree.
21

Router ID
The Router ID (RID) is an IP address used to identify the
router
Cisco chooses the Router ID by using the highest IP address
of all configured loopback interfaces
If no loopback interfaces are configured with addresses,
OSPF will choose the highest IP address of all active
physical interfaces.
You can manually assign the router ID.
The RID interface MUST always be up, therefore loopbacks
are preferred

22

Neighbours
Neighbours are two or more routers
that have an interface on a common
network
E.g. two routers connected on a serial
link
E.g. several routers connected on a
common Ethernet or Frame relay
network

Communication
takes
between / among neighbours

place
23

Adjacency
A relationship between two routers
that permits the direct exchange of
route updates
Not
all
neighbours
will
form
adjacencies
This is done for reasons of efficiency

24

OSPF Design

Each router connects to the backbone called area 0, or the backbone area.
Routers that connect other areas to the backbone within an AS are called Area Border Routers
(ABRs). One interface must be in area 0.
OSPF runs inside an autonomous system, but can also connect multiple autonomous systems
together. The router that connects these ASes together is called an Autonomous System
Boundary Router (ASBR).
25

OSPF Areas
An OSPF area is a grouping of contiguous
networks and routers
Share a common area ID
A router can be a member of more than one area
(area border router)
All routers in the same area have the same
topology database
When multiple areas exist, there must always be
an area 0 (the backbone) to which other areas
connect

26

Why areas?
Decreases routing overhead
Compare to multiple smaller
domains instead of one large one

broadcast

Speeds convergence
Confines network instability (e.g. route "flapping")
to single area of the network
Adds considerably to the complexity of setting up
OSPF
27

Area Terminology

28

LSAs in Area
LSAs communicate with adjacent routers in the
same OSPF area
Subsequently, a change in a link
"flooded" to all area routers via LSAs

state

is

In larger networks, multiple areas may be created


LSAs are sent only to adjacent routers in the
same area
"Area border routers" connect areas, passing
summarized route information between

29

Path Calculation
Changes to the topological database of a router
trigger a recalculation to re-establish the best
route(s) to known networks
Uses the SPF (shortest path first) algorithm
developed by a computer scientist named
Dijkstra
This is done by each individual router using its
detailed "knowledge" of the whole network
Leads to rapid and accurate convergence
Based on detailed knowledge of every link in
the area and the OSPF "cost" of each
builds an OSPF tree with itself at the route
31

Types of Neighbors
OSPF can be defined for three type of
neighbors
Broadcast Multi Access (BMA) ex- Ethernet
Point to Point
Non-Broadcast Multi Access (NBMA)

32

OSPF Network Types

33

Adjacencies
Point to Point all routers form adjacencies
BMA & NBMA one router is elected as DR
DR establish adjacency with every neighbor
router
LSA updates are exchanged only to DR
DR is the router which has highest priority
All CISCO routers has priority 1
If priority is same then router id is seen
The RID is highest IP address of all interfaces

34

Point-to-Point Links

Usually a serial interface running either PPP


or HDLC
No DR or BDR election required
OSPF autodetects this interface type
OSPF packets are sent using multicast 224.0.0.5
All routers form adjacencies

35

Multi-access Broadcast
Network

Generally LAN technologies like Ethernet and Token Ring


DR and BDR selection required
All neighbor routers form full adjacencies with the DR and
BDR only
Packets to the DR use 224.0.0.6
Packets from DR to all other routers use 224.0.0.5
36

Electing the DR and BDR

Hello packets are exchanged via IP multicast.

The router with the highest priority is


selected as the DR.
If Priority is same then Router ID is seen
Use the OSPF router ID as the tie breaker.
37

Terminology: DRs and BDRs


The
designated
router (DR)
is
responsible
for
generating
LSAs on
behalf of all
routers
connected
to the same
segment
38

DR Responsibility
When a router sees a new or changed link-state,
it sends an LSA to its DR using a particular
multicast address
The DR then forwards the LSA to all the other
routers with whom it is adjacent
Minimizes the number of formal adjacencies
that must be formed and therefore the amount
of LSU (link state update) packet traffic in a
multi-router network

39

OSPF Summary
AD -100
Hop count is unlimited
Classless, VLSM
Load balance up to SIX routers
Require more processing power

40

Basic OSPF Configuration


Router(config)# router ospf 1

The number 1 in this example is a process-id #


that begins an OSPF process in the router
More than one process can be launched in a
router, but this is rarely necessary
Usually the same process-id is used throughout
the entire network, but this is not required
The process-id # can actually be any value
from 1 to "very large integer
The process-id # cannot be ZERO
This is NOT the same as the AS# used in IGRP
and EIGRP

41

Configuring OSPF Areas


After identifying the OSPF process, you need to identify the
interfaces that you want to activate OSPF communications
Lab_A#config t
Lab_A(config)#router ospf 1
Lab_A(config-router)#network 10.0.0.0 0.255.255.255
area ?
<0-4294967295> OSPF area ID as a decimal value
A.B.C.D OSPF area ID in IP address format
Lab_A(config-router)#network 10.0.0.0 0.255.255.255
area 0
Every OSPF network must have an area 0 (the backbone area) to
which other areas connect
So in a multiple area network, there must be an area 0
The wildcard mask represents the set of hosts supported by
the network and is really just the inverse of the subnet mask .
42

OSPF states

OSPF Configuration

OSPF Process ID number is irrelevant. It can be the same on


every router on the network
The arguments of the network command are the network
number (10.0.0.0) and the wildcard mask (0.255.255.255)
Wildcards - A 0 octet in the wildcard mask indicates that the
corresponding octet in the network must match exactly
A 255 indicates that you dont care what the corresponding
octet is in the network number
A network and wildcard mask combination of 1.1.1.1 0.0.0.0
would match 1.1.1.1 only, and nothing else.
The network and wildcard mask combination of 1.1.0.0
0.0.255.255 would match anything in the range 1.1.0.0
1.1.255.255
44

OSPF Configuration -1
S0

S1

20.0.0.2

30.0.0.1

R2
R1
S020.0.0.1

10.0.0.1

E0

10.0.0.2

S0

R3

30.0.0
.2

E0

40.0.0
.1

40.0.0.2

45

OSPF Configuration -1
S0

S1

20.0.0.2

30.0.0.1

R2
R1
S0

10.0.0.1

E020.0.0.1

S0

R3

30.0.0
.2

10.0.0.2

E0

40.0.0
.1

40.0.0.2

R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router ospf 1
R1(config-router)#network 10.0.0.0 0.255.255.255 area 0
R1(config-router)#network 20.0.0.0 0.255.255.255 area 0
R1(config-router)#^Z

46

OSPF Configuration -2
S0

200.0.0.8/30

S1

R2

200.0.0.12/30

R1

R3
S0
S0
E0

E0

200.0.0.16/28

200.0.0.32/27

47

OSPF Configuration -2
S0

S1

200.0.0.10
255.255.255.2
52
R1
S0200.0.0.9

200.0.0.17
255.255.255.2
40

E0

200.0.0.18

R2

200.0.0.13
255.255.255.2
52 R3
S0

200.0.0.1
4

E0

200.0.0.3
3

255.255.255.2
24

200.0.0.34

48

OSPF Configuration -2
S0

S1

200.0.0.10
255.255.255.2
52
R1
S0200.0.0.9

200.0.0.17
255.255.255.2
40

E0

200.0.0.13

R2

255.255.255.2
52 R3
S0

200.0.0.1
4

E0

255.255.255.2
24

200.0.0.18

R1#config t
Enter configuration commands, one per line. End with
CNTL/Z.
R1(config)#router ospf 1
R1(config-router)#network 200.0.0.16
0.0.0.15 area
0
R1(config-router)#network 200.0.0. 8
0.0.0.3
area
0
R1(config-router)#^Z

200.0.0.3
3

200.0.0.34

R3#config t
Enter configuration commands, one per line. End with
CNTL/Z.
R3(config)#router ospf 1
R3(config-router)#network 200.0.0. 32 0.0.0.31 area
0
R3(config-router)#network 200.0.0. 12
0.0.0.3
area 0
R3(config-router)#^Z

49

OSPF and Loopback


Interfaces
Configuring loopback interfaces when using the OSPF
routing protocol is important
Cisco suggests using them whenever you configure OSPF
on a router
Loopback interfaces are logical interfaces, which are virtual,
software-only interfaces; they are not real router interfaces
Using loopback interfaces with your OSPF configuration
ensures that an interface is always active for OSPF
processes.
The highest IP address on a router will become that routers
RID
The RID is used to advertise the routes as well as elect the
DR and BDR.
If you configure serial interface of your router with highest
IP Address this Address becomes RID of t is the RID of the
router because e router
If this interface goes down, then a re-election must occur
It can have an big impact when the above link is flapping

50

Configuring Loopback Interfaces


R1#config t
Enter configuration commands, one per line.
End with CNTL/Z.
R1(config)#int loopback 0
R1(config-if)#ip address 172.16.10.1
255.255.255.255
R1(config-if)#no shut
R1(config-if)#^Z
R1#
51

Verifying OSPF Operation


Router#

show ip protocols

Verifies the configured IP routing


protocol processes, parameters and
statistics
Router#
show ip route ospf

Displays all OSPF routes learned by the


router
Router#
show ip ospf interface

Displays the OSPF router ID, area ID and


adjacency information
52

Verifying OSPF Operation


(Cont.)
Router#

show ip ospf

Displays the OSPF router ID, timers, and


statistics
Router#

show ip ospf neighbor [detail]

Displays information about the OSPF


neighbors, including Designated Router
(DR) and Backup Designated Router
(BDR) information on broadcast networks
53

The show ip route ospf


Command
RouterA# show ip route ospf
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,
B - BGP, D - EIGRP, EX - EIGRP external, O - OSPF,
IA - OSPF inter area, E1 - OSPF external type 1,
E2 - OSPF external type 2, E - EGP, i - IS-IS, L1 - IS-IS
level-1, L2 - IS-IS level-2, * - candidate default
Gateway of last resort is not set
10.0.0.0 255.255.255.0 is subnetted, 2 subnets
O
10.2.1.0 [110/10] via 10.64.0.2, 00:00:50, Ethernet0

54

The show ip ospf interface


Command
RouterA# show ip ospf interface e0
Ethernet0 is up, line protocol is up
Internet Address 10.64.0.1/24, Area 0
Process ID 1, Router ID 10.64.0.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State DROTHER, Priority 1
Designated Router (ID) 10.64.0.2, Interface address 10.64.0.2
Backup Designated router (ID) 10.64.0.1, Interface address 10.64.0.1
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:04
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 10.64.0.2 (Designated Router)
Suppress hello for 0 neighbor(s)

55

The show ip ospf neighbor Command


RouterB# show ip ospf neighbor
Neighbor ID
10.64.1.1
10.2.1.1

Pri
1
1

State
FULL/BDR
FULL/-

Dead Time
00:00:31
00:00:38

Address
10.64.1.1
10.2.1.1

Interface
Ethernet0
Serial0

56

show ip ospf neighbor detail

show ip ospf database

57

Setting Priority for DR Election

Router(config-if)#
ip ospf priority number

This interface configuration command assigns the


OSPF priority to an interface.
Different interfaces on a router may be assigned
different values.
The default priority is 1. The range is from 0 to 255.
0 means the router is a DROTHER; it cant be the DR
or BDR.
58

You might also like