[OPNFLWPLUG-245] Set VLAN PCP does not work Created: 18/Aug/14  Updated: 27/Sep/21  Resolved: 17/Sep/14

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

Type: Bug
Reporter: Luis Gomez Assignee: James Gregory Hall
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: PC


External issue ID: 1566

 Description   

After pushing following flow to set VLAN-id + VLAN-PCP:

{
"flow-node-inventory:table": [
{
"flow-node-inventory:flow": [
{
"flow-node-inventory:flow-name": "foo",
"flow-node-inventory:match": {
"flow-node-inventory:vlan-match": {
"flow-node-inventory:vlan-id":

{ "flow-node-inventory:vlan-id": 78, "flow-node-inventory:vlan-id-present": true }

,
"flow-node-inventory:vlan-pcp": 3
},
"flow-node-inventory:ethernet-match": {
"flow-node-inventory:ethernet-destination":

{ "flow-node-inventory:address": "ff:ff:29:01:19:61" }

,
"flow-node-inventory:ethernet-source":

{ "flow-node-inventory:address": "00:00:00:11:23:ae" }

,
"flow-node-inventory:ethernet-type":

{ "flow-node-inventory:type": 2048 }

}
},
"flow-node-inventory:priority": 2,
"flow-node-inventory:instructions": {
"flow-node-inventory:instruction": [
{
"flow-node-inventory:apply-actions": {
"flow-node-inventory:action": [
{
"flow-node-inventory:order": 2,
"flow-node-inventory:output-action":

{ "flow-node-inventory:output-node-connector": "openflow:1:1" }

},
{
"flow-node-inventory:order": 1,
"flow-node-inventory:set-field": {
"flow-node-inventory:vlan-match": {
"flow-node-inventory:vlan-id":

{ "flow-node-inventory:vlan-id": 79, "flow-node-inventory:vlan-id-present": true }

,
"flow-node-inventory:vlan-pcp": 4
}
}
}
]
},
"flow-node-inventory:order": 0
}
]
},
"flow-node-inventory:strict": false,
"flow-node-inventory:table_id": 0,
"flow-node-inventory:id": "138"
}
],
"flow-node-inventory:id": 0
}
]
}

I check Operational data for it:

{
"flow-node-inventory:table": [
{
"opendaylight-flow-table-statistics:flow-table-statistics":

{ "opendaylight-flow-table-statistics:packets-looked-up": 404, "opendaylight-flow-table-statistics:active-flows": 10, "opendaylight-flow-table-statistics:packets-matched": 212 }

,
"flow-node-inventory:flow-cookie-map": [

{ "flow-node-inventory:flow-ids": [ "#UF$TABLE*0-1" ], "flow-node-inventory:cookie": 1 }

],
"flow-node-inventory:flow": [
{
"flow-node-inventory:match": {
"flow-node-inventory:vlan-match": {
"flow-node-inventory:vlan-id":

{ "flow-node-inventory:vlan-id": 78 }

,
"flow-node-inventory:vlan-pcp": 3
},
"flow-node-inventory:ethernet-match": {
"flow-node-inventory:ethernet-destination":

{ "flow-node-inventory:address": "FF:FF:29:01:19:61" }

,
"flow-node-inventory:ethernet-source":

{ "flow-node-inventory:address": "00:00:00:11:23:AE" }

,
"flow-node-inventory:ethernet-type":

{ "flow-node-inventory:type": 2048 }

}
},
"flow-node-inventory:flags": "SEND_FLOW_REM",
"flow-node-inventory:priority": 2,
"flow-node-inventory:instructions": {
"flow-node-inventory:instruction": [
{
"flow-node-inventory:apply-actions": {
"flow-node-inventory:action": [
{
"flow-node-inventory:order": 0,
"flow-node-inventory:set-field": {
"flow-node-inventory:vlan-match": {
"flow-node-inventory:vlan-id":

{ "flow-node-inventory:vlan-id": 79 }

}
}
},
{
"flow-node-inventory:order": 1,
"flow-node-inventory:output-action":

{ "flow-node-inventory:output-node-connector": "1", "flow-node-inventory:max-length": 0 }

}
]
},
"flow-node-inventory:order": 0
}
]
},
"flow-node-inventory:idle-timeout": 300,
"opendaylight-flow-statistics:flow-statistics": {
"opendaylight-flow-statistics:duration":

{ "opendaylight-flow-statistics:second": 11, "opendaylight-flow-statistics:nanosecond": 725000000 }

,
"opendaylight-flow-statistics:byte-count": 0,
"opendaylight-flow-statistics:packet-count": 0
},
"flow-node-inventory:hard-timeout": 600,
"flow-node-inventory:table_id": 0,
"flow-node-inventory:id": "#UF$TABLE*0-1",
"flow-node-inventory:cookie": 1
}
],
"flow-node-inventory:id": 0
}
]
}

