OSPF

 OSPF (Open Shortest Path First) uses Link State Advertisements (LSAs) to share routing information within and between areas. These LSAs populate the Link State Database (LSDB), which is used to calculate the shortest path tree. Below is an explanation of the key OSPF LSA types:

Type 1: Router LSA Generated by every router within an area, this LSA contains information about the router's directly connected links, including their types and states. It does not leave the originating area.

Type 2: Network LSA Generated by the Designated Router (DR) on multi-access networks, this LSA lists all routers connected to the network, including the DR and Backup DR. It also includes the network's prefix and subnet mask. Like Type 1, it remains within the area.

Type 3: Summary LSA Created by Area Border Routers (ABRs), this LSA advertises inter-area routes to other areas. It allows routers in one area to learn about networks in other areas. Despite its name, it does not summarize routes by default unless explicitly configured.

Type 4: Summary ASBR LSA Generated by ABRs to inform other areas about the location of an Autonomous System Boundary Router (ASBR). This LSA is essential for routing to external networks redistributed into OSPF.

Type 5: External LSA Created by ASBRs, this LSA advertises routes to external networks (e.g., those learned via redistribution from other protocols like RIP). These routes are marked as E1 or E2 in the routing table, depending on how the cost is calculated.

Type 6: Multicast OSPF LSA This LSA type is reserved for multicast OSPF but is not widely used or supported (e.g., not supported by Cisco).

Type 7: NSSA External LSA Used in Not-So-Stubby Areas (NSSAs), this LSA allows external routes to be advertised within the NSSA. It is converted to a Type 5 LSA by the ABR when leaving the NSSA.

Key Notes

  • LSAs are identified by their Link ID, Advertising Router, and other attributes like sequence number and checksum.

  • LSAs have a maximum age of 3600 seconds (1 hour) before being removed from the LSDB.

  • The show ip ospf database command on Cisco routers can be used to view LSAs in the LSDB.

Understanding these LSA types is crucial for configuring and troubleshooting OSPF networks, especially in multi-area or redistributed environments.


OSPF uses a metric called OSPF Cost based on each hop's outgoing interface bandwidth.


Every router then advertises the Cost of each link as part of the LSA Type 1 advertisement to neighbors. Since all routers within an area have all LSAs - in the end, all routers know the cost of all links in the area. 



In OSPF, External Type 1 (E1) and External Type 2 (E2) routes are used to represent networks redistributed from outside the OSPF domain. While both are advertised using Type-5 LSAs (or Type-7 in NSSA areas), the way their costs are calculated and compared is different.

E1 Routes

  • The total cost is the sum of the external cost (from the ASBR to the destination) plus the internal OSPF cost (from the local router to the ASBR).

  • This means E1 reflects the true end-to-end cost through the OSPF domain.

  • Preferred when internal path cost matters, especially in multi-entry point designs where internal distances vary.

E2 Routes

  • The cost is only the external cost assigned at redistribution, regardless of internal OSPF path cost.

  • By default, E2 routes have a metric of 20 unless manually changed.

  • Internal OSPF costs are ignored, so all routers see the same metric to the destination, even if internal paths differ.


https://www.networkacademy.io/ccna/ospf/ospf-area-types



On Cisco ASA and FTD platforms, you often must explicitly tell OSPF to allow subnet redistribution. If it is missing, only classful networks (like A, B, or C) are redistributed.

router ospf 1
...
 redistribute static metric 1 subnets route-map Static-to-OSPF-GDC
!
FTD-GDC#




Configuration Summary



Networks list generates network command under "router ospf".


FTD-GDC# sh run router ospf

router ospf 1

 router-id 3.3.3.3

 network 10.3.3.0 255.255.255.0 area 0

 network 10.3.254.0 255.255.255.128 area 0

 network 10.3.254.128 255.255.255.128 area 0

 log-adj-changes

 redistribute static metric 1 subnets route-map Static-to-OSPF-GDC

!

FTD-GDC#






