3177 Commits

Author SHA1 Message Date
FUJITA Tomonori
63f81837fd Ryu 4.20
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v4.20
2017-12-02 09:50:31 +09:00
morland
7f6d8730ab fix bug in the example of flow_stats_reply
Signed-off-by: morland <mqy_bs@hotmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-28 11:30:13 +09:00
Thomas Boros
9aa56ef3bd app: added simple switch with openflow 1.5 support
Signed-off-by: Thomas Boros <tomas.boros92@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-28 10:48:26 +09:00
IWASE Yusuke
4d26387910 ofproto_v1_5_parser: Change default of command_bucket_id
Currently, Ryu will send the OFPGroupMod message with
"command_bucket_id=0" by the default if using the OpenFlow version 1.5.
OTOH, Open vSwitch expects "command_bucket_id=OFPG_BUCKET_ALL" if
"command" is other than OFPGC_INSERT_BUCKET or OFPGC_REMOVE_BUCKET,
otherwise OVS will rejects the OFPGroupMod message.

This patch changes the default value of "command_bucket_id" to
OFPG_BUCKET_ALL as OVS expects.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-28 10:33:23 +09:00
Jerico Moeyersons
3b946c0192 app: Fix simple_switch for multi switch env
Currently, the matches of flows in the learning switch examples are based
on the destination and the in_port. In a multi-OF-switch environment this
could cause issues when doing calls from a host on a first switch to
multiple hosts on another switch, namely that new destinations aren't
added as a flow because the source is already known on the second switch
(when doing multiple calls to different hosts on another switch).
This patch fixes this issue by adding the eth_src to the match field.

Reported-by: Jerico Moeyersons <jerico09@hotmail.com>
2017-11-28 10:28:12 +09:00
Charlie Lewis
ed2c6eca22 doc: fix typo 2017-11-18 12:26:49 +09:00
IWASE Yusuke
6ec8802a00 test_icmpv6: Catch proper Exception
In some test cases in test_icmpv6.py, @raises() decorator does not catch
the correct Exception, because "pack" function cannot be resolved and it
need to be specified as "struct.pack".

This patch fixes to this unresolved references and make it more strictly
matching of Exception class (e.g., AssertionError).

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-16 09:15:47 +09:00
IWASE Yusuke
f3d752178c packet/icmp: Avoid TypeError when calculating length
Currently, ICMPv4 packet instance without its payload, it will raise
TypeError when calculating packet length, because the default value of
"data" field (payload data) is None and len() can not be applied against
None type object.

This patch changes the default value of "data" to the empty binary
value and confirms the value type of "data" field before serialization.
Also, this patch applies the same improvements to ICMPv6 packet library.

Reported-by: William Fisher <william.w.fisher@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-16 09:15:28 +09:00
Satoshi Fujimoto
2599aef3bf *: Reject Binary Represented IP Addresses
As a default, netaddr.valid_ipv4() uses the "aton" rule for its validation,
so valid_ipv4('2') and valid_ipv4('1.2.3') returns True.
It may cause unexpected behaviors.

This commit replaces netaddr.valid_ipv4() to ryu.lib.ip.valid_ipv4(),
which is wrapper of netaddr.valid_ipv4(), and use "pton" rule in the method.
So, address representation like '2' or '1.2.3' will be rejected.

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-11-16 09:15:12 +09:00
Satoshi Fujimoto
8185637767 serivice/bgp: Fix ssh connection problem in Python 2.7
Currently, 'is_connected' attribute in SshServer is refered
before it is created, in Python 2.7.
This raises an Exception and the SSH operation won't work
anymore after this happens.
This commit ensures that 'is_connected' is created before
it is refered.

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-05 21:10:03 +09:00
IWASE Yusuke
5bde6ae440 flags: Inject __class__ attribute to LooseVersion
Currently, ryu-manager uses distutils.version.LooseVersion for
"--zapi-frr-version" to parse the given version sting.
With custom type class for oslo_config.cfg.Opt, oslo_config might access
__class__ attribute for equal comparison.
But in case on Python 2, LooseVersion does not have __class__ attribute
and it causes AttributeError. (This error is not always reproduced)

