Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

Revision history [back]

click to hide/show revision 1
initial version

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>

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 first rule corresponds to the above xml)

ovs-ofctl -O OpenFlow13 dump-flows s1

OFPST_FLOW reply (OF1.3) (xid=0x2):
 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=0x2b00000000000007, duration=18.416s, table=0, n_packets=0, n_bytes=0, priority=1,arp actions=CONTROLLER:65535

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 first rule corresponds to the above xml)

ovs-ofctl -O OpenFlow13 dump-flows s1

OFPST_FLOW reply (OF1.3) (xid=0x2):
 

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 npackets=0, nbytes=0, sendflowrem priority=30,udp,nwsrc=10.0.0.0/24,nwdst=10.0.0.0/24,tpdst=5001 actions=setqueue:1,output:2 cookie=0x2b00000000000007, duration=18.416s, table=0, n_packets=0, n_bytes=0, priority=100,dl_type=0x88cc npackets=0, nbytes=0, priority=100,dltype=0x88cc actions=CONTROLLER:65535 cookie=0x2b00000000000007, duration=18.416s, table=0, n_packets=0, npackets=0, n_bytes=0, priority=1,arp actions=CONTROLLER:65535 actions=CONTROLLER:65535

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 first second rule corresponds to the above xml)

 ovs-ofctl -O OpenFlow13 dump-flows s1

OFPST_FLOW reply (OF1.3) (xid=0x2):

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, npackets=0, nbytes=0, sendflowrem priority=30,udp,nwsrc=10.0.0.0/24,nwdst=10.0.0.0/24,tpdst=5001 actions=setqueue:1,output:2 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, npackets=0, nbytes=0, priority=100,dltype=0x88cc 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, npackets=0, n_packets=0, n_bytes=0, priority=1,arp actions=CONTROLLER:65535

actions=CONTROLLER:65535