This patch adds a test framework with OVS to test various matches and
actions; adding various matches and actions and check `ovs-ofctl
dump-flows' output.
First, create 'br-tester' bridge:
fujita@rose:~$ sudo ovs-vsctl add-br br-tester
Secondly, configure the bridge to use the local controller:
fujita@rose:~$ sudo ovs-vsctl set-controller br-tester tcp:127.0.0.1
Thirdly, run what you want to test. If you want to try adding flows on
OF1.0:
fujita@rose:~$ ryu-manager --verbose --run_test_mod ryu.tests.integrated.test_add_flow_v10 ryu.tests.integrated.tester
This patch adds three test sets:
ryu.tests.integrated.test_add_flow_v10
ryu.tests.integrated.test_add_flow_v12_actions
ryu.tests.integrated.test_add_flow_v12_matches
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
simple_switch is a a learing material (who uses this in
production?). It should be the simple learning switch code like one in
OpenFlow tutorial. It's easier for learniners if simple_switch doesn't
use the outside modules.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
cbench works with only OF1.0 and OF1.0 provides all cbench needs. So
specify OF1.0.
Also it doesn't need nxm so use OFPMatch and OFPFlowMod.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
simple_switch works with only OF1.0 and OF1.0 provides all
simple_switch needs. So specify OF1.0.
simple_switch doesn't need nxm so use OFPMatch and OFPFlowMod (and
avoid the helper functions).
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
'from . import ofproto_v1_0 as ofproto' in ryu/ofproto/__init__.py is
a wrong assumption. We need to remove it.
This introduces ryu/ofproto/ofproto_common.py including only constatns
that OF version independent code must use. Note that I don't move data
structures there that multiple OF versions can share (like OVS does).
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
* In the case of ARP_SPA, ARP_TPA and IPV6_FLABEL a masked match should be
used unless the mask is all ones.
Previously a non-masked matched was used in the case were the mask was
zero, leading to the value being unmasked, whereas in should be completely
masked out.
* An un-masked IPV6_FLABEL should internally use a mask of UINT32_MAX
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
port_no is not a member of msg, but a member of msg.desc.
Signed-off-by: Hiroaki KAWAI <kawai@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Some applications need to use particular OF versions.
With this patch, applications can specify OF versions in the following
way:
class YourApplication(app_manager.RyuApp):
OFP_VERSIONS = [ofproto_v1_1.OFP_VERSION, ofproto_v1_2.OFP_VERSION]
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
This fixes a bug that the conversion ignores dl_dst.
Soheil Hassas Yeganeh reported a problem about simple_isolation:
The problem is that the isolation service tries to install
flow-entries for a specific src and dst (in
SimpleIsolation._modflow_and_send_packet), but instead the nx match
code installs flow-entries only with src addresses and ignores the
dst. So, when I boot multiple vms, only one of them is reachable.
For instance, assume that you have two VM's A and B. When a packet
comes from the gw to A, it installs "gw->A: A's port", but the acutal
installed rule is "gw: A's port". This works for A, but, when you boot
B, it tries to install "gw->B: B's port", but the acutal rule to be
installed is "gw: B's port". So, it always connect the gateway to
only one VM at a time.
Reported-by: Soheil Hassas Yeganeh <soheil@cs.toronto.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Soheil Hassas Yeganeh <soheil@cs.toronto.edu>
Fix the following error:
File "/Users/fujita/git/ryu/ryu/ofproto/ofproto_v1_2_parser.py",
line 1501, in serialize
self.append_field(header, self.flow.vlan_vid, self.vlan_vid_mask)
AttributeError: 'OFPMatch' object has no attribute 'vlan_vid_mask'
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In the case where the match length is a multiple of 8 the pad should be 0.
Previously a pad of 8 was used.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
- MT* class serialize method doesn't need match argument so we can use
MT* class for set_field action nicely.
- we can create the common serialize method for most of MT* classes
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Most of MT* classes can use this helper classmethod.
We get value and mask values but don't set them to an instance. It's
done later.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Bump the major version because:
- Ryu fully support OpenFlow 1.0, Nicira Extensions, and OpenFlow 1.2.
- Ryu was tested with various OpenFlow Hardware switches.
- There is lots of improvement since the last release.
Ryu is usable now so let's use the major version that implies so.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Add unittest workaround to OFPPortStatus parser. Another Option is
defining something like OFP_PORT_STATUS_PACK_STR0, 'B'. I don't care
much. Let's just do as we do with OF1.0.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This is used in a queue statistics request to request statistics
of all queues.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This is used in a queue statistics request to request statistics
of all queues.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
run_test.sh:
* run pylint on virtualenv to enforce version 0.25.0 for now.
(because pylint 0.25.1 doesn't work due to a bug)
* output pep8.log for Jenkins integration.
pylint:
* disable some noisy messages.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>