This patch injects required attribute into LooseVersion and avoids this
problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-02 11:18:03 +09:00
IWASE Yusuke
eda4940eb8 library_ovsdb_manager: Descriptions for OVS configs
To connect OVSDB Manager library to OVS, some additional configurations
on OVS is required, but currently no description about these
configurations.

This patch adds descriptions for OVS configurations and includes some
improvements of sample application.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-02 09:20:55 +09:00
Satoshi Fujimoto
92730dc7e9 app/ofctl: Enable to send single BarrierRequest
Currently, with ryu.app.ofctl.api.send_msg(),
a BarrierRequest will send with every messages.
So, using send_msg() with a BarrierRequest will
cause duplex transmission of BarrierRequests.

This commit enables to send a single BarrierRequest
if send_msg() is used with a BarrierRequest
by avoiding sending an additional BarrierRequest.

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-01 23:22:37 +09:00
IWASE Yusuke
66bdeaa7b5 packet/zebra: Support FRRouting version 3.0
This patch enables to support Zebra messages of FRRouting version 3.0
and introduces a flag to switch FRRouting version.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-01 23:22:09 +09:00
IWAMOTO Toshihiro
6e51b2a41d of14: Implement OFPBundleCtrlMsg parser
Copied from of15 implementation.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-01 23:21:44 +09:00
IWASE Yusuke
98d97b992e rest_qos: Avoid None when deleting OVSDB addr
Currently, rest_qos.py will raise AttributeError when deleting OVSDB
server address because rest_qos.py will try to split the given address
string but the address is None when deleting.

This patch checks if the given address is None or not before the string
manipulation and fixes this problem.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-01 23:21:11 +09:00
IWASE Yusuke
253ce73b7f lib/ovs/vsctl: Function for validate OVSDB address
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-01 23:21:09 +09:00
FUJITA Tomonori
51a1130f6c Ryu 4.19
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v4.19
2017-11-01 21:48:39 +09:00
IWASE Yusuke
e1e85052f5 BGPSpeaker: Enable to specify local listen addresses
Currently, BGPSpeaker will listen the incoming connection with the
unspecified IP addresses ('0.0.0.0' and '::').

This patch enables to specify the local listen address list for starting
BGPSpeaker instance.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-10-15 13:21:23 +09:00
IWASE Yusuke
6329444165 bgp/application: Enhance arguments handling for BGPSpeaker
Currently, when new arguments are introduced into BGPSpeaker,
ryu.application.RyuBGPSpeaker need modifications to support the
introduced arguments.

