OSPF(Open Shortest Path First)
1. What is OSPF?
OSPF (Open Shortest Path First) is Link State IGP Dynamic
Routing protocol that operates directly over IP using protocol number 89 and AD
110.
OSPF exchanges link state information using LSA (link
state advertisement) to build LSDB (link state database) which represents
complete network topology.
OSPF runs SPF (shortest path first) also known as Dijkstra’s
Algorithm on LSDB to calculate shortest path tree and selects best path based
on metric called cost, which is derived from interface Bandwidth. Cost=reference
BW(default:100Mbps)/interface BW) but can change reference bandwidth with “auto-cost
reference-bandwidth xxxxxx”
OSPF uses hierarchical multi-area design with area 0
as backbone to reduce LSDB size, limit SPF recalculations, and improve scalability
and convergence in large networks.
2. What are OSPF Features?
1.Fast Convergence
-hello and dead timers for neighbor failure detection
-Supports fast hello by using hello-multiplier command(may increase control-plane overhead)
-integrating BFD for sub-second failure detection
2.Support VLSM(variable length subnet mask) by carrying subnet mask information in LSA
3.Support hierarchical area design to reduce LSDB size, limit spf recalculation scope and improves scalability and convergence
4.Triggered Updates: Sends incremental LSAs only when topology changes and avoid full routing table updates
5.Support Authentication with Plain text and MD5 authentication.
6.Support multiple ECMP
3. What are OSPF Neighborship Requirement?
Neighbor
relationship (2-way state)
1. Same
Hello and Dead timers
2. Same
Area ID
3.
Compatible Area type
4. Same
Network (required on Broadcast and NBMA)
5. Same
Auth Type and Password
6.
Different Router-ID
Full Adjacency
(Full state)
7. Same
MTU (it is checked during DBD processing (Exstart->Exchange) and adjacency may
be stuck in Exstart or Exchange. It can be bypass using “ip ospf mtu-ignore)
4. Area, Router, Network, Message and LSA Types.
Area
-hierarchical area design has two level: one is backbone
area (area 0) and another is non-backbone area
-area 0 serves as backbone and transit area for inter-area
traffic between non-backbone areas
-backbone area should have maximum 50 routers (design
recommendation)
-one router should have maximum 3 area (design
recommendation)
-reduce LSDB size and limit SPF recalculation and improve
scalability and convergence
OSPF has two area categories:
1.
standard area,
2.
special area (stub, totally stub, NSSA, totally NSS).
Special area is used to reduce LSDB size and limit SPF
recalculation by limiting or blocking certain LSAs.
Stub Area block type 5 (external LSAs) and ABR inject
default route to stub area to reachable external network.
Totally Stubby block type 3 and type 5 and ABR inject
default route to totally stubby area to reachable external network and cisco
proprietary
NSSA (Not So Stubby Area)
- blocks type 5 LSAs
but allows redistribution of external routes inside NSSA as type 7 LSAs.
- ABR translates type
7 LSAs into type 5 LSAs before advertising them to area 0 or other normal
areas.
Router Types
1.Internal Router
It has
all interfaces within same area.
Maintain
a single LSDB for that area only
2.ABR
-router that has interfaces in
multiple areas, and one of them must be area 0
Maintains
separate LSDB per area and performs SPF calculation for each area's database.
ABR
advertises inter-area routes using Type 3 LSAs.
Route
summarization must be manually configured (area 1 range x.x.x.x x.x.x.x)
3. ASBR
Redistribute
external routes into ospf
ASBR
generates Type 5 LSAs (or Type 7 in NSSA)
External
route summarization must be manually configured(summary-address)
OSPF Message Types
1. Hello message
used to
discover neighbor and maintain neighbor relationship
2. DBD (Database Description)
used to
know own and neighbor's LSDB are fully synchronize or same.
3. LSR (Link state Request)
if some
LSAs are missing, request to send required LSA
4. LSU (Link State Update)
neighbor
send requested LSA
5. LSAck (Link State Acknowledge)
-send
back to neighbor when LSU message arrive
LSA Types
Type1 – Router LSA -> Every OSPF router
generates its own Type 1 LSA and floods it within the same area.
sh
ip ospf database router #show type1 router lsa
-intra-area routes appear as “O” in
routing-table after spf calculation based on type1/2 LSAs
Type2 –
Network LSA ->Generated by DR on multi-access broadcast and NBMA network
types and flooded within same area
sh
ip ospf database network
Type3 -
Summary LSA -> Generated by an ABR to advertise inter-area routes from one
area into other connected areas.
sh
ip ospf database summary
inter-area
routes appear as “O IA”in routing-table
Type4-ASBR
summary LSA-> Generated by ABR and advertises the reachability to ASBR into
other areas
#sh
ip ospf database asbr-summary
Type5-External
LSA -> generate by ASBR and flood to non-stub area
sh
ip ospf database external #show with “O E1 or O E2”
-(“redistribute
static subnets” work specific routes only not include default route)
-(“default-information
originate” only redistribute when default have in routing-table)
-(“default-information
originate always” can redistribute without having default route in routing)
-metric-type
E1 and E2(default). E1 calculate internal cost and external cost(default 20 but
for default route is 1). E2 is only external cost. E1 win then E2
Neighbor Adjacency Step by Step
---Establish Neighbor Adjacency -----
1. Down State
-no
hello received from that neighbor yet
2. Attempt State
-specific
for NBMA non-broadcast networks when neighbors are statically configured but
still not received hello from neighbor
3. Init State
-OSPF
hello packets are received from neighbor but still not see its own router id
from neighbor's hello message
4. Two Way state
-Router
see its own router id from neighbor's hello and it mean bidirectional
confirmed. Neighbor Established
-------Synchronize OSPF Databases-
5. Ex-Start State
- master/
slave negotiation (typically higher Router ID become master) and initial DBD
sequence number negotiation, preparing to start DBD exchange
6. Exchange State
-Start
Exchange DBD by master
7. Loading State
-router
A send LSR and B reply LSU and A send back LSAck to B
8. Full State
- adjacency
fully formed and LSDB synchronized.
Comments
Post a Comment