openvswitch / ovs-issues

Issue tracker repo for Open vSwitch
10 stars 3 forks source link

ovs configuring queues -opendaylight controller #116

Open elina1490 opened 8 years ago

elina1490 commented 8 years ago

I'm trying to configure Queues in OVS . I have created this topology

         h3
          |
    h1-- s1 -- h2

$ sudo mn --custom ~/one_node_topo_3_hosts.py --topo mytopo1 --controller=remote,ip=172.28.40.29,port=33081 --switch=ovsk,protocols=OpenFlow13 --link tc

Then i create 2 queues per port s1-eth3 and per port s1-eth3 with following commands. The queueshave different min-rate and max-rate. q1 min-rate =4000000 max-rate =4000000 q2 min-rate =40000 max-rate=40000


$ sudo ovs-vsctl -- set Port s1-eth3 qos=@newqos -- --id=@newqos create QoS type=linux-htb other-config:max-rate=1000000000 queues=0=@q0 -- --id=@q0 create Queue other-config:min-rate=4000000 other-config:max-rate=4000000 039e8f17-1317-47ce-8058-d46457791aaa 3b21dc27-5f45-4244-a0c2-48b82b0bdbdd

$ mininet@ubuntu:~$ sudo ovs-vsctl -- set Port s1-eth3 qos=@newqos -- --id=@newqos create QoS type=linux-htb other-config:max-rate=1000000000 queues=1=@q1 -- --id=@q1 create Queue other-config:min-rate=40000 other-config:max-rate=40000 b2290f37-1358-495a-a190-427fd5d7088a 4a5a97fe-af06-4297-b78a-1a8233221e82

I can check that the queues are created by the following command $ sudo ovs-ofctl -O Openflow13 queue-stats s1 OFPST_QUEUE reply (OF1.3) (xid=0x2): 3 queues port 3 queue 0: bytes=53860, pkts=634, errors=0, duration=689.717s port 3 queue 1: bytes=0, pkts=0, errors=0, duration=691.253s

Also i can see queues are stored in opendaylight controller.

GET: URL ---> http://127.0.0.1:33074/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:1/queue/0

The Output will be:

<queue>
     queue-id>0</queue-id>
    <flow-capable-node-connector-queue-statistics>
      <duration><second>3392</second><nanosecond>561000000</nanosecond></duration>
      <transmitted-bytes>99760</transmitted-bytes>
      <transmitted-packets>1174</transmitted-packets>
     <transmission-errors>0</transmission-errors>
</flow-capable-node-connector-queue-statistics>
</queue>

the other queue is stored too.

After i add flows using REST API

PUT : http://127.0.0.1:33077/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1 and for seconfd flow http://127.0.0.1:33077/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/2 Headers Content-Type: application/xml

Body

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
    <priority>20</priority>
    <flow-name>flow2</flow-name>
    <flags>
    SEND_FLOW_REM
    </flags>
    <match>
        <in-port>openflow:1:1</in-port >      <in-port>openflow:1:2</in-port >
    </match>
    <hard-timeout>0</hard-timeout>
    <idle-timeout>0</idle-timeout>
    <cookie>30</cookie>
    <id>1</id>                                        <id>2</id>
    <table_id>0</table_id>
    <instructions>
        <instruction>
            <order>0</order>
              <apply-actions>
                <action>
                   <order>1</order>
                   <set-queue-action>
                      <queue-id>
                         1
                      </queue-id>
                      <queue>
                         1
                      </queue>
                  </set-queue-action>
                </action>
                <action>
                   <order>2</order>
                   <output-action>
                      <output-node-connector>
                         openflow:1:3
                      </output-node-connector>
                  </output-action>
                </action>
            </apply-actions>
        </instruction>
    </instructions>
</flow>

the <id>2</id> and <in-port>openflow:1:2</in-port > are for the second flow.

the flows are created succesfully.

Lastly i generate packets for h1 and h2

$ ~/mininet/util/m h1 sudo mz -c 0 -t udp -Q 7:1 -p 1000 & ~/mininet/util/m h2 sudo mz -c 0 -t udp -Q 7:2 -p 1000 i capture the Traffic $ sudo tcpdump -p -i s1-eth3 "((not ether proto 0x88cc) and (not icmp6))" -w tempFile.pcap

when i use wireshark to filter packets that i receive the from each port s1-eth3 with vlan id ==1 and vlan ==2 i get the same result.

What i am doing wrong ? Am i missing something?

blp commented 7 years ago

Do the queue statistics show packets being sent through queue 1? You should note that queue 0 is the default queue, so packets will pass through it even if the flows to set the output queue aren't working properly.