Step 18e. Address Forwarding¶
Goals¶
The goal of this step is to demonstrate the use of the Forwarding Address field in AS-External LSAs.
By default, when an ASBR advertises an external route, the Forwarding Address is set to 0.0.0.0, meaning traffic should be sent to the ASBR itself. However, if the external network is reachable through another router on a shared network, the ASBR can set the Forwarding Address to that router’s IP, allowing packets to be forwarded directly to the actual next-hop router, saving a hop.
Configuration¶
This step demonstrates a scenario where R6 (not running OSPF) is the actual gateway to an external network, and R5 (an ASBR) sets the Forwarding Address to R6’s IP.
The configuration in omnetpp.ini is the following:
[Config Step18e]
description = "Address Forwarding"
network = OSPF_Area_External_Forwarding
# R6 is not an OSPF router.
# forwardingAddress is set to 192.168.22.3 in R5. Other routers forward packets with destination 192.168.22.8
# to R6. If forwardingAddress is unset, packets are forwarded to R5 and then to R6 (packet delivery takes one extra hop).
*.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 among='host1 host2 R1 R2 R3' address='192.168.11.x' netmask='255.255.255.x' /> \
<interface among='R3 R4 R5 R6 host3' address='192.168.22.x' netmask='255.255.255.x' /> \
\
<route hosts='host*' destination='*' netmask='0.0.0.0' interface='eth0' /> \
<route hosts='R6' destination='*' netmask='0.0.0.0' interface='eth0' gateway='192.168.22.1' /> \
</config>")
*.R6.hasOspf = false
*.R*.ospf.ospfConfig = xmldoc("ASConfig_Area_ExternalRoute_Forwarding.xml")
# application parameters
*.host1.numApps = 1
*.host1.app[0].typename = "PingApp"
*.host1.app[0].destAddr = "host3"
*.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">
<AddressRange address="R4>switch3" mask="R4>switch3" />
<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" />
</Router>
<Router name="R4" RFC1583Compatible="true">
<PointToPointInterface ifName="ppp0" areaID="0.0.0.0" />
<BroadcastInterface ifName="eth0" areaID="0.0.0.2" />
</Router>
<Router name="R5" RFC1583Compatible="true">
<BroadcastInterface ifName="eth0" areaID="0.0.0.2" />
<ExternalInterface ifName="eth0" advertisedExternalNetworkAddress="192.168.22.8" advertisedExternalNetworkMask="255.255.255.252" externalInterfaceOutputCost="10" externalInterfaceOutputType="Type1" forwardingAddress="192.168.22.3" />
</Router>
</OSPFASConfig>
Results¶
With the Forwarding Address configured:
R5 (ASBR) advertises an external route with Forwarding Address set to R6’s IP (192.168.22.3).
Other OSPF routers learn this external route.
When sending packets to the external destination, routers forward them directly to R6 (via OSPF routing to 192.168.22.3), not to R5.
This saves one hop compared to routing through R5 first.
The ping from host1 to host3 demonstrates the direct forwarding path.
The Forwarding Address field allows OSPF to optimize forwarding when the ASBR is not the actual next-hop to the external destination.
Sources:
omnetpp.ini,
OSPF_Area_External_Forwarding.ned,
ASConfig_Area_ExternalRoute_Forwarding.xml
Discussion¶
Use this page in the GitHub issue tracker for commenting on this tutorial.