A mininet based leaf-spine topology
Included in this repo is a Vagrantfile
that can be used to create a VM on
which the leaf-spine topology can be run. To create the VM a simple vagrant up
should do.
vagrant up
vagrant ssh
cd /vagrant
The script which wraps the leaf-spine topology only supports ONOS currently. To start and instance of the ONOS controller as container the following command should work.
docker run -tid --name onos --rm \
-p 8101:8101 -p 8181:8181 -p 6653:6653 \
-e ONOS_APPS=openflow,segmentrouting,layout \
onosproject/onos:1.13.2
To create a simple 3 leaf / 2 spine topology the following command can be used.
sudo ./lsnet.py \
--controller=remote,ip=127.0.0.1,port=6653 \
--leaves=3 \
--spines=2 \
--hosts=2 \
--wait \
--ping \
--onos=http://karaf:karaf@localhost:8181 \
--post
This command will create the topology, wait for the switches to be connected
to the controller, have each host ping its leaf switch (for arps), and
generate and POST
the segment routine configuration to ONOS.
NOTE: if you add a -v
command line argument to the lsnet.py
command to see
more debug output from the script as the topology is created
NOTE: I don't know why this is, but if you execute a pingall
at the mininet
prompt it really doesn't work. But if you ctrl-D
out of mininet and restart
it with the same parameters and then do a pingall
it seems to work. I think
this has something to do with a required order in ONOS between the config push
and the devices being connected and I consider it a big in ONOS or the SR
application.
At the mininet prompt execute the pingall
command to have every host ping
across the fabric. The output should be something like the following.
mininet> pingall
*** Ping: testing ping reachability
h1 -> h2 h3 h4 h5 h6
h2 -> h1 h3 h4 h5 h6
h3 -> h1 h2 h4 h5 h6
h4 -> h1 h2 h3 h5 h6
h5 -> h1 h2 h3 h4 h6
h6 -> h1 h2 h3 h4 h5
*** Results: 0% dropped (30/30 received)
Open your browser and view http://localhost:8181/onos/ui
and you
should see the topology. If you want to see the topology in an access layout
issue the following commands via the ONOS CLI.
ssh -p 8101 karaf@localhost topo-layout access
To revert to the default layout use
ssh -p 8101 karaf@localhost topo-layout default
NOTE: the default password is karaf
usage: lsnet.py [-h] [--leaves [N]] [--spines [N]] [--hosts [N]]
[--controller [CONTROLLER]] [--numlinks [N]] [--ping]
[--verbose] [--generate] [--wait] [--onos [ONOS]] [--post]
[--driver [NAME]]
Process some integers.
optional arguments:
-h, --help show this help message and exit
--leaves [N], -l [N] the number of leaf nodes
--spines [N], -s [N] the number of spine nodes
--hosts [N], -t [N] the number of hosts per leaf node
--controller [CONTROLLER], -c [CONTROLLER]
the number of hosts per leaf node
--numlinks [N], -nl [N]
the number of links from each leaf to each spine
--ping, -p have each host ping the leaf switch
--verbose, -v display a bit more detailed logging
--generate, -g gerate ONOS network configuration for fabric
--wait, -w wait for switches to connect to controller
--onos [ONOS], -o [ONOS]
ONOS base URL
--post, -d post configuration to onos
--driver [NAME], -r [NAME]
device driver to use in the ONOS configuration