1763 Commits

Author SHA1 Message Date
Simon Horman
1d1c3b8751 tests/integrated: Do not verify buffer_id of packet_in resulting from packet_out
When a packet_in message results from a packet_out message
there is no particular relationship between the buffer_ids of
the two messages.

I noticed this when using Open vSwitch's "make ryu-check".

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-25 18:41:16 +09:00
Yuichi Ito
d1b9e371db sw test tool: Modify lengths of pad fields for ARP
Wireshark may misunderstand a MAC frame (including ARP) whose length is 64 bytes or more, as a frame with the FCS field.
This patch fixes the issue by modifying lengths of pad fields for ARP.

Reported-by: Arne Goetje <arne_goetje@accton.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-24 23:10:03 +09:00
takahashi.minoru
9c5e9288cc packet lib: ipv6: support Routing header (type3)
Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-24 23:09:41 +09:00
Yuichi Ito
0f8407a9ce sw test tool: Fix MAC addresses used in tests
IEEE 802.3-2012 (3.2.3 Address fields) says:

 b) The first bit (LSB) shall be used in the Destination Address field as an address type designation bit
    to identify the Destination Address either as an individual or as a group address. If this bit is 0, it
    shall indicate that the address field contains an individual address. If this bit is 1, it shall indicate that
    the address field contains a group address that identifies none, one or more, or all of the stations
    connected to the LAN. In the Source Address field, the first bit is reserved and set to 0.
 c) The second bit shall be used to distinguish between locally or globally administered addresses. For
    globally administered (or U, universal) addresses, the bit is set to 0. If an address is to be assigned
    locally, this bit shall be set to 1. Note that for the broadcast address, this bit is also a 1.

This patch fixes MAC addresses used in tests as follows:

 - set the first bit to 0
 - set the second bit to 1

Reported-by: Arne Goetje <arne_goetje@accton.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-24 23:09:34 +09:00
Simon Horman
4a38237357 tests/integrated: Use table_id greater than the current table for goto-table instruction
For a goto-table instruction use a table_id greater than the table in which
a flow will be inserted.  OpenFlow 1.2 section 5.6 stipulates that this is
required.

I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces the above stipulation.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-24 23:09:24 +09:00
Simon Horman
9664f3b9e3 tests/integrated: Specify table_id for flow_mod modify tests
Use actual table ids rather than OFPTT_ALL for
flow_mod modify tests as OpenFlow 1.2 section A3.4.1
stipulates that OFPTT_ALL is only valid for flow_mod delete requests.

I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces the above stipulation.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-24 23:09:17 +09:00
FUJITA Tomonori
66759d76dd bgp: fix connect timeout error
RROR 2014-04-23 11:54:59,239 hub 58 hub: uncaught exception: Traceback (most recent c\
all last):
  File "/Users/fujita/git/ryu/ryu/lib/hub.py", line 50, in _launch
    func(*args, **kwargs)
  File "/Users/fujita/git/ryu/ryu/services/protocols/bgp/base.py", line 239, in start
    self._run(*args, **kwargs)
  File "/Users/fujita/git/ryu/ryu/services/protocols/bgp/peer.py", line 448, in _run
    self._connect_loop(client_factory)
  File "/Users/fujita/git/ryu/ryu/services/protocols/bgp/peer.py", line 820, in _conne\
ct_loop
    bind_address=bind_addr)
  File "/Users/fujita/git/ryu/ryu/services/protocols/bgp/base.py", line 354, in _conne\
ct_tcp
    return sock
UnboundLocalError: local variable 'sock' referenced before assignment

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-24 07:32:06 +09:00
FUJITA Tomonori
ce1c6c0c1e bgp: add __init__.py files
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-24 07:32:04 +09:00
takahashi.minoru
b47fa61dd3 packet lib: ipv6: Fix to calculate AH length
RFC2402 says:

    All IPv6 extension headers, as per RFC 1883, encode the "Hdr Ext Len" field by first
    subtracting 1 (64-bit word) from the header length (measured in 64-bit words).
    AH is an IPv6 extension header.  However, since its length is measured in 32-bit words,
    the "Payload Length" is calculated by subtracting 2 (32 bit words).

