# How to set a static flow in Karaf and how to get information about configurated Flows?

I want to connect my mininet to the Controller, want to have basic switch support, get information about the configurated flows and set static flows.

I downloaded the pre-build helium zip file from the ODL-HP. I started the karaf distribution an installed the following features:

If these Features are not correct, which features should i use instead?

After that I connected mininet (sudo mn --topo single,3 --mac --controller 'remote,ip=192.168.56.1,port=6633' --switch ovsk) and do a pingall, everything works as aspected. I can show the configurated Flows via ovs-ofctl on my mininet. But if I don't want to use the ovs-ofctl command on the switch, how can I get information about the flows via the controller?

Question 1: How can I get information about the configurated Flows and why is the /restconf/config Part only showing 404 error Not Found?

To get the statistics I use a REST call like the one below and it works:

I thought I could use a REST call to the config part (like in the Hydrogen Version of ODL) to see the configurated flows but I only get a 404 Not Found Error:

Every REST GET call to the config part returns with an 404 error Not Found:

Does someone have a similar problem or am I doing something wrong?

Question 2: How can I set a static Flow?

I looked at this Wiki-Page: https://wiki.opendaylight.org/view/OpenDaylightOpenFlowPlugin:EndtoEnd_Flows and used the following configuration to push a flow:

After that no flow with id 1 is shown via ovs-ofctl on my switch, however if i do the REST call below i see the configurated Flow in the config part but also no entry in the operational part...

Am i'm doing something wrong, in Hydrogen this worked for me? Is there another possibility to set Flows? I also checked the above REST calls with http://localhost:8080 but the same things happen here.

edit retag close merge delete

Sort by » oldest newest most voted

I can't say for sure, but I think the reason you are not able to see any flows in /restconf/config is because you have not directly added any flows, only those created by default when the switch connects and directly programmed when hosts are learned (during pingall). So before you manually create flows, there are none to be found (404).

However, you should be able to see all of the flows in operation with the /restconf/operational REST GET. you noted that it gave you a 404 as well though. Was that a typo in your question? (the 4th REST GET you noted)

I followed your same steps (BTW, you are using OpenFlow 1.0. just an observation) and was able to push a flow via REST. The "id" is only relevant for the controller and you wont see it in the flow dump on the switch. Here are those details:

PUT http://172.17.7.21:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1 basic auth using admin/admin for the credentials. content-type is application/xml the data xml is:

<flow xmlns="urn:opendaylight:flow:inventory"><instructions><instruction><order>0</order><apply-actions><action><order>0</order><output-action><output-node-connector>FLOOD</output-node-connector></output-action></action></apply-actions></instruction></instructions><match><ethernet-match><ethernet-type><type>0x800</type></ethernet-type><ethernet-source><address>00:ab:cd:ef:01:23</address></ethernet-source><ethernet-destination><address>ff:ff:ff:ff:ff:ff</address></ethernet-destination></ethernet-match><ipv4-source>11.3.0.0/16</ipv4-source><ipv4-destination>99.0.0.0/8</ipv4-destination></match><table_id>0</table_id><id>1</id></flow>


The one gotcha I found was that after I create a flow with /restconf/config it may time out of the switch, which will remove it from the operational datastore, but will remain in the config data store. Simply doing another PUT to /restconf/config is not sufficient to push it down to the switch. you have to DELETE it from the config datastore and issue a new PUT.

Not a complete answer, but hopefully it helps.

more

You definitely helped me a lot! So I only see flows in the config part if I manually create these flows! My understanding was that the Flows which are created by default (from L2Switch) when a switch connects are also shown in config part like the flows from the learningswitch-sample in the Hydrogen-Release. Thanks for clarifying me! Yes I see all flows /restconf/operational, that was a typo in bullet four (I updated the question). For now I know that every REST Call to the config part returns a 404 error until I provide my own flows there. The Flow you provided works in my environment too. Also the Flow from the Wiki-Page "now" works. With OF10 the action changes in mininet to "drop", because OF10 don't know the action dec_ttl i think. With mininet and OF13 the action is dec_ttl. Perhaps i did something wrong while testing ... Thank ...(more)

( 2014-10-28 02:38:50 -0700 )edit

Thanks, i am able to add a flow with source and destination ip addresses in the match condition. But, i am still facing the problem in having in-port/out-port in match conditions. When i tried, it throws up the error code 404. It will be great and helpful if you could provide an example for the same. Thanks in advance!

more