Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


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

asked 2014-10-27 06:51:08 -0800

mawil gravatar image

updated 2014-10-27 11:11:49 -0800

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:

  • feature:install odl-restconf odl-l2switch-switch odl-mdsal-apidocs odl-adsal-all odl-adsal-northbound odl-dlux-core

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=,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: 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.

Any answer would be appreciated, thanks in advance!

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-10-27 10:51:11 -0800

jamoluhrsen gravatar image

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 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></ipv4-source><ipv4-destination></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.

edit flag offensive delete publish link 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)

mawil ( 2014-10-28 02:38:50 -0800 )edit

answered 2015-04-02 08:45:33 -0800

kishore345127 gravatar image

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!

edit flag offensive delete publish link more


the xml tag of in-port action is <in-port></in-port> and the out-port is <output-node-connector></output-node-connector>

oeufhp ( 2017-01-24 06:21:48 -0800 )edit
Login/Signup to Answer

Question Tools



Asked: 2014-10-27 06:51:08 -0800

Seen: 8,797 times

Last updated: Apr 02 '15