[CONTROLLER-536] Wrong value in OFPXMT_OFB_VLAN_VID in FLOW_MOD using new OF plugin for OF 1.3 switches. Created: 05/Jun/14  Updated: 25/Jul/23  Resolved: 23/Jun/14

Status: Resolved
Project: controller
Component/s: mdsal
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: 1138

 Description   

Values in OFPXMT_OFB_VLAN_VID field of FLOW_MOD messages were wrong, when VTN Manager run on MD-SAL and the new OF plugin, connected to OF 1.3 switches, and tried to install flow entries which match packets with VLAN tag for VLAN 100.
In this situation, the controller must set 100 into the OFPXMT_OFB_VLAN_VID field.
However, it set 0, so packets with VLAN tag for VLAN 100 didn't match the flow entries.

[What I used]
The latest version of the Virtualization Edition on 5th June.

/work/integration/distributions
odc180 $ git log -3 --oneline
90e2f0c INTEGRAT-4: Remove toaster from virt edition
64e608a Adding extra TCs for RESTCONF
3516960 Uploaded working AD-SAL cluster testcases

[How to produce]

1. Start up the Virtualization edition with of13 and vtn option.

$ ./run.sh -of13 -virt vtn

2. Create a virtual brige using REST API exposed by VTN Manager.

curl --user "admin":"admin" -H "Accept: application/json" -H \
"Content-type: application/json" -X POST \
http://192.168.60.180:8080/controller/nb/v2/vtn/default/vtns/vtn1 \
-d '

{"description": "Virtual Tenat 1 for Hackfest network"}

'

curl --user "admin":"admin" -H "Accept: application/json" -H \
"Content-type: application/json" -X POST \
http://192.168.60.180:8080/controller/nb/v2/vtn/default/vtns/vtn1/vbridges/vbr1 \
-d '{}'

curl --user "admin":"admin" -H "Accept: application/json" -H \
"Content-type: application/json" -X POST \
http://192.168.60.180:8080/controller/nb/v2/vtn/default/vtns/vtn1/vbridges/vbr1/interfaces/if1 \
-d '{}'

curl --user "admin":"admin" -H "Accept: application/json" -H \
"Content-type: application/json" -X POST \
http://192.168.60.180:8080/controller/nb/v2/vtn/default/vtns/vtn1/vbridges/vbr1/interfaces/if2 \
-d '{}'

curl --user "admin":"admin" -H "Accept: application/json" -H \
"Content-type: application/json" -X PUT \
http://192.168.60.180:8080/controller/nb/v2/vtn/default/vtns/vtn1/vbridges/vbr1/interfaces/if1/portmap \
-d '{"node":

{"type":"MD_SAL","id":"openflow:3"}

, "port":

{"name": "s3-eth1"}

, "vlan": "100"}'

curl --user "admin":"admin" -H "Accept: application/json" -H \
"Content-type: application/json" -X PUT \
http://192.168.60.180:8080/controller/nb/v2/vtn/default/vtns/vtn1/vbridges/vbr1/interfaces/if2/portmap \
-d '{"node":

{"type":"MD_SAL","id":"openflow:7"}

, "port":

{"name": "s7-eth2"}

, "vlan": "100"}'

3. Run Mininet and run OF1.3 switches.

$ sudo mn --controller=remote,192.168.60.180 --topo tree,3 --switch=ovsk,protocols=of13

4. Configure hosts for sending packets with VLAN tag.

h1 ifconfig h1-eth0 inet 0.0.0.0
h1 vconfig add h1-eth0 100
h1 ifconfig h1-eth0.100
h1 ifconfig h1-eth0.100 inet 10.0.0.1/8

h8 ifconfig h8-eth0 inet 0.0.0.0
h8 vconfig add h8-eth0 100
h8 ifconfig h8-eth0.100
h8 ifconfig h8-eth0.100 inet 10.0.0.8/8

