Ask Your Question
0

Add flows via restconf to build VXLAN - Resolved

asked 2015-08-12 03:00:20 -0700

nevalosa gravatar image

updated 2015-08-17 02:55:19 -0700

I followed this video and tried to build VXLAN with restconf REST API. My problem is I don't know whether these XML flows are correct or not. Bold flows get from github.

Could anyone help to check XML flow is equivalent to the Bold one? I really appreciate your help ;)

Rest API returns 200, but get nothing when using cmd "ovs-ofctl -O OpenFlow13 dump-flows mybridge".

NOTE: flow-name, for example, S1T0F1 means Server1Table0Flow0. Refers this video and code repository: github.

table=0,inport=1,actions=setfield:100->tun_id,resubmit(,1)

[edit] POST: http://172.171.2.156:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
<flow-name>S1T0F1</flow-name>
<table_id>0</table_id>
<id>1</id>
<installHw>false</installHw>
<strict>false</strict>
<priority>10</priority>

<instructions>
    <instruction>
        <order>0</order>
        <apply-actions>
            <action>
                <order>0</order>
                <set-field>
                    <tunnel>
                        <tunnel-id>100</tunnel-id>
                    </tunnel>
                </set-field>
            </action>
        </apply-actions>
    </instruction>
    <instruction>
        <order>1</order>
        <go-to-table>
            <table_id>1</table_id>
        </go-to-table>
    </instruction>
</instructions>

<match>
    <in-port>1</in-port>
</match>
</flow>

table=1,tunid=100,dldst=00:00:00:00:aa:01,actions=output:1

[edit] POST: http://172.171.2.156:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
<flow-name>S1T1F1</flow-name>
<table_id>1</table_id>
<id>1</id>
<installHw>false</installHw>
<strict>false</strict>

<instructions>
    <instruction>
        <order>0</order>
        <apply-actions>
            <action>
                <order>0</order>
                <output-action>
                    <output-node-connector>1</output-node-connector>
                </output-action>
            </action>
        </apply-actions>
    </instruction>
</instructions>

<match>
    <ethernet-match>
        <ethernet-type>
            <type>2048</type>
        </ethernet-type>
        <ethernet-destination>
            <address>00:00:00:00:aa:01</address>
        </ethernet-destination>
    </ethernet-match>
    <tunnel>
        <tunnel-id>100</tunnel-id>
    </tunnel>
</match>
</flow>

table=1,tunid=100,arp,nwdst=10.0.0.1,actions=output:1

[edit] POST: http://172.171.2.156:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
<flow-name>S1T1F5</flow-name>
<table_id>1</table_id>
<id>5</id>
<installHw>false</installHw>
<strict>false</strict>

<instructions>
    <instruction>
        <order>0</order>
        <apply-actions>
            <action>
                <order>0</order>
                <output-action>
                    <output-node-connector>1</output-node-connector>
                </output-action>
            </action>
        </apply-actions>
    </instruction>
</instructions>

<match>
    <ethernet-match>
        <ethernet-type>
            <type>2054</type>
        </ethernet-type>
    </ethernet-match>
    <arp-target-transport-address>10.0.0.1/0</arp-target-transport-address>
    <tunnel>
        <tunnel-id>100</tunnel-id>
    </tunnel>
</match>
</flow>

table=0,actions=resubmit(,1)

POST: http://172.171.2.156:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/1/

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
<flow-name>S1T0F3</flow-name>
<table_id>0</table_id>
<id>3</id>
<strict>false</strict>
<installHw>false</installHw>
<priority>1</priority>

<instructions>
    <instruction>
        <order>0</order>
        <go-to-table>
            <table_id>1</table_id>
        </go-to-table>
    </instruction>
</instructions>

<match>
</match>
</flow>

table=1,priority=100,actions=drop

POST: http://172.171.2.156:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
<flow-name>S1T0F3</flow-name>
<table_id>0</table_id>
    <id>3 ...
(more)
edit retag flag offensive close merge delete

Comments

The problem are: I have no idea which flow is incorrect, and why dump nothing from ovs after restconf post returns 200.

nevalosa ( 2015-08-13 00:04:04 -0700 )edit

Your first translation is not actually the equivalent of the listed command. What you have provided the XML for is not "table=0,inport=1,actions=setfield:100->tun_id,resubmit(,1)" but is instead "table=0,inport=1,actions=setfield:100->tun_id,goto_table:1". I request that you make a clarifying edit.

DeJuan ( 2015-09-14 10:18:31 -0700 )edit

The same is true of "table=0,actions=resubmit(,1)"; it should be "table=0,actions=goto_table:1". Resubmit is a Nicira extension which is an action, where goto_table is an instruction;this is visible in your xml. Again, I request that you change the provided lines to reflect an accurate translation.

DeJuan ( 2015-09-14 10:21:35 -0700 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-08-16 07:03:17 -0700

Hello,

Can you include the URL used to add these flows ? From what I remember, I think every bridge has an ODL OpenFlow node associated to it, ie openflow:21312312312312. So when pushing your flow, make sure you send it to the right bridge.

Cheers

edit flag offensive delete publish link more

Comments

Thanks for your reply. Check the [edit] part URL. Yes, you're right, my node is openflow:1. I checked by GET, all these flow can be got from this node after POST, but got nothing using ovs-ofctl to dump-flows. I have a suspect that the xml flow is not equivalent with text flow. Did I miss anything?

nevalosa ( 2015-08-16 19:04:30 -0700 )edit
0

answered 2015-08-17 02:56:42 -0700

nevalosa gravatar image

I have resolved this issue, and update correct format as post. Thanks all.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-08-12 03:00:20 -0700

Seen: 594 times

Last updated: Aug 17 '15