Interface list specify which interface participants the OSPF process, generating interface OSPF commands.


FTD-GDC# sh run int g0/2

!

interface GigabitEthernet0/2

 nameif mpls-1

 security-level 0

 ip address 10.3.254.2 255.255.255.128

 ospf cost 50

 ospf authentication null

 ospf bfd disable

FTD-GDC#

FTD-GDC#

FTD-GDC# sh run int g0/3

!

interface GigabitEthernet0/3

 nameif mpls-2

 security-level 0

 ip address 10.3.254.130 255.255.255.128

 ospf cost 150

 ospf authentication null

 ospf bfd disable

FTD-GDC#






=============



FTD-HQ# sh ospf database network 10.3.3.0



            OSPF Router with ID (5.5.5.5) (Process ID 1)

FTD-HQ#


 blank under the Router ID heading. This means network 10.3.3.0/24 is not being advertised as an internal Type 2 Network LSA in this OSPF area, Type 2 LSA only exists for multi-access segments (like Ethernet) that have a Designated Router (DR).
 If your subnet is missing from that specific command, it is likely because:
  • It is a point-to-point link: It is inside a Type 1 Router LSA instead.
  • It is an external route: It was redistributed into OSPF from another protocol.
  • It is an inter-area route: It lives in a different OSPF area.


FTD-HQ# sh route 10.3.3.0

Routing entry for 10.3.3.0 255.255.255.0
  Known via "ospf 1", distance 110, metric 70, type intra area
  Last update from 10.5.254.1 on mpls-1, 18:55:36 ago
  Routing Descriptor Blocks:
  * 10.5.254.1, from 3.3.3.3, 18:55:36 ago, via mpls-1
      Route metric is 70, traffic share count is 1

FTD-HQ#

The output shows that 10.3.3.0/24 is a type intra area route. This means the network lives inside your own OSPF area, so it must be configured as a point-to-point network type, advertised in Type 1 Router SLA from router 3.3.3.3. 


FTD-HQ# show ospf database router 3.3.3.3


            OSPF Router with ID (5.5.5.5) (Process ID 1)

                Router Link States (Area 0)

  Routing Bit Set on this LSA
  LS age: 904
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 3.3.3.3
  Advertising Router: 3.3.3.3
  LS Seq Number: 80000025
  Checksum: 0x9229
  Length: 60
  AS Boundary Router
  Number of Links: 3

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 10.3.3.0
     (Link Data) Network Mask: 255.255.255.0
      Number of TOS metrics: 0
       TOS 0 Metrics: 10

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 10.3.254.130
     (Link Data) Router Interface address: 10.3.254.130
      Number of TOS metrics: 0
       TOS 0 Metrics: 150

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 10.3.254.1
     (Link Data) Router Interface address: 10.3.254.2
      Number of TOS metrics: 0
       TOS 0 Metrics: 50


FTD-HQ#

-----------

Analyze redistributed route 10.3.4.0


FTD-HQ# show route 10.3.4.0

Routing entry for 10.3.4.0 255.255.255.0
  Known via "ospf 1", distance 110, metric 71, type extern 1
  Last update from 10.5.254.1 on mpls-1, 16:46:55 ago
  Routing Descriptor Blocks:
  * 10.5.254.1, from 3.3.3.3, 16:46:55 ago, via mpls-1
      Route metric is 71, traffic share count is 1

FTD-HQ#
FTD-HQ# sh ospf database external 10.3.4.0


            OSPF Router with ID (5.5.5.5) (Process ID 1)

                Type-5 AS External Link States

  Routing Bit Set on this LSA
  LS age: 533
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 10.3.4.0 (External Network Number )
  Advertising Router: 3.3.3.3
  LS Seq Number: 8000001f
  Checksum: 0x825c
  Length: 36
  Network Mask:255.255.255.0
        Metric Type: 1 (Comparable directly to link state metric)
        TOS: 0
        Metric: 1
        Forward Address: 10.3.3.10
        External Route Tag: 0

FTD-HQ#


























Comments