[ovs-discuss] OpenVSwitch - "OFPBRC_BAD_VERSION" error packet not received when there is version mismatch between stats request and stats reply
Varun Gupta
Varun.Gupta at nechclst.in
Mon May 21 03:50:19 PDT 2012
Hi,
We are evaluating OVS 1.2.2 and would like to report an unexpected behavior of OVS.
* Bug Description
Switch is not notifying the controller for OFPBRC_BAD_VERSION, /* ofp_header.version not supported. */ when there is version mismatch between stats request and stats reply. The switch was resetting the connection and only a warning message was generated on switch in log (/var/log/messages) before resetting connection.
* What you did that make the problem appear?
1. Made the following bridge:
ovs-vsctl show
e999897a-932f-4a57-81ce-252adc12cce9
Bridge "br0"
fail_mode: secure
Port "br0"
Interface "br0"
type: internal
Port "em1"
Interface "em1"
Port "vnet0"
Interface "vnet0"
Issue can be generated by ofctl or NOX as controller , steps for both mentioned below:-
With ofctl
a. cd openvswitch-1.2.2
b. Add following code in file lib/ofp-util.c in routine put_openflow_xid() after "Oh->type=type;" statement
if (type==OFPT_STATS_REQUEST) {
oh->version=2; }
c. make install
d. ovs-ofctl dump-flows tcp:<bridge ip>:<6633>
With Nox
a. Change macro OFP_VERSION to 2 in file - nox.src.include.openflow.h
b. Set all OFP_VERSION macro in nox.src.lib.openflow.c to 1, set OFP_VERSION macro in nox.src.builtin.nox.c in register_switch routine to 1.
c. Set command parameter in config.py to NULL list
d. Make connection between switch and NOX
* What you expected to happen?
Error packet with code " OFPBRC_BAD_VERSION " should generate by switch to controller.
* What actually happened.
No error packet is generating and connection resets by switch after stats request packet from controller.
* The Open vSwitch version number (as output by "ovs-vswitchd --version")
ovs-vswitchd (Open vSwitch) 1.2.2
Compiled May 21 2012 11:23:22
OpenFlow versions 0x1:0x1
* The Git commit number (as output by "git rev-parse HEAD"),
if you built from a Git snapshot.
Not from git.
* Any local patches or changes you have applied (if any).
No patches are applied.
* The kernel version on which Open vSwitch is running (from
/proc/version) and the distribution and version number of
your OS (e.g. "Centos 5.0").
Linux version 2.6.38.6-26.rc1.fc15.x86_64 (mockbuild at x86-04.phx2.fedoraproject.org<mailto:mockbuild at x86-04.phx2.fedoraproject.org>) (gcc version 4.6.0 20110428 (Red Hat 4.6.0-6) (GCC) ) #1 SMP Mon May 9 20:45:15 UTC 2011
OVS OS- Fedora 15
NOX OS - Ubuntu 10.0.4
* The output of "ovs-dpctl show".
system at br0:
lookups: frags:0, hit:30, missed:6, lost:0
port 0: br0 (internal)
port 1: em1
* A fix or workaround, if you have one.
When Incorrect version is set in ofp-header in a stat request packet from controller, the switch resets the connection and no error packet is sent to controller, only warning message is generated on switch.
If we add a condition in vconn.c file to prevent the reset of connection on receiving incorrect version in stat request packet and in ofproto.c file to first check whether version in stat request packet is same as that of version supported by switch ,if versions are different we return error packet to controller. This gives us the desired output.
* Any other information that you think might be relevant.
We have verified this on OVS-1.4.1, same is happening on this release also.
DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and
intended
for the named recipient(s) only.
It shall not attach any liability on the originator or NECHCL or its
affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the
opinions of NECHCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is
strictly prohibited. If you have
received this email in error please delete it and notify the sender
immediately. .
-----------------------------------------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/discuss/attachments/20120521/cbe2ae16/attachment-0001.htm>
More information about the discuss
mailing list