Table Of Contents
Table Of Contents

Step 8. BGP with OSPF and RIP redistribution

Goals

Step 8 demonstrates BGP’s ability to act as a unified routing plane over a heterogeneous internal landscape. In this scenario (BGP_Topology_4.ned), different Autonomous Systems use different IGPs, and BGP is responsible for providing seamless connectivity between them.

The setup is as follows:

  • AS 64500 (RA): Uses RIP as its internal routing protocol.

  • AS 64700 (RC): Also uses RIP internally.

  • AS 64600 (RB): Uses OSPF as its internal routing protocol.

Key features demonstrated:

  • Hybrid Redistribution: Border routers are configured to redistribute routes from both RIP and OSPF into BGP.

  • Protocol Interworking: BGP carries routes from a RIP-based domain, across an OSPF-based transit domain, to another RIP-based domain.

  • Unified Reachability: Demonstrating that end-to-end connectivity (e.g., host0 to host1) is independent of the specific IGPs used within each AS, provided BGP is correctly configured.

Configuration

The topology is the same as in Step 6 (BGP_Topology_4.ned).

../../../_images/BGP_Topology_4.png

The configuration in omnetpp.ini defines the protocol mix:

[Config Step8]
description = "BGP with OSPF and RIP redistribution"
network = BGP_Topology_4
*.routingTableRecorder.logfile = "step8.rt"

*.pcapRecorder.pcapFile = "step8.pcap"

# adding default routes in RA4 and RC1. RIP and OSPF will distribute it within the AS
*.configurator.config = xml("<config> \
                                <interface hosts='RA4' names='eth0' address='192.168.x.x' netmask='255.x.x.x'/> \
                                <interface hosts='RB1' names='eth2' address='192.168.x.x' netmask='255.x.x.x'/> \
                                <interface hosts='RB4' names='eth2' address='192.168.x.x' netmask='255.x.x.x'/> \
                                <interface hosts='RC1' names='eth2' address='192.168.x.x' netmask='255.x.x.x'/> \
                                \
                                <interface among='host0 RA*' address='10.x.x.x' netmask='255.x.x.x'/> \
                                <interface hosts='RA*' address='10.x.x.x' netmask='255.x.x.x'/> \
                                \
                                <interface hosts='RB*' address='20.x.x.x' netmask='255.x.x.x'/> \
                                \
                                <interface among='host1 RC*' address='30.x.x.x' netmask='255.x.x.x'/> \
                                <interface hosts='RC*' address='30.x.x.x' netmask='255.x.x.x'/> \
                                \
                                <route hosts='host*' destination='*' netmask='0.0.0.0' interface='eth0' /> \
                                \
                                <route hosts='RA4' destination='*' netmask='0.0.0.0' interface='eth0' /> \
                                <route hosts='RC1' destination='*' netmask='0.0.0.0' interface='eth2' /> \
                             </config>")

# RIP configuration
*.RA*.hasRip = true
*.RC*.hasRip = true
*.R*.rip.ripConfig = xmldoc("RIPConfig.xml")

# OSPF configuration
*.RB*.hasOspf = true
*.RB*.ospf.ospfConfig = xmldoc("OSPFConfig.xml")

# BGP configuration
*.RA4.hasBgp = true
*.RB1.hasBgp = true
*.RB4.hasBgp = true
*.RC1.hasBgp = true
*.R*.bgp.bgpConfig = xmldoc("BGPConfig_Redist.xml")
*.R*.bgp.redistributeRip = true
*.R*.bgp.redistributeOspf = "O IA"

# enable BGP on RB2 and RB3
*.RB2.hasBgp = true
*.RB3.hasBgp = true

The BGP configuration enables redistribution for both protocols:

*.R*.bgp.redistributeRip = true
*.R*.bgp.redistributeOspf = "O IA"

The BGP configuration:

<?xml version="1.0" encoding="ISO-8859-1"?>
<BGPConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="BGP.xsd">

    <TimerParams>
        <connectRetryTime> 120 </connectRetryTime>
        <holdTime>         180 </holdTime>
        <keepAliveTime>    60  </keepAliveTime>
        <startDelay>       50  </startDelay>   <!--long enough for the intra-AS routing protocol to converge-->
    </TimerParams>

    <AS id="64500">
    	<!--router RA4-->
        <Router interAddr="10.0.0.1"/>
    </AS>
    
    <AS id="64600">
    	<!--router RB1-->
        <Router interAddr="20.0.0.6">
            <Neighbor address='20.0.0.5' nextHopSelf='true' />
            <Neighbor address='20.0.0.2' nextHopSelf='true' />
            <Neighbor address='20.0.0.17' nextHopSelf='true' />
        </Router>
                        
        <!--router RB4-->
        <Router interAddr="20.0.0.2">
            <Neighbor address='20.0.0.6' nextHopSelf='true' />
            <Neighbor address='20.0.0.5' nextHopSelf='true' />
            <Neighbor address='20.0.0.17' nextHopSelf='true' />
        </Router>        
        
        <!--router RB2-->
        <Router interAddr="20.0.0.5"/>
        
        <!--router RB3-->
        <Router interAddr="20.0.0.17"/>
    </AS>

    <AS id="64700">
    	<!--router RC1-->
        <Router interAddr="30.0.0.1"/>
    </AS>

    <!--bi-directional E-BGP session between RA4 and RB1-->
    <Session id="1">
        <Router exterAddr="192.168.0.5"/>
        <Router exterAddr="192.168.0.6"/>
    </Session>
    
    <!--bi-directional E-BGP session between RB4 and RC1-->
    <Session id="2">
        <Router exterAddr="192.168.0.1"/>
        <Router exterAddr="192.168.0.2"/>
    </Session>

</BGPConfig>

Results

The simulation results in step8.rt show that BGP successfully bridges the different protocols:

  1. IGP Convergence:

    • Routers in RA and RC reach internal convergence using RIP.

    • Routers in RB reach internal convergence using OSPF.

  2. Redistribution into BGP:

    • RA4 and RC1 redistribute their RIP-learned routes into BGP.

    • RB1 and RB4 redistribute their OSPF-learned routes (including paths to IBGP peers) into BGP.

  3. BGP Propagation:

    • Routes from RA (10.x.x.x) are carried across RB via OSPF-enabled IBGP sessions and delivered to RC.

    • Routes from RC (30.x.x.x) are carried across RB and delivered to RA.

  4. End-to-End Success: Host0 in the RIP-based AS 64500 can successfully ping Host1 in the RIP-based AS 64700, transiting through the OSPF-based AS 64600.

This step highlights BGP’s role as the “glue” of the Internet, enabling communication between networks with entirely different internal architectures.

Sources: BGP_Topology_4.ned, omnetpp.ini, RIPConfig.xml, OSPFConfig.xml, BGPConfig_Redist.xml

Discussion

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