1918 Commits

Author SHA1 Message Date
FUJITA Tomonori
bf58248a61 bgp: support specifying next hop for neighbor
neighbor_add method takes 'next_hop' parameter. If not specified, like
before, host's ip connected to the neighbor is used as a next hop.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-30 12:24:41 +09:00
FUJITA Tomonori
f2e62c2f2b bgp: add IPv6 advertisement support
You can advertize IPv6 addresses to IPv6 neighbors.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-30 12:24:41 +09:00
FUJITA Tomonori
0ab9f19d60 packet/bgp: fix BGPPathAttributeMpReachNLRI next_hop parser and serializer
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-30 12:24:41 +09:00
FUJITA Tomonori
8907f5e426 bgp: clean up getpeername() and getsockname() usage
The current code calls getpeername() and getsockname() at lots of
places. The formats of the return values of getpeername() and
getsockname() are different between ipv4 and v6. So the code became
messy.

Calling getpeername() and getsockname() at one place and caching the
results is ideal. But that needs some refactoring. This patch is kinda
halfway.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-30 12:24:41 +09:00
Srini Seetharaman
d94f7bd0fb Initializing the variable 's' so that the get_desc_stats() call does not cause an exceptions when there are no messages
Signed-off-by: Srini Seetharaman <srini.seetharaman@gmail.com>
Reviewed-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-29 21:24:45 +09:00
YAMAMOTO Takashi
858aec4cef Add a small library to deal with TCP-MD5 socket option
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-29 08:19:49 +09:00
Yoshihiro Kaneko
b620f7a160 doc: improve the appearance of the table
I don't want to write a directive of sphinx in scripts, but
I was not able to find other methods.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-26 08:28:45 +09:00
Yoshihiro Kaneko
3e1fd452b6 doc: leave out too large samples
To let compilation of the document succeed, this patch leave out
large samples.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-26 08:28:44 +09:00
ISHIDA Wataru
6b9f5580ac bgp: add ssh_console option for bgpspeaker module
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:23:40 +09:00
YAMADA Hideki
5b1f5aea29 document: ryu.app.gui_topology
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:12:51 +09:00
Yuichi Ito
a3cb8f8c25 sw test tool: Add default test files (of14: new features)
OF 1.4.0 spec (B.14.14 PBB UCA header field) says:

    A new OXM field OFPXMT_OFB_PBB_UCA has been added to match the "use customer address" header
    field from the PBB header (EXT-256).

These test files aim to examine new features of 'set-field action' and 'match' of FlowMod message.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
44a8c69350 sw test tool: Add default test files (of14: group:all/select)
These test files aim to examine 'group action' of FlowMod message.
This patch only copies ryu/tests/switch/of13/group.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
dd960c9c18 sw test tool: Add default test files (of14: meter)
These test files aim to examine 'meter instruction' of FlowMod message.
This patch only copies ryu/tests/switch/of13/meter.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
1319010d81 sw test tool: Add default test files (of14: match)
These test files aim to examine 'match' of FlowMod message.
This patch only copies ryu/tests/switch/of13/match.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
f333b94368 sw test tool: Add default test files (of14: action with set-field only)
These test files aim to examine 'set-field action' of FlowMod message.
This patch only copies ryu/tests/switch/of13/action/25_SET_FIELD.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
947465e4de sw test tool: Add default test files (of14: action without set-field)
These test files aim to examine 'action' excluding 'set-field' of FlowMod message.
This patch only copies ryu/tests/switch/of13/action.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
76da336bd5 sw test tool: run_mininet: support Open vSwitch with OpenFlow 1.4
usage)

  to use Open vSwitch with OpenFlow 1.4:
    sudo ryu/tests/switch/run_mininet.py --swtich ovs14

  to use Open vSwitch with OpenFlow 1.3:
    sudo ryu/tests/switch/run_mininet.py --switch ovs13
      or
    sudo ryu/tests/switch/run_mininet.py --switch ovs
      or
    sudo ryu/tests/switch/run_mininet.py

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
2d173ad25c sw test tool: Modify OFPActionSetField to normalize
This patch is for avoiding the following issues when using ofproto_v1_4_parser:

  - OFPActionSetField that is created from JSON keeps unicode strings, instead of usual strings.
  - In OFPActionSetField that is created from JSON, IPv6 formats like 'ff::0' or '00ff:0000:0000:0000:0000:0000:0000:0000' are not normalized to 'ff::'.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
1474ec3255 sw test tool: Modify OFPMatch to normalize
This patch is for avoiding the following issues when using ofproto_v1_4_parser:

  - OFPMatch that is created from JSON keeps unicode strings, instead of usual strings.
  - In OFPMatch that is created from JSON, IPv6 formats like 'ff::0' or '00ff:0000:0000:0000:0000:0000:0000:0000' are not normalized to 'ff::'.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
