Table Of Contents
Table Of Contents

Step 24. OSPF Path Selection - Suboptimal routes

Goals

[explanation]

Configuration

This step uses the following network:

../../../_images/step24.png
network OSPF_Suboptimal
{
    @display("bgb=772,445");

    submodules:
        configurator: Ipv4NetworkConfigurator {
            @display("p=65,38");
        }
        visualizer: IntegratedCanvasVisualizer {
            @display("p=187,38");
        }
        scenarioManager: ScenarioManager {
            @display("p=324,38");
        }
        R1: Router {
            @display("p=64.128,139.278");
        }
        R2: Router {
            @display("p=230.45999,139.278");
        }
        R3: Router {
            @display("p=559.11597,139.278");
        }
        R4: Router {
            @display("p=323.646,242.484");
        }
        R5: Router {
            @display("p=474.948,242.484");
        }
        switch4: EtherSwitch {
            @display("p=64.128,386.772");
        }
        switch3: EtherSwitch {
            @display("p=474.948,330.66");
        }
        R6: Router {
            @display("p=230.45999,387.774");
        }
        R7: Router {
            @display("p=559.11597,387.774");
        }
        switch1: EtherSwitch {
            @display("p=708,138");
        }
        switch2: EtherSwitch {
            @display("p=323.646,330.66");
        }
        host0: StandardHost {
            @display("p=65,246");
        }
        host6: StandardHost {
            @display("p=708,387");
        }
    connections:
        R2.ethg++ <--> Eth100M <--> R1.ethg++;
        R2.ethg++ <--> Eth100M <--> R3.ethg++;
        R2.ethg++ <--> Eth100M <--> R6.ethg++;
        R2.ethg++ <--> Eth100M <--> R4.ethg++;
        R4.ethg++ <--> Eth100M <--> R5.ethg++;
        R5.ethg++ <--> Eth100M <--> R3.ethg++;
        R3.ethg++ <--> Eth100M <--> R7.ethg++;
        R7.ethg++ <--> Eth100M <--> R6.ethg++;
        switch4.ethg++ <--> Eth100M <--> R6.ethg++;
        switch1.ethg++ <--> Eth100M <--> R3.ethg++;
        switch3.ethg++ <--> Eth100M <--> R5.ethg++;
        switch2.ethg++ <--> Eth100M <--> R4.ethg++;
        host0.ethg++ <--> Eth100M <--> R1.ethg++;
        host6.ethg++ <--> Eth100M <--> R7.ethg++;
}

The configuration in omnetpp.ini is the following:

[Config Step24]
description = "OSPF Path Selection - Suboptimal routes"
network = OSPF_Suboptimal

# host0 pings host6 and the following route is used by the OSPF that is not optimal:
# R1--> R2 --> R4 --> R5 --> R3 --> R7 --> 10.0.0.52
# this is because intra-area routes are always prefered by inter-area routes even if
# they have higher total cost.

*.configurator.config = xml("<config> \
                                <interface hosts='**' address='10.x.x.x' netmask='255.x.x.x'/> \
                                <route hosts='host*' destination='*' netmask='0.0.0.0' interface='eth0' /> \
                             </config>")

# application parameters
*.host0.numApps = 1
*.host0.app[0].typename = "PingApp"
*.host0.app[0].destAddr = "host6"
*.host0.app[0].startTime = 60s

*.R*.ospf.ospfConfig = xmldoc("ASConfig_Suboptimal.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.1">
    <AddressRange address="R2>R4" mask="R2>R4" />
    <AddressRange address="R2>R6" mask="R2>R6" />      
    
    <AddressRange address="R3>R5" mask="R3>R5" />
    <AddressRange address="R3>R7" mask="R3>R7" />      
    
    <AddressRange address="R4>R2" mask="R4>R2" />
    <AddressRange address="R4>R5" mask="R4>R5" />   
    <AddressRange address="R4>switch2" mask="R4>switch2" /> 
    
    <AddressRange address="R5>R4" mask="R5>R4" />
    <AddressRange address="R5>R3" mask="R5>R3" />   
    <AddressRange address="R5>switch3" mask="R5>switch3" /> 
    
    <AddressRange address="R6>R2" mask="R6>R2" />
    <AddressRange address="R6>R7" mask="R6>R7" />
    <AddressRange address="R6>switch4" mask="R6>switch4" />
    
    <AddressRange address="R7>R6" mask="R7>R6" />
    <AddressRange address="R7>R3" mask="R7>R3" />
    <AddressRange address="R7>host6" mask="R7>host6" />    
  </Area>

  <!-- Routers -->
  <Router name="R1" RFC1583Compatible="true">
    <BroadcastInterface ifName="eth0" areaID="0.0.0.0" />
    <BroadcastInterface ifName="eth1" areaID="0.0.0.0" interfaceMode="Passive" />
  </Router>

  <Router name="R2" RFC1583Compatible="true">
    <BroadcastInterface ifName="eth0" areaID="0.0.0.0" />
    <BroadcastInterface ifName="eth1" areaID="0.0.0.0" />
    <BroadcastInterface ifName="eth2" areaID="0.0.0.1" interfaceOutputCost="10" />
    <BroadcastInterface ifName="eth3" areaID="0.0.0.1" />
  </Router>

  <Router name="R3" RFC1583Compatible="true">
    <BroadcastInterface ifName="eth0" areaID="0.0.0.0" />
    <BroadcastInterface ifName="eth1" areaID="0.0.0.1" />
    <BroadcastInterface ifName="eth2" areaID="0.0.0.1" />
    <BroadcastInterface ifName="eth3" areaID="0.0.0.0" interfaceMode="Passive" />
  </Router>

  <Router name="R4" RFC1583Compatible="true">
    <BroadcastInterface ifName="eth0" areaID="0.0.0.1" />
    <BroadcastInterface ifName="eth1" areaID="0.0.0.1" />
    <BroadcastInterface ifName="eth2" areaID="0.0.0.1" interfaceMode="Passive" />
  </Router>

  <Router name="R5" RFC1583Compatible="true">
    <BroadcastInterface ifName="eth0" areaID="0.0.0.1" />
    <BroadcastInterface ifName="eth1" areaID="0.0.0.1" />
    <BroadcastInterface ifName="eth2" areaID="0.0.0.1" interfaceMode="Passive" />
  </Router>
   
  <Router name="R6" RFC1583Compatible="true">
    <BroadcastInterface ifName="eth0" areaID="0.0.0.1" />
    <BroadcastInterface ifName="eth1" areaID="0.0.0.1" />
    <BroadcastInterface ifName="eth2" areaID="0.0.0.1" interfaceMode="Passive" />
  </Router>
  
  <Router name="R7" RFC1583Compatible="true">
    <BroadcastInterface ifName="eth0" areaID="0.0.0.1" />
    <BroadcastInterface ifName="eth1" areaID="0.0.0.1" />
    <BroadcastInterface ifName="eth2" areaID="0.0.0.1" interfaceMode="Passive" />
  </Router>

</OSPFASConfig>

Results

[explanation]

Sources: omnetpp.ini, OSPF_Suboptimal.ned, ASConfig_Suboptimal.xml

Discussion

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