Step 20. Stub area¶
Goals¶
The goal of this step is to demonstrate OSPF stub areas.
A stub area is an area that does not receive AS-External LSAs (Type-5). Instead, the ABR injects a default route into the stub area, reducing the LSDB size and memory requirements for routers in that area.
Stub areas are useful for:
Reducing memory and CPU usage in routers with limited resources
Simplifying routing in areas with limited external connectivity (single exit point)
All routers in a stub area must be configured as stub; otherwise, adjacencies will not form.
Configuration¶
This step configures an area as a stub area.
The configuration in omnetpp.ini is the following:
[Config Step20]
description = "Stub area"
network = OSPF_Stub
*.configurator.config = xml("<config> \
<interface hosts='R3' towards='R4' address='192.168.0.x' netmask='255.255.255.x' /> \
<interface hosts='R4' towards='R3' address='192.168.0.x' netmask='255.255.255.x' /> \
\
<interface hosts='R2' towards='N1.*' address='192.168.8.x' netmask='255.255.255.x' /> \
<interface hosts='R3' towards='N2.*' address='192.168.9.x' netmask='255.255.255.x' /> \
<interface hosts='R4' towards='N3.*' address='192.168.10.x' netmask='255.255.255.x' /> \
\
<interface among='host1 host2 R1 R2 R3' address='192.168.11.x' netmask='255.255.255.x' /> \
<interface among='R3 R4 R5 host3' address='192.168.22.x' netmask='255.255.255.x' /> \
<interface hosts='**' address='192.168.x.x'/> \
\
<route hosts='host*' destination='*' netmask='0.0.0.0' interface='eth0' /> \
</config>")
*.R*.ospf.ospfConfig = xmldoc("ASConfig_Stub_Area.xml")
# application parameters
*.host1.numApps = 1
*.host1.app[0].typename = "PingApp"
*.host1.app[0].destAddr = "N3.host[0]"
*.host1.app[0].startTime = 60s
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">
<Stub defaultCost="1" />
<!-- area 2 is a normal area -->
<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" />
<ExternalInterface toward="N1" advertisedExternalNetworkAddress="R2>N1" advertisedExternalNetworkMask="R2>N1" externalInterfaceOutputCost="20" externalInterfaceOutputType="Type1" />
</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="N2" advertisedExternalNetworkAddress="R3>N2" advertisedExternalNetworkMask="R3>N2" externalInterfaceOutputCost="10" externalInterfaceOutputType="Type1" />
</Router>
<Router name="R4" RFC1583Compatible="true">
<PointToPointInterface ifName="ppp0" areaID="0.0.0.2" />
<PointToPointInterface ifName="ppp1" areaID="0.0.0.0" />
<ExternalInterface toward="N3" advertisedExternalNetworkAddress="R4>N3" advertisedExternalNetworkMask="R4>N3" externalInterfaceOutputCost="5" externalInterfaceOutputType="Type1" />
</Router>
<Router name="R5" RFC1583Compatible="true">
<BroadcastInterface ifName="eth0" areaID="0.0.0.2" interfaceMode="Passive" />
<PointToPointInterface ifName="ppp0" areaID="0.0.0.2" />
</Router>
</OSPFASConfig>
Results¶
In a stub area configuration:
The ABR does NOT flood AS-External LSAs (Type-5) into the stub area.
Instead, the ABR generates a default route Summary LSA (0.0.0.0/0) into the stub area.
Routers in the stub area have smaller LSDBs (no external LSAs).
Traffic destined for external networks uses the default route to the ABR (R5 forwards external traffic to R4, which then routes it appropriately to the external networks, N1, N2, or N3.)
Intra-area and inter-area routing works normally.
The stub area flag is negotiated in Hello packets. If there’s a mismatch, routers will not form adjacencies.
Stub areas provide significant scalability benefits for areas that don’t need detailed external routing information.
Sources:
omnetpp.ini,
OSPF_Stub.ned,
ASConfig_Stub_Area.xml
Discussion¶
Use this page in the GitHub issue tracker for commenting on this tutorial.