[OPNFLWPLUG-12] set-tos-action does not work Created: 04/Jan/14  Updated: 27/Sep/21  Due: 25/Jan/14  Resolved: 25/Jan/14

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

Type: Bug
Reporter: Jan Medved Assignee: Jyotsna Priya
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac OS
Platform: Macintosh


External issue ID: 269
Priority: Normal

 Description   

when set-tos-action is used in a flow-add operation from restconf, no flow-mod message is sent to the switch. All other parameters of the flow with a different action.

The following xml can be used to reproduce the problem:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
<strict>false</strict>
<instructions>
<instruction>
<order>0</order>
<apply-actions>
<action>
<order>0</order>
<set-nw-tos-action>
<tos>1</tos>
</set-nw-tos-action>
</action>
</apply-actions>
</instruction>
</instructions>
<table_id>2</table_id>
<id>159</id>
<cookie_mask>255</cookie_mask>
<installHw>false</installHw>
<match>
<ethernet-match>
<ethernet-type>
<type>2048</type>
</ethernet-type>
</ethernet-match>
<ipv4-destination>10.0.0.1/24</ipv4-destination>
</match>
<hard-timeout>12</hard-timeout>
<flags>FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false]</flags>
<cookie>36</cookie>
<idle-timeout>34</idle-timeout>
<flow-name>FooXf36</flow-name>
<priority>2</priority>
<barrier>false</barrier>
</flow>

USe HTTP PUT with the following URL:

http://192.168.4.1:8080/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/2/flow/159



 Comments   
Comment by Martin Sunal [ 10/Jan/14 ]

All values are put into a transaction correctly including set-nw-tos-action. It seems that bug is in another component - moved to md-sal

Comment by Tony Tkacik [ 21/Jan/14 ]

Action went correct thru MD-SAL as in log below [_setNwTosAction=SetNwTosAction [_tos=1, augmentation=[]]

2014-01-21 11:36:29.053 CET [md-sal-binding-commit-2] INFO o.o.c.m.s.c.i.service.TwoPhaseCommit - Transaction: BA-3 Started.
2014-01-21 11:36:29.053 CET [md-sal-binding-commit-2] INFO o.o.o.t.OpenflowpluginTestServiceProvider - addFlow - AddFlowInput [_flowRef=FlowRef [_value=InstanceIdentifier [path=[org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node[key=NodeKey [_id=Uri [_value=foo:node:1]]], org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table[key=TableKey [_id=0]], org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow[key=FlowKey [_id=Uri [_value=139]]]]]], _flowTable=FlowTableRef [_value=InstanceIdentifier [path=[org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node[key=NodeKey [_id=Uri [_value=foo:node:1]]], org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table[key=TableKey [_id=0]]]]], _barrier=false, _bufferId=null, _containerName=null, _cookieMask=10, _flags=FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false], _flowName=FooXf14, _installHw=false, _instructions=Instructions [_instruction=[Instruction [_order=0, _key=InstructionKey [_order=0], _instruction=ApplyActionsCase [_applyActions=ApplyActions [_action=[Action [_order=0, _key=ActionKey [_order=0], _action=SetNwTosActionCase [_setNwTosAction=SetNwTosAction [_tos=1, augmentation=[]], augmentation=[]], augmentation=[]]], augmentation=[]], augmentation=[]], augmentation=[]]], augmentation=[]], _match=Match [_ethernetMatch=EthernetMatch [_ethernetDestination=null, _ethernetSource=null, _ethernetType=EthernetType [_mask=null, _type=EtherType [_value=2048], augmentation=[]], augmentation=[]], _icmpv4Match=null, _icmpv6Match=null, _inPhyPort=null, _inPort=null, _ipMatch=null, _layer3Match=Ipv4Match [_ipv4Destination=Ipv4Prefix [_value=10.0.0.1/24], _ipv4Source=null, augmentation=[]], _layer4Match=null, _metadata=null, _protocolMatchFields=null, _tunnel=null, _vlanMatch=null, augmentation=[]], _outGroup=null, _outPort=null, _strict=false, _cookie=10, _hardTimeout=12, _idleTimeout=34, _priority=2, _tableId=0, _node=NodeRef [_value=InstanceIdentifier [path=[org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node[key=NodeKey [_id=Uri [_value=foo:node:1]]]]]], _transactionUri=Uri [_value=BA-3], augmentation=[]]

Moving to Openflow Plugin

Comment by Gaurav Bhagwani [ 22/Jan/14 ]

Can it be confirmed please that are we testing this particular action on 1.0 switch or 1.3 switch since SetNwTosAction is 1.0 specific

Comment by Michal Polkorab [ 22/Jan/14 ]

Same issue as OPNFLWPLUG-11 (and probably the same will occur for any OF 1.0 action with OF 1.3 vswitch)

