Step 2. BGP Scenario with E-BGP session only¶
Goals¶
This step demonstrates BGP operating in a more realistic scenario where an Interior Gateway Protocol (IGP) is used within each Autonomous System. Specifically, OSPF is configured within AS 64500 (RA routers) and AS 64600 (RB routers).
The key objectives are:
Establishing an E-BGP session between the border routers RA4 and RB1.
Redistributing OSPF routes into BGP so that internal networks of one AS can be reached from the other.
In omnetpp.ini, redistribution is enabled using the redistributeOspf parameter:
*.RA4.bgp.redistributeOspf = "O IA"
*.RB1.bgp.redistributeOspf = "O IA"
This tells the BGP module to advertise routes learned via OSPF (both intra-area ‘O’ and inter-area ‘IA’ routes) to its BGP peers.
Configuration¶
This step uses the following network:
network BGP_Topology_1
{
@display("bgb=1050.615,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=710.955,349.65");
}
RB3: Router {
@display("p=710.955,441.225");
}
RB4: Router {
@display("p=815.85,399.6");
}
RB1: Router {
@display("p=607.725,399.6");
}
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");
}
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=710.955,249.75");
}
switch5: EthernetSwitch {
@display("p=710.955,532.8");
}
switch6: EthernetSwitch {
@display("p=944.055,397.935");
}
host0: StandardHost {
@display("p=53.28,251.415");
}
host1: StandardHost {
@display("p=944.055,261.405");
}
connections:
RB2.ethg++ <--> Eth100M <--> RB4.ethg++;
RB3.ethg++ <--> Eth100M <--> RB4.ethg++;
RB1.ethg++ <--> Eth100M <--> RB2.ethg++;
RB1.ethg++ <--> Eth100M <--> RB3.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++;
switch1.ethg++ <--> Eth100M <--> RA1.ethg++;
RA2.ethg++ <--> Eth100M <--> switch2.ethg++;
RA3.ethg++ <--> Eth100M <--> switch3.ethg++;
RB2.ethg++ <--> Eth100M <--> switch4.ethg++;
RB3.ethg++ <--> Eth100M <--> switch5.ethg++;
switch1.ethg++ <--> Eth100M <--> host0.ethg++;
switch6.ethg++ <--> Eth100M <--> host1.ethg++;
RB4.ethg++ <--> Eth100M <--> switch6.ethg++;
}
The configuration in omnetpp.ini is the following:
[Config Step2]
description = "BGP Scenario with E-BGP session only"
network = BGP_Topology_1
*.routingTableRecorder.logfile = "step2.rt"
*.pcapRecorder.pcapFile = "step2.pcap"
*.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 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='host1 RB*' address='20.x.x.x' netmask='255.x.x.x'/> \
<interface hosts='RB*' address='20.x.x.x' netmask='255.x.x.x'/> \
\
<route hosts='RA4' destination='*' netmask='0.0.0.0' interface='eth0' /> \
<route hosts='RB1' 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_EBGP.xml")
*.RA4.ipv4.routingTable.routerId = "10.0.0.5"
*.RB1.ipv4.routingTable.routerId = "20.0.0.18"
# BGP configuration
*.RA4.hasBgp = true
*.RB1.hasBgp = true
*.R*.bgp.bgpConfig = xmldoc("BGPConfig_EBGP.xml")
# enable OSPF redistribution
*.RA4.bgp.redistributeOspf = "O IA"
*.RB1.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.6" />
</AS>
<!--bi-directional E-BGP session between RA4 and RB1-->
<Session id="1">
<Router exterAddr="192.168.0.2"/>
<Router exterAddr="192.168.0.1"/>
</Session>
</BGPConfig>
Results¶
The simulation proceeds in two phases:
IGP Convergence: Initially, OSPF converges within each AS. You can see OSPF HELLO and LSU packets being exchanged, and the routing tables filling with internal routes.
BGP Session Establishment: After a configured delay (
startDelay = 60sinBGPConfig_EBGP.xml), RA4 and RB1 initiate their BGP session.
Once the E-BGP session is established at approximately 61.5s:
RA4 receives BGP UPDATE messages from RB1 containing all the internal networks of AS 64600 (the
20.0.0.0/30subnets).RB1 receives BGP UPDATE messages from RA4 containing all the internal networks of AS 64500 (the
10.0.0.0/30subnets).
Checking step2.rt reveals that both border routers now have complete
reachability to the other AS’s internal networks via the BGP peer. However, note
that internal routers (like RA1 or RB2) still cannot reach the other AS because
the BGP-learned routes have not been redistributed back into OSPF.
Sources: BGP_Topology_1.ned,
omnetpp.ini,
OSPFConfig_EBGP.xml,
BGPConfig_EBGP.xml
Discussion¶
Use this page in the GitHub issue tracker for commenting on this tutorial.