Ask Your Question
0

Proactive flow insertion using REST Api - HP 3500yl + Opendaylight 0.3.0

asked 2015-07-06 05:53:47 -0700

vikin9 gravatar image

updated 2015-07-06 05:59:42 -0700

Hi, I experiment with HP switches and want to fill the flow table with artificial flows to investigate the behavior of the switch in such conditions (no Mininet!). I follow the follwoing tutorial: https://wiki.opendaylight.org/view/EditingOpenDaylightOpenFlowPlugin:EndtoEndFlows:Example_Flows

I can easily read the values of the flow table, although the flow id's are strange (see output below). Unfortunately, when I try to add a flow, the PUT requests always return status 405 Method not allowed. How to debug this behavior? Where do I make a mistake?

GET request: http://10.0.1.118:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:2942596454227584/table/2/flow/%23UF%24TABLE%2A2-1

Status 200 OK

<flow xmlns="urn:opendaylight:flow:inventory">
    <id>#UF$TABLE*2-1</id>
    <instructions>
        <instruction>
            <order>0</order>
            <apply-actions>
                <action>
                    <order>0</order>
                    <output-action>
                        <max-length>65535</max-length>
                        <output-node-connector>3</output-node-connector>
                    </output-action>
                </action>
                <action>
                    <order>1</order>
                    <output-action>
                        <max-length>65535</max-length>
                        <output-node-connector>CONTROLLER</output-node-connector>
                    </output-action>
                </action>
            </apply-actions>
        </instruction>
    </instructions>
    <cookie>3098476543630901248</cookie>
    <match>
        <in-port>openflow:2942596454227584:2</in-port>
    </match>
    <hard-timeout>0</hard-timeout>
    <priority>2</priority>
    <table_id>2</table_id>
    <flow-statistics xmlns="urn:opendaylight:flow:statistics">
        <byte-count>6000</byte-count>
        <duration>
            <second>2308</second>
            <nanosecond>116000000</nanosecond>
        </duration>
        <packet-count>100</packet-count>
    </flow-statistics>
    <idle-timeout>0</idle-timeout>
</flow>

PUT request: http://10.0.1.118:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:2942596454227584/table/2/flow/%23UF%24TABLE%2A2-1

Status 405 Method Not Allowed

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
    <strict>false</strict>
    <instructions>
        <instruction>
            <order>0</order>
            <apply-actions>
                <action>
                    <order>0</order>
                    <dec-mpls-ttl/>
                </action>
            </apply-actions>
        </instruction>
    </instructions>
    <table_id>2</table_id>
    <id>#UF$TABLE*2-1</id>
    <cookie_mask>255</cookie_mask>
    <installHw>true</installHw>
    <match>
        <ethernet-match>
            <ethernet-type>
                <type>45</type>
            </ethernet-type>
            <ethernet-destination>
                <address>ff:ff:ff:ff:ff:ff</address>
            </ethernet-destination>
            <ethernet-source>
                <address>00:00:00:00:23:ae</address>
            </ethernet-source>
        </ethernet-match>
    </match>
    <hard-timeout>12</hard-timeout>
    <cookie>4</cookie>
    <idle-timeout>34</idle-timeout>
    <flow-name>FooXf4</flow-name>
    <priority>2</priority>
    <barrier>false</barrier>
</flow>

The whole table 2 looks like this: (GET http://10.0.1.118:8181/restconf/operational/opendaylight-inventory:nodes/node/openflow:2942596454227584/table/2/ )

<table xmlns="urn:opendaylight:flow:inventory">
    <id>2</id>
    <flow>
        <id>#UF$TABLE*2-1</id>
        <instructions>
            <instruction>
                <order>0</order>
                <apply-actions>
                    <action>
                        <order>0</order>
                        <output-action>
                            <max-length>65535</max-length>
                            <output-node-connector>3</output-node-connector>
                        </output-action>
                    </action>
                    <action>
                        <order>1</order>
                        <output-action>
                            <max-length>65535</max-length>
                            <output-node-connector>CONTROLLER</output-node-connector>
                        </output-action>
                    </action>
                </apply-actions>
            </instruction>
        </instructions>
        <cookie>3098476543630901248</cookie>
        <match>
            <in-port>openflow:2942596454227584:2</in-port>
        </match>
        <hard-timeout>0</hard-timeout>
        <priority>2</priority>
        <table_id>2</table_id>
        <flow-statistics xmlns="urn:opendaylight:flow:statistics">
            <byte-count>6180</byte-count>
            <duration>
                <second>2416</second>
                <nanosecond>341000000</nanosecond>
            </duration>
            <packet-count>103</packet-count>
        </flow-statistics>
        <idle-timeout>0</idle-timeout>
    </flow>
    <flow>
        <id>#UF$TABLE*2-2</id>
        <instructions>
            <instruction>
                <order>0</order>
                <apply-actions>
                    <action>
                        <order>0</order>
                        <output-action>
                            <max-length>65535</max-length>
                            <output-node-connector>2</output-node-connector>
                        </output-action>
                    </action>
                    <action>
                        <order>1</order>
                        <output-action>
                            <max-length>65535</max-length>
                            <output-node-connector>CONTROLLER</output-node-connector>
                        </output-action>
                    </action>
                </apply-actions>
            </instruction>
        </instructions>
        <cookie>3098476543630901249</cookie>
        <match>
            <in-port>openflow:2942596454227584:3</in-port>
        </match>
        <hard-timeout>0 ...
(more)
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2016-07-07 18:19:56 -0700

david gravatar image

updated 2016-07-11 01:27:18 -0700

Hi, To putting flow to ODL, should use 'config' not 'operational' data store.

http://10.0.1.118:8181/restconf/opera... ==> http://10.0.1.118:8181/restconf/config/

Regards, David

edit flag offensive delete publish link more
0

answered 2016-07-09 12:59:30 -0700

updated 2016-07-09 12:59:46 -0700

As @david has answered you should not add the flow to operational data store (read only data). You should add the flow to config data store.

For the flow id, these kind of the flows are known as alien flows in OF community, you can read the details here : https://ask.opendaylight.org/question/5115/added-flow-to-operational-datastore-has-other-id-than-specified/

edit flag offensive delete publish link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

Follow
1 follower

Stats

Asked: 2015-07-06 05:53:47 -0700

Seen: 946 times

Last updated: Jul 11 '16