I don't see any reason why we need to handle those two OFP messages as
differently as the rest.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
We don't send OFPC_DELETE OFPFlowMod or OFPBarrier during
CONFIG_DISPATCHER so we don't need OFPFlowRemoved and OFPBarrierReply.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
We don't send OFPEchoRequest so there is no point to have OFPEchoReply
handler.
I think that sending OFPEchoRequest is useful for some cases
(e.g. finding problems on the switch quickly). But that should be
another helper dispatcher since not all applications need such.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
All protocols need to check if the data length is long enough so let's
set the minimum length in the same way.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
- we need to serialize in reverse order since some need to know
payload.
- TCP and UDP need the previous protocol info (IP) to calculate the
checksum.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fix the following:
ryu/ofproto/ofproto_v1_2_parser.py", line 1701, in parser
type_, length = struct.unpack_from('!HH', buf, offset)
TypeError: unpack_from() argument 1 must be string or read-only buffer, not bytearray
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
As discussed on the mailing list, there is no good packet library
(parses and builds various protocol packets). dpkt isn't flexible
enough (can't nicely handle stacked protocols such as vlan, mpls,
gre). NOX's one is nice but released under GPL3.
So we need our own packet library.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This is useful when debugging. it's difficult to debug without
backtrace.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Run this in the following way:
$ ryu-manager ryu/ryu/tests/integrated/test_request_reply_v12.py
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Ryu crashes when it finds an unknown match field in OFPMatch. Instead,
Ryu should just ignore it and continue to parse.
With this patch, Ryu uses OFPmatchField class for an unknown match
field and continue to parse.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Tested-by: Simon Horman <horms@verge.net.au>
This patch simplifies integrated OVS test suite. Currently, we wait
for a barrier response before moving to the next test. However, we
don't need. The logic works like the following:
sending a flow mod (deleting all the flows)
sending a barrier
sending a flow mod (set up a flow to test)
sending a barrier
sending a flow stats
Then the reply handler for flow stats verifies the result and move to
the next.
You can run a test suite like:
$ ryu-manager ~/git/ryu/ryu/tests/integrated/test_add_flow_v12_actions.py
We can try two more suites:
ryu/tests/integrated/test_add_flow_v10.py
ryu/tests/integrated/test_add_flow_v12_matches.py
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fix the folloing problem in MTIPv6Src, MTIPv6Src, MTIPv6Dst, and
MTIPv6NdTarget's parsers:
File "/home/openflow/ryu/ryu/ofproto/ofproto_v1_2_parser.py", line 1705, in parser
field = OFPMatchField.parser(buf, offset)
File "/home/openflow/ryu/ryu/ofproto/ofproto_v1_2_parser.py", line 1934, in parser
field = cls_.field_parser(header, buf, offset)
File "/home/openflow/ryu/ryu/ofproto/ofproto_v1_2_parser.py", line 1949, in field_parser
(value,) = struct.unpack_from(cls.pack_str, buf, offset + 4)
ValueError: too many values to unpack
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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>