Table Of Contents
Table Of Contents

Step 1. BGP Basic Topology

Goals

This step introduces a basic BGP configuration. The network consists of two Autonomous Systems (AS): AS 64520 and AS 64530.

  • AS 64520 contains two routers, RA1 and RA2.

  • AS 64530 contains two routers, RB1 and RB2.

An External BGP (E-BGP) session is established between RA1 and RB1. The primary goal is to demonstrate how BGP peers exchange routing information. In this configuration, the Network attribute in the XML configuration is used to manually specify which networks should be advertised by each router:

  • RA1 advertises the network 10.0.0.8/30.

  • RB1 advertises the network 10.0.0.0/30.

Configuration

This step uses the following network:

../../../_images/BGP_Basic_Topology.png
network BGP_Basic_Topology
{
    @display("bgb=880.3688,269.73");

    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=817.9313,194.805");
        }
        RB1: Router {
            @display("p=642.69,194.805");
        }
        RA1: Router {
            @display("p=291.375,194.805");
        }
        RA2: Router {
            @display("p=141.10875,194.805");
        }

    connections:
        RB1.ethg++ <--> Eth100M <--> RB2.ethg++;
        RB1.ethg++ <--> Eth100M <--> RA1.ethg++;
        RA2.ethg++ <--> Eth100M <--> RA1.ethg++;
}

The configuration in omnetpp.ini is the following:

[Config Step1]
description = "BGP Basic Topology"
network = BGP_Basic_Topology
*.routingTableRecorder.logfile = "step1.rt"

*.pcapRecorder.pcapFile = "step1.pcap"

# BGP configuration
*.R*.hasBgp = true
*.R*.bgp.bgpConfig = xmldoc("BGPConfig_Basic.xml")

*.visualizer.routingTableVisualizer[1].displayRoutingTables = false
*.visualizer.routingTableVisualizer[*].lineShift = 80
*.visualizer.routingTableVisualizer[*].destinationFilter = "*"
*.visualizer.routingTableVisualizer[*].lineColor = "black"

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>       5   </startDelay>
    </TimerParams>

    <AS id="64520">
    	<!--router RA1-->
        <Router interAddr="10.0.0.9">
            <Network address='10.0.0.8' />
        </Router>
        
        <!--router RA2-->
        <Router interAddr="10.0.0.10"/>
    </AS>
    
    <AS id="64530">
    	<!--router RB1-->
        <Router interAddr="10.0.0.2">
            <Network address='10.0.0.0' />
        </Router>
                
        <!--router RB2-->
        <Router interAddr="10.0.0.1"/>
    </AS>

    <!--bi-directional E-BGP session between RA1 and RB1-->
    <Session id="1">
        <Router exterAddr="10.0.0.6"/>
        <Router exterAddr="10.0.0.5"/>
    </Session>

</BGPConfig>

Results

Upon running the simulation, the BGP speakers RA1 and RB1 perform the following sequence:

  1. They establish a TCP connection between their external interfaces.

  2. They exchange BGP OPEN messages to negotiate session parameters.

  3. Once the session is in the Established state, they exchange BGP UPDATE messages to advertise their configured networks.

In the routing table log (step1.rt), we can observe the impact of these exchanges:

  • At approximately 6.5s, RB1 installs a route to 10.0.0.8/30 with the next hop set to RA1 (10.0.0.6).

  • Simultaneously, RA1 installs a route to 10.0.0.0/30 with the next hop set to RB1 (10.0.0.5).

Note that in this basic step, RA2 and RB2 do not learn these routes because I-BGP (Internal BGP) is not yet configured, and BGP routes are not redistributed into any interior gateway protocol.

Sources: BGP_Basic_Topology.ned, omnetpp.ini, BGPConfig_Basic.xml

Discussion

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