OSPF Forward Address – Database Overview

This post covers in detail the OSPF LSA Types, their scope and functionality. You should read this publication to understand how OSPF works because it can get very complex.

Contents

  1. Topology.
  2. OSPF Topology.
  3. OSPF Database Overview.
    1. Type 1 LSA – Router LSA.
    2. Type 2 LSA – Network LSA.
    3. Type 3 LSA – Summary LSA.
    4. Type 4 LSA – Summary ASBR LSA.
    5. Type 5 LSA – Autonomous system External LSA.

Topology

This diagram shows the topology we are going to use for this discussion:

Figure 1

OSPF Topology

There are two Interior Gateway Protocols (IGPs) running in our topology: OSPF 1 that runs in the internal network and EIGRP 100 that runs in the external domain. R7 is the point of mutual redistribution between OSPF and EIGRP.

Figure 2

OSPF Database Overview

In this section we are going to go over the OSPF database in order to understand its structure, the different LSA Types and their flooding domain, and how nodes and prefixes are described.

Type 1 LSA – Router LSA:

Router LSA describes the nodes or routers that are within a particular area and the number of prefixes that each node has. Type 1 LSA flooding domain is the area; they are not flooded out to other areas.

Figure 3

Remember that in OSPF we solve the tree to the nodes and implicitly we learn the shortest path to the prefixes because the prefixes or links are attributes of the node. The principle behind this is “If I can route to the node, I can route to its links”. The calculation of the Shortest Path Tree (SPT) to each router and the prefixes associated to that particular router is what allows OSPF to build the graph of the network topology.

One thing to remember is that Link ID is the ID of the node; this is not an IP address. In this particular example and if we focus on R2, 2.2.2.2 is the Link ID of R2 that we manually configured under the OSPF process (router-id command). If this is not manually configured, the highest IP address is selected as a node ID. R2’s node ID is 2.2.2.2, which is not a real IP address configured on any R2’s interfaces.

Type 1 LSA has the Link ID and ADV Router parameters configured as the Node ID. Remember, you always use the Link ID to query the OSPF database.

R1#show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 0)
Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         612         0x80000008 0x00E9A6 5
2.2.2.2         2.2.2.2         22          0x8000000B 0x00AAAF 5
3.3.3.3         3.3.3.3         21          0x80000007 0x000277 5
4.4.4.4         4.4.4.4         270         0x80000009 0x00F771 5
Router Link States (Area 1)
Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         581         0x80000002 0x0055AD 1
2.2.2.2         2.2.2.2         577         0x80000002 0x0017E2 1
7.7.7.7         7.7.7.7         582         0x80000007 0x00EE04 2

As you can see in the output above, R2 has 5 links in Area 0 and 1 link in Area 2. But if you check the diagram R2 has 2 point-to-point links (Fa1/0 and Fa0/0) and a Loopback (Lo2) in Area 0, however the Link Count shows the number 5. Why does it show 5 links when R2 only has 3 links in Area 0? This is because Point-to-Point links are modelled as two entries in Type 1 LSA: one entry describes solely a direct connection to another router, without advertising the network that is present on the link. The second entry advertises the network on the point-to-point link as a stub network.

OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 0)
LS age: 465
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 2.2.2.2
Advertising Router: 2.2.2.2
LS Seq Number: 8000000B
Checksum: 0xAAAF
Length: 84
Area Border Router
Number of Links: 5

Link connected to: a Stub Network

(Link ID) Network/subnet number: 172.16.1.2

(Link Data) Network Mask: 255.255.255.255

Number of TOS metrics: 0

TOS 0 Metrics: 1

Link connected to: another Router (point-to-point)

(Link ID) Neighboring Router ID: 4.4.4.4

(Link Data) Router Interface address: 10.1.24.2

Number of TOS metrics: 0

TOS 0 Metrics: 10

Link connected to: a Stub Network

(Link ID) Network/subnet number: 10.1.24.0

(Link Data) Network Mask: 255.255.255.0

Number of TOS metrics: 0

TOS 0 Metrics: 10

Link connected to: another Router (point-to-point)

(Link ID) Neighboring Router ID: 3.3.3.3

(Link Data) Router Interface address: 10.1.23.2

Number of TOS metrics: 0

TOS 0 Metrics: 1

Link connected to: a Stub Network

(Link ID) Network/subnet number: 10.1.23.0