740823f7b6 sw test tool: Enable using connected switches to compare
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:25 +09:00
Yuichi Ito
013cc84ce5 sw test tool: Enable using user-specified versions to parse
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:24 +09:00
Yuichi Ito
b9034c18bf sw test tool: Add support for using user-specified versions
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:24 +09:00
Yuichi Ito
7aa71165d7 ryu/flags: Add config parameters related sw test tool
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:24 +09:00
Yuichi Ito
6942189d8f sw test tool: Modify conditions of ofp_packet_in_reason
OF 1.4.0 spec (B.14.2 More descriptive reasons for packet-in) says:

    The main change is that the the "output action" reason OFPR_ACTION is effectively split into four reasons,
    "apply-action", "action-set", "group bucket" and "packet-out", representing the four distinct context
    where this action is used.

A set of reason values for ofp_packet_in message in OF 1.3.3 is:

    enum ofp_packet_in_reason {
        OFPR_NO_MATCH    = 0, /* No matching flow (table-miss flow entry). */
        OFPR_ACTION      = 1, /* Action explicitly output to controller. */
        OFPR_INVALID_TTL = 2, /* Packet has invalid TTL */
    };

And a new set of reason values for ofp_packet_in message in OF 1.4.0 is:

    enum ofp_packet_in_reason {
        OFPR_TABLE_MISS   = 0, /* No matching flow (table-miss flow entry). */
        OFPR_APPLY_ACTION = 1, /* Output to controller in apply-actions. */
        OFPR_INVALID_TTL  = 2, /* Packet has invalid TTL */
        OFPR_ACTION_SET   = 3, /* Output to controller in action set. */
        OFPR_GROUP        = 4, /* Output to controller in group bucket. */
        OFPR_PACKET_OUT   = 5, /* Output to controller in packet-out. */
    };

Therefore, "reason != OFPR_ACTION" means "reason == OFPR_NOMATCH or reason == OFPR_INVALID_TTL".

NOTE: OFPR_TABLE_MISS is defined as OFPR_NO_MATCH in ryu.ofproto.ofproto_v1_4.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-23 17:10:24 +09:00
FUJITA Tomonori
63451ce0a2 bgp: fix ipv6 peering regression
Workaround. Needs to clean up get_peername and get_sockname usage.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-22 17:19:20 +09:00
FUJITA Tomonori
3aeeffa48c bgp: fix best_path_change_handler for best_path_lost
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-22 17:18:32 +09:00
FUJITA Tomonori
9b0754944f bgp: fix example code
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-22 12:59:30 +09:00
YAMAMOTO Takashi
602cf17b40 bgp: fix another crash (recv_open -> recv_open_msg)
Tested-by: Itsuro ODA <oda@valinux.co.jp>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-22 12:32:39 +09:00
YAMAMOTO Takashi
2814715ef9 bgp: fix some leftover of transition to packet lib bgp
fix some leftover of commit 9d5e66fa4e49ce66103dbc9640a33bd9c22fab3f.
("bgp: use ryu bgp packet library instead of original one")

Tested-by: Itsuro ODA <oda@valinux.co.jp>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-22 12:32:39 +09:00
YAMAMOTO Takashi
254ae732de bgp: fix a crash in path comparison
this fixes the following crash.

