OSPF


How OSPF works:

OSPF routers send out Hello packets every 10 seconds (30 seconds for NBMA and Point-to-Multipoint networks) to negotiate a two-way neighbor relationship (in order to become neighbors, they must agree on certain parameters such as Hello interval and network types). A neighbor is declared down if no Hello packet is received within the dead-interval (by default 4 x Hello-interval).

Adjacency is not necessarily established between all two-way neighbors (e.g. DOthers don't establish adjacency with each other).

LSAs are sent to the adjacent neighbors. Neighbors first forward the received LSAs out to their own adjacent neighbors, then create their own topology databases based on these LSAs. This repeats until the LSAs are flooded throughout the whole area.

Every router in the area builds SPF tree based on its own topology database and calculate the shortest path to every known destination.

LSAs are retransmitted every 30 minutes with a incremental sequence number even there is no network topology change. LSAs will timeout after 60 minutes without receiving refresh LSAs.

OSPF multicast addresses:

· 224.0.0.5 is All OSPF routers
· 224.0.0.6 is All DRouters (DR and BDR)

OSPF network types:

1. Broadcast Network

· elects DR and BDR
· OSPF routers only become adjacent with DR/BDR
· Hellos are sent to 224.0.0.5
· LSAs are sent to 224.0.0.6, then DR floods them to 224.0.0.5

2. Poin-to-Point Network

· no DR/BDR election
· neighbors always become adjacent
· both Hellos and LSAs use 224.0.0.5

3. Point-to-Multipoint Network

· no DR/BDR election
· multiple remote sites terminating on the same interface
· creates a /32 host route for each neighbor (no need for complete frame-relay mapping)
· essentially creates a group of point-to-point adjacencies
· better alternative to NBMA

4. Point-to-Multipoint non-broadcast Network

· no DR/BDR election
· variation from point-to-multipoint (it allows defining different cost for different neighbors)
· neighbors need to be explicitly defined on the hub

5. Non-broadcast Multi-access Network (NBMA)

· elects DR and BDR
· DR has to have direct pvc to every neighbor, need to explicitly set priority to 0 on all DOther routers
· neighbors need to be explicitly defined on the DR (DOther doesn’t need neighbor definition)
· essentially the DR will forward LSA among the Dothers
· all OSPF packets are unicast

6. Loopback Network

· by default creates /32 host route for loopback interfaces

7. Virtual Link Network

· treated as point-to-point network
· cannot run across a stub area
· must be terminated on router ID instead of just any physical interface address.
· different from tunneling in that the transitional routers will see the real destination address, which means the routers on the path in the transitional area must know how to route the packet
· A virtual ink essentially creates two ABRs, and the routers on the path need to know how to reach the destination, therefore a virtual link cannot be built across a stub area.

Note: Network types with DR/BDR are able to establish adjacency with each other (may need to adjust timer), and network types without DR/BDR are able to establish adjacency with each other. However they cannot mix match.

When using non-broadcast network type, a complete frame-relay mapping statement has to be explicitly defined on all routers on the same NBMA subnet (even if there is no direct pvc between the two routers) because spoke A will see sopke B (not the DR) as the next hop for spoke B’s sunbets.

Complete frame-relay mapping statement is not required for point-to-multipoint network type because it creates a /32 host route for each router, and spoke A’s next-hop for spoke B’s subets is the hub (because a point-to-multipoint network is treated as a group of point-to-point networks).

OSPF interface state machine:

OSPF neighbor state machine:

1. Down
2. Init
3. Two-way
4. Ex-Start
5. Exchange
6. Loading
7. Full

OSPF area types:

· Transitional area
· Backbone area
· Stub area (doesn’t accept any external routes, only inter-area routes)
· Totally stubby area (doesn’t even accept inter-area routes, only a default route)
· NSSA area (only accept its own external routes and inter-area routes)
· Totally NSSA area (only accept its own external routes and a default route)

Note: ASBR of a NSSA area uses a P-bit (pass bit) to notify the ABR whether or not to translate the type 7 NSSA external LSAs into type 5 external AS LSAs and flood them throughout other areas. Cisco implementation always set P-bit to 1.

OSPF LSA types:

type 1 – router link LSA
type 2 – network link LSA (generated by DR)
type 3 – network summary LSA
type 4 – ASBR summary LSA
type 5 – external AS LSA
type 6 – MOSPF LSA
type 7 – external NSSA LSA

OSPF metric:

cost = 10^8/bw

cost is only considered in one-direction (only the outgoing interfaces on the path towards the destination will be considered, which means the router interfaces at each end of a link can have different costs).

OSPF route types (in the order of preference):

intra-area routes
inter-area routes
type 1 external routes
type 2 external routes

OSPF packet types:

Hello packet
LSA request packet
LSA update packet
LSA acknowledgement packet
Database description packet (used during ExStart state)
· I-bit (indicates the first DD packet)
· M-bit (indicates more DD packets to come)
· M/S-bit (indicates Master of the database sync process)

OSPF stub router:

Similar to EIGRP stub router, the stub router will change its interfaces in the non-stub areas to infinity while keep the stub area interfaces unchanged.

OSPF Demand Circuit:

OSPF demand circuit suppresses both Hello packets and LSA refresh packets (LSAs learned across it will not age), but still floods LSA updates across it when there is a network topology change.

More information can be found at:

OSPF Stub Router

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?