Ask Your Question
0

How to add Flows to Queue created on OVS switch using REST API?

asked 2015-05-28 22:08:57 -0700

princepereira gravatar image

Hi,

I am trying to add flows to the queues created on the OVS switch using REST API(http://10.200.8.30:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1/) by passing Xml in the body..

Xml as follows: <flow> <flow-name>flow1</flow-name> <match> <in-port>1</in-port> </match> <instructions> <instruction> <order>0</order> <write-actions> <action> <order>0</order> <set-queue-action> <queue-id>1</queue-id> </set-queue-action> </action> </write-actions> </instruction> <instruction> <order>1</order> <apply-actions> <action> <order>0</order> <output-action> <output-node-connector>NORMAL</output-node-connector> </output-action> </action> <action> <order>1</order> <set-queue-action> <queue-id>1</queue-id> </set-queue-action> </action> </apply-actions> </instruction> </instructions> <id>1</id> <table_id>0</table_id> </flow>

But flows are not added.. Can any one tell me the exact Xml format that as to be sent with url to add flows.

Thanks & Regards.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-06-01 05:06:01 -0700

Rounak gravatar image

updated 2015-06-01 05:24:58 -0700

Opendaylight Version - distribution-karaf-0.2.3-Helium-SR3 (HELIUM)

Opendaylight Module - RestConf

Client - Postman

Method - PUT

Headers - [Content-Type: application/xml, Accept: application/xml]

Creds - admin/admin

Flood matching ARP mac-1
http://10.138.97.209:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1

xml

    <?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<flow xmlns="urn:opendaylight:flow:inventory"> 
    <flow-name>f1</flow-name> 
    <id>1</id> 
    <table_id>0</table_id> 
    <match> 
    <ethernet-match> 
            <ethernet-type> 
              <type>2054</type> 
            </ethernet-type>        
            <ethernet-source> 
                <address>00:00:00:00:00:01</address> 
            </ethernet-source> 
        </ethernet-match> 
    </match> 
    <cookie>3026418949592973312</cookie> 
    <hard-timeout>0</hard-timeout> 
    <idle-timeout>0</idle-timeout> 
    <priority>10</priority> 
    <instructions> 
        <instruction> 
            <order>0</order> 
            <apply-actions> 
                <action> 
                   <order>0</order> 
                   <output-action> 
                        <output-node-connector>FLOOD</output-node-connector> 
                        <max-length>60</max-length> 
                   </output-action> 
                </action> 
            </apply-actions> 
        </instruction> 
    </instructions> 
</flow>
edit flag offensive delete publish link more

Comments

this is simple flow which is for an arp request. floods packets is encounters an arp request from the specified mac.. obviously m running this on karaf. hope it helps :-)

Rounak ( 2015-06-01 05:11:19 -0700 )edit

Thanks Rounak. Now I am able to add flows. :-) U specified cred as admin/admin is there any possible way for calling REST API for authentication? And Is there REST API to get ofstatistics? Hope u could help me.. Thankx in advance.

princepereira ( 2015-06-02 10:10:37 -0700 )edit
0

answered 2015-06-03 09:48:46 -0700

Nuno gravatar image

I added my flows to map the queue created via ovsdb this way. http://pastebin.com/4CfCyVjG Is that you were looking for ? Regards, Nuno B.

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

Question Tools

Follow
2 followers

Stats

Asked: 2015-05-28 22:08:57 -0700

Seen: 877 times

Last updated: Jun 03 '15