Upload
raini
View
1.407
Download
0
Tags:
Embed Size (px)
DESCRIPTION
OSPF Routing Protocol
Citation preview
1
Introduction to
OSPF Protocol Design
By:
Ranjeet SainiEngineering Test LeadAgnity Technologies, Inc.
March, 2008
2
Agenda
I. References & Standard
II. Terminology
III. OSPF Format
IV. OSPF Algorithm
3
References & Standard
1. RFC 2328 OSPF Version 2 April, 1998by John Moy
2. RFC 2370 The OSPF Opaque LSA Option April, 1998 by R. Coltun
3. Understanding TCP/IP December, 1995SynOptics Communications
4. RFC 1349 Type of Service in the Internet Protocol July, 1992
4
I. References & Standard
II. Terminology
III. OSPF Format
IV. OSPF Algorithm
5
Internet Routing
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
R1 R2
R3Fast SwitcHub-8mi
30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
R4 R5
R6
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
R7 R8
R9
Core System
Autonomous System #1 Autonomous System #3
Autonomous System #2
Area Border Router
Area Border Router
Area Border Router
6
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
IGP1 IGP1
IGP1
Autonomous System1
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
IGP2
Autonomous System #2
IGP1
IGP2 IGP2
IGP2
EGP
Exterior Gateway Protocol
An External Links Advertisement originates for each destination outsideThe AS, and these advertisements are in turn flooded throughout the AS.
An External Links Advertisement is used for externally derived routingInformation obtained by another routing protocol such as EGP or BGP.
7
Autonomous Systems(AS) Each AS is a group of networks & routers administered by single authority using a common routing protocol.
Interior Gateway Protocol(IGP) Routers within single AS communicate using one of several dynamic routing protocols, known generically as an IGP.
Exterior Gateway Protocols(EGP) Communication between routers belonging to different AS requires additional protocol, so-called EGP.
Open Shortest Path First(OSPF) is an Interior Gateway Protocol(IGP) IP routing protocol.
Terminology
8
Configurable Metrics
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
14X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
14X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
14X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Hop = 1Cost= 10
Hop = 1Cost= 10
Hop = 1Cost= 100
A B
T1 T1
56Kb
Using RIP, traffic would be routed over slow 56K link since the hop countMetric is 1. Using OSPF as the IGP, traffic can be routed over faster T-1Link since total cost would be 20.
For single destination, there may be separate routing table entries for eachType Of Service. A metric for TOS 0 must always be specified.
9
Network Types
OSPF operates over below physical networks :
1) Point-to-point Network A network joining single pair of routers.
2) Broadcast Network A network with more than 2 attached routers, and the ability to address single physical messages to all of attached routers.
3) Non-broadcast Network A network with more than 2 attached router, but having nobroadcast capability such as X.25 public data network.
DR
BDR
10
Adjacencies
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Adjacency
Router Router
Router
An “adjacency” is a two-way communication between selected neighboring routers for the purpose of exchangingrouting information through link-state advertisements.
11
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/HalfConfig
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI
10 M/ 100 M
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%
Demo
Diag
Full/HalfConfig
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/HalfConfig
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/HalfConfig
1 2 3 4 5 6 7 890+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/HalfConfig
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI
10 M/ 100 M
N6
N7
N8
Router
Router
N9
N10
Router
Router
RouterArea 1 Area 2
AS 300
AS 100
AS 200
Area Border Router (ABR)
N1
N2
N3
N4
N5
Note : Each area has its own topological link-state database. All routers within an area contain Router LSAs & Network LSAs. Router is Autonomous System Boundary Router(ASBR).
Routing Area
12
Routing Area(Con’t)
OSPF allows collections of contiguous networks and hosts to be groupedtogether. This group, along with the routers having interfaces connectedto the networks in this group, is called an “area”.
A single area limits the boundary for Link-Stat Advertisement(LSA) flooding.the Shortest Path First(SPF) tree is computed on a per-area basis, and anyintra-area destinations are derived from the SPF tree.
All areas must have at least one route/interface connected to area 0.0.0.0(the backbone area).
An Area Border Router(ABR) is an OSPF router having interface connectedto multiple areas. ABRs must keep a distinct link-state database for eacharea, and run the SPF algorithm on distinct database.
13
Routing Area- Backbone Area
ABR
ABR
ABR
Area-1
Area-2
Area-3
Backbone Area
If an AS is divided into areas, the areas must be connected to each otherVia special area called the “Backbone Area”. Backbone consists of thoseNetworks not contained in any area.
All ABRs in an AS must belong to the Backbone Area. Backbone area isassigned an area_ID to 0.0.0.0
AS 300
14
Backbone Area(Con’t)
An ABR connected to the Backbone executes two copies of OSPF protocol:
1) Operates on the interface connected to local area and accept floodedadvertisements from other routers that are members of the area
2) Executes over the interface that connects to the backbone. This secondcopy won’t propagate flooded advertisements from the area acrossthe backbone. Instead, it sends Summary Link Advertisements overthe backbone so that attached area can learn about backbone reachability.
15
Stub Area
When an OSPF area within an AS has a single entry/exit router thatis used by all externally addressed traffic, it is possible to block theimport of the AS External Link Advertisements into the area :
~ No LSA type 4 & 5’s ~ ASBRs are not supported with stub area ~ Virtual links are not supported in stub area ~ The ABR must be configured as default router for stub area ~ The ASBR can be configured to be disabled for an area
Area0.0.0.0Area
0.0.0.0Stub
Area 51Stub
Area 51
OSPF Domain
AS 101RIP or
IGP
AS 101RIP or
IGP
ASBR 0.0.0.0 Default
16
Virtual Link
Router
ABRABR
Router
Router Router
ABR
ABR
AS 200
Backbone
Area 1 Area2
Area 3
Area 4
A virtual link can be configured to allow the connection of an ABR to backboneWhen the ABR and its are aren’t contiguous to the backbone.
In below figure, Area 1 cannot directly learn all inter-area from the other areasSince it lacks a direct connection to the backbone. Area 1 is connected to theBackbone by a virtual link between the ABRs in Area 2. All inter-area routes From the backbone are flooded over virtual link to the ABR in Area 1. The ABRIn Area 1 will summarize all intra-area routes for Area 1 over virtual link forTransmission on the backbone.
17
Virtual Link(Con’t)
Area0.0.0.7Area
0.0.0.7ABR ABR
Area 0.0.0.0Area
0.0.0.0Area
0.0.0.51Area
0.0.0.51
Virtual Link
Any physical arrangement of areas can be logically attached to the Backbone through a virtual link.
Virtual links allow summary-LSAs to be tunneled across a non-Backbone area to exchange the routing information.
18
Virtual Link(Con’t)
Area0.0.0.7Area
0.0.0.7Area
0.0.0.0Area
0.0.0.0
Area 51Area 51C
B
Area 52Area 52A
DData
DataDa
taVirtual link
Virtual link
The exchange of routing information continues to follow viavirtual link but the forwarding of data packets does not.
A data packets from router C destine for router D would gothrough routers A & B, but not through Area 0.
19
Routing Area greatly reduce the amount of routing informationtraffic that must be propagated throughout entire AS
Areas allow the development of a hierarchy of routing information,thus protecting each area from external routing information.
The area’s information is hidden from routers outside of the area.This “information hiding” technique is important from a security standpoint, since it prohibits other areas from identifying the physical topology of an area.
Area Routing Advantages
20
I. References & Standard
II. Terminology
III. OSPF Format
IV. OSPF Algorithm
21
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
VERS LEN Type Of Service Total Length
Identification Fragment OffsetFlags
Time To live = 1
Protocol= 89 Header Checksum
Source IP Address
Destination IP Address
Option Padding
D A T A
0
4
8
C
E
10
14
Total: 20 bytes
IPv4 Format
22
OSPF Assigned Class D Address
Multicast Class D addresses assigned for OSPF :
224.0.0.5 All OSPF routers must be capable of transmitting & receiving packets with this destination IP address
224.0.0.6 All OSPF Designated Routers must be capable of receiving packets with this destination address. This includes the Backup Designated Router.
IP Address MAC
224.0.0.5 01005E-000005
224.0.0.6 01005E-000006
Note : OSPF multicast addresses are used on both point-to-point links & multi-access networks, but does not use over non-broadcast networks or virtual links. To ensure that multicast OSPF messages won’t travel multiple hops, their IP TTL must be set to 1.
23
OSPF Packet Header
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
Version No. Type Packet Length
AuTypeHeader Checksum
Area ID
Authentication
Router ID
0
4
8
C
10
14
Type Description
1 Hello 2 Database Description 3 Link State Request 4 Link State Update 5 Link State Acknowledgment
OSPF Packet Header = 24 bytes
24
Network Mask
HelloInterval Option Rtr Pri
RouterDeadInterval
Designated Router
Backup Designated Router Neighbor :
:
Hello
Entry 1(24 bytes)
Entry n
Version No.Type= 1
Packet Length
AuTypeChecksum
Area ID
Authentication
Router ID
Network Mask
HolloInterval Option Rtr Pri
RouterDeadInterval
Designated Router
Backup Designated Router
Neighbor
D A T A
OSPF Hello Packet
Note: DR/BDR = 0 means no designated router
25
The router’s “Router Priority” used to determine the DesignatedRouter & Backup Designated Router.
The hello interval in which the transmitting router sends Hellopackets on given network.
The interval(in seconds) in which the transmitting router expectsto receive Hello packets from a neighbor before determining that the neighbor is down.
A list of routers from which Hello packets have been recentlyreceived.
The router’s current choice fro the Designated Router & BackupDesignated Router. A value of zero in these fields indicates thatone has not yet been selected.
Hello Message Contents
26
The OSPF Optional Capability
7 6 5 4 3 2 1 0- - DC EA N/P MC E -
AS-external-LSAs are flooded
Whether IP multicast datagrams are forwarded
The handling of Type-7 LSAs
The router’s willingness to receive & forwardExternal-attributes-LSAs
The router’s handling of demand circuits
27
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
14X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
X 2X 3X
Router
Router Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
14X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
14X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
14X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
14X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
14X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
14X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Router
Router
RouterDR
BDR
Multi-access Network
Each router on the network exchanges link-state information(forms an adjacency)Only with the Designated Router(DR) and the Backup Designated Router(BDR).Each neighbor exchanged information with a DR & BDR specified, the number ofExchanges is reduced to O(2n).
The router with the highest configured Router Priority is elected DR.The BDR is elected at the same time as the DR. The router with second highestRouter Priority is elected the BDR.
Designated Router & Backup Designated Router
28
Version No.Type= 2
Packet Length
AuTypeChecksum
Area ID
Authentication
Router ID
D A T A
OSPF Database Description Packet
DD Sequence number
Interface MTU Option 0 0 0 0 0 I M MS
:::
An LSA HeaderAuthentication
0
4
8
C
10
14
18
29
Link State Request Packet
Version No.Type= 3
Packet Length
AuTypeChecksum
Area ID
Authentication
Router ID
D A T A
Advertising Router
LS Type
Link State ID
:::
0
4
8
30
Link State Update Packet
Version No.Type= 24
Packet Length
AuTypeChecksum
Area ID
Authentication
Router ID
D A T A
# LSA
:::
LSAs
0
4
8
C
10
14
18
31
Link State Acknowledgment Packet
Version No.Type= 5
Packet Length
AuTypeChecksum
Area ID
Authentication
Router ID
D A T A :::
An LSA Header
0
4
8
C
10
14
18
32
IP-172.16.32.2RID-100.100.100.6
IP-172.16.32.1RID-100.100.100.4
Hello (Packet 15 & 17)
Hello (Packet 16 & 18)
DB Description (Packet 19 & 21)
DB Description (Packet 20)
Link State Request (Packet 22)
Link State Update (Packet 25)
(Adjacency Up)
Hello
Hello
Down DownInit
2-WayExStart ExStart
Exchange Exchange
Loading Loading
Full Full
Exchange
Full
Forming Adjacency
33
OSPF LSA Header
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
LS age Option LS type
LengthLS Checksum
Advertising Router
LS sequence number
Link State ID
0
4
8
C
10
Type Description
1 Router-LSAs 2 Network-LSAs 3 Summary-LSAs (IP network) 4 Summary-LSAs (ASBR) 5 AS-external-LSAsOSPF LSA Header = 20 bytes
34
Router-LSAs Format
LS age LS Type= 1Options
LengthChecksum
Advertising Router
LS sequence number
Link State ID
Link Data
Type # TOS Metric
Link State ID
0 V E B 0 No. of Links
:
:
D A T A
0
4
8
C
10
14
18Note: V for virtual link; E for AS boundary router B for Area Border router. Each router in an area originates a router-LSA.
35
Router-LSAs Format(Con’t)
Type Link ID Link Data
1 Neighboring router’s Router ID Interface’s MIB ifIndex value
2 IP address of Designated Router DR IP address
3 IP network / subnet number Network IP address
4 Neighboring router’s Router ID Network IP address
Type Description
1 Point-to-point connection to another router
2 Connection to a transit network
3 Connection to a stub network
4 Virtual link
36
LS age LS Type=2Options
LengthChecksum
Advertising Router
LS sequence number
Link State ID
Network-LSAs Format
Network Mask
Attached Router
0
4
8
C
10
14
18
Note: the distance from network to all attached routers is 0. Network-LSA is originated by the network’s DR.
37
LS age LS Type=3Options
LengthChecksum
Advertising Router
LS sequence number
Link State ID
D A T A
Summary-LSAs(IP network) Format
TOS TOS metric
Network Mask
0 metric
:::
Note: Link State ID= 0.0.0.0 & Network mask= 0.0.0.0 if default summary route. Metric is the cost of this route.
0
4
8
38
LS age LS Type=4Options
LengthChecksum
Advertising Router
LS sequence number
Link State ID
D A T A
Summary-LSAs(ASBR) Format
TOS TOS metric
Network Mask
0 metric
:::
0
4
8
39
LS age LS Type= 5Options
LengthChecksum
Advertising Router
LS sequence number
Link State ID
D A T A
As-external-LSAs Format
Forwarding address
Network Mask
E 0 metric
:::
External Route Tag
Forwarding address
E TOS TOS metric
0
4
8
C
10
14
40
Shortest Path Tree
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full Duplex
Select/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full Duplex
Select/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Router3
Router2
Router1
Network2
Network3
Network4
Network1
Cost = 30
Cost = 20
41
Link State Database
R1 R2 R3
(N1-0) (N2-0) (N3-0)
(N2-0) (N3-0) (N4-0)
(R2-20) (R1-20) (R2-30) (R3-30)
From the Link-State Database, each router builds a shortest path treeusing itself as the root.
Each node of the tree shows the shortest, or best cost path tothe vertex from the root.
Each router then build its routing table from the shortest path tree.
42
R1
N1 N2R2
20
N3
R3
N4
30
Destination Next Hop Metric
N1 Direct 0
N2 Direct 0
N3 R2 20
N4 R2 50
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full Duplex
Select/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Network1
Network2
Network3
Network4
Router1
Router2
Router3
Cost = 20
Cost = 30Routing Table for R1
Shortest Path Tree & Routing Table
43
Destination Next Hop Metric
N1 R1 20
N2 Direct 0
N3 Direct 0
N4 R3 30
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full Duplex
Select/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Network1
Network2
Network3
Network4
Router1
Router2
Router3
Cost = 20
Cost = 30Routing Table for R2
Shortest Path Tree & Routing Table(Con’t)
R2
N1
20
R1R3
N4
30
N2N3
44
Destination Next Hop Metric
N1 R2 50
N2 R2 30
N3 Direct 0
N4 Direct 0
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full Duplex
Select/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/Half
Config
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-8MDI
10 M/ 100 M
Network1
Network2
Network3
Network4
Router1
Router2
Router3
Cost = 20
Cost = 30Routing Table for R3
Shortest Path Tree & Routing Table(Con’t)
N3
N1
N2
N4
R3
30
R1
R2
20
45
• When an intra-area route has been added, deleted or modified
• When an inter-area route has been added, deleted or modified
• When a router has an interface that becomes active in an area
• When a router’s virtual link changes
• When an external route changes
• When a router that was an ASBR is no longer an ASBR
When Router re-calculate SPF tree?
46
I. References & Standard
II. Terminology
III. OSPF Format
IV. OSPF Algorithm
47
Features of Link-State Algorithm
All routers maintain identical routing tables.
The database of each router describes complete topology ofthe router’s domain. The router’s domain may be theentire AS, or an area within the AS.
Each router uses the database to calculate a set of shortestpaths to all destinations. The routing table is built fromthese calculation.
OSPF uses a Link-State Routing Algorithm.
48
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/HalfConfig
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI
10 M/ 100 M
Fast SwitcHub-8mi30+20105
1100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%
Demo
Diag
Full/HalfConfig
1 2 3 4 5 6 7 8
90+70503520
1051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/HalfConfig
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/HalfConfig
1 2 3 4 5 6 7 890+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI
10 M/ 100 M
Fast SwitcHub-8mi30+201051100MTx/Rx
Full DuplexSelect/Link
PWR
Collision
StatusUtil%
Forward%
Filter%Demo
Diag
Full/HalfConfig
1 2 3 4 5 6 7 8
90+705035201051Link
Rate %
SNMP
1X 2X 3X 4X 5X 6X 7X 8MDI-X-or-MDI
10 M/ 100 M
N6
N7
N8
Router
ASBR
N9
N10
Router
Router
ASBRArea 1 Area 2
AS 300
AS 100
AS 200
Example of Link-State Algorithm
Area Border Router (ABR)
N1
N2
N3
N4
N5
49
Basic Operation of Link-State Algorithm
1) Exchange of Routing Information- Each router periodically sends out a description of its connections to its neighbors.- Routers are neighbors if they are directly connected via a common network.- A router sends the LSA to each of its neighbors. The LSA includes a listing of all interfaces & configured “cost” of each link and each configured cost- TOS pairing.
2) Routing Area- The LSA is flooded throughout the router’s domain. The router’s domain may be entire AS, or limited area within the AS.- Areas are configured by assigning an area_ID for each router interface. If the area_ID is identical for all ports on a router, then the router is contained in a single area.
3) Link-State Database- Each router in the domain maintains an identical, synchronized copy of a database composed of this link-state information.- Router belonging to multiple areas maintain a separate Link_State database
for each area.
50
4) Shortest Path Tree- Each router runs an algorithm on the database used to create a shortest-path tree. A different shortest-path tree is constructed for each TOS support.- The shortest-path tree contains the shortest path to every router and every network that other routers can reach. The router performing the calculation places itself at the root of each tree.
5) Routing Table- The resulting shortest-path trees determine total cost to the destination network and next hop router. The shortest-path trees are used as the basis of creating the routing table. A different routing table is created for each TOS.
6) Optional TOS Support- OSPF allows the network administrator to configure OSPF routers to calculate/use only single routing table(TOS 0 table).- A router desiring to calculate/use single table informs its peers by resetting the TOS-capable bit in the option field of the router’s links advertisement. If a route cannot be found that uses a non-zero TOS value, the traffic is forwarded along the TOS 0 route.
Basic Operation of Link-State Algorithm(Con’t)
51
How to Forward datagrams
The forwarding process uses routing tables to route datagrams.
1) The destination network number is extracted from an incomingdatagram.
2) The TOS field is examined for information pointing to
3) The datagram is forwarded towards its final destination.Datagram having same final destination may be routed alongdifferent paths based on the TOS requested by the source station.
52
Initial Link-State Database Synchronization
A pair of routers attempting to become adjacent send a summary of their Link-State databases to one another. This summary is called a “Database Description Packet”.
The Database Description Packet consists of a list of abbreviated link-stateAdvertisements(LSA).
Based on the Database Description Packet received from its neighbor, eachrouter builds a list of requests for LSAs, required to update its own database.
A router builds this list by checking its link-state database for a copy of eachLSA received in the summary. If the router doesn’t have a particular LSA in its link-state database, or determines that its neighbor has a more recent version of A LSA, that LSA is added to the request list.
Each router sends this list in a Link-State Request packet to its neighbor.
Each router responds to a received Link-State Request packet with a Link-State Update packet containing the requested LSAs. The neighbors becomeFully adjacent when they have received all requested LSAs.
Once the routers become fully adjacent, they run the SPF algorithm on the data-Base, add OSPF routes to their routing tables, and periodically exchange LSAs.
53
Maintain Link-State Database Synchronization
Flooding ProcedureWhen an LSA is flooded, it is passed from a router to an adjacent router untilIt has been distributed throughout the routing domain.Each router determines, individually, whether the LSA should be passed toAn adjacent neighbor. More details are described in Section 13, 13.3 & 13.4 ofRFC 2328.
Reliable UpdatesReliability is accomplished by requiring that both the receipt and transfer ofan LSA be acknowledged by adjacent router. In the absence of such anacknowledgment, the source router retransmits the LSA until it is acknowledged.
- Each router originates a router-LSA. - Area Border routers originate a single summary-LSA for each known inter- area destination. - AS Boundary routers originate a single As-external-LSA for each known AS external destination.
(Ten events can cause new instance of an LSA to be originated)
54
Link-State AgeAn LSA’s age field is periodically incremented while residing in a router’s link-state database. It is possible for an LSA to reach an age where it is no longer usedin the flooding procedure, and must be flushed from the link-state database. IfThere’s a change in the link-state database, a new shortest-path tree is constructedand the routing table is updated.
Link-State Sequence NumbersA common event is for an LSA to be replaced by the receipt of more recent LSA from its adjacent neighbor. Each LSA contains 32-bit sequence number usedby OSPF routers to detect old, or duplicate LSAs. A linearly ordered sequence number is used for LSA identification. All routers keep their link-state databases synchronized by ageing LSAs in their database, and updating withnew incoming LSAs.
Maintain LS Database Synchronization(Con’t)