This patch fixes as follows:

    return (int(size) - 1) * 8 ->
    return (int(size) + 2) * 4
                      ^ ^    ^
And, this patch also fixes a default argument of length.

Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 22:22:58 +09:00
ISHIDA Wataru
57166dc485 bgp: fix pep8
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
8bda92da85 bgp: add sample configuration file
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
4488761fb5 bgp: improve log visibility
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
d8407d445d bgp: avoid the trouble of having to explicitly specify IDs in configuration
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
8b07123c91 bgp: enable to use system IP addr implicitly for binding
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
ce33b61a1f bgp: enable default label range
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
d262c1bcb6 bgp: make bgpspeaker RyuApp
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
3a4f092de5 bgp: use ryu.lib.hub instead of the direct use of eventlet
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
68c13b7fa1 bgp: clean up codes which constructs an update message
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:35 +09:00
ISHIDA Wataru
2eccc5da41 bgp: fix typo
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 20:55:34 +09:00
FUJITA Tomonori
128fd85c13 remove obsolete man pages (rpc_cli and neutron_ofagent_agent)
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 19:07:22 +09:00
FUJITA Tomonori
28f6f6020a delete bin/neutron-ofagent-agent
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2014-04-21 19:06:25 +09:00
FUJITA Tomonori
78d0b08048 delete ryu/tests/bin/of-config-cli
This command is available via ryu command.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 19:05:47 +09:00
FUJITA Tomonori
95fa2d63d4 delete bin/rpc-cli
This command is available via ryu command.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-21 19:05:46 +09:00
YAMAMOTO Takashi
86da3d9939 document ryu command
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2014-04-20 21:00:57 +09:00
YAMAMOTO Takashi
769fb62ca9 add bin/ryu to PYLINT_INCLUDE
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2014-04-20 21:00:56 +09:00
YAMAMOTO Takashi
ce2f39a720 add bin/ryu
this new command takes a sub-command name as its first positional argument
and passes the rest of arguments to the corresponding sub-module.
for example, 'run' sub-command is an equivalent to bin/ryu-manager.

this commit does not replace the existing commands like ryu-manager.
this merely adds new ways to invoke the functionalities.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-20 21:00:51 +09:00
YAMAMOTO Takashi
7d1fcd7581 pip-requires: require oslo.config >= 1.2.0
specifically we want their commit de803cdf
(Change-Id: If712e1d51c1e1329093acb16ed6a84e9f0baf8c1)
for stable order of cli options.
the following sub-command commits rely on it.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-20 20:59:14 +09:00
YAMAMOTO Takashi
e88529f966 allow overriding argv and progname
this will be used by the comming 'ryu' command.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-20 20:59:14 +09:00
YAMAMOTO Takashi
186da7eb78 ryu.cfg: re-export some more stuff for convenience
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-20 20:59:14 +09:00
Yuichi Ito
51ec3d2d7b sw test tool: Fix to compare OFPMatch using masks without byte boundary
Mask lengths without byte boundary are fixed as follows:

 - VLAN_VID, from 16 bits (2 bytes) to 12 + 1 bits
 - IPV6_EXTHDR, from 16 bits (2 bytes) to 9 bits