5. Send ping packets from h1 to h8 (10.0.0.8).

mininet> h1 ping 10.0.0.8

At this time, VTN Manager tries to install flow entries to forward packets between h1 and h8 based on the vtn configuration (See step 2).



 Comments   
Comment by Prasanna Huddar [ 11/Jun/14 ]

Hello Hideyuki,

I tried f49 test case from test provider to verify VLAN match setting looks like it is working

addMDFlow openflow:1 f49

And CPQD output shows the correct vlan-ID

prasanna@ubuntu:~/mininet/ofsoftswitch13$ ./utilities/dpctl tcp:127.0.0.1:6634 stats-flow

SENDING:
stat_req{type="flow", flags="0x0", table="all", oport="any", ogrp="any", cookie=0x0", mask=0x0", match=oxm{all match}}

RECEIVED:
stat_repl{type="flow", flags="0x0", stats=[{table="2", match="oxm

{vlan_vid="10", vlan_pcp="3"}

", dur_s="48", dur_ns="802000", prio="2", idle_to="0", hard_to="0", cookie="0xa", pkt_cnt="0", byte_cnt="0", insts=[meter

{meter="1"}

]}]}

Rgds,
Prasanna

Comment by Ed Warnicke [ 12/Jun/14 ]

Prasanna, please check the adaptors as the issue may be there.

Comment by Michal Rehak [ 20/Jun/14 ]

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

set vlanIdPresent to true if assigning vlanId

Comment by Michal Rehak [ 20/Jun/14 ]

Hideyuki, could you please retest?

OVS reports this flows:
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x0, duration=5.114s, table=0, n_packets=3, n_bytes=246, send_flow_rem priority=10,in_port=2,dl_vlan=100,dl_src=00:00:00:00:00:08,dl_dst=00:00:00:00:00:01 actions=output:1
cookie=0x0, duration=5.068s, table=0, n_packets=3, n_bytes=246, send_flow_rem priority=10,in_port=1,dl_vlan=100,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:08 actions=output:2

Comment by Hideyuki Tai [ 23/Jun/14 ]

(In reply to michal rehak from comment #4)
> Hideyuki, could you please retest?
>
> OVS reports this flows:
> OFPST_FLOW reply (OF1.3) (xid=0x2):
> cookie=0x0, duration=5.114s, table=0, n_packets=3, n_bytes=246,
> send_flow_rem
> priority=10,in_port=2,dl_vlan=100,dl_src=00:00:00:00:00:08,dl_dst=00:00:00:
> 00:00:01 actions=output:1
> cookie=0x0, duration=5.068s, table=0, n_packets=3, n_bytes=246,
> send_flow_rem
> priority=10,in_port=1,dl_vlan=100,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:
> 00:00:08 actions=output:2

Thank you!
I'll test it today.

Comment by Hideyuki Tai [ 23/Jun/14 ]

(In reply to michal rehak from comment #3)
> https://git.opendaylight.org/gerrit/#/c/8172/
>
> set vlanIdPresent to true if assigning vlanId

Hi Michal,

Thank you for creating the patch.
I've confirmed that your patch fixes the problem.

I pulled the latest code of Integration Git repository, and built the Virtualization Edition on 23rd June.
And I applied the change of your patch to the Virtualization edition. (I replaced org.opendaylight.controller.sal-compatibility-1.1-SNAPSHOT.jar.)

After that, I retested the same scenario I written in comment #1.
On the test, I captured all packets on OpenFlow channels, and I confirmed that the controller correctly set 100 to OFPXMT_OFB_VLAN_VID field in FLOW_MOD messages.

After the patch will be merged to the master branch of controller Git repository, I'm going to change the status of the bug report to "RESOLVED".

Comment by Ed Warnicke [ 23/Jun/14 ]

Merged: https://git.opendaylight.org/gerrit/#/c/8172/

Hideyuki,

Would you mark this as resolved?

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