Table Of Contents
Table Of Contents

Step 18b. AS-External LSAs of ‘type 2 metric’ with different advertised destination

Goals

The goal of this step is to demonstrate AS-External LSAs with Type-2 metrics.

Type-2 (E2) is the default external metric type in OSPF. With Type-2 metrics:

  • The cost to the external destination is ONLY the external cost advertised by the ASBR

  • Internal OSPF cost to reach the ASBR is NOT added to the metric

  • If multiple ASBRs advertise the same destination with the same external cost, the ASBR with the lowest internal cost is preferred (used as a tiebreaker)

Type-2 is appropriate when external costs are much larger than internal OSPF costs.

Configuration

This configuration is based on Step 18, using Type-2 metrics instead of Type-1.

../../../_images/OSPF_Area_External.png

The configuration in omnetpp.ini is the following:

[Config Step18b]
description = "AS-External LSAs of 'type 2 metric' with different advertised destination"
extends = Step18

*.R*.ospf.ospfConfig = xmldoc("ASConfig_Area_ExternalRoute_Type2.xml")

The OSPF configuration:

<?xml version="1.0"?>
<OSPFASConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="OSPF.xsd">

  <!-- Areas -->
  <Area id="0.0.0.0">
    <AddressRange address="R3>R4" mask="R3>R4" />
    <AddressRange address="R4>R3" mask="R4>R3" />
  </Area>

  <Area id="0.0.0.1">
    <AddressRange address="R1>switch1" mask="R1>switch1" />
    <AddressRange address="R1>R2" mask="R1>R2" />
    <AddressRange address="R1>R3" mask="R1>R3" />        
    
    <AddressRange address="R2>switch2" mask="R2>switch2" />
    <AddressRange address="R2>R1" mask="R2>R1" />
    <AddressRange address="R2>R3" mask="R2>R3" />        

    <AddressRange address="R3>R1" mask="R3>R1" />
    <AddressRange address="R3>R2" mask="R3>R2" />
  </Area>

  <Area id="0.0.0.2">
    <AddressRange address="R4>R5" mask="R4>R5" />
    
    <AddressRange address="R5>R4" mask="R5>R4" />
    <AddressRange address="R5>switch3" mask="R5>switch3" />
  </Area>

  <!-- Routers -->
  <Router name="R1" RFC1583Compatible="true">
    <BroadcastInterface ifName="eth0" areaID="0.0.0.1" interfaceMode="Passive" />
    <PointToPointInterface ifName="ppp0" areaID="0.0.0.1" />
    <PointToPointInterface ifName="ppp1" areaID="0.0.0.1" />
  </Router>

  <Router name="R2" RFC1583Compatible="true">
    <BroadcastInterface ifName="eth0" areaID="0.0.0.1" interfaceMode="Passive" />
    <PointToPointInterface ifName="ppp0" areaID="0.0.0.1" />
    <PointToPointInterface ifName="ppp1" areaID="0.0.0.1" />
  </Router>

  <Router name="R3" RFC1583Compatible="true">
    <PointToPointInterface ifName="ppp0" areaID="0.0.0.1" />
    <PointToPointInterface ifName="ppp1" areaID="0.0.0.1" />
    <PointToPointInterface ifName="ppp2" areaID="0.0.0.0" />
    <ExternalInterface toward="N1" advertisedExternalNetworkAddress="R3>N1" advertisedExternalNetworkMask="R3>N1" externalInterfaceOutputCost="10" externalInterfaceOutputType="Type2" />
  </Router>

  <Router name="R4" RFC1583Compatible="true">
    <PointToPointInterface ifName="ppp0" areaID="0.0.0.2" />
    <PointToPointInterface ifName="ppp1" areaID="0.0.0.0" />
  </Router>

  <Router name="R5" RFC1583Compatible="true">
    <BroadcastInterface ifName="eth0" areaID="0.0.0.2" interfaceMode="Passive" />
    <PointToPointInterface ifName="ppp0" areaID="0.0.0.2" />
    <ExternalInterface toward="N2" advertisedExternalNetworkAddress="R5>N2" advertisedExternalNetworkMask="R5>N2" externalInterfaceOutputCost="5" externalInterfaceOutputType="Type2" />
  </Router>

</OSPFASConfig>

Results

With Type-2 external routes:

  1. ASBRs generate AS-External LSAs with Type-2 metric (E2).

  2. Routers calculate routes using ONLY the external cost.

  3. The route cost displayed in routing tables is the external cost, regardless of how far the ASBR is from the router.

  4. All routers see the same cost for a given external route.

  5. Internal topology has minimal impact on external route selection (only used as tiebreaker).

Type-2 is useful when external metrics represent costs in a different domain (e.g., BGP AS-path length) that shouldn’t be mixed with internal OSPF costs.

Sources: omnetpp.ini, OSPF_Area_External.ned, ASConfig_Area_ExternalRoute_Type2.xml

Discussion

Use this page in the GitHub issue tracker for commenting on this tutorial.