A tutorial on setting up the whole virtual invironment for OpendayLight SDN controller.
Category | Detail |
---|---|
OS | Centos 7 or Ubuntu 14.04 |
SDN Controller | OpendayLight Beryllium-SR2 |
Virtual network | Mininet 2.2.1 |
Virtual switch | Open vSwitch 2.3.3 |
Network trafic generation | iperf or iperf3 |
Traffic monitoring | sFlow-RT |
sudo apt-get -y install git
sudo yum -y install git
./install_mininet.sh
git clone https://github.com/mininet/mininet.git
(1) ADD the following before the line ‘test -e /etc/fedora-release && DIST=”Fedora”‘. Somewhere around line 47. May differ.
test -e /etc/centos-release && DIST="CentOS"
if [ "$DIST" = "CentOS" ]; then
install='sudo yum -y install'
remove='sudo yum -y erase'
pkginst='sudo rpm -ivh'
# Prereqs for this script
if ! which lsb_release &> /dev/null; then
$install redhat-lsb-core
fi
fi
(2) EDIT
if ! echo $DIST | egrep 'Ubuntu|Debian|Fedora'; then
echo "Install.sh currently only supports Ubuntu, Debian and Fedora."
exit 1
fi
to
if ! echo $DIST | egrep 'Ubuntu|Debian|Fedora|CentOS'; then
echo "Install.sh currently only supports Ubuntu, Debian and Fedora."
exit 1
fi
mininet/util/install.sh -nf
./install_ovs.sh
yum -y install wget gcc make python-devel openssl-devel kernel-devel graphviz kernel-debug-devel autoconf automake rpm-build redhat-rpm-config libtool
adduser ovs
su - ovs
wget http://openvswitch.org/releases/openvswitch-2.3.3.tar.gz
cp openvswitch-2.3.3.tar.gz ~/rpmbuild/SOURCES/
tar xfz openvswitch-2.3.3.tar.gz
sed 's/openvswitch-kmod, //g' openvswitch-2.3.3/rhel/openvswitch.spec > openvswitch-2.3.3/rhel/openvswitch_no_kmod.spec
rpmbuild -bb --nocheck openvswitch-2.3.3/rhel/openvswitch_no_kmod.spec
exit
mkdir /etc/openvswitch
yum localinstall /home/ovs/rpmbuild/RPMS/x86_64/openvswitch-2.3.3-1.x86_64.rpm
systemctl start openvswitch.service
chkconfig openvswitch on
root@user:~# sudo ovs-vsctl show
5ad5c67c-163b-41a3-9d60-9708efe79cbd
ovs_version: “2.3.3”
root@user:~# sudo mn --test pingall
*** Creating network
*** Adding controller
*** Adding hosts:
.
.
.
*** Results: 0% dropped (2/2 received)
*** Stopping 1 controllers
c0
*** Stopping 1 switches
s1 ..
*** Stopping 2 hosts
h1 h2
*** Done
completed in 5.125 seconds
Download through web browser or use wget
in terminal. (Note:following is currently the latest version.)
wget https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.4.3-Beryllium-SR3/distribution-karaf-0.4.3-Beryllium-SR3.zip
unzip distribution-karaf-0.4.3-Beryllium-SR3.zip
cd distribution-karaf-0.4.3-Beryllium-SR3
./bin/karaf
Use version
to check the version.
opendaylight-user@root>version
3.0.3
Reference:https://www.opendaylight.org/software/downloads/beryllium-sr2
opendaylight-user@root>feature:install odl-mdsal-clustering
opendaylight-user@root>feature:install odl-restconf
opendaylight-user@root>feature:install odl-l2switch-switch
opendaylight-user@root>feature:install odl-openflowplugin-all
opendaylight-user@root>feature:install odl-dlux-all
opendaylight-user@root>feature:install odl-mdsal-all
Advisement: Install odl-mdsal-clustering first then install other components one by one
Check all the components feature:list
Check installed components feature:list -i
• is-install-dropall-flow
true
means a drop-all flow will be installed on each switch, so the default action will be to drop a packet instead of sending it to the controller
false
means this flow will not be installed
• is-proactive-flood-mode
true
means that flood flows will be installed on each switch. With this flood flow, each switch will flood a packet that doesn't match any other flows.
Advantage: Fewer packets are sent to the controller because those packets are flooded to the network.
Disadvantage: A lot of network traffic is generated.
false
means the previously mentioned flood flows will not be installed. Instead an ARP flow will be installed on each switch that sends all ARP packets to the controller.
Advantage: Less network traffic is generated.
Disadvantage: The controller handles more packets (ARP requests & replies) and the ARP process takes longer than if there were flood flows.
• is-hybrid-mode
http://controller-ip:8181/index.html
account:admin
password:admin
I use Postman to send requests :) Download the Mac app or install the Chrome extension.
- Type -> select
Basic Auth
- Username and Password -> both
admin
as default - Check
Save helper data to request
- Click
Update Request
button
Method | URL |
---|---|
get | http://127.0.0.1:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:1 |
- Note :
openflow:1
is my demo node(switch) id, please revise to yours.
Method | URL |
---|---|
get | http://127.0.0.1:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/flow-node-inventory:table/0/opendaylight-flow-table-statistics:flow-table-statistics |
Method | URL |
---|---|
get | http://127.0.0.1:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/0 |
Method | URL |
---|---|
get | http://127.0.0.1:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1 |
- Note : if your flow id look like this
#UF$TABLE*0-1
, use URL encoding for converting flow id to%23UF%24TABLE%2A0-1
Method | URL |
---|---|
put | http://127.0.0.1:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1 |
request body:
{
"flow":[
{
"id":"1",
"table_id":0,
"match":{
"ethernet-match":{
"ethernet-type":{
"type":2048
}
},
"ipv4-source":"8.8.8.8/24",
"in-port":"openflow:1:3"
},
"instructions":{
"instruction":[
{
"order":0,
"apply-actions":{
"action":[
{
"order":0,
"output-action":{
"output-node-connector":"CONTROLLER",
"max-length":65535
}
},
{
"order":1,
"drop-action":{
}
}
]
}
}
]
},
"priority":20
}
]
}
Method | URL |
---|---|
delete | http://127.0.0.1:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1 |
Please feel free to send me a pull request if you wanna contribute:)