Ask Your Question

Added flow to operational datastore has other id, than specified

asked 2015-08-31 11:10:07 -0700

Denis gravatar image

updated 2015-08-31 11:13:00 -0700

ODL-Version: Helium (1.4.6-Snapshot)

Switch: Mininet 2.2.1

I have to add manually flows to md sal operational data store, as using the salFlowService doesnt store them in md sal. So what im basically doing is writing the flows to switches via salFlowService and additionally storing them in md sal operational datastore. The flows are present in the ovs switches (checked per ovs-ofctl) However i'm able to write the flows to md sal, but curiously the specified id in instance identifier is not used.

This is my hardcoded instance-identifier (for testing)

 InstanceIdentifier<Flow> flowId = InstanceIdentifier
            .child(Node.class, new NodeKey(new NodeId("openflow:1")))
            .child(Table.class, new TableKey((short) 0))
            .child(Flow.class, new FlowKey(new FlowId("1"))).build();

When i query the REST api ( http://localhost:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/0 ), i can see my flow (identified by name), but the id is not the same as specified in instance identifier

Inrelevant lines ommited:


Can anyone explain this behaviour ? Do I miss some basic stuff ? Is this maybe an issue in ODL-Helium and was fixed in Lithium ? Just didnt manage to migrate my application to lithium, yet

edit: i dont see any errors or warnings in karaf log

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2015-09-02 03:08:35 -0700

Mandeep gravatar image

when ODL controller sees a new flow (during discovery or added via Service in your case), it tries to find same in config data store. In your case it does not find exact match flow-id, so it added that flow in operational data store with specific flow id. which is of format #UF$TABLE*0-1. This means UF = Undefined Flow for TABLE 0, and this may be first and last number will get increased for subsequent flows.

To solve this difference, I tried adding into config data store first then you can add into operational.

edit flag offensive delete publish link more



FYI, these are commonly referred to as alien flows in the openflowplugin community.

jamoluhrsen ( 2015-09-02 08:52:14 -0700 )edit

answered 2015-09-05 06:17:38 -0700

Denis gravatar image

updated 2015-09-05 06:18:40 -0700

@Mandeep: I believe your answer is correct, but actually your suggestion is not working for me. When i try to add the flow manually to config datastore, it shows me the exception': Caused by: Node /(urn:opendaylight:inventory?revision=2013-08-19)nodes does not exist. Cannot apply modification to its children.

Im a bit confused, as my whole config datastore seems to be empty.. When i query via curl:

curl -X GET -H "Content-Type: application/json" -H "Accept: application/json" --user admin:admin http://localhost:8181/restconf/config/opendaylight-inventory:nodes/

It shows nothing. When i query the operational datastore, i get a normal output. Can you give me some advice, whats going wrong in my case ?

edit flag offensive delete publish link more


config data store keeps only those details what you pushed (manually or using some application) to controller. What ever is learned/discovered from network will not be present in config data store. SUGGESTION (not tried): If you really want to get correct flow-id in operational data store, then you can add basic data as soon as discovered into config data store. for example, when node discovered add node with id into config same way add flow with flow-id. So config will have limited info but operational will show all correct data.

Mandeep ( 2015-09-05 08:27:41 -0700 )edit

Thank you very much, you provided very useful information regarding how config/operational ds really works, however as i am novice in odl, couldnt find that kind of details in wiki. Any pointer where i can read such things to get a better insight ?

Denis ( 2015-09-05 08:39:07 -0700 )edit

I am too newbie (just three months before started with ODL) :) I would say "hands on" is my best teacher ever :)

Mandeep ( 2015-09-05 08:57:07 -0700 )edit
Login/Signup to Answer

Question Tools



Asked: 2015-08-31 11:10:07 -0700

Seen: 598 times

Last updated: Sep 05 '15