[CONTROLLER-563] Values of match fields for VLAN tag were wrong when using AD-SAL OF plugin. Created: 20/Jun/14  Updated: 25/Jul/23  Resolved: 05/May/15

Status: Resolved
Project: controller
Component/s: adsal
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Hideyuki Tai Assignee: Hideyuki Tai
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: 1212

 Description   

Values of match fields for VLAN tag was wrong when I used AD-SAL OF plugin and tried to create a flow entry whose matched packets without VLAN tags.

I ran a controller with AD-SAL OF plugin, and used REST API of Flow Programmer service to install a flow entry which matched packets without VALN tag.
And I got the flow entry from a switch by using REST API of Statistics service.
However I saw the flow entry didn't have a match field for VLAN ID, but had a match field for VLAN PCP.

What I used
-----------
The latest code of controller project on 19th June, 2014.

$ git log -3 --oneline
6c5efc6 Merge "Prepare for security-related catalina/tomcat version updates"
1e672ce Prepare for security-related catalina/tomcat version updates
0d34210 Merge "CONTROLLER-436 CONTROLLER-432 - Enhance Restconf Swagger Documentation"

How to produce
--------------

1. Build a controller.
$ git clone https://git.opendaylight.org/gerrit/p/controller.git
$ cd controller
$ mvn clean install -DskipTests

2. Run the controller.
$ cd opendaylight/distribution/opendaylight/target/distribution.opendaylight-osgipackage/opendaylight/
$ ./run.sh

3. Run a Mininet.
$ sudo mn --controller=remote,192.168.60.180 --topo tree,1

4. Install a flow entry.
Use REST API of Flow Programmer service to install a flow entry which has DL_VLAN match field set to 0 which means that the flow entry matches packets without VLAN tag.

$ curl --user "admin":"admin" -H "Accept: application/json" -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"}

, "priority":"0", "vlanId":"0","actions":["DROP"]}'

5. Check the flow entry in Mininet console.
mininet> dpctl dump-flows

      • s1 ------------------------------------------------------------------------
        NXST_FLOW reply (xid=0x4):
        cookie=0x0, duration=8.121s, table=0, n_packets=0, n_bytes=0, idle_age=8, priority=0,vlan_tci=0x0000 actions=drop

6. Get the flow entry from the Mininet.

$ curl --user "admin":"admin" -H "Accept: application/json" -H \
"Content-type: application/json" -X GET \
http://localhost:8080/controller/nb/v2/statistics/default/flow

This GET request must return the flow entry which has DL_VLAN match field set to 0.
However, the flow entry I saw didn't have DL_VLAN field, but had DL_VLAN_PR field set to 0.

{
"flowStatistics": [
{
"flowStatistic": [
{
"byteCount": 0,
"durationNanoseconds": 472000000,
"durationSeconds": 29,
"flow": {
"actions": [

{ "type": "DROP" }

],
"hardTimeout": 0,
"id": 0,
"idleTimeout": 0,
"match": {
"matchField": [

{ "type": "DL_VLAN_PR", <=== VLAN PCP incorrectly set. "value": "0" }

]
},
"priority": 0
},
"packetCount": 0,
"tableId": 0
}
],
"node":

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

}
]
}



 Comments   
Comment by Hideyuki Tai [ 20/Jun/14 ]

I've already found out that V6Match class causes this problem.

I'm writing the patch to V6Match class and unit tests on it.

Comment by Hideyuki Tai [ 27/Jun/14 ]

Fixed.

https://git.opendaylight.org/gerrit/8166 (master)
https://git.opendaylight.org/gerrit/8339 (stable/hydrogen)

Comment by Carol Sanders [ 05/May/15 ]

This bug is part of the project to Move all ADSAL associated component bugs to ADSAL.

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