Sdnexp 3
Sdnexp 3
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:
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.