Tuesday, December 27, 2011

Type-4 ASBR-Summary-LSA and Type-5 AS-External-LSA

Network Setup for Type-4 ASBR-Summary-LSA and Type-5 AS-External-LSA

Type-4 ASBR-Summary-LSAs are originated from an ABR that resides within the same area as the ASBR to identify the ASBR and describes the route to the ASBR. Type-5 LSAs are flooded to all areas but the detailed info to reach the ASBR may not be available throughout all areas. This problem is solved by having an ABR to describe the route to the ASBR that originated the Type-5 LSA. The Link-State ID of a Type-4 LSA is the Router ID of the ASBR.

Type-5 AS-External-LSAs are originated from an ASBR and contains information imported into an OSPF routing domain from other routing processes. Type-5 LSAs are flooded throughout all areas except stub areas, totally stubby areas, and NSSAs. When a stub router receives a Type-5 LSA from another router within the stub area, the LSA will be rejected.
The Link-State ID of a Type-5 LSA is the IP address of the external subnet that is being advertised.
MISC Note:
 Internal routes are always preferred over external routes.
 There is no Type-4 and Type-5 LSAs when there is no ASBR in an OSPF routing domain.
 All OSPF routers in a routing domain maintain the same Type-5 LSA in their LSDBs.
 All types of LSAs have area flooding scope (not flooded across area borders); expect Type-5 LSAs which have AS flooding scope (flooded throughout all areas).

OSPF Type-5 AS-External-LSA Format

Below lists the fields in the OSPF AS-External-LSA:

Field
Description
Network Mask Indicates the subnet mask of the external network that is being advertised.
Note: If the Type-5 LSA is advertising a default route, the Link-State ID and the Network Mask are both 0.0.0.0.
E (External Metric) bit Indicates the type of external metric for the advertised external route. If the E bit is set to 1, the metric type is E2; else the metric type is E1. E2 is the default route type for routes learnt via route redistribution.
Metric Indicates the cost of the external route as set by the ASBR.
Forwarding Address Indicates the destination IP address to which the packets for the advertised external network should be forwarded. If the Forwarding Address is 0.0.0.0, the packets are forwarded to the originating ASBR. The Forwarding Address will be non-zero in the following situations to avoid suboptimal routing:
- OSPF is enabled on the ASBR’s next-hop interface
- The ASBR’s next-hop interface is non-passive to OSPF
- The ASBR’s next-hop interface network type is not point-to-point or point-to-multipoint
- The ASBR’s next-hop interface address falls into the OSPF network range
Note: The route to the non-zero Forwarding Address must be known via an intra-area or inter-area route; or else the external route will not be installed into the routing table!
External Route Tag Indicates an arbitrary tag that may be applied upon the external route. It is not being used by OSPF itself, but is instead provides external route management using route maps.

Below lists the criteria for an OSPF router to install an AS-External-LSA into its routing table:
i) The router must be able to reach the ASBR through an intra-area or inter-area route, which means that there must be a Type-1 Router-LSA or Type-4 ASBR-Summary-LSA generated for the ASBR.
ii) The Forwarding Address must be known via an intra-area or inter-area route.

A default seed metric of 1 will be used for redistributed BGP routes; while a default seed metric of 20 will be used for routes redistributed from other routing protocols, including static routes and directly connected interfaces. The seed metric is a starting metric for redistributed routes.

Below shows the routing table, as well as Type-4 ASBR-Summary-LSA and Type-5 AS-External-LSAs received on RT4:
RT4#sh ip route

Gateway of last resort is not set

     20.0.0.0/30 is subnetted, 1 subnets
O IA    20.20.20.0 [110/128] via 30.30.30.1, 00:00:45, Serial0/0
     10.0.0.0/30 is subnetted, 1 subnets
O E2    10.10.10.0 [110/20] via 30.30.30.1, 00:00:35, Serial0/0
O E2 192.168.1.0/24 [110/20] via 30.30.30.1, 00:00:35, Serial0/0
     30.0.0.0/30 is subnetted, 1 subnets
C       30.30.30.0 is directly connected, Serial0/0
RT4#
RT4#sh ip ospf database asbr-summary

            OSPF Router with ID (44.44.44.44) (Process ID 100)

                Summary ASB Link States (Area 1)

  Routing Bit Set on this LSA
  LS age: 45
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(AS Boundary Router)
  Link State ID: 22.22.22.22 (AS Boundary Router address)
  Advertising Router: 33.33.33.33
  LS Seq Number: 80000001
  Checksum: 0x24FA
  Length: 28
  Network Mask: /0
        TOS: 0  Metric: 64

