[OPNFLWPLUG-267] The way of handling values for SET_NW_TOS action is wrong Created: 09/Sep/14  Updated: 27/Sep/21  Due: 15/Sep/14  Resolved: 19/Sep/14

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

Type: Bug
Reporter: Hideyuki Tai Assignee: Ed Warnicke
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: File bug-1795-inputFlows.tgz    
External issue ID: 1759

 Description   

The way of handling values for SET_NW_TOS action is wrong.
Consequently, I cannot set some values for SET_NW_TOS action.

I detected the issue with the latest Base Edition on 09/07/2014.
And I've found out that the issue occurs with bout the MD-SAL OpenFlow plugin and the AD-SAL OpenFlow plugin.

First of all, it was failed to create a flow entry which had a SetNwTos action to set 1 into DSCP field.

$ curl --user "admin":"admin" -H "Content-type: application/json" -X PUT \
http://localhost:8080/controller/nb/v2/flowprogrammer/default/node/OF/00:00:00:00:00:00:00:01/staticFlow/flow1 \
-d '{ "installInHw":"true", "name":"flow1", "node":

{"id":"00:00:00:00:00:00:00:01","type":"OF"}

,"ingressPort":"1","priority":"500","actions":["SET_NW_TOS=1"] }'

Even after I executed the above curl command, the flow entry was not installed into the switch.
I observed that the controller sent a FLOW_MOD message to the switch, and the switch sent a ERROR message to the controller.

It seemed to me that the AD-SAL used the passed value "1" for the nw_tos field for OFPAT_SET_NW_TOS in FLOW_MOD messages.
"1" in TOS field means DSCP=0 and ECP=1, altought OpenFlow controllers can set a value only in DSCP field.

1 2 3 4 5 6 7
-----------------------

DSCP field ECP field

-----------------------

Next, to set 1 into DSCP field, I set 4 (1 << 2) to a SET_NW_TOS.

$ curl --user "admin":"admin" -H "Content-type: application/json" -X PUT \
http://localhost:8080/controller/nb/v2/flowprogrammer/default/node/OF/00:00:00:00:00:00:00:01/staticFlow/flow1 \
-d '{ "installInHw":"true", "name":"flow1", "node":

{"id":"00:00:00:00:00:00:00:01","type":"OF"}

,"ingressPort":"1","priority":"500","actions":["SET_NW_TOS=4"] }'

I saw the flow entry which contained the action which set 4 into TOS field. (It meant to set 1 into DSCP field.)

mininet> dpctl dump-flows

      • s1 ------------------------------------------------------------------------
        NXST_FLOW reply (xid=0x4):
        cookie=0xa, duration=3727.481s, table=0, n_packets=0, n_bytes=0, idle_age=3727, priority=0 actions=CONTROLLER:65535
        cookie=0x0, duration=2.677s, table=0, n_packets=0, n_bytes=0, idle_age=2, priority=500,in_port=1 actions=mod_nw_tos:4

Thirdly, to set 63 into DSCP field, I set 252 (63 << 2) to a SetNwTos.
However, it was also failed.

$ curl --user "admin":"admin" -H "Content-type: application/json" -X PUT \
http://localhost:8080/controller/nb/v2/flowprogrammer/default/node/OF/00:00:00:00:00:00:00:01/staticFlow/flow1 \
-d '{ "installInHw":"true", "name":"flow1", "node":

{"id":"00:00:00:00:00:00:00:01","type":"OF"}

,"ingressPort":"1","priority":"500","actions":["SET_NW_TOS=252"] }'

The response message of the above request was:
Invalid Configuration (IP ToS bits 252 is not in the range 0 - 63)

I saw the following output in the OSGi console of the controller.

2014-09-05 19:54:47.069 EDT [http-bio-8080-exec-4] WARN o.o.c.f.i.ForwardingRulesManager - Invalid Configuration for flow FlowConfig [dynamic=false, status=Invalid Configuration (IP ToS bits 252 is not in the range 0 - 63), installInHw=true, name=flow1, switchId=OF|00:00:00:00:00:00:00:01, ingressPort=1, portGroup=null, etherType=null, priority=500, vlanId=null, vlanPriority=null, dlSrc=null, dlDst=null, nwSrc=null, nwDst=null, protocol=null, tosBits=null, tpSrc=null, tpDst=null, cookie=null, idleTimeout=null, hardTimeout=null, actions=[SET_NW_TOS=252]]. The failure is IP ToS bits 252 is not in the range 0 - 63



 Comments   
Comment by Hideyuki Tai [ 10/Sep/14 ]

I've submitted a patch to controller project to fix the issue.
https://git.opendaylight.org/gerrit/#/c/10960/

I've tested the patch, and confirmed that the patch fixes the issue partially.
I mean that the issue does not occur with this patch with the AD-SAL OF plugin (the old plugin) for OF 1.0 switches.
And the issue does not occur with this patch with the MD-SAL OF plugin for OF 1.0 switch.
However, it is failed to install a flow entry to change TOS value to 63 for OF 1.3 switch.

