Cannot set new flow via REST API after minor changes in content body

asked 2016-11-28 13:07:16 -0700

dkindel gravatar image

I'm trying right now to just figure out how to set flows and validate they are added properly. I have a controller set up on one VM and mininet set up on another with a simple topology with 1 switch and 3 hosts connected to that switch. The switch is OVS (Open vSwitch). I've installed DLUX and other features (odl-dlux-all, odl-l2switch-all, odl-restconf-all, odl-mdsal-apidocs, odl-openflowplugin-all). I've confirmed that I can communicate with the switch via the controller.
I do 2 different accesses. One works and the other doesn't. Both address the same URL: http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1

The body for the one that works is: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <flow xmlns="urn:opendaylight:flow:inventory"> <priority>2</priority> <flow-name>Foo</flow-name> <match> <ethernet-match> <ethernet-type> <type>2048</type> </ethernet-type> </ethernet-match> </match> <id>1</id> <table_id>0</table_id> <instructions> <instruction> <order>0</order> <apply-actions> <action> <order>0</order> <drop-action/> </action> </apply-actions> </instruction> </instructions> </flow>

The body for what doesn't work is: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <flow xmlns="urn:opendaylight:flow:inventory"> <priority>2</priority> <flow-name>Foo</flow-name> <match> <ethernet-match> <ethernet-type> <type>2048</type> </ethernet-type> </ethernet-match> <ipv4-destination></ipv4-destination> </match> <id>1</id> <table_id>0</table_id> <instructions> <instruction> <order>0</order> <apply-actions> <action> <order>0</order> <drop-action/> </action> </apply-actions> </instruction> </instructions> </flow>

(Sorry for any formatting issues. Either the preview window isn't 100% accurate or the code tag really doesn't work for xml so I used backticks which don't preserve line endings it looks like.)

Note that the difference is the ipv4-destination field. That single entry is the difference between a functioning flow and not. I've also tried quoting the ip address and in doing so got a 400 error with a malformed message response. I can get the flow through of the successful PUT by using GET at the URL: http://localhost:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1. The unsuccessful PUT returns a 404 error when accessing the flow.

I have no idea what I'm doing wrong here and half (probably more) of the examples don't work from their site (

Does anyone have any insight as to what's happening?

Bonus question: Do flows perform matching by logical OR or AND? That is, if I have an ethernet address and an ipv4 address, does it try to match a connection that is made by both, say, 00:00:00:00:00:01, and, or does it look for anything coming from 00:00:00:00:00:01 or

edit retag flag offensive close merge delete