Ask Your Question
0

Unable to write flows for queues in OVSwitch through Rest API calls

asked 2015-10-30 00:44:32 -0700

yogesh_pandey gravatar image

When I am sending this request, I am getting 200 OK but unable to get the flow information from config/operational or switch.

Put URL: http://localhost:8080/restconf/config...

Body:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
    <priority>2</priority>
    <flow-name>Foo</flow-name>
    <match>
        <ethernet-match>
            <ethernet-type>
                <type>2048</type>
            </ethernet-type>
        </ethernet-match>
        <ipv4-source>10.0.0.1/32</ipv4-source>
        <ipv4-destination>10.0.0.2/32</ipv4-destination>
    </match>
    <table_id>0</table_id>
    <id>0</id>
    <instructions>
        <instruction>
            <order>0</order>
            <apply-actions>
                <action>
                  <order>1</order>
                        <output-action>
                        <output-node-connector>2</output-node-connector>
                    </output-action>
                </action>
                <action>
                    <order>0</order>
                      <set-queue-action>
                        <queue>newqueue2</queue>
                        <queue-id>1</queue-id>
                        </set-queue-action>
                  </action>
            </apply-actions>
        </instruction>
    </instructions>
</flow>
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-03-10 06:51:45 -0700

Cesar gravatar image

updated 2017-03-10 08:22:44 -0700

Hi, Im not really sure, but... I think you have to use the <ip-protocol> tag when using L3 (and L4) match.

Here is an example:

<flow xmlns="urn:opendaylight:flow:inventory">
    <id>99</id>
    <flow-name>APPLY-QUEUE1-UDP-H1-H2</flow-name>
    <flags>
    SEND_FLOW_REM
    </flags>
    <instructions>
        <instruction>
        <order>0</order>
        <apply-actions>
            <action>
                <order>2</order>
                   <output-action>
                      <output-node-connector>
                         openflow:1:2
                      </output-node-connector>
                  </output-action>
            </action>
            <action>
                <order>1</order>
                <set-queue-action>
                    <queue-id>1</queue-id>
                    <queue>1</queue>
                </set-queue-action>
            </action>
        </apply-actions>
        </instruction>
    </instructions>
   <match>
        <ethernet-match>
            <ethernet-type>
                <type>2048</type>
            </ethernet-type>
        </ethernet-match>
        <ipv4-source>10.0.0.1/24</ipv4-source>
        <ipv4-destination>10.0.0.2/24</ipv4-destination>
        <ip-match>
            <ip-protocol>17</ip-protocol>
        </ip-match>
        <udp-destination-port>5001</udp-destination-port>
    </match>
    <hard-timeout>0</hard-timeout>
    <idle-timeout>0</idle-timeout>
    <priority>30</priority>
    <table_id>0</table_id>
</flow>

I have created the mininet topology using:

mn --mac --controller=remote,ip=127.0.0.1 --topo=single,2 --switch ovsk,protocols=OpenFlow13 --ipbase=10.0.0.0/24

I created the queues using this command:

sudo ovs-vsctl set port s1-eth1 qos=@newqos -- --id=@newqos create qos type=linux-htb other-config:max-rate=10000000 queues=1=@q1,2=@q2 -- --id=@q1 create queue other-config:min-rate=5000000 other-config:max-rate=5000000

And I use the following command do inspect the flow rules (please note that the second rule corresponds to the above xml)

 ovs-ofctl -O OpenFlow13 dump-flows s1
 cookie=0x69, duration=18.413s, table=0, n_packets=14, n_bytes=1156, priority=1 actions=NORMAL,CONTROLLER:65535
 cookie=0x0, duration=1.798s, table=0, n_packets=0, n_bytes=0, send_flow_rem priority=30,udp,nw_src=10.0.0.0/24,nw_dst=10.0.0.0/24,tp_dst=5001 actions=set_queue:1,output:2
 cookie=0x2b00000000000007, duration=18.416s, table=0, n_packets=0, n_bytes=0, priority=100,dl_type=0x88cc actions=CONTROLLER:65535
 cookie=0x0, duration=18.413s, table=0, n_packets=0, n_bytes=0, priority=30,arp actions=ALL,CONTROLLER:65535
 cookie=0x2b00000000000007, duration=18.416s, table=0, n_packets=0, n_bytes=0, priority=1,arp actions=CONTROLLER:65535
edit flag offensive delete publish link more

Comments

I used your example to add the flow to my controller, but I still don't see anything when I click Flows under Nodes in DLUX. Also, ovs-ofctl dump flows does not show the new flow.

penguin360 ( 2017-03-10 07:47:45 -0700 )edit

I edited the response putting the commands I used to create queues and inspect the rule on OVS.

Cesar ( 2017-03-10 08:19:12 -0700 )edit

Your Answer

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

Add Answer

[hide preview]

Stats

Asked: 2015-10-30 00:44:32 -0700

Seen: 177 times

Last updated: Mar 10