Reported-by: Arne Goetje <arne_goetje@accton.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-18 18:42:49 +09:00
ISHIDA Wataru
660c8e68b4 bgp: remove original bgp packet library
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-17 08:38:43 +09:00
ISHIDA Wataru
9d5e66fa4e bgp: use ryu bgp packet library instead of original one
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-17 08:38:43 +09:00
ISHIDA Wataru
bdad6267de bgp: add stuff for integration with bgp speaker
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-17 08:38:43 +09:00
FUJITA Tomonori
a1fe3d92db Rename to CONTRIBUTING.rst
This makes the GitHub interface aware of the contribution guidelines,
so it will be displayed to contributors when they submit issues or
pull requests.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-16 15:56:59 +09:00
Yuichi Ito
f4d3c5616d of14: set default attributes for group-related classes
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-16 15:11:25 +09:00
Yuichi Ito
f516474c10 of13: set default attributes for group-related classes
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-16 15:11:23 +09:00
Yuichi Ito
97e8827681 of12: set default attributes for group-related classes
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-16 15:11:22 +09:00
Yuichi Ito
d083895961 sw test tool: Correct the comparison method to treat matches as the set
OF 1.3.3 spec (3 Glossary) says:

    Flow Entry: an element in a flow table used to match and process packets. It contains a set of
    match fields for matching packets, a priority for matching precedence, a set of counters to track
    packets, and a set of instructions to apply (see 5.2).

According to OF spec, the match fields are treated as the set.
This means that the order of matches which flow_stats message returns is inconsistant.
This patch corrects the comparison method of matches by sorting in a particular order before comparison.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-15 14:54:14 +09:00
Yuichi Ito
bff6008488 sw test tool: Fix to compare OFPMatch ignoring fields that masks are all zero bits
OF 1.3.3 spec (7.2.3.5 Flow Match Field Masking) says:

    An all-zero-bits oxm_mask is equivalent to omitting the OXM TLV entirely. An all-one-bits oxm_mask
    is equivalent to specifying 0 for oxm_hasmask and omitting oxm_mask.

This patch fixes to compare OFPMatch ignoring fields that masks are all zero bits.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-15 14:54:13 +09:00
Yuichi Ito
02cce18108 sw test tool: Fix to compare OFPMatch ignoring masks that are all one bits
OF 1.3.3 spec (7.2.3.5 Flow Match Field Masking) says:

    An all-zero-bits oxm_mask is equivalent to omitting the OXM TLV entirely. An all-one-bits oxm_mask
    is equivalent to specifying 0 for oxm_hasmask and omitting oxm_mask.

This patch fixes to compare OFPMatch ignoring masks that are all one bits.

Reported-by: Arne Goetje <arne_goetje@accton.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-15 14:54:12 +09:00
Hiroaki KAWAI
2d7053ac0b fix pbb itag related tests
i-tagged packets will have ETH_TYPE=0x88E7. The tests are
rewritten in the same way with MPLS.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 22:17:43 +09:00
FUJITA Tomonori
d3f8f4eb4c RyuApp: delete a key without handlers when unregistering a handler
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 09:51:26 +09:00
YAMAMOTO Takashi
92ef0bdbb5 ryu.app.ofctl: raise exceptions on openflow error messages
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
598c3c5e75 ryu.app.ofctl: implement multipart
an example:
    msg = parser.OFPPortDescStatsRequest(datapath=datapath)
    result = ofctl.api.send_msg(self, msg,
                                reply_cls=parser.OFPPortDescStatsReply,
                                reply_multi=True)

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
7265edc236 ryu.app.ofctl: implement reception of reply message
an example:
    msg = parser.OFPEchoRequest(datapath=datapath)
    result = ofctl.api.send_msg(self, msg, reply_cls=parser.OFPEchoReply)
    assert isinstance(result, parser.OFPEchoReply)

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
5f57cfd16a ofp_event: add a function to find Event class for given OFP class
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
a4a77546d8 RyuApp: add methods to observe/unobserve specific event dynamically
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
5b34514c99 RyuApp: allow observing events without having handlers
this will be used by ofctl app which registers handlers dynamically.
when unobserving an event cls dynamically, there might be events of
the cls left in app's event queue already.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
b75cd0c0bd RyuApp.get_handlers: restructure code and add a comment
no functional changes.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00
YAMAMOTO Takashi
6ccec65aaf RyuApp: add a method to unregister a handler
this method undos register_handler.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-04-10 07:09:56 +09:00