...
Note: The demo configuration also includes entries for the SDN-IP and the Reactive-Routing application (separate step, pre-configured and not presented in this demo for simplicity). It specifies where the BGP speaker is located and which are the local prefixes.
Running the Demo
First, setup a clean VM with As a first step, start from a clean setup of an Ubuntu 16.04 virtual machine, with at least 12 GB HD space, 2 processors, 3 GB of RAM and a single NATed NATted interface.
Having this VM setup with Internet connectivity as a starting point, launch a terminal and install the ExaBGP Python library:
Code Block |
---|
language | bash |
---|
theme | Midnight | language | bash |
---|
|
$ cd ~
$ sudo apt-get install git
$ git clone https://github.com/Exa-Networks/exabgp
$ cd exabgp; git checkout 3.4
$ echo 'export PATH=$PATH:~/exabgp/sbin' >> ~/.bashrc
$ source ~/.bashrc |
Install the Quagga software routing suite:
Code Block |
---|
language | bash |
---|
theme | Midnight | language | bash |
---|
|
$ cd ~
$ sudo apt-get install quagga -y |
Download and install mininet:
Code Block |
---|
language | bash |
---|
theme | Midnight | language | bash |
---|
|
$ git clone https://github.com/mininet/mininet
$ cd mininet; git checkout 2.2.2
$ ./util/install.sh -fnv |
Install java 8 (required by ONOS):
Code Block |
---|
language | bash |
---|
theme | Midnight | language | bash |
---|
|
$ cd ~
$ sudo apt-get install software-properties-common -y && \
sudo add-apt-repository ppa:webupd8team/java -y && \
sudo apt-get update && \
echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections && \
sudo apt-get install oracle-java8-installer oracle-java8-set-default -y |
Download ONOS from GitHub and configure the corresponding bash profile:
Code Block |
---|
language | bash |
---|
theme | Midnight | language | bash |
---|
|
$ git clone https://github.com/opennetworkinglab/onos.git
$ echo '. ~/onos/tools/dev/bash_profile' >> ~/.bashrc
$ source ~/.bashrc |
Install pip3, Python packages and set the configuration used by ExaBGP:
Code Block |
---|
language | bash |
---|
theme | Midnight | language | bash |
---|
|
$ sudo apt-get install python3-pip -y
$ sudo -H pip3 install -r ~/onos/tools/tutorials/artemis/requirements.txt
$ nano ~/onos/tools/tutorials/artemis/configs/exabgp.conf
|
...
Install curl and run ONOS (the first run will require some time):
Code Block |
---|
language | bash |
---|
theme | Midnight | language | bash |
---|
|
$ sudo apt-get install curl
$ cd onos
$ buck run onos-local -- clean |
After the ONOS instance has started, open a new terminal and load the mininet topology:
Code Block |
---|
language | bash |
---|
theme | Midnight | language | bash |
---|
|
$ cd onos/tools/tutorials/artemis
$ sudo ./topo.py |
While having the two terminals open (ONOS instance and mininet), open a new terminal and load the network configuration with onos-netcfg. From this terminal, login to the ONOS CLI:
Code Block |
---|
language | bash |
---|
theme | Midnight | language | bash |
---|
|
$ onos-netcfg localhost ~/onos/tools/tutorials/artemis/configs/network-cfg.json
$ onos localhost |
...
Activate ARTEMIS using the ONOS CLI (reactive-routing must be activated first):
Code Block |
---|
language | bash |
---|
theme | Midnight | language | bash |
---|
|
onos> app activate org.onosproject.reactive-routing
onos> app activate org.onosproject.artemis |
Check if bgp-routes are visible by ONOS, indicating that BGP has converged (must include the 10.0.0.0/8, 20.0.0.0/8, 30.0.0.0/8 and 40.0.0.0/8 prefixes; if not, you should restart the mininet topology). It requires time (~1-2 minutes) for the BGP protocol to converge, so this step requires patience:
Code Block |
---|
language | bash |
---|
theme | Midnight | language | bash |
---|
|
ONOS> bgp-routes |
Now that the topology is running, through the mininet CLI you can connect to the hosts to check connectivity and also to the BGP speakers to modify the BGP control plane. To hijack the prefix of the protected AS:
1. Connect to the BGP speaker named R3, and also check connectivity between hosts H1 and H4:
Code Block |
---|
language | bash |
---|
theme | Midnight | language | bash |
---|
|
mininet> xterm R3 (opens a new terminal on R3)
mininet> pingall (to make the hosts visible)
mininet> h1 ping h4 (to see the data plane interactions) |
2. On the terminal of R3, announce the prefix:
Code Block |
---|
language | bash |
---|
theme | Midnight | language | bash |
---|
|
R3> telnet localhost bgpd
Password: sdnip (this is the password)
bgp> en (enable)
bgp# conf t (configure terminal)
bgp(config)# router bgp 65003
bgp(config-router)# network 40.0.0.0/8 |
...
3. Also, by checking the current configuration of R4:
Code Block |
---|
language | bash |
---|
theme | Midnight | language | bash |
---|
|
mininet> xterm R4 (opens a new terminal on R4)
R4> telnet localhost bgpd
Password: sdnip (this is the password)
bgp> en (enable)
bgp# sh run (show running configuration) |
...