RT4#
RT4#sh ip ospf database external

            OSPF Router with ID (44.44.44.44) (Process ID 100)

                Type-5 AS External Link States

  Routing Bit Set on this LSA
  LS age: 57
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 10.10.10.0 (External Network Number )
  Advertising Router: 22.22.22.22
  LS Seq Number: 80000001
  Checksum: 0xD557
  Length: 36
  Network Mask: /30
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 0

  Routing Bit Set on this LSA
  LS age: 57
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 192.168.1.0 (External Network Number )
  Advertising Router: 22.22.22.22
  LS Seq Number: 80000001
  Checksum: 0x9449
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 0

RT4#
Note: Type-4 LSAs are not translated directly from link-state database into routing table.
Note: The metric value in a Type-4 LSA indicates the cost from the ABR to reach the ASBR. This value is used by routers within an area to determine the nearest ABR for an external route.

Below describes the routing table designators for OSPF:

Code
Description
O OSPF intra-area route that indicates a network within the area which the router resides. Learnt via a Router-LSA or Network-LSA.
O IA OSPF inter-area route that indicates a network outside the area which the router resides but within the OSPF routing domain. Learnt via a Summary-LSA.
O E1 / O E2 OSPF Type-1 / Type-2 external route that indicates a network outside the autonomous system which the router resides. Learnt via an AS-External-LSA.

The difference between External Type-1 (E1) and External Type-2 (E2) external routes is that the metric of an E1 route is similar to the OSPF metric in which the external metric is being accumulated with the internal metric of every link across the forwarding path towards the ASBR; while the metric of an E2 route remains the same as the external metric throughout an OSPF routing domain. E2 is the default route type for routes that learnt via route redistribution.

The recommended best practices are implement E1 routes when multiple ASBRs are advertising an external route into the same routing domain in order to avoid suboptimal routing; implement E2 routes when there is only 1 ASBR is advertising an external route into the routing domain.

Network Setup for OSPF E1 and E2 Routes

Below shows the routing tables on RT1 and RT2 for the OSPF E1 and E2 routes advertised by RT3:
RT1#sh ip route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, FastEthernet0/0
     11.0.0.0/24 is subnetted, 1 subnets
O IA    11.11.11.0 [110/2] via 10.10.10.2, 00:00:39, FastEthernet0/0
O E1 192.168.1.0/24 [110/22] via 10.10.10.2, 00:00:24, FastEthernet0/0
O E2 192.168.2.0/24 [110/20] via 10.10.10.2, 00:00:24, FastEthernet0/0
RT1#
======================================================================
RT2#sh ip route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, FastEthernet0/0
     11.0.0.0/24 is subnetted, 1 subnets
C       11.11.11.0 is directly connected, FastEthernet1/0
O E1 192.168.1.0/24 [110/21] via 11.11.11.2, 00:00:37, FastEthernet1/0
O E2 192.168.2.0/24 [110/20] via 11.11.11.2, 00:00:37, FastEthernet1/0
RT2#

External Type-1 (E1) routes are always preferred over External Type-2 (E2) routes. When there are multiple External Type-2 (E2) routes for the same external network in the OSPF LSDB, the LSA with the lowest advertised E2 metric will be selected and installed into the routing table. The forward metric (cost to reach an ASBR) will be considered when multiple E2 routes have the same metric value. The show ip ospf border-routers command displays the cost to an ASBR. Note: The internal metric or cost towards the ASBR is not considered when comparing E2 routes.

Network Setup for OSPF E1 and E2 Routes Selection

Below shows the routing table and OSPF LSDB on RT1 for the OSPF external routes:
RT1#sh ip route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, FastEthernet0/0
O E1 192.168.1.0/24 [110/101] via 10.10.10.2, 00:00:30, FastEthernet0/0
O E2 192.168.2.0/24 [110/50] via 10.10.10.3, 00:00:30, FastEthernet0/0
RT1#sh ip ospf database

            OSPF Router with ID (10.10.10.1) (Process ID 100)

--- output omitted ---

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.10.4      11.11.11.4      59          0x80000001 0x00B4AA

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
192.168.1.0     11.11.11.2      96          0x80000001 0x00B58D 0
192.168.1.0     11.11.11.3      96          0x80000001 0x003DB6 0
192.168.2.0     11.11.11.3      96          0x80000001 0x0032C0 0
192.168.2.0     11.11.11.4      100         0x80000001 0x00229D 0
RT1#

No comments:

Post a Comment