(Link Data) Network Mask: 255.255.255.0

Number of TOS metrics: 0

TOS 0 Metrics: 1

Type 2 LSA – Network LSA:

The type 2 LSA or Network LSA is originated by the Designated Router (DR) on broadcast or non broadcast networks. The DR is the router with the highest priority or highest IP address if there is a tie in priority. The DR is used for more efficiently peerings setup because routers do not need to be fully adjacent with each other (full mesh). Network LSA is area significant and it is not flooded out of the area.

Figure 4

R1#show ip ospf database
Net Link States (Area 1)
Link ID         ADV Router      Age         Seq#       Checksum
10.1.127.7      7.7.7.7         1538        0x80000002 0x002936

One thing to remember is that the Link ID is the IP Address of the DR in the segment, 10.1.127.7, and the ADV Router is the ID of the node. In our topology, the DR just happens to be R7 (because of the highest IP address) which is running the virtual process of the DR. Technically, R1, R2 and R7 are not adjacent, they are adjacent with the DR.

R1# show ip ospf database router self-originate
Router Link States (Area 1)
  LS age: 52
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 1.1.1.1
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000003
  Checksum: 0x53AE
  Length: 36
  Area Border Router
  Number of Links: 1
    Link connected to: a Transit Network
     (Link ID) Designated Router address: 10.1.127.7
     (Link Data) Router Interface address: 10.1.127.1
      Number of TOS metrics: 0
       TOS 0 Metrics: 10

Then, the next step is to query the DR: “who are you adjacent with?”

R1#show ip ospf database network 10.1.127.7
            OSPF Router with ID (1.1.1.1) (Process ID 1)
                Net Link States (Area 1)
  Routing Bit Set on this LSA
  LS age: 1246
  Options: (No TOS-capability, DC)
  LS Type: Network Links
  Link State ID: 10.1.127.7 (address of Designated Router)
  Advertising Router: 7.7.7.7
  LS Seq Number: 80000002
  Checksum: 0x2936
  Length: 36
  Network Mask: /24
        Attached Router: 7.7.7.7
        Attached Router: 1.1.1.1
        Attached Router: 2.2.2.2

The DR lists the Node IDs of the routers within the segment: R1 (1.1.1.1), R2 (2.2.2.2) and R7 (7.7.7.7).

Type 3 LSA – Summary LSA:

Type 3 LSAs are generated by Area Border Routers (ABRs). Type 1 LSAs do not cross area boundaries, so ABRs use Type 3 LSA to inform routers in an area about prefixes learned in other areas.

Figure 5

In our particular example, ABRs inform routers in Area 0 about prefixes (Link IDs) learned from Area 1 and Area 2 and vice versa. The ADV Router is the Node ID of the ABRs in the network (R1 – 1.1.1.1, R2 – 2.2.2.2 and R3 – 3.3.3.3).

Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.1.35.0       3.3.3.3         572         0x80000003 0x007E78
10.1.56.0       3.3.3.3         318         0x80000003 0x00FADC
10.1.127.0      1.1.1.1         734         0x80000004 0x00C0E0
10.1.127.0      2.2.2.2         630         0x80000004 0x00A2FA
172.16.1.5      3.3.3.3         318         0x80000003 0x00D68A
172.16.1.6      3.3.3.3         318         0x80000003 0x003125
172.16.1.7      1.1.1.1         734         0x80000002 0x000167
172.16.1.7      2.2.2.2         630         0x80000002 0x00E281

Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
10.1.13.0       1.1.1.1         737         0x80000002 0x00AF66
10.1.13.0       2.2.2.2         119         0x80000003 0x009976
10.1.14.0       1.1.1.1         737         0x80000002 0x004AD3
10.1.14.0       2.2.2.2         632         0x80000002 0x00907F
10.1.23.0       1.1.1.1         2026        0x80000002 0x004BBF
10.1.23.0       2.2.2.2         119         0x80000002 0x00C848
10.1.24.0       1.1.1.1         737         0x80000002 0x0040C9
10.1.24.0       2.2.2.2         633         0x80000002 0x0018EE
10.1.35.0       1.1.1.1         738         0x80000002 0x0021D4
10.1.35.0       2.2.2.2         122         0x80000003 0x00A653
10.1.56.0       1.1.1.1         741         0x80000002 0x009D39
10.1.56.0       2.2.2.2         122         0x80000003 0x0023B7
172.16.1.1      1.1.1.1         741         0x80000002 0x00D89F
172.16.1.1      2.2.2.2         635         0x80000002 0x002940
172.16.1.2      1.1.1.1         741         0x80000002 0x003D2F
172.16.1.2      2.2.2.2         635         0x80000002 0x00B0C2
172.16.1.3      1.1.1.1         741         0x80000002 0x002943
172.16.1.3      2.2.2.2         122         0x80000003 0x00AEC1
172.16.1.4      1.1.1.1         741         0x80000002 0x00C4AF
172.16.1.4      2.2.2.2         635         0x80000002 0x000166
172.16.1.5      1.1.1.1         741         0x80000002 0x0079E6
172.16.1.5      2.2.2.2         122         0x80000003 0x00FE65
172.16.1.6      1.1.1.1         741         0x80000002 0x00D381
172.16.1.6      2.2.2.2         122         0x80000003 0x0059FF

