Table Of Contents
Table Of Contents

Step 17. Loop avoidance in multi-area OSPF topology

Goals

[explanation]

Configuration

This step uses the following network:

../../../_images/step17.png
network OSPF_LoopAvoidance
{
    @display("bgb=692,488");

    submodules:
        configurator: Ipv4NetworkConfigurator {
            @display("p=62.18875,63.635002");
        }
        visualizer: IntegratedCanvasVisualizer {
            @display("p=195.24374,63.635002");
        }
        scenarioManager: ScenarioManager {
            @display("p=357.22375,63.635002");
        }
        R1: Router {
            @display("p=218,179");
        }
        R2: Router {
            @display("p=474,179");
        }
        R3: Router {
            @display("p=349,297");
        }
        R4: Router {
            @display("p=474,411");
        }
        R5: Router {
            @display("p=218,411");
        }
        switch1: EtherSwitch {
            @display("p=72,177");
        }
        switch2: EtherSwitch {
            @display("p=619,177");
        }
        switch3: EtherSwitch {
            @display("p=250,296");
        }
        switch4: EtherSwitch {
            @display("p=619,410");
        }
        switch5: EtherSwitch {
            @display("p=72,410");
        }
        switch6: EtherSwitch {
            @display("p=349,410");
        }

    connections:
        switch1.ethg++ <--> Eth100M <--> R1.ethg++;
        R2.ethg++ <--> Eth100M <--> R3.ethg++;
        R2.ethg++ <--> Eth100M <--> switch2.ethg++;
        R5.ethg++ <--> Eth100M <--> switch5.ethg++;
        R3.ethg++ <--> Eth100M <--> R4.ethg++;
        R3.ethg++ <--> Eth100M <--> R5.ethg++;
        R5.ethg++ <--> Eth100M <--> R1.ethg++;
        R4.ethg++ <--> Eth100M <--> R2.ethg++;
        switch4.ethg++ <--> Eth100M <--> R4.ethg++;
        R1.ethg++ <--> Eth100M <--> R2.ethg++;
        switch3.ethg++ <--> Eth100M <--> R3.ethg++;
        switch6.ethg++ <--> Eth100M <--> R3.ethg++;
}

The configuration in omnetpp.ini is the following:

[Config Step17]
description = "Loop avoidance in multi-area OSPF topology"
network = OSPF_LoopAvoidance

*.configurator.config = xml("<config> \
                                <interface hosts='R1' names='eth0' address='10.0.0.9' netmask='255.255.255.252' /> \
                                <interface hosts='R1' towards='R2' address='10.0.0.5' netmask='255.255.255.252' /> \
                                <interface hosts='R1' towards='R5' address='10.0.0.1' netmask='255.255.255.252' /> \
                                \
                                <interface hosts='R2' names='eth1' address='10.0.0.21' netmask='255.255.255.252' /> \
                                <interface hosts='R2' towards='R1' address='10.0.0.6' netmask='255.255.255.252' /> \
                                <interface hosts='R2' towards='R3' address='10.0.0.13' netmask='255.255.255.252' /> \
                                <interface hosts='R2' towards='R4' address='10.0.0.17' netmask='255.255.255.252' /> \
                                \
                                <interface hosts='R3' names='eth3' address='10.0.0.33' netmask='255.255.255.252' /> \
                                <interface hosts='R3' names='eth4' address='10.0.0.37' netmask='255.255.255.252' /> \
                                <interface hosts='R3' towards='R2' address='10.0.0.14' netmask='255.255.255.252' /> \
                                <interface hosts='R3' towards='R5' address='10.0.0.29' netmask='255.255.255.252' /> \
                                <interface hosts='R3' towards='R4' address='10.0.0.25' netmask='255.255.255.252' /> \
                                \
                                <interface hosts='R4' names='eth2' address='10.0.0.41' netmask='255.255.255.252' /> \
                                <interface hosts='R4' towards='R2' address='10.0.0.18' netmask='255.255.255.252' /> \
                                <interface hosts='R4' towards='R3' address='10.0.0.26' netmask='255.255.255.252' /> \
                                \
                                <interface hosts='R5' names='eth0' address='10.0.0.45' netmask='255.255.255.252' /> \
                                <interface hosts='R5' towards='R1' address='10.0.0.2' netmask='255.255.255.252' /> \
                                <interface hosts='R5' towards='R3' address='10.0.0.30' netmask='255.255.255.252' /> \
                                \
                                <route hosts='host*' destination='*' netmask='0.0.0.0' interface='eth0' /> \
                             </config>")

*.R*.ospf.ospfConfig = xmldoc("ASConfig_Area_Loop.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="R1>R2" mask="R1>R2" />
    <AddressRange address="R2>R1" mask="R2>R1" />
  </Area>

  <Area id="0.0.0.1">
    <AddressRange address="R1>R5" mask="R1>R5" />
    <AddressRange address="R1>switch1" mask="R1>switch1" />      
    
    <AddressRange address="R5>R1" mask="R5>R1" />
    <AddressRange address="R5>R3" mask="R5>R3" />        
    <AddressRange address="R5>switch5" mask="R5>switch5" />
    
    <AddressRange address="R3>R5" mask="R3>R5" />
    <AddressRange address="R3>switch3" mask="R3>switch3" />
  </Area>

  <Area id="0.0.0.2">
    <AddressRange address="R2>switch2" mask="R2>switch2" />
    <AddressRange address="R2>R4" mask="R2>R4" />        
    <AddressRange address="R2>R3" mask="R2>R3" />
    
    <AddressRange address="R4>switch4" mask="R4>switch4" />
    <AddressRange address="R4>R2" mask="R4>R2" />        
    <AddressRange address="R4>R3" mask="R4>R3" />    
        
    <AddressRange address="R3>R2" mask="R3>R2" />
    <AddressRange address="R3>R4" mask="R3>R4" />
    <AddressRange address="R3>switch6" mask="R3>switch6" />
  </Area>

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

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

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

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

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

</OSPFASConfig>

Discussion

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