[OPNFLWPLUG-188] of-flow: instruction (push-vlan-action) different in config and operational db Created: 11/Jun/14  Updated: 27/Sep/21  Resolved: 13/Jun/14

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

Type: Bug
Reporter: Peter Gubka Assignee: Anil Vishnoi
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: PC


Attachments: File f110.xml     File f110odb.xml    
External issue ID: 1183

 Description   

odl:
version.properties
org.opendaylight.controller.version = 0.1
org.opendaylight.controller.build.scm.version = 2fffd8cdb3ed75f478b900c677bb4d97e5e91c9c
org.opendaylight.controller.build.user = jenkins-controller
org.opendaylight.controller.build.workspace = **********
org.opendaylight.controller.build.timestamp = 1402444582255
org.opendaylight.controller.build.machine = **********

test: mininet 2.1.0 + ovs 2.0.0

steps:
1) PUT xml /restconf/config/opendaylight-inventory:nodes/node/openflow:${switch_idx}/table/${table_id}/flow/${flow_id}
(xml file f110.xml in attachment)

2) GET its operational state (for full details see f110odb.xml in attachment)
3) GET its config

4) seen difference
config:
<instruction>
<order>0</order>
<apply-actions>
<action>
<push-vlan-action>
<ethernet-type>33024</ethernet-type>
<vlan-id>1234</vlan-id>
</push-vlan-action>
<order>0</order>
</action>
</apply-actions>
</instruction>

operational:
<instruction>
<order>0</order>
<apply-actions>
<action>
<push-vlan-action>
<ethernet-type>33024</ethernet-type>
</push-vlan-action>
<order>0</order>
</action>
</apply-actions>
</instruction>

the tag <vlan-id>1234</vlan-id> is missing in operational data store



 Comments   
Comment by Peter Gubka [ 11/Jun/14 ]

Attachment f110.xml has been added with description: flow to be configured

Comment by Peter Gubka [ 11/Jun/14 ]

Attachment f110odb.xml has been added with description: operational details of the flow

Comment by Anil Vishnoi [ 13/Jun/14 ]

Hi Peter,

I am able to recreate this issue locally. After installing the flow through RESTCONF, when i dump the flow on switch i see following flow

mininet> sh ovs-ofctl dump-flows s1 --protocol=OpenFlow13
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0xc9, duration=158.164s, table=2, n_packets=0, n_bytes=0, idle_timeout=3400, hard_timeout=1200, send_flow_rem priority=110,tcp6,ipv6_src=1234:5678:9abc:def0:fdc0::/76,ipv6_dst=fe80:2acf:e9ff:fe21::/94,nw_ecn=3,tp_src=183,tp_dst=8080 actions=push_vlan:0x8100

So if you see [actions=push_vlan:0x8100] push_vlan only has ethertype [0x8100 = 33024], and that's the reason operational datastore shows only ethertype. This information is directly fetch from switch and hence reflect the final flow installed on the switch. I debug to figure out what controller is getting from switch and this is what it receives from switch

Action [_type=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.PushVlan, augmentation=[EthertypeAction [_ethertype=EtherType [_value=33024]]]]

and it doesn't have vlan-id value.

I believe this behavior is correct because if you refer openflow spec 1.3.2+ (section 7.2.4 & 5.12) following is the structure for the push vlan tag

/* Action structure for OFPAT_PUSH_VLAN/MPLS/PBB. */
struct ofp_action_push {
uint16_t type;
/* OFPAT_PUSH_VLAN/MPLS/PBB. */
uint16_t len;
/* Length is 8. */
uint16_t ethertype;
/* Ethertype */
uint8_t pad[2];
};
OFP_ASSERT(sizeof(struct ofp_action_push) == 8);

So push vlan action doesn't take vlan-id as a input, it just take ethertype. This action will add vlan header with given ethertype to the packet and rest all fields of the header will be unset. If you want to set vlan-id field of this header you will have to use Set-Field action after push-vlan action to do that.

Thanks
Anil

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