In the output below, R1 learns about the prefix 10.1.35.0/24 from R3. R3 is who originates the Summary LSA from Area 2 into Area 0. However, R1 also sees the Summary LSA about the same prefix in Area 1. This is because the Type 3 LSA is advertised by itself (1.1.1.1) and R2 (2.2.2.2) from Area 0 to Area 1.  In this way R7 can also learn about prefixes in Area 2.

R1#show ip ospf database summary 10.1.35.0
            OSPF Router with ID (1.1.1.1) (Process ID 1)
                Summary Net Link States (Area 0)
  Routing Bit Set on this LSA
  LS age: 872
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 10.1.35.0 (summary Network Number)
  Advertising Router: 3.3.3.3
  LS Seq Number: 8000000B
  Checksum: 0x6E80
  Length: 28
  Network Mask: /24
        TOS: 0  Metric: 10
                Summary Net Link States (Area 1)
  LS age: 956
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 10.1.35.0 (summary Network Number)
  Advertising Router: 1.1.1.1
  LS Seq Number: 8000000D
  Checksum: 0xB043
  Length: 28
  Network Mask: /24
        TOS: 0  Metric: 11
  LS age: 1407
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 10.1.35.0 (summary Network Number)
  Advertising Router: 2.2.2.2
  LS Seq Number: 8000000E
  Checksum: 0x905E
  Length: 28
  Network Mask: /24
        TOS: 0  Metric: 11

Type 3 LSA describes the metric reported by the ABR to get to a specific prefix. So if I add my metric to reach the ABR plus the ABR’s reported metric I can find my final metric to the destination. From R1’s point of view this is: 1 (my metric to R3) + 10 (metric reported by R3 in the output above) = 11.

R1#show ip ospf border-routers
OSPF Process 1 internal Routing Table
Codes: i – Intra-area route, I – Inter-area route
i 2.2.2.2 [2] via 10.1.13.3, FastEthernet0/0, ABR, Area 0, SPF 33
i 2.2.2.2 [10] via 10.1.127.2, FastEthernet0/1, ABR, Area 1, SPF 13
i 2.2.2.2 [2] via 10.1.14.4, FastEthernet1/0, ABR, Area 0, SPF 33
i 3.3.3.3 [1] via 10.1.13.3, FastEthernet0/0, ABR, Area 0, SPF 33
i 7.7.7.7 [10] via 10.1.127.7, FastEthernet0/1, ASBR, Area 1, SPF 13

R1#show ip route 10.1.35.0
Routing entry for 10.1.35.0/24
  Known via “ospf 1”, distance 110, metric 11, type inter area
  Last update from 10.1.13.3 on FastEthernet0/0, 03:46:57 ago
  Routing Descriptor Blocks:
  * 10.1.13.3, from 3.3.3.3, 03:46:57 ago, via FastEthernet0/0
      Route metric is 11, traffic share count is 1

Type 4 LSA – Summary ASBR LSA:

It is generated by an ABR, NOT by an ASBR. The type 4 LSA is an LSA that instructs the rest of the OSPF domain how to get to the ASBR so that other routes in the OSPF domain can route to external prefixes redistributed into OSPF by the ASBR.

Figure 6

According to that, routers that are in the same Area where the ASBR is located they do not see the type 4 LSA. Because it is generated by ABRs, only routers in other areas are able to see this Summary ASBR LSA.