I have debugged the serialization and found out that the problem is in the OF Plugin.

Logs when debugging openflowjava:
2014-01-22 14:45:48.787 CET [nioEventLoopGroup-8-2] WARN o.o.o.p.i.u.InstructionsSerializer - ACTIONS IN APPLY INSTRUCTIONS NOT NULL
2014-01-22 14:45:48.787 CET [nioEventLoopGroup-8-2] WARN o.o.o.p.impl.util.ActionsSerializer - COMPUTE LENGTH IN ACTIONS
2014-01-22 14:45:48.787 CET [nioEventLoopGroup-8-2] WARN o.o.o.p.impl.util.ActionsSerializer - ACTIONSLIST NOT NULL
2014-01-22 14:45:48.787 CET [nioEventLoopGroup-8-2] WARN o.o.o.p.impl.util.ActionsSerializer - ACTIONSLIST IS EMPTY
2014-01-22 14:45:48.787 CET [nioEventLoopGroup-8-2] WARN o.o.o.p.i.u.InstructionsSerializer - ACTIONS IN APPLY INSTRUCTIONS NOT NULL - LENGTH: 0

Problem is in the ActionConvertor, where the received action was SetNwTosActionCase

  • this action is used in the OF 1.0, and in the OF 1.3 causes following exception:

2014-01-22 14:45:48.779 CET [md-sal-binding-commit-16] ERROR o.o.o.o.m.c.s.c.ActionConvertor - Unknown Action Type for the Version

I am not familiar with the md-sal's models, but it is probably needed to choose the correct action depending on the version first, and then finding the corresponding action. (In this case I believe it should have been SetField action with OXM_OF_IP_DSCP oxm-field)

NOTE:
Looking into FlowConvertor.java:

if (flow.getInstructions() != null)

{ flowMod.setInstructions(toInstructions(flow.getInstructions(), version,datapathid)); flowMod.setActionsList(getActionsList(flow.getInstructions(), version,datapathid)); }

actions should be filled only in case of OF 1.0, instructions in case of OF 1.3.

Comment by Ed Warnicke [ 24/Jan/14 ]

Should be fixed by https://git.opendaylight.org/gerrit/#/c/4697/ Please check for merge status.

Comment by Gaurav Bhagwani [ 24/Jan/14 ]

Hi Ed,

https://git.opendaylight.org/gerrit/#/c/4697/ does not maps set-nwtos to OF1.3 action, so guess shouldnt be fixed by this review

Comment by Vaclav Demcak [ 24/Jan/14 ]

REST - put / get is corrected but

sudo ovs-ofctl -O OpenFlow13 dump-flows s1
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x24, duration=12.735s, table=2, n_packets=0, n_bytes=0, idle_timeout=34, hard_timeout=12, priority=2,ip,nw_dst=10.0.0.0/24 actions=drop

Comment by Gaurav Bhagwani [ 24/Jan/14 ]

this should work : http://git.opendaylight.org/gerrit/4736

Comment by Deepankar Gupta [ 25/Jan/14 ]

Verified patch http://git.opendaylight.org/gerrit/4736 and it is found to be working correctly.

Following is the test procedure that I followed:

Step 1:
In RestClient, PUT: http://192.168.56.1:8080/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/2/flow/159

The following xml was used:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
<strict>false</strict>
<instructions>
<instruction>
<order>0</order>
<apply-actions>
<action>
<order>0</order>
<set-nw-tos-action>
<tos>1</tos>
</set-nw-tos-action>
</action>
</apply-actions>
</instruction>
</instructions>
<table_id>2</table_id>
<id>159</id>
<cookie_mask>255</cookie_mask>
<installHw>true</installHw>
<match>
<ethernet-match>
<ethernet-type>
<type>2048</type>
</ethernet-type>
</ethernet-match>
<ipv4-destination>10.0.0.1/24</ipv4-destination>
</match>
<hard-timeout>12</hard-timeout>
<flags>FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false]</flags>
<cookie>36</cookie>
<idle-timeout>34</idle-timeout>
<flow-name>FooXf36</flow-name>
<priority>2</priority>
<barrier>false</barrier>
</flow>

Step 2:

Restclient GET using the same URL mentioned above: Successfull.

Step 3:
Checked whether the flow is installed on the switch.

mininet> dpctl dump-flows

      • s1 ------------------------------------------------------------------------
        NXST_FLOW reply (xid=0x4):
        cookie=0x24, duration=10.439s, table=0, n_packets=0, n_bytes=0, idle_timeout=34,hard_timeout=12,priority=2,ip,nw_dst=10.0.0.0/24 actions=mod_nw_tos:1
Comment by Vaclav Demcak [ 25/Jan/14 ]

Tested for every tests :

actions=set_field:1->nw_tos_shifted

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