This patch enables to pass arguments to BGPSpeaker without some
modifications on RyuBGPSpeaker.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-10-15 13:21:21 +09:00
IWASE Yusuke
7ef14a83a2 test_controller: Test cases for _split_addr()
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-10-15 13:04:41 +09:00
IWASE Yusuke
09d5b2533c controller: APIs to register switch address dynamically
This patch introduces APIs to register/unregister switch address after
Ryu (ofp_handler) starting.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-10-15 13:04:39 +09:00
IWASE Yusuke
f775290360 controller: Support proactive connection
This patch enables to initiate OpenFlow connection from controller side
by using "--ofp-switch-address-list" and "--ofp-switch-connect-interval"
options.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-10-15 13:04:38 +09:00
FUJITA Tomonori
6e69e9b8a6 Ryu 4.18
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v4.18
2017-10-03 13:38:51 +09:00
IWASE Yusuke
3c22bf4144 zclient/zserver: Support FRRouting messages format
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:32 +09:00
IWASE Yusuke
bf9b8ac588 test_zebra: Enhance test cases
Note: The binary representation is not extracted from the real packets
and based on the implemetation, so might be required to be fixup with
the real packets.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:31 +09:00
IWASE Yusuke
aedd3920b3 packet/zebra: Support MPLS Labels messages
This patch implements the following messages on FRRouting:
 - FRR_ZEBRA_MPLS_LABELS_ADD
 - FRR_ZEBRA_MPLS_LABELS_DELETE

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:29 +09:00
IWASE Yusuke
e423a1f0bc packet/zebra: Support Interface Router Advertisement messages
This patch implements the following messages on FRRouting:
 - FRR_ZEBRA_INTERFACE_ENABLE_RADV
 - FRR_ZEBRA_INTERFACE_DISABLE_RADV

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:22 +09:00
IWASE Yusuke
6b48da6729 packet/zebra: Support VRF related messages
This patch implements the following messages on FRRouting:
 - FRR_ZEBRA_VRF_ADD
 - FRR_ZEBRA_VRF_DELETE
 - FRR_ZEBRA_INTERFACE_VRF_UPDATE

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:16 +09:00
IWASE Yusuke
7baed0a100 packet/zebra: Support BFD Destination messages
This patch implements the following messages on FRRouting:
 - ZEBRA_INTERFACE_BFD_DEST_UPDATE
 - ZEBRA_BFD_DEST_REGISTER
 - ZEBRA_BFD_DEST_DEREGISTER
 - ZEBRA_BFD_DEST_UPDATE
 - ZEBRA_BFD_DEST_REPLAY

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:13 +09:00
IWASE Yusuke
7804cbb6f4 packet/zebra: Support Neighbor Connected Address messages
This patch implements the following messages on FRRouting:
 - ZEBRA_INTERFACE_NBR_ADDRESS_ADD
 - ZEBRA_INTERFACE_NBR_ADDRESS_DELETE

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:07 +09:00
IWASE Yusuke
7091523f8f test_zebra: Add pcap for API version 4 on FRR v2.0
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:37:00 +09:00
IWASE Yusuke
90f0434c18 packet/zebra: Support some FRRouting messages format
Note: This patch does not support all messages defined in FRRouting,
and some of message are left on TODO.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:53 +09:00
IWASE Yusuke
0716d2cba1 packet/zebra: Constants for supporting FRRouting format
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:45 +09:00
IWASE Yusuke
a5f24fe3e3 packet/zebra: Support asymmetric structure of ZEBRA_*_IMPORT_LOOKUP
The ZEBRA_IPV4_IMPORT_LOOKUP/ZEBRA_IPV6_IMPORT_LOOKUP has asymmetric
structures at when sent to Zebra daemon and when sent from Zebra daemon.
Especially, "prefix_len" field is inserted before "prefix" filed when
sent to Zebra daemon.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:40 +09:00
IWASE Yusuke
b66c597fb6 packet/zebra: Parse messages based on Zebra API version
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:32 +09:00
IWASE Yusuke
c860675a5f packet/zebra: Missing bw_cls_num in InterfaceLinkParams
This patch fixes to parse the missing field of the number of unreserved
bandwidth classes in Interface Link Parameters structure.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:26 +09:00
IWASE Yusuke
8e851711a7 packet/zebra: Constants for Link Parameters Status
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:14 +09:00
IWASE Yusuke
18fa853352 packet/zebra: Constants for Interface Address Flags
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:12 +09:00
IWASE Yusuke
a104e11c0d packet/zebra: Return "ZebraMessage" for message from Zebra
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:10 +09:00
IWASE Yusuke
96891addf5 packet/zebra: Fix unresolved reference for _serialize_nexthops
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-17 13:36:02 +09:00
Thomas Bechtold
0673a8868e Only import pip if needed
In some systems pip is not installed and the parse_requirements() function
is not needed. So only import pip if needed. Otherwise this fails with:

  from ryu.base import app_manager
  File "/usr/lib/python2.7/site-packages/ryu/base/app_manager.py", line 34, in <module>
  from ryu import utils
  File "/usr/lib/python2.7/site-packages/ryu/utils.py", line 23, in <module>
  from pip import req as pip_req
  ImportError: No module named pip

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-09-05 15:54:07 +09:00
FUJITA Tomonori
1782f54f3c Ryu 4.17
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v4.17
2017-09-04 21:52:10 +09:00
mgrex97
0c0656f95a topology/switches: Fix delete port can't immediately remove link.
If remove port data from self.port_state first,
self.get_port method can't get the port data,
this problem will cause link can't immediately be removed.
This patch remove port data after get_port and link delete.