API method core.start called with args: {'router_id': '172.17.190.2', 'waiter':<
<ryu.lib.hub.Event object at 0x7f903ed084d0>, 'bgp_server_port': 179, 'local_as:
: 64512, 'refresh_max_eor_time': 0, 'refresh_stalepath_time': 0}
API method neighbor.create called with args: {'cap_mbgp_vpnv6': False, 'ip_addrs
ss': '172.17.190.3', 'cap_mbgp_vpnv4': False, 'remote_as': 64512, 'cap_mbgp_ipv'
': True}
API method neighbor.create called with args: {'cap_mbgp_vpnv6': False, 'ip_addrs
ss': '172.17.190.4', 'cap_mbgp_vpnv4': False, 'remote_as': 64512, 'cap_mbgp_ipv'
': True}
Connection to peer: 172.17.190.3 established
Connection to peer: 172.17.190.4 established
the best path changed: 64512 0.0.0.0/0 172.17.190.3 False
hub: uncaught exception: Traceback (most recent call last):
  File "/opt/ryu/ryu/lib/hub.py", line 52, in _launch
    func(*args, **kwargs)
  File "/opt/ryu/ryu/services/protocols/bgp/base.py", line 241, in start
    self._run(*args, **kwargs)
  File "/opt/ryu/ryu/services/protocols/bgp/processor.py", line 97, in _run
    self._process_dest()
  File "/opt/ryu/ryu/services/protocols/bgp/processor.py", line 114, in _proces_
_dest
    next_dest.process()
  File "/opt/ryu/ryu/services/protocols/bgp/info_base/base.py", line 396, in prc
cess
    self._process()
  File "/opt/ryu/ryu/services/protocols/bgp/info_base/base.py", line 366, in _po
ocess
    new_best_path, reason = self._process_paths()
  File "/opt/ryu/ryu/services/protocols/bgp/info_base/base.py", line 485, in _po
ocess_paths
    current_best_path, reason = self._compute_best_known_path()
  File "/opt/ryu/ryu/services/protocols/bgp/info_base/base.py", line 588, in _cm
mpute_best_known_path
    next_path)
  File "/opt/ryu/ryu/services/protocols/bgp/processor.py", line 252, in computeb
best_path
    best_path = _cmp_by_router_id(local_asn, path1, path2)
  File "/opt/ryu/ryu/services/protocols/bgp/processor.py", line 495, in _cmp_byr
router_id
    local_bgp_id = path_source1.protocol.sent_open.bgpid
AttributeError: 'Peer' object has no attribute 'protocol'

Tested-by: Itsuro ODA <oda@valinux.co.jp>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-22 12:32:39 +09:00
YAMAMOTO Takashi
24f4a01bc4 library_bgp_speaker.rst: make an example more complete
also, while i'm here, remove trailing whitespaces in the example.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-22 12:32:39 +09:00
YAMAMOTO Takashi
eb602ab71d ofa_neutron_agent: Change the copyright notice
As a preparation to move this module to neutron repo,
change the copyright notice to the style commonly found there.

Also, add myself as co-author.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 11:50:13 +09:00
YAMAMOTO Takashi
e5f2cad6c0 ofa_neutron_agent: Remove unused logger instance
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 11:50:13 +09:00
YAMAMOTO Takashi
581674dd9b ofa_neutron_agent: Use AppManager.run_apps
No functional changes are intended.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 11:50:13 +09:00
YAMAMOTO Takashi
ecbb8640f5 AppManager: Add a convenient method to run apps
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 11:50:13 +09:00
YAMAMOTO Takashi
771fb79501 ofa_neutron_agent: Simplify
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 11:50:13 +09:00
ISHIDA Wataru
c770172804 app_manager: prevent loading unnecessary RyuApps
don't load RyuApps which is just imported and not defined in the module.
for example, if we run the script "test.py" as shown below by

$ ryu run test.py

the past implementation loads and instantiates not only Test but also RyuApp
and DPSet. this patch fix this wrong behavior

test.py
===

from ryu.base.app_manager import RyuApp
from ryu.controller.dpset import DPSet

class Test(RyuApp):
    _CONTEXTS = {'dpset' : DPSet}

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 08:41:51 +09:00
Yoshihiro Kaneko
03731ad04c package: add python-ryu-doc
This patch adds python-ryu-doc package which contains the HTML
documentation generated from doc/.
Also updates the man pages in doc/source/man/.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 08:41:51 +09:00
Yuichi Ito
cc6dcbabaa sw test tool: Enable IPv6 flow label maskable
OF 1.3.4 spec (B.15.1 Changes) says:

    Make IPv6 flow label maskable (EXT-101).

This patch makes IPv6 flow label maskable, and adds a test file for IPv6 flow label with masks.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-19 08:41:51 +09:00
YAMAMOTO Takashi
a2fc54bd79 document ryu.app.ofctl
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-18 12:13:14 +09:00
YAMAMOTO Takashi
e1f9e1e0a7 ws_topology: shut up pep8 for long lines in a comment
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-18 12:13:13 +09:00
FUJITA Tomonori
3c3a29b535 bgp: support IPv6 peering
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-18 10:21:01 +09:00
YAMADA Hideki
dabcfaa856 Add GUI app
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-18 00:39:00 +09:00
YAMADA Hideki
6650a97d8d ws_topology: Handle WebSocket disconnection
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-18 00:39:00 +09:00
YAMADA Hideki
e1cd4325eb ws_topology: Avoid controller name confliction
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-18 00:39:00 +09:00
Yoshihiro Kaneko
712d599f54 add debian files to make packages for Ubuntu
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-17 06:50:42 +09:00
YAMAMOTO Takashi
4f19fc54cd app_manager: Stop checking h.callers in get_handlers()
dynamically registered handlers (vs. ones registered via
set_ev_cls/handler decorators) do not necessarily have h.callers.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-17 06:50:41 +09:00
FUJITA Tomonori
ba9621627d bgp: catch socket error with sendall
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-16 08:11:41 +09:00
FUJITA Tomonori
f513b8751d bgp: use sendall with lock
With the current design, multiple greenlets calls sendall() on a
single tcp socket. This leads to a corrupted bgp message.

This patch introduces mutex to work around the problem. However, I
hope that we _fix_ the design where only one greenlet call sendall()
on a signel tcp socket in the future.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-16 08:11:41 +09:00
FUJITA Tomonori
783663afb2 bgp: use TCP_NODELAY for bgp connection
Disables Nagle to send data immediately.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-06-16 08:11:41 +09:00