Flow Setup Time (FST) model for measuring the reaction time of master controller received by switch in ONOS/Atomix architecture (onos ver. 2.7.0)
Before setting up an ONOS/Atomix architecture on one or more virtual machines (VMs) or across multiple domains, you should ensure that Docker and Mininet are installed on your VMs. You can check if Docker is installed by following these steps:
sudo systemctl status dockerIf you got error such as: Unit docker.service could not be found., that means this VM has not installed Docker, then you can install Docker by implementing the following commands:
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce
sudo systemctl enable docker
sudo systemctl start docker
sudo systemctl status dockersudo apt install mininet
git clone https://github.com/openvswitch/ovs.git
cd ovs
git checkout v2.7.0
cd ..
git clone https://github.com/mininet/mininet
mininet/util/install.sh -wsudo cat /etc/ssh/sshd_config |grep -i X11Forwarding
sudo vi /etc/ssh/sshd_config
sudo service ssh status
sudo service ssh restart
xauth list
export DISPLAY=localhost:10.0
xterm
env|grep DISPLAY
DISPLAY=localhost:10.0
xauth list | grep unix`echo $DISPLAY | cut -c10-12` > /tmp/xauth
sudo apt install x11-apps
sudo apt install xtermAutomatically generate an ONOS cluster within a single VM using the create_cluster bash script. In this script, -o specifies the version of the ONOS controller, -a specifies the version of the Atomix node, -i indicates the number of Atomix nodes needed, and -j indicates the number of ONOS controllers needed. For example, to create a cluster with 2 Atomix nodes of version 3.1.5 and 2 ONOS controllers of version 2.7.0, you would use the following command:
./create_cluster.sh -o 2.7.0 -a 3.1.5 -i 2 -j 2Then you can use the following command for creating virtual network devices (switches, hosts) and connecting them to ONOS controllers:
cd Previous_data/topos/
XAUTHORITY=~/.Xauthority sudo mn --custom h1h2_2_topo.py --topo=mytopo -xIf you want to distribute ONOS controllers across multiple VMs, you need to use Overlay network to connect all ONOS controllers to make an ONOS cluster. To set up the overlay network, you first need to designate one VM as the Manager node and initialize a swarm on this node. This will generate a token that other Worker nodes can use to join the swarm. Then, you can use this token on the Worker side to add their ONOS controllers to the ONOS cluster.
sudo docker swarm leave --force
sudo docker swarm init
# Create an overlay network for supporting a way workers can join the swarm
sudo docker network create --driver=overlay --attachable onos-cluster-net --subnet 172.20.0.0/16 --gateway 172.20.0.1 --label "creator=onos-cluster-create"Then setup Atomix cluster before create ONOS controller, in this example, use 3 Atomix nodes (To ensure the performance of ONOS/Atomix, it is crucial to understand the minimum requirements for an Atomix node) and 1 ONOS controller in Manager side. You can run create_cluster_multi bash script to achieve above context:
./create_cluster_multi.shFirst, you have to let this Worker join to Manager side by overlay network (using the token you got):
sudo docker swarm join --token [TOKEN] [IP_of_Manager_side]:[Port_of_Manager_side]Then you can use following command to create ONOS controlelr, these controlelrs will automatically join to ONOS cluster:
- Define
$ONOS_NAMEbe the name of this controller, let's say it isonos2;$icould be2; The line 2, after '-n' you should be noticed (in this case has 3 Atomix nodes with name atomix-1, atomix-2, and atomix-3, separately);$PUB_PORTis for receiving traffic from other node (Manager or other Workers), you can define it as you want, do not repeat with other controller's;
# Create an ONOS controller by using 'xingyuankang/onos_cluster:v4' custom image (ONOS version: onosproject/onos:2.7.0)
mkdir tmp
onos/tools/test/bin/onos-gen-config $ONOS_NAME tmp/cluster-$i.json -n atomix-1 atomix-2 atomix-3
sudo docker run -t -d --name $ONOS_NAME --hostname $ONOS_NAME --net onos-cluster-net -e ONOS_APPS="drivers,openflow-base,netcfghostprovider,lldpprovider,gui2" --publish published=$PUB_PORT,target=6653 xingyuankang/onos_cluster:v4
sudo docker inspect $ONOS_NAME | grep -i ipaddress
sudo docker cp tmp/cluster-$i.json $ONOS_NAME:/root/onos/config/cluster.json
sudo docker restart $ONOS_NAME