Ask Your Question
0

REST command (body) with tcp port range?

asked 2016-05-05 02:37:22 -0700

nodachi gravatar image

updated 2016-05-05 03:59:37 -0700

Hello,

I'm trying to add a flow on my OVS with tcp port range (e.g. 1000-1007) via controller. I have successfuly installed this flow directly through CLI on my OVS (command: sudo ovs-ofctl add-flow bridge1 dltype=0x800,nwproto=6,tp_dst=1000/65528,actions=output:1) so I know my OVS version supports this.

What I want to do now is send REST command to my controller, and then the controller sends appropriate OpenFlow command to OVS which will add specified flow. To do this, I need appropirate XML body to send in my REST command. I've tried with the .xml body presented below, but I'm getting an error.

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <flow xmlns="urn:opendaylight:flow:inventory">
    <instructions>
        <instruction>
            <order>0</order>
            <apply-actions>
                <action>
                    <order>0</order>
                    <output-action>
                        <output-node-connector>1</output-node-connector>
                        <max-length>60</max-length>
                    </output-action>
                </action>
            </apply-actions>
        </instruction>
    </instructions>
    <table_id>0</table_id>
    <id>252</id>
    <match>
        <ethernet-match>
            <ethernet-type>
                <type>2048</type>
            </ethernet-type>
        </ethernet-match>
        <ip-match>
            <ip-protocol>6</ip-protocol>         
        </ip-match>
        <tcp-source-port>1000/65528</tcp-source-port>
    </match>   
    <hard-timeout>0</hard-timeout>
    <cookie>10</cookie>
    <idle-timeout>0</idle-timeout>
    <flow-name>flow-instruction-go-to-tablee</flow-name>
    <priority>400</priority> </flow>

I'm using OpenDaylight Lithium controller and OVS 2.4

I think that I'm not using correct .xml tag for tcp port since I get an error below. Does anyone know how to do this?

    <errors 
    xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">
    <error>
        <error-type>protocol</error-type>
        <error-tag>malformed-message</error-tag>
        <error-message>Error parsing input: Incorrect lexical representation of integer value: 1000/65528.
An integer value can be defined as: 
  - a decimal number,
  - a hexadecimal number (prefix 0x),
  - an octal number (prefix 0).
Signed values are allowed. Spaces between digits are NOT allowed.</error-message>
    </error>
</errors>
edit retag flag offensive close merge delete

Comments

Check this link

https://wiki.opendaylight.org/view/Editing_OpenDaylight_OpenFlow_Plugin:End_to_End_Flows:Example_Flows

karthik330 ( 2016-05-05 03:30:50 -0700 )edit

I've searched through all these examples and haven't found the REST body I need. The example I've shown in my question is derived from your link.

nodachi ( 2016-05-05 03:57:13 -0700 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-05-05 21:29:57 -0700

jamoluhrsen gravatar image

I may be wrong, but I think this might be a limitation of openflowplugin. You can ask for clarification by sending an email to openflowplugin-dev@lists.opendaylight... . If that's the case, you could request the enhancement on that list or open a bug on bugzilla.

The yang model that describes the tcp port match fields does not appear to have masking available. see here

In the meantime, as a workaround, maybe you could add 8 separate flows, one for each of the ports in your 1000-1007 range?

edit flag offensive delete publish link more

Comments

Thank you very much, it really appears that yang model does not support tcp port masking. I'll send an e-mail to openflowplugin-dev@lists.opendaylight.org and ask them about my problem.

nodachi ( 2016-05-05 23:44:54 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2016-05-05 02:37:22 -0700

Seen: 63 times

Last updated: May 05 '16