OpenDaylight (ODL) is a lightweight orchestration system, that can take over control of OVS.
Before you begin
Make sure that you have:
- A host OS with a desktop environment
- Java 1.8 installed, for example dnf install openjdk
- A JAVA_HOME environment path to the Java installation, for example JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.fc29.x86_64/jre/
About this task
Procedure
- Setup OVS offload as described in OVS-DPDK Configuration Examples without starting the VM as described in Booting the VM
-
Download OpenDaylight version 0.6.4-Carbon from the following link:
https://nexus.opendaylight.org/content/repositories/public/org/ opendaylight/integration/distribution-karaf/0.6.4-Carbon/
- Unpack the archive to distribution-karaf-0.6.4-Carbon:
-
Run ODL:
./distribution-karaf-0.6.4-Carbon/bin/karaf
-
In the ODL terminal install the following features:
feature:install odl-dlux-core feature:install odl-dluxapps-nodes feature:install odl-dluxapps-applications feature:install odl-dluxapps-yangutils feature:install odl-restconf odl-l2switch-switch feature:install odl-l2switch-switch-rest feature:install odl-l2switch-all
- Reboot the system:
-
Ensure that OVS-DPDK is running and create a bridge, br0:
ovs-vsctrl add-br br0 -- set bridge br0 datapath_type=netdev
-
Open a controller socket on the br0 bridge:
ovs-vsctl set-controller br0 tcp:x.x.x.x:6633
where x.x.x.x is the IP address of the server. -
Set the controller socket to utilize OpenFlow13 protocol:
ovs-vsctl set bridge br0 protocols=OpenFlow13
-
Add a port to the bridge:
ovs-vsctl add-port br0 dpdk0 -- set interface dpdk0 type=dpdk options:dpdk-devargs=class=eth,mac=xx:xx:xx:xx:xx
where mac=xx:xx:xx:xx:xx:xx is the MAC address of the physical port. -
Display the current flows:
ovs-ofctl dump-flows br0 -O Openflow13
Note: There are no flows related to the test IP 192.168.1.99 -
Run ODL:
./distribution-karaf-0.6.4-Carbon/bin/karaf
-
Verify the ODL to OVS connection:
ovs-vsctl show Bridge "br0" Controller "tcp:x.x.x.x:6633" is_connected: true
Note: is_connected: true should show on the bridge. -
Login to the web GUI from any browser with the default username admin
and password admin:
http://x.x.x.x:8181/index.html#/login
where x.x.x.x is the IP address of the server.Note: The entire URL must be used. -
Go to the Nodes tab and note the Node Id:
This is an example of a Node ID: openflow:59744028284
-
Go to the Yang UI tab and click Custom API
request:
-
Insert the following link in the API path:
http://x.x.x.x:8181/restconf/config/opendaylight-inventory:nodes/node/ <Node ID>/flow-node-inventory:table/2/flow/1
where:- x.x.x.x is the IP address of the server
- NODE ID is the node id for example: openflow:59744028284
For example:http://10.10.9.66:8181/restconf/config/opendaylight-inventory:nodes/node/ openflow:59744028284/flow-node-inventory:table/2/flow/1
-
Insert the following in the API data textbox:
{ "flow": [ { "id": "1", "match": { "ethernet-match": { "ethernet-type": { "type": "0x0800" } }, "ipv4-source": "192.168.1.99/32", "ipv4-destination": "192.168.1.101/32" }, "instructions": { "instruction": [ { "order": "0", "apply-actions": { "action": [ { "order": "0", "drop-action": {} } ] } } ] }, "priority": "25", "idle-timeout": "0", "hard-timeout": "0", "cookie": "10000000", "table_id": "2" } ] }
- Click Push config:
-
Select PUT in the dropdown selector and click
Send:
-
Verify that the flow configuration is installed in OVS:
ovs-ofctl dump-flows br0 -O Openflow13
Expect the following result showing the programmed flow:cookie=0x989680, duration=4.168s, table=2, n_packets=0, n_bytes=0, priority=25,ip,nw_src=192.168.1.99,nw_dst=192.168.1.101 actions=drop
- In the web gui select DELETE from the dropdown selector and click send:
-
Verify that the flow has been deleted:
ovs-ofctl dump-flows br0 -O Openflow13