In our scenario, R1 sees this Type 4 LSA originated by itself (1.1.1.1) and by R2 (2.2.2.2) in Area 0. R1 does not see the Summary ASBR LSA in Area 1 where R7 (7.7.7.7), the ASBR, resides.

Note that Link ID is the Node ID of R7, 7.7.7.7, again this is not R7’s IP address.

Summary ASB Link States (Area 0)
Link ID         ADV Router      Age         Seq#       Checksum
7.7.7.7         1.1.1.1         497         0x80000001 0x007E93
7.7.7.7         2.2.2.2         499         0x80000001 0x0060AD

R1#show ip ospf database asbr-summary
            OSPF Router with ID (1.1.1.1) (Process ID 1)
                Summary ASB Link States (Area 0)
  LS age: 360
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(AS Boundary Router)
  Link State ID: 7.7.7.7 (AS Boundary Router address)
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000001
  Checksum: 0x7E93
  Length: 28
  Network Mask: /0
        TOS: 0  Metric: 10
  LS age: 362
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(AS Boundary Router)
  Link State ID: 7.7.7.7 (AS Boundary Router address)
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000001
  Checksum: 0x60AD
  Length: 28
  Network Mask: /0
        TOS: 0  Metric: 10

Type 4 LSA describes the metric reported by the ABR to reach the ASBR. Therefore, if I add my metric to reach the ABR to the ABR’s reported metric to the ASBR I can find my final metric to exit point of the OSPF domain. From R3’s point of view this is: 10 (metric reported by R1/R2 to the ASBR) + 1 (my metric to my ABR – R1/R2 – equal metric) = 11.

R3#show ip ospf database asbr-summary
            OSPF Router with ID (3.3.3.3) (Process ID 1)
                Summary ASB Link States (Area 0)
  Routing Bit Set on this LSA
  LS age: 1823
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(AS Boundary Router)
  Link State ID: 7.7.7.7 (AS Boundary Router address)
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000008
  Checksum: 0x709A
  Length: 28
  Network Mask: /0
        TOS: 0  Metric: 10
  Routing Bit Set on this LSA
  LS age: 2019
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(AS Boundary Router)
  Link State ID: 7.7.7.7 (AS Boundary Router address)
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000008
  Checksum: 0x52B4
  Length: 28
  Network Mask: /0
        TOS: 0  Metric: 10

R3#show ip ospf border-routers
OSPF Process 1 internal Routing Table
Codes: i – Intra-area route, I – Inter-area route
i 1.1.1.1 [1] via 10.1.13.1, FastEthernet0/0, ABR, Area 0, SPF 30
i 2.2.2.2 [1] via 10.1.23.2, FastEthernet1/0, ABR, Area 0, SPF 30
I 7.7.7.7 [11] via 10.1.23.2, FastEthernet1/0, ASBR, Area 0, SPF 30
I 7.7.7.7 [11] via 10.1.13.1, FastEthernet0/0, ASBR, Area 0, SPF 30

The command show ip ospf border-routers also give us the final metric (11) to the ASBR.

R3#show ip route 10.1.127.7
Routing entry for 10.1.127.0/24
  Known via “ospf 1”, distance 110, metric 11, type inter area
  Last update from 10.1.13.1 on FastEthernet0/0, 00:55:12 ago
  Routing Descriptor Blocks:
    10.1.23.2, from 2.2.2.2, 00:55:12 ago, via FastEthernet1/0
      Route metric is 11, traffic share count is 1
  * 10.1.13.1, from 1.1.1.1, 00:55:12 ago, via FastEthernet0/0
      Route metric is 11, traffic share count is 1

However, if we want to know the metric to the ASBR from R1’s point of view we query the OSPF database to check if the ASBR is in my area. R1 and R7 are part of Area 1 so the Type 1 LSA gives us the metric to the ASBR (10). There is not Type 4 LSA involved.

R1#show ip ospf database router 7.7.7.7
            OSPF Router with ID (1.1.1.1) (Process ID 1)
                Router Link States (Area 1)
  Routing Bit Set on this LSA
  LS age: 1875
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 7.7.7.7
  Advertising Router: 7.7.7.7
  LS Seq Number: 80000011
  Checksum: 0xE006
  Length: 48
  AS Boundary Router
  Number of Links: 2
    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 172.16.1.7
     (Link Data) Network Mask: 255.255.255.255
      Number of TOS metrics: 0
       TOS 0 Metrics: 1
    Link connected to: a Transit Network
     (Link ID) Designated Router address: 10.1.127.7
     (Link Data) Router Interface address: 10.1.127.7
      Number of TOS metrics: 0
       TOS 0 Metrics: 10

