[OPNFLWPLUG-262] OF plugin incorrectly converted a MD-SAL flow which contained SET_VLAN_ID action. Created: 05/Sep/14  Updated: 27/Sep/21  Resolved: 11/Sep/14

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

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

Operating System: All
Platform: All


Issue Links:
Blocks
is blocked by OPNFLWPLUG-222 MD-SAL app cannot create a flow entry... Resolved
External issue ID: 1720

 Description   

This issue was originally reported in OPNFLWPLUG-222.

It seems that the patch has a problem.
https://git.opendaylight.org/gerrit/10280

At FlowConvertor.java, you can see how the OpenFlow plugin handles SET_VLAN_ID action.

public static List<FlowModInputBuilder> toFlowModInputs(Flow srcFlow, short version, BigInteger datapathId) {
List<FlowModInputBuilder> list = new ArrayList<>();

if (version >= OFConstants.OFP_VERSION_1_3 && isSetVlanIdActionCasePresent(srcFlow))

{ list.addAll(handleSetVlanIdForOF13(srcFlow, version, datapathId)); }

else

{ list.add(toFlowModInput(srcFlow, version, datapathId)); }

return list;
}

However, handleSetVlanIdForOF13() method ignores original match condition and changes the match condition incorrectly.

For example, when VTN Manager tries to install a flow entry which matches untagged frame, the OF plugin incorrectly deletes in_port match field, source/destination MAC Address match field, and change VLAN match field.

[Flow entry which VTN Mamanager tries to install]

  • Match
    + source MAC address
    + destination MAC address
    + in_port
    + untagged
  • Action
    + SET_VLAN_ID(100)
    + OUTPUT:2

[Flow entry which the OF Plugin sets to a switch]

  • Match
    + vlan_tci=0x1000/0x1000
  • Action
    + SET_FIELD(4196->vlan_vid)
    + OUTPUT:2


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

I can reproduce this issue as follows.

1. Run a controller with the OF plugin.
I'm using the latest code in Integration Group to build and run the Base Edition.

2. Run an OpenFlow 1.3 switch.
I'm using Mininet to run the OF 1.3 switch.
$ sudo mn --controller remote,192.168.2.56 --switch ovsk,protocols=OpenFlow13

3. Install a flow entry using RESTCONF.

Method: PUT

URI: http://<CONTROLLER IP ADDRESS>:8080/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/2
Body:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
<priority>2</priority>
<flow-name>Foo</flow-name>
<match>
<in-port>10</in-port>
<ethernet-match>
<ethernet-source>
<address>3a:72:f1:02:1a:d0</address>
</ethernet-source>
<ethernet-destination>
<address>16:58:21:81:bc:43</address>
</ethernet-destination>
</ethernet-match>
<vlan-match>
<vlan-id>
<vlan-id-present>false</vlan-id-present>
</vlan-id>
</vlan-match>
</match>
<id>2</id>
<table_id>0</table_id>
<instructions>
<instruction>
<order>0</order>
<apply-actions>
<action>
<order>0</order>
<set-vlan-id-action>
<vlan-id>55</vlan-id>
</set-vlan-id-action>
</action>
</apply-actions>
</instruction>
</instructions>
</flow>

4. Check a flow table of the switch.

mininet> dpctl dump-flows -O OpenFlow13

      • s1 ------------------------------------------------------------------------
        OFPST_FLOW reply (OF1.3) (xid=0x2):
        cookie=0xa, duration=303.904s, table=0, n_packets=21, n_bytes=1674, send_flow_rem priority=0 actions=CONTROLLER:65535
        cookie=0x0, duration=2.704s, table=0, n_packets=0, n_bytes=0, idle_timeout=300, hard_timeout=600, send_flow_rem priority=2,vlan_tci=0x1000/0x1000 actions=set_field:4151->vlan_vid

<======== The 2nd flow entry was the flow entry which the controller installed by the above PUT request.
However, the match condition and action were totally different from the body message of the PUT request.

Comment by Michal Rehak [ 11/Sep/14 ]

fixed within bug1421

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