Table Of Contents
Table Of Contents

Step 5. BGP Scenario with I-BGP over not directly-connected BGP speakers

Goals

This step explores Internal BGP (I-BGP) in a more realistic scenario where I-BGP peers are not directly connected. The topology (BGP_Topology_3.ned) features a transit Autonomous System, AS 64600 (RB), consisting of three routers: RB1, RB3, and RB2.

The setup is as follows:

  • RB1 and RB2 are border routers running BGP. They are I-BGP peers.

  • RB3 is an interior router that does not run BGP.

  • The routers are connected in a chain: RB1 <-> RB3 <-> RB2.

  • OSPF is running on all routers within AS 64600 to provide internal reachability.

The primary goal is to demonstrate the “BGP Hole” or “BGP Synchronization” problem. While RB1 and RB2 can establish an I-BGP session over the multi-hop OSPF path, the interior router RB3 remains unaware of the external routes learned via BGP.

Configuration

This step uses the following network:

../../../_images/BGP_Topology_3.png
network BGP_Topology_3
{
    @display("bgb=1238.76,594.405");

    submodules:
        configurator: Ipv4NetworkConfigurator {
            @display("p=93,44");
        }
        visualizer: IntegratedMultiCanvasVisualizer {
            @display("p=243.2025,43.536247");
        }
        routingTableRecorder: RoutingTableRecorder {
            @display("p=426,43");
        }
        pcapRecorder: PcapRecorder {
            @display("p=636,42");
        }
        RB2: Router {
            @display("p=699.3,174.825");
        }
        RC1: Router {
            @display("p=872.46,392.94");
        }
        RC2: Router {
            @display("p=964.035,344.655");
        }
        RC3: Router {
            @display("p=964.035,444.555");
        }

        RB1: Router {
            @display("p=491.175,174.825");
        }
        RA4: Router {
            @display("p=349.79123,400.83374");
        }
        RA2: Router {
            @display("p=244.70375,342.285");
        }
        RA3: Router {
            @display("p=244.70375,442.86874");
        }

        RA1: Router {
            @display("p=153.1275,393.32748");
        }
        RC4: Router {
            @display("p=1048.95,392.94");
        }
        switch1: EthernetSwitch {
            @display("p=54.045,391.82623");
        }
        switch2: EthernetSwitch {
            @display("p=244.70375,250.70874");
        }
        switch3: EthernetSwitch {
            @display("p=244.70375,534.445");
        }
        switch4: EthernetSwitch {
            @display("p=964.035,246.42");
        }
        switch5: EthernetSwitch {
            @display("p=964.035,527.805");
        }
        switch6: EthernetSwitch {
            @display("p=1158.84,391.275");
        }
        host0: StandardHost {
            @display("p=53.28,251.415");
        }
        host1: StandardHost {
            @display("p=1158.84,261.405");
        }
        RB3: Router {
            @display("p=599.265,97.8075");
        }
    connections:
        RC1.ethg++ <--> Eth100M <--> RC2.ethg++;
        RC1.ethg++ <--> Eth100M <--> RC3.ethg++;
        RB2.ethg++ <--> Eth100M <--> RC1.ethg++;
        RB1.ethg++ <--> Eth100M <--> RA4.ethg++;
        RA4.ethg++ <--> Eth100M <--> RA2.ethg++;
        RA3.ethg++ <--> Eth100M <--> RA4.ethg++;
        RA2.ethg++ <--> Eth100M <--> RA1.ethg++;
        RA1.ethg++ <--> Eth100M <--> RA3.ethg++;
        RC4.ethg++ <--> Eth100M <--> RC2.ethg++;
        RC3.ethg++ <--> Eth100M <--> RC4.ethg++;
        switch1.ethg++ <--> Eth100M <--> RA1.ethg++;
        RA2.ethg++ <--> Eth100M <--> switch2.ethg++;
        RA3.ethg++ <--> Eth100M <--> switch3.ethg++;
        RC2.ethg++ <--> Eth100M <--> switch4.ethg++;
        RC3.ethg++ <--> Eth100M <--> switch5.ethg++;
        RC4.ethg++ <--> Eth100M <--> switch6.ethg++;
        switch1.ethg++ <--> Eth100M <--> host0.ethg++;
        switch6.ethg++ <--> Eth100M <--> host1.ethg++;
        RB1.ethg++ <--> Eth100M <--> RB3.ethg++;
        RB3.ethg++ <--> Eth100M <--> RB2.ethg++;
}

