0% found this document useful (0 votes)
23 views4 pages

Sdnexp 3

The document outlines the steps to create a Software Defined Networking (SDN) application using the Northbound API to program flow table rules for use cases such as L2 learning switch, Traffic Engineering, and Firewall. It details the installation of Bazel, starting the ONOS SDN controller, connecting Mininet, and installing network flows using specific curl commands. The successful completion of the application and verification of the output is also confirmed.

Uploaded by

jhayani2008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views4 pages

Sdnexp 3

The document outlines the steps to create a Software Defined Networking (SDN) application using the Northbound API to program flow table rules for use cases such as L2 learning switch, Traffic Engineering, and Firewall. It details the installation of Bazel, starting the ONOS SDN controller, connecting Mininet, and installing network flows using specific curl commands. The successful completion of the application and verification of the output is also confirmed.

Uploaded by

jhayani2008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Exp no:3 Create a SDN application that uses the Northbound API to

Date: program flow table rules on the switch for various use cases
like L2 learning switch, Traffic Engineering,Firewall

Aim:
To create a SDN application that uses the Northbound API to program flow
table rules on the switch for various use cases like L2 learning switch, Traffic
Engineering,Firewall.

Algorithm:

Step 1: Install the Correct Version of Bazel


Remove the incorrect Bazel version using:
sudo apt-get remove --purge bazel
Move the correct file to the required location:
sudo mv ~/Downloads/bazel-6.0.0-pre.20220421.3-linux-x86_64
/usr/local/lib/bazel/bin/
Set the file as executable:
sudo chmod +x /usr/local/lib/bazel/bin/bazel-6.0.0-pre.20220421.3-linux-x86_64
Create a symlink to the binary:
sudo ln -sf /usr/local/lib/bazel/bin/bazel-6.0.0-pre.20220421.3-linux-x86_64
/usr/bin/bazel
Verify the installation:
bazel version
Step 2: Start the ONOS SDN Controller
Set the ONOS root directory in Terminal 1:
export ONOS_ROOT=~/onos
cd $ONOS_ROOT
Start ONOS using Bazel in Terminal 2:
bazel clean
bazel run onos-local
Step 3: Start Mininet and Connect to ONOS
sudo mn --topo tree,depth=2,fanout=2 --controller=remote,ip=127.0.0.1 --switch
ovsk
Step 4: Verify OVS Configuration
Run this to confirm OVS is properly configured:
sudo ovs-vsctl show
Step 5: Install Network Flows in ONOS
Add a learning switch flow,traffic engineering flow and a firewall flow.

Program:

1.Learning switch:
curl --user onos:rocks -X POST -H "Content-Type: application/json" \
--data '{
"flows": [
{
"deviceId": "of:0000000000000001",
"priority": 40000,
"isPermanent": true,
"treatment": {
"instructions": [
{"type": "OUTPUT", "port": 1}
]
},"selector": {
"criteria": [
{"type": "ETH_SRC", "mac": "00:11:22:33:44:55"}
]
}
}
]
}' http://127.0.0.1:8181/onos/v1/flows?appId=org.onosproject.fwd

2.Traffic Engineering:
curl --user onos:rocks -X POST -H "Content-Type: application/json" \
--data '{
"flows": [
{
"deviceId": "of:0000000000000002",
"priority": 50000,
"isPermanent": true,
"treatment": {
"instructions": [
{"type": "QUEUE", "queueId": 1}
]
},
"selector": {
"criteria": [
{"type": "IP_PROTO", "protocol": 17}
]
}
}
]
}' http://127.0.0.1:8181/onos/v1/flows

3.Firewall:
curl --user onos:rocks -X POST -H "Content-Type: application/json" \
--data '{
"flows": [
{
"deviceId": "of:0000000000000003"
,
"priority": 60000,
"isPermanent": true,
"treatment": {
"instructions": []
},
"selector": {
"criteria": [
{"type": "IPV4
_
SRC"
,
"ip": "10.0.0.1/32"}
]
}
}
]
}' http://127.0.0.1:8181/onos/v1/flows

Output:
1.Learning Switch:

2.Traffic Engineering:

3.Firewall:

Result:
Thus the creation of a SDN application that uses the Northbound API to
program flow table rules on the switch for various use cases like L2 learning
switch, Traffic Engineering,Firewall has been completed successfully and output
has been verified.

You might also like