[openflowplugin-dev] default flow for punting to CONTROLLER

Luhrsen, Jamo james.luhrsen at hp.com
Fri Sep 12 17:56:43 UTC 2014


doh!  I got it now.  I was missing a proper Content-Type header of application/yang.data+xml

Thanks for all the help.

JamO

From: Michal Rehak -X (mirehak - Pantheon Technologies SRO at Cisco) [mailto:mirehak at cisco.com]
Sent: Friday, September 12, 2014 6:38 AM
To: Luhrsen, Jamo; openflowplugin-dev at lists.opendaylight.org; integration-dev at lists.opendaylight.org
Subject: RE: default flow for punting to CONTROLLER

Hi Jamo,
I have no idea. I tried todays build and it worked. Could you check if there is no suspicious white character at the beginning? Is it valid?

Regards,
Michal
________________________________
From: Luhrsen, Jamo [james.luhrsen at hp.com]
Sent: Friday, September 12, 2014 01:14
To: Michal Rehak -X (mirehak - Pantheon Technologies SRO at Cisco); openflowplugin-dev at lists.opendaylight.org<mailto:openflowplugin-dev at lists.opendaylight.org>; integration-dev at lists.opendaylight.org<mailto:integration-dev at lists.opendaylight.org>
Subject: RE: default flow for punting to CONTROLLER
Thanks for the help, Michal, but I'm still a little stuck.

The response I'm getting when POST'ing to operations/sal-flow:remove-flow
is:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<errors
    xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">
    <error>
        <error-type>protocol</error-type>
        <error-tag>invalid-value</error-tag>
        <error-message>Content must be empty.</error-message>
    </error>
</errors>

I've used a bare minimum xml to POST (like your example) with the right cookie
and flow-table values.  I've also taken the entire flow as it's defined in the output
from operational/opendaylight-inventory:nodes/.  The response was the same
with the message that "Content must be empty".

Any idea where my mistake is?

Thanks,
JamO

From: Michal Rehak -X (mirehak - Pantheon Technologies SRO at Cisco) [mailto:mirehak at cisco.com]
Sent: Wednesday, September 10, 2014 12:40 AM
To: Luhrsen, Jamo; openflowplugin-dev at lists.opendaylight.org<mailto:openflowplugin-dev at lists.opendaylight.org>; integration-dev at lists.opendaylight.org<mailto:integration-dev at lists.opendaylight.org>
Subject: RE: default flow for punting to CONTROLLER

Hi Jamo,
sorry for incomplete answer. Sure - you do not have to use dataStore/config at all. If you want to manipulate flows/groups/meters on device, you can do that in programmatical way (see test-provider) or you can use restconf to invoke those rpcs.

For example in order to delete a group you can POST this xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<input xmlns="urn:opendaylight:group:service">
    <barrier>false</barrier>
    <group-id>1</group-id>
    <group-name>Foo</group-name>
    <group-type>group-select</group-type>
    <node xmlns:inv="urn:opendaylight:inventory">/inv:nodes/inv:node[inv:id="openflow:1"]</node>
</input>

to this ur:
http://localhost:8080/restconf/operations/sal-group:remove-group

For flows this would be similar. Base url contains http://localhost:8080/restconf/operations/<http://localhost:8080/restconf/operations/sal-group:remove-group>
then there is <module name>:<rpc name>
sal-flow:remove-flow

The xml content should look like this (based on yang model of rpc input):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<input xmlns="urn:opendaylight:flow:service">
    <barrier>false</barrier>
    <flow-table>0</flow-table>

    <node xmlns:inv="urn:opendaylight:inventory">/inv:nodes/inv:node[inv:id="openflow:1"]</node>
    <cookie>54</cookie>
    <match/>
    <priority>0</priority>
</input>


Xml is in principle the same as you used for add flow. But there must be the node element in order for md-sal to find appropriate provider. The most important flow identifiers are priority and match (and probably cookie+mask).