Notice that intra area external (the ASBR is in my area) is always preferred over inter area external (the ASBR is not in my area) independently of the cost.

Type 5 LSA – Autonomous system External LSA:

It is generated by an ASBR. It creates a Type 5 LSA for a prefix that is injected into OSPF from an external source, in this particular topology EIGRP. This describes the metric reported by the ASBR to get to the external destination. There are two metric types: E1 routes which use the redistributed cost plus the cost to the ASBR and E2 routes which only use the redistributed cost and does not increment with flooding. The redistributed cost or metric reported by the ASBR is 20 by default and E1 routes are preferred over E2 routes in the OSPF path selection algorithm.

Figure 7

R3#show ip ospf database
Type-5 AS External Link States
Link ID         ADV Router      Age         Seq#       Checksum Tag
10.1.78.0       7.7.7.7         1295        0x80000009 0x00190A 0
172.16.1.8      7.7.7.7         1295        0x80000009 0x002492 0

From R3 if we query the OSPF database about the external prefix 172.16.1.8/32, we can see that it has been advertised by R7 (Advertising Router: 7.7.7.7), the ASBR; that is an E2 route and the reported metric from the ASBR to reach the destination is 20.

R3#show ip ospf database external 172.16.1.8
            OSPF Router with ID (3.3.3.3) (Process ID 1)
                Type-5 AS External Link States
  Routing Bit Set on this LSA
  LS age: 1467
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 172.16.1.8 (External Network Number )
  Advertising Router: 7.7.7.7
  LS Seq Number: 80000009
  Checksum: 0x2492
  Length: 36
  Network Mask: /32
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 0

If we check the routing table information, we can verify that the metric to reach the final destination is 20  so the metric to reach the ASBR (forward metric 11) is not added to the final metric calculation.

R3#show ip route 172.16.1.8
Routing entry for 172.16.1.8/32
  Known via “ospf 1”, distance 110, metric 20, type extern 2, forward metric 11
  Last update from 10.1.23.2 on FastEthernet1/0, 00:00:41 ago
  Routing Descriptor Blocks:
    10.1.23.2, from 7.7.7.7, 00:00:41 ago, via FastEthernet1/0
      Route metric is 20, traffic share count is 1
  * 10.1.13.1, from 7.7.7.7, 00:00:41 ago, via FastEthernet0/0
      Route metric is 20, traffic share count is 1

If we change the route type to E1 when doing redistribution:

R7(config)#router ospf 1
R7(config-router)#redistribute eigrp 100 subnets metric-type 1

And now see what have changed, we can see the metric reported by the ASBR to reach 172.16.1.8/32 is still 20 but the forward metric (11) is added to the final metric shown in the routing table (31).

R3#show ip ospf database external 172.16.1.8
            OSPF Router with ID (3.3.3.3) (Process ID 1)
                Type-5 AS External Link States
  Routing Bit Set on this LSA
  LS age: 27
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 172.16.1.8 (External Network Number )
  Advertising Router: 7.7.7.7
  LS Seq Number: 8000000A
  Checksum: 0x9E97
  Length: 36
  Network Mask: /32
        Metric Type: 1 (Comparable directly to link state metric)
        TOS: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 0

R3#show ip route 172.16.1.8
Routing entry for 172.16.1.8/32
  Known via “ospf 1”, distance 110, metric 31, type extern 1
  Last update from 10.1.23.2 on FastEthernet1/0, 00:00:14 ago
  Routing Descriptor Blocks:
    10.1.23.2, from 7.7.7.7, 00:00:14 ago, via FastEthernet1/0
      Route metric is 31, traffic share count is 1
  * 10.1.13.1, from 7.7.7.7, 00:00:14 ago, via FastEthernet0/0
      Route metric is 31, traffic share count is 1

If you want to learn more about the Forward Address in OSPF Type 5 and Type 7 LSA, you can check the next post: OSPF Forward Address – Case Studies.

Leave a Reply

Your email address will not be published. Required fields are marked *