The configuration in omnetpp.ini is the following:

[Config Step5]
description = "BGP Scenario with I-BGP over not directly-connected BGP speakers"
network = BGP_Topology_3
*.routingTableRecorder.logfile = "step5.rt"

*.pcapRecorder.pcapFile = "step5.pcap"

# adding default routes in RA4 and RC1 and ask OSPF to 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='eth0' address='192.168.x.x' netmask='255.x.x.x'/> \
                                \
                                <interface hosts='RB2' names='eth0' 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 among='RB1 RB2 RB3' 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='RA4' destination='*' netmask='0.0.0.0' interface='eth0' /> \
                                <route hosts='RC1' destination='*' netmask='0.0.0.0' interface='eth2' /> \
                                <route hosts='host*' destination='*' netmask='0.0.0.0' interface='eth0' /> \
                             </config>")

# OSPF configuration
*.R*.hasOspf = true
*.R*.ospf.ospfConfig = xmldoc("OSPFConfig_Multi.xml")

*.RA4.ipv4.routingTable.routerId = "10.0.0.5"
*.RC1.ipv4.routingTable.routerId = "30.0.0.5"
*.RB1.ipv4.routingTable.routerId = "20.0.0.5"
*.RB2.ipv4.routingTable.routerId = "20.0.0.1"

# BGP configuration
*.RA4.hasBgp = true
*.RB1.hasBgp = true
*.RB2.hasBgp = true
*.RC1.hasBgp = true
*.R*.bgp.bgpConfig = xmldoc("BGPConfig_Multi.xml")

# enable OSPF redistribution
*.RA4.bgp.redistributeOspf = "O IA"
*.RC1.bgp.redistributeOspf = "O IA"
*.RB1.bgp.redistributeOspf = "O IA"
*.RB2.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>       60   </startDelay>
    </TimerParams>

    <AS id="64500">
    	<!--router RA4-->
        <Router interAddr="10.0.0.1" />
    </AS>
    
    <AS id="64600">
    	<!--router RB1-->
        <Router interAddr="20.0.0.5" >
            <Neighbor address='20.0.0.1' nextHopSelf='true' />
        </Router>
        
        <!--router RB2-->
        <Router interAddr="20.0.0.1" >
            <Neighbor address='20.0.0.5' nextHopSelf='true' />
        </Router>
    </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.6"/>
        <Router exterAddr="192.168.0.5"/>
    </Session>
    
    <!--bi-directional E-BGP session between RB2 and RC1-->
    <Session id="2">
        <Router exterAddr="192.168.0.1"/>
        <Router exterAddr="192.168.0.2"/>
    </Session>

</BGPConfig>

Results

In this simulation, the following happens:

  1. OSPF converges, allowing RB1 and RB2 to ping each other’s interface addresses via RB3.

  2. RB1 and RB2 establish an I-BGP session.

  3. RB1 learns RA’s networks (10.0.0.x) from RA4 and advertises them to RB2.

  4. RB2 learns RC’s networks (30.0.0.x) from RC1 and advertises them to RB1.

  5. The Problem: While RB1 and RB2 have these routes in their BGP tables, the transit router RB3 has no knowledge of these external networks.

If you were to trace a packet from AS 64500 to AS 64700:

  • RA4 sends it to RB1.

  • RB1 knows the destination is reachable via RB2 and sends it towards RB3.

  • RB3 receives the packet, looks up the destination (e.g., 30.0.0.26), finds no match in its OSPF-only routing table, and drops the packet.

This demonstrates that simply having I-BGP peering between border routers is insufficient for a transit AS if the intermediate routers are not running BGP or receiving redistributed routes.

Sources: BGP_Topology_3.ned, omnetpp.ini, OSPFConfig_Multi.xml BGPConfig_Multi.xml

Discussion

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