I can see VLAN PCP is not being pushed to switch. I have also a wireshark capture that proves controller does not push PCP value.

BR/Luis



 Comments   
Comment by Luis Gomez [ 18/Aug/14 ]

Please use this URL to configure the flow:

PUT http://<controller IP>:8080/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0

BR/Luis

Comment by James Gregory Hall [ 19/Aug/14 ]

So now do I suspect openflowjava code ... yes OF13SetFieldActionSerializer.serialize() is getting the full set actions ...
MatchEntries entry = oxmField.getMatchEntries().get(0);

But it ignores the second set field entry ...

Comment by James Gregory Hall [ 19/Aug/14 ]

https://git.opendaylight.org/gerrit/#/c/10077/

Comment by Michal Polkorab [ 20/Aug/14 ]

Please see next definition from Openflow 1.3.2 specification:

Set Field actions uses the following structure and fi elds:
/* Action structure for OFPAT_SET_FIELD. */
struct ofp_action_set_field {
uint16_t type; /* OFPAT_SET_FIELD. */
uint16_t len; /* Length is padded to 64 bits. */
/* Followed by:

  • - Exactly (4 + oxm_length) bytes containing a single OXM TLV, then
  • - Exactly ((8 + oxm_length) + 7)/8*8 - (8 + oxm_length)
  • (between 0 and 7) bytes of all-zero bytes
    */
    uint8_t field[4]; /* OXM TLV - Make compiler happy */
    };
    OFP_ASSERT(sizeof(struct ofp_action_set_field) == 8);

Set Field action contains only single OXM TLV, that's why openflowjava checks only the first element in the list. (List is used because of existing model)

As per Greg's comment:
"OF13SetFieldActionSerializer.serialize() is getting the full set actions ... "
This means that REST (SAL) model is incorrectly translated into openflowjava model. Some of the components above openflowjava should fix the translation process.

Comment by James Gregory Hall [ 20/Aug/14 ]

Ok, since the ofj interface doesn't support a list of augmentations in a setField Action which is a list ... then we should modify the code to throw and exception as such.

There is a lack of testing to trap this error in ofp ... the unit test runs the code but doesn't do any validation beyond catching exceptions.

I'll push new changes accordingly.

Comment by Luis Gomez [ 20/Aug/14 ]

I am not sure what is the problem you are describing here but I just followed RESTCONF API doc for set-field:

case: set-field-case
container: set-field
uses: match
refines:
leaf: in-port
type: node-connector-id
leaf: in-phy-port
type: node-connector-id
container: vlan-match
uses: vlan-match-fields
refines:
container: vlan-id
description: VLAN id.
leaf: vlan-id-present
type: boolean
leaf: vlan-id
type: vlan-id
leaf: vlan-pcp
description: VLAN priority.
type: vlan-pcp

BR/Luis

Comment by Michal Rehak [ 11/Sep/14 ]

Could you retest? Bug1421 contained some vlan-id and vlan-pcp fixes.

Thank you.

Comment by Abhijit Kumbhare [ 16/Sep/14 ]

Any update on this?

Comment by Luis Gomez [ 17/Sep/14 ]

Yes, this works for me with the format suggested by Greg

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