Regards,
Michal
________________________________
From: Luhrsen, Jamo [james.luhrsen at hp.com]
Sent: Tuesday, September 09, 2014 22:18
To: Michal Rehak -X (mirehak - Pantheon Technologies SRO at Cisco); openflowplugin-dev at lists.opendaylight.org<mailto:openflowplugin-dev at lists.opendaylight.org>; integration-dev at lists.opendaylight.org<mailto:integration-dev at lists.opendaylight.org>
Subject: RE: default flow for punting to CONTROLLER
Thanks Michal.  Having the ability to enable/disable this behavior may be fine for
system test, but I still have the same question.  Maybe in a more generic form:

Is there was via REST to delete a flow that only exists in the operational datastore,
and not the config datastore?

Thanks again,
JamO

From: Michal Rehak -X (mirehak - Pantheon Technologies SRO at Cisco) [mailto:mirehak at cisco.com]
Sent: Monday, September 08, 2014 11:37 PM
To: Luhrsen, Jamo; openflowplugin-dev at lists.opendaylight.org<mailto:openflowplugin-dev at lists.opendaylight.org>; integration-dev at lists.opendaylight.org<mailto:integration-dev at lists.opendaylight.org>
Subject: RE: default flow for punting to CONTROLLER

Hi Jamo,
there is already patch making this behavior optional - table miss entry will be provided by module which requires configSubsystem config file in order to get loaded. I expect this to be merged today:

https://git.opendaylight.org/gerrit/#/c/10910/


Regards,
Michal
________________________________
From: openflowplugin-dev-bounces at lists.opendaylight.org<mailto:openflowplugin-dev-bounces at lists.opendaylight.org> [openflowplugin-dev-bounces at lists.opendaylight.org] on behalf of Luhrsen, Jamo [james.luhrsen at hp.com]
Sent: Monday, September 08, 2014 19:40
To: openflowplugin-dev at lists.opendaylight.org<mailto:openflowplugin-dev at lists.opendaylight.org>; integration-dev at lists.opendaylight.org<mailto:integration-dev at lists.opendaylight.org>
Subject: [openflowplugin-dev] default flow for punting to CONTROLLER
Hi all,

I've noticed that the default behavior is to now program a flow when a switch
connects to punt all packets to the controller.  I'm writing robot test cases in
this area.

I can't figure out how to delete that flow after the fact?  It's there in the operational
datastore, but not in the config datastore.  The only method I've used to delete flows
before is sending a DELETE to /restconf/config ...

Can someone point me in the right direction please?

Thanks,
JamO



ovs/mininet output after switch connect:

mininet> dpctl dump-flows -O OpenFlow13
*** s1 ------------------------------------------------------------------------
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0xa, duration=4.002s, table=0, n_packets=15, n_bytes=1254, send_flow_rem priority=0 actions=CONTROLLER:65535


Operational datastore:

                        "flow": [
                            {
                                "cookie": "10",
                                "flags": "SEND_FLOW_REM",
                                "hard-timeout": "0",
                                "id": "#UF$TABLE*0-1",
                                "idle-timeout": "0",
                                "instructions": {
                                    "instruction": [
                                        {
                                            "apply-actions": {
                                                "action": [
                                                    {
                                                        "order": "0",
                                                        "output-action": {
                                                            "max-length": "65535",
                                                            "output-node-connector": "CONTROLLER"
                                                        }
                                                    }
                                                ]
                                            },
                                            "order": "0"
                                        }
                                    ]
                                },


Config datastore:

"node": [
        {
            "id": "openflow:1",
            "flow-node-inventory:table": [
                {
                    "id": "81",
                    "flow": []
                }
            ]
        }
    ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opendaylight.org/pipermail/openflowplugin-dev/attachments/20140912/a091abfc/attachment-0001.html>


More information about the openflowplugin-dev mailing list