Signed-off-by: Yu Ren <j6y4u4xup6@gmail.com>
Signed-off-by: mgrex97 <j6y4u4xup6@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-29 22:51:15 +09:00
IWASE Yusuke
80fedbfeaf BGPSpeaker/net_ctrl: Close activity for each session
Currently, a thread for processing outgoing message will be remained in
"RpcSession" activity even if RPC session is closed by the remote peer,
and garbages on memory will grow.

This patch fixes to close "RpcSession" activity when RPC session
closing.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-29 22:50:36 +09:00
Satoshi Fujimoto
98a838e487 packet/bmp: Correctly parse peer address with IPv4
Currently, Ryu expects that the IPv4 peer address format is
"4 bytes with IPv4 address, followed by 12 bytes padding".
However RFC 7854 says the format is
"12 bytes padding, followed by 4 bytes with IPv4 address".

This patch fixes it to correctly parse/serialize peer address.

Reported-by: Henk Smit <hhwsmit@xs4all.nl>
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-29 22:49:53 +09:00
IWASE Yusuke
f85ae78465 rest_qos: Avoid discarding Queues info for each request
Currently, rest_qos discards the Queues info stored on its dictionary
for each "Set queue" request.
So rest_qos always reply only last Queue setting.

This patch fixes to avoid discarding the Queues info and enable to reply
all configured Queues settings.

Note: In order to store all Queues settings, "port name" field for each
Queue will be inserted on the reply of "Get queue configuration" API.
 - Before:
    [
      {
        "command_result": {
          "result": "success",
          "details": {
            "0": {
              "config": {
                "max-rate": "500000"
              }
            },
            "1": {
              "config": {
                "min-rate": "800000"
              }
            }
          }
        },
        "switch_id": "0000000000000001"
      }
    ]
 - After:
    [
      {
        "command_result": {
          "result": "success",
          "details": {
            "s1-eth1": {    # <-- Inserted
              "0": {
                "config": {
                  "max-rate": "500000"
                }
              },
              "1": {
                "config": {
                  "min-rate": "800000"
                }
              }
            }
          }
        },
        "switch_id": "0000000000000001"
      }
    ]

Reported-by: Fahmy Sherif Alaa Salaheldin <sherif.fahmy@epfl.ch>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-29 22:49:36 +09:00
Dingyuan Hu
bc7451dc7c services/ovsdb: Listen on IPv6 Address
This patch enables Ryu to listen ovsdb connections on IPv6 Address.
Note that you need to make a config file like belows:
    [ovsdb]
    address=::

Signed-off-by: Dingyuan Hu <hdyvip@gmail.com>
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-29 22:49:12 +09:00
Satoshi Fujimoto
7f537c4185 packet/icmpv6: Assert length in options are valid
About the 'length' field in ICMPv6 options,
RFC4861 says that "The value 0 is invalid".
This patch adds assertions to raise a exception
for such invalid ICMPv6 packets.

Reported-by: William Fisher <william.w.fisher@gmail.com>
Reported-by: Shivaram Mysore <shivaram.mysore@gmail.com>
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-04 21:11:49 +09:00
Satoshi Fujimoto
ee9a197dd6 packet/icmpv6: Fix parsing undefined nd_option fails
The length of nd_option is units of 8 octets.
Currently, for nd_options which is undefined in the ICMPv6 packet library,
the parser assumes that the length is [8 * length - 2].
It causes fails while parsing these options.

This patch fixes it to parse such options correctly.

Reported-by: William Fisher <william.w.fisher@gmail.com>
Reported-by: Shivaram Mysore <shivaram.mysore@gmail.com>
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-08-04 21:11:09 +09:00