Compale

Open Shortest Path First (OSPF)

OSPF is

Examples
Link state protocolOSPFFaster, Better routes
Distance vector protocolRIPSlower

Router ID

The router ID

The selection criteria for the router ID is

  1. a manually configured router ID
  2. the highest IP address on loopback interface
  3. the highest IP address on active interface

[!tip] Best practice Manually configure the router ID and a loopback interface with the same address. Enable OSPF on the loopback interface.

OSPF

OSPF routers exchange hello LSAs periodically on OSPF-enabled interfaces. The hello message is addressed to 224.0.0.5 (all OSPF routers) and contains information to establish a adjacency with other OSPF routers. Data in the LSAs exchanged between two OSPF routers has to match or routers remain in the INIT state. Route reflectors

OSPF router typeAdvertised LSA typesAdjacency
DRType 2, LSU to 224.0.0.5With all other routers
BDRLSU to DRWith all other routers
DROTHERLSU to 224.0.0.6With DR and BDR

Multi-area OSPF

Multi-area OSPF divides the OSPF system into multiple areas for

Multi-area OSPF uses a two-tiered hierarchy to scale:

OSPF router that connect a non-backbone areas to the backbone area are ABR (Area Border Router) and maintain LSDB for both areas. ASBR (Autonomous System Broder Router) connect to an external network and redistribute routes into the OSPF system. Multi-area ospf

LSA types

TypeNameAdvertised byScopeIncluded information
1RouterAll routersAreaLinks (ID, type, metric)
2NetworkDR for broadcast networksAreaDR IP, network mask, IDs of routers on the network
3SummaryABRsAreaNetwork in another area (network IP, mask, metric)
4ASBRABRsAreaASBR router ID and metric
5AS externalASBRsAll normal areas in the ASExternal network, mask, metric, metric type
7NSSA externalASBRsAreaExternal network, mask, metric, metric type
9Opaque link localAll capable OSPF routersLinkExtensions (graceful restart)
10Opaque area-localAll capable OSPF routersAreaExtensions (traffic engineering)
11Opaque ASCapable ASBRsNon-stub areasExtensions

LSA type 1 (router)

LSA type 1 is advertised by all routers and local to the area the router is part of. This LSA contains information of all directly connected routes.

LSA type 2 (network)

LSA type 2 is advertised by the DR on a segment. The DR advertises its connected subnets.

LSA type 3 (route summary)

LSA type 3 are generated by ABRs to summarize

[!tip] Best practice: Route summarization on ABR Route summarization reduces the amount of LSUs and SPF recalculation by aggregating routes. The ABR advertises a few type 3 LSAs instead of one type 3 LSA for every network in an area.

LSA type 4 (ASBR summary)

LSA type 4 are generated by the ABR to advertise the presence of an ASBR.

LSA type 5 (AS external)

LSA type 5 are generated by the ASBR to advertise external redistributed routes into the OSPF system.

Commands

  1. Create OSPF routing process with router ospf <PROCESS_ID>
  2. Define router ID with router-id <ROUTER_ID>
  3. Create an area with area <AREA>
  4. Enable OSPF on L3 interfaces
    1. Assign interface to an area with ip ospf area <AREA>
    2. Specify network type with ip ospf network <NETWORK-TYPE>