[OPNFLWPLUG-59] Set-field cannot update read-only actions on OVS Created: 27/Jan/14  Updated: 27/Sep/21  Resolved: 24/Mar/14

Status: Resolved
Project: OpenFlowPlugin
Component/s: General
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Krishnan Iyer Assignee: Krishnan Iyer
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: PC


Attachments: File f129.xml    
External issue ID: 381

 Description   

We cannot use set-field action for:
ETH_TYPE
ICMPV4_TYPE
ICMPV4_CODE
ARP_OP
ARP_SPA
ARP_TPA
ARP_SHA
ARP_THA
IPV6_FLABEL
ICMPV6_TYPE
ICMPV6_CODE
IPV6_ND_TARGET
IPV6_ND_SLL
IPV6_ND_TLL

We were testing using XMLs and the odl_tests.py script, which failed.
When we tried to do it manually over CLI, this is the output:

mininet@mininet-vm:~$ sudo ovs-ofctl O OpenFlow13 add-flow s1 "dl_type=0x800,table=2,nw_src=1.2.3.4/24,metadata=12345,actions=set_field:0x86DD>dl_type"
ovs-ofctl: dl_type is read-only

mininet@mininet-vm:~$ sudo ovs-ofctl O OpenFlow13 add-flow s1 "table=2,priority=2,dl_type=0x86DD,dl_dst=aa:bb:cc:00:64:00,nw_proto=1,actions=set_field:7>icmp_code"
ovs-ofctl: icmp_code is read-only

mininet@mininet-vm:~$ sudo ovs-ofctl O OpenFlow13 add-flow s1 "table=2,priority=2,dl_type=0x86DD,dl_dst=aa:bb:cc:00:64:00,nw_proto=1,actions=set_field:7>icmp_code"
ovs-ofctl: icmp_code is read-only

and so on.

Version Info:
mininet@mininet-vm:~/removeMDFlow-test-scripts$ ovs-ofctl -V
ovs-ofctl (Open vSwitch) 2.0.0
Compiled Nov 11 2013 12:25:52
OpenFlow versions 0x1:0x4
mininet@mininet-vm:~/removeMDFlow-test-scripts$ mn --version
2.1.0
krish@krish-Ubuntu32:~/Desktop/shared/E_DRIVE/openflowplugin$ git log
commit 49029e5d7978e4bf9f9c56f1ec98a264f61ff203
Author: Ed Warnicke <eaw@cisco.com>
Date: Sat Jan 25 21:33:22 2014 -0600

Turned down logging in ErrorTranslator from ERROR to DEBUG

Change-Id: I296451951e41320def91234b67671211948f5908
Signed-off-by: Ed Warnicke <eaw@cisco.com>



 Comments   
Comment by Jyotsna Priya [ 29/Jan/14 ]

If the flow is being written from CLI, what is the role of controller in this?

I think the openvswitch code is working as intended and this is an invalid scenario: Try to write the set field that are read-only.

The set-field action parameters are set as read-only in openvswitch. In file openvswitch<version>/lib/ofp-parse.c, method set_field_parse(), the code checks for the those variables that are not writable and returns fatal error if they are read-only.

Please update that my understanding is correct on this or not?

Comment by Krishnan Iyer [ 03/Feb/14 ]

Hi Jyotsna,

"If the flow is being written from CLI, what is the role of controller in this?"
I just tested using the CLI, and also with the restconf API.

"I think the openvswitch code is working as intended and this is an invalid scenario: Try to write the set field that are read-only. "
The OpenFlow 1.3.2 spec says that we should be able to set the values for these fields.

"The set-field action parameters are set as read-only in openvswitch. In file openvswitch<version>/lib/ofp-parse.c, method set_field_parse(), the code checks for the those variables that are not writable and returns fatal error if they are read-only.
Please update that my understanding is correct on this or not?"
So, if this is the case, either OVS needs to make them read-write ot the OF spec should be updated.
Thanks.

Comment by Krishnan Iyer [ 03/Feb/14 ]

Also, restconf sends an OK/Success when tested. PUT/GET succeeds.
It should return an error code if the field is read-only.
This part is an OpenflowPlugin bug.

Comment by Jyotsna Priya [ 06/Feb/14 ]

>"The OpenFlow 1.3.2 spec says that we should be able to set the values for these fields"
You are right. In openflow 1.3.2 spec, it is mentioned that all fi elds in
ofp_table_features may be requested to be changed by the controller with the exception of the max_entries_fi eld, this is read only and returned by the switch.

So this is ovs bug and not of openflowplugin. OVS needs to make them read-write.

Comment by Jyotsna Priya [ 10/Feb/14 ]

Hi Krishnan,

Can you please provide the url and xml file that you used in restclient.

Thanks

Comment by Krishnan Iyer [ 05/Mar/14 ]

One of the example XML

Comment by Krishnan Iyer [ 05/Mar/14 ]

Attachment f129.xml has been added with description: ICMPv4 Type XML

Comment by Michal Rehak [ 05/Mar/14 ]

On cpqd switch the attached xml works. But on ovs it fails and corresponding error message arrives from switch. This message gets translated into MD-SAL model and published to MD-SAL.

I believe that controller is processing this scenario as expected.

Krishnan, could you please mark this bug as resolved and eventually file a bug into openvswitch.org?

Thank you.

Comment by Abhijit Kumbhare [ 24/Mar/14 ]

Any update on this Krishnan?

Comment by Krishnan Iyer [ 24/Mar/14 ]

Abhijit/Michal,
Have marked the bug as fixed.
Am trying to find how to file a bug on openvswitch.org.
Once I file there,will cross-reference it over here.

Comment by Krishnan Iyer [ 24/Mar/14 ]

Have emailed bugs@openvswitch.org with the details.

Comment by Ben Pfaff [ 24/Mar/14 ]

(In reply to Krishnan Iyer from comment #2)
>> "I think the openvswitch code is working as intended and this is an invalid
> scenario: Try to write the set field that are read-only. "
> The OpenFlow 1.3.2 spec says that we should be able to set the values for
> these fields.

This is some kind of misunderstanding. Here's what OpenFlow 1.3.3 says in section 5.12. Set-Field is clearly optional:

Optional Action: Set-Field. The various Set-Field actions are
identified by their field type and mod- ify the values of
respective header fields in the packet. While not strictly
required, the support of rewriting various header fields using
Set-Field actions greatly increase the usefulness of an OpenFlow
implementation.

Here's what 7.2.5 Action Structures says:

All header fields are valid in the set-field action, as well as
the OXM_OF_TUNNEL_ID pipeline field, and can be used if the switch
support them.

Comment by Ben Pfaff [ 24/Mar/14 ]

(In reply to Jyotsna Priya from comment #4)
> >"The OpenFlow 1.3.2 spec says that we should be able to set the values for these fields"
> You are right. In openflow 1.3.2 spec, it is mentioned that all fi elds in
> ofp_table_features may be requested to be changed by the controller with the
> exception of the max_entries_fi eld, this is read only and returned by the
> switch.
>
> So this is ovs bug and not of openflowplugin. OVS needs to make them
> read-write.

This is wrong. ofp_table_features allows one to find out the switch's features, including whether it can write various fields, and to request changes to the switch's features. The text in 1.3.2 means that the controller can request a change to any feature, but it doesn't mean that the switch must be able to implement any change that the controller requests.

Generated at Wed Feb 07 20:31:28 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.