It seems to me that the MD-SAL OF plugin uses TOS value for set-field(DSCP) action although it must use DSCP value for set-field(DSCP).
I think we need a patch to OpenFlow Plugin project to fix the issue completely.

Comment by Michal Rehak [ 12/Sep/14 ]

input flows (xml for MD-SAL, json for AD-SAL) containing 3 tests: TOS=

{1, 4, 252}
Comment by Michal Rehak [ 12/Sep/14 ]

Attachment bug-1795-inputFlows.tgz has been added with description: input flows

Comment by Michal Rehak [ 12/Sep/14 ]

added fixes:

And I added etherType to AD-SAL inputs so that OF-1.3 wont reject those flows because of inconsistent match - see attachment.

Results are the same through MD-SAL and AD-SAL:

OF-1.3 accepts all 3 flows and reported DSCP values are: 0, 1, 63
OF-1.0 rejects 1. value (=1) and reported TOS values are: x, 4, 252

Comment by Hideyuki Tai [ 12/Sep/14 ]

(In reply to michal rehak from comment #3)
> added fixes:
> - expanded TOS valid range to 0..255 in AD-SAL - frm
> https://git.opendaylight.org/gerrit/11115
> - added TOS to DSCP shift for OF-1.3 in OFPlugin
> https://git.opendaylight.org/gerrit/11114
>

Thank you for submitting patches.

I've tested the following two patches.

https://git.opendaylight.org/gerrit/#/c/11114/1
https://git.opendaylight.org/gerrit/#/c/11115/1

I've confirmed that the MD-SAL OF plugin works fine for OF 1.3 switches and OF 1.0 switches, and the AD-SAL OF plugin works fine for OF 1.0.

However, I've observed two issues.

The first issue is that after a controller installs a flow entry containing an action "SET_NW_TOS=252", the following error message is output repeatedly.

[Statistics Collector] ERROR o.o.controller.sal.action.Action - Invalid field value assignement. For type: setNwTos Expected: [0x0-0xff], Got: 0xfffffffc

It happens only when I use the AD-SAL OF plugin.

The second issue is that the MD-SAL OF plugin doesn't add SET_FIELD(ECN) action in flow entries.
Because VTN project does not plan to change a value of ECN field for Helium release, it is ok for VTN project to fix this issue in Lithium release.

Comment by Michal Rehak [ 13/Sep/14 ]

https://git.opendaylight.org/gerrit/#/c/11132/
abandon AD-SAL change in favor of sal-compatibility adapters change:

adapters now consider

  • AD-SAL NW-TOS value containing NW-DSCP only and
  • MD-SAL NW-TOS value to containing full NW-TOS

Testing:
AD-SAL TOS input =

{0, 1, 63}
OF-1.0 reports = {0, 4, 252} (ovs shows TOS)
OF-1.3 reports = {0, 1, 63}

(ovs shows DSCP)

MD-SAL TOS input =

{0, 1, 4, 252}

OF-1.0 reports =

{0, x, 4, 252}

(ovs shows TOS) *
OF-1.3 reports =

{0, 1, 63}

(ovs shows DSCP) **

  • input #2 (TOS=1) was rejected for it touches ENC
    • inputs #1 (TOS=0) and #2 (TOS=1) rendered into the same flow as TOS value was for both == 0

Now inputs for AD-SAL and MD-SAL are different because:

  • AD-SAL enforces range for TOS = 0..63, which effectively makes TOS to DSCP
  • MD-SAL provides ENC value for OF-1.3
Comment by Michal Rehak [ 16/Sep/14 ]

Update:
Hideyuki confirmed that currently proposed patches solving VTN issues. Also we agreed with Ed that AD-SAL code should not be touched this late before helium.

Changes are ready for merge:

ofplugin (OF-1.3 TOS to DSCP fork):
https://git.opendaylight.org/gerrit/11114
controller (adapters):
https://git.opendaylight.org/gerrit/11132

Please merge on sight.

Comment by Hideyuki Tai [ 16/Sep/14 ]

Hi Michal and Ed,

Thank you for submitting the patches.
VTN project would be happy if you would merge the above two patches.

I've confirmed that these patches fix the issue when I uses the MD-SAL OF plugin.

Please do not forget that the patches does not fix the issue when the AD-SAL OF plugin (the old OF plugin) is used.

Comment by Abhijit Kumbhare [ 18/Sep/14 ]

Fixed for the OF 1.0/1.3 plugin. For OF 1.0 only plugin - please assign to the controller.

Comment by Hideyuki Tai [ 19/Sep/14 ]

(In reply to Abhijit Kumbhare from comment #8)
> Fixed for the OF 1.0/1.3 plugin. For OF 1.0 only plugin - please assign to
> the controller.

I've created a new bug report for the AD-SAL OF plugin (OF 1.0 only plugin).
https://bugs.opendaylight.org/show_bug.cgi?id=1989

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