3200 Commits

Author SHA1 Message Date
FUJITA Tomonori
fb224e23b9 Ryu 4.22
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-02-01 20:56:39 +09:00
IWASE Yusuke
fa172559c5 bgp/application: Add note for BGPSpeaker API reference
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-23 17:16:47 +09:00
IWASE Yusuke
7d0b080e73 BGPSpeaker: Move docstring from __init__ to class
By the default, Sphinx does not include __init__() method for the
"autoclass" directive, and currently the description for the arguments
of BGPSpeaker is not generated.

This patch moves the docstring of __init__() to the class's docstring
and enables to generate the docs for the arguments of __init__().

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-23 17:16:45 +09:00
IWASE Yusuke
80312a4d64 BGPSpeaker: Enable to notify adj-RIB-in changed
This patch introduces a new argument "adj_rib_in_change_handler" into
BGPSpeaker and enables to notify adj-RIB-in changed to watchers.

Also this patch enables to "bgp.application.RyuBGPSpeaker" to notify a
new event EventAdjRibInChanged to other Ryu applications.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-23 17:16:41 +09:00
IWASE Yusuke
e81ec3fb01 ofctl: Enable to get all datapath objects
Also, updates the API document of ryu.app.ofctl.api.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-17 08:46:53 +09:00
IWASE Yusuke
37c73db7b1 confroller/dpset: Add usage example of instantiation
This patch adds the example to explain how to register dpset.DPSet
service and how to get DPSet instance from user application in order to
call the API of DPSet.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-17 08:46:52 +09:00
IWASE Yusuke
81cdd4f0d7 test_rpc: Adopt to msgpack-python>=0.50
msgpack-python version 0.50 or later supports bytearray objects, this
patch fixes to adopt to this change.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-17 08:46:14 +09:00
IWASE Yusuke
c3b484c787 doc: Usage for ryu/services/protocols/bgp/application.py
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-17 08:46:13 +09:00
FUJITA Tomonori
8287e3513a Ryu 4.21
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-01-02 13:49:50 +09:00
IWASE Yusuke
6e3eccb453 *: Apply autopep8
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:47 +09:00
IWASE Yusuke
83650576e4 travis: Introduce autopep8 test
This patch add a new test using "autopep8" to keep codes reformatted
easily by using Python tool.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:46 +09:00
IWASE Yusuke
d64db265b3 *: Adopt to pycodestyle's checks
This patch adopts to the following pycodestyle's checks;
  E275: missing whitespace after keyword
  E305: expected 2 blank lines after end of function or class

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:42 +09:00
IWASE Yusuke
bdf3549563 pycodestyle: Replace pep8
pep8 has been renamed to pycodestyle and will be removed in a future
release.

This patch replaces pep8 by pycodestyle and adding some settings for
pycodestyle.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:41 +09:00
IWASE Yusuke
870dcab678 ofproto_v1_5_parser: oxm_ids with name str in OFPActionCopyField
Currently, oxm_ids argument of OFPActionCopyField should be a list of
OFPOxmId instances, but this patch enables to specify with the OXM field
name as the str type value which is corresponding to the keywords of
OFPMatch.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:33 +09:00
IWASE Yusuke
4602651b2c ofproto_v1_5_parser: Missing trailing pads of OFPActionCopyField
OpenFlow Spec 1.5 says OFPActionCopyField has the trailing paddings to
make the action a whole multiple of 8 bytes in length.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:33 +09:00
IWASE Yusuke
aa9f3f483c ofproto_v1_5_parser: Fix length calculation of OFPOxmId
Currently, the oxm_length field is always composed with zero value
because OpenFlow Spec does not still clarify whether its value should be
doubled if the hasmask bit is set.

This patch fixes to compose the oxm_length value with the payload length
because Open vSwitch strictly checks the oxm_length which contained in
the OFPAT_COPY_FIELD action (introduced at OpenFlow 1.5), and this
causes the OFPT_ERROR messages then flows will not be installed.

Note: This patch does not backport this fix to ofproto_v1_3_parser.py
and ofproto_v1_4_parser.py because those modules are tested based on the
implementation of "linc/of_protocol" which supposes the oxm_length is
always zero. Also OFPOxmId should be rarely serialized at the controller
side when using OpenFlow 1.3 or 1.4.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:31 +09:00
Felician Nemeth
385b628d70 ovsdb: Fix small bug
Signed-off-by: Felicián Németh <nemethf@tmit.bme.hu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-11 23:42:31 +09:00
IWAMOTO Toshihiro
1493f51daa packet_data_generator3: Generate OF13 Ext-230 bundle packets
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-11 22:35:10 +09:00
IWAMOTO Toshihiro
381216075f packet_data_generator3: Support ovs-2.8
From ovs 2.8, ovs-ofctl tries to collect port descriptions, which
isn't handled by the fake server in gen.py.  Pass the --no-names
option to work around this.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-11 22:35:09 +09:00
IWAMOTO Toshihiro
9fa0b58199 ofproto_v1_3: Add bundle extension
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-11 22:35:05 +09:00
IWAMOTO Toshihiro
98ea9024ed ofproto: Correct OFPBundle{Ctrl, Add}Msg docstrings
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-11 22:34:16 +09:00
IWASE Yusuke
bf83292364 rest_vtep: Add some descriptions for troubleshooting
This patch adds some notes about the settings when using the Mininet
VMs for the environment on which rest_vtep.py running.

Reported-by: Varun Amrutiya <h20170244@pilani.bits-pilani.ac.in>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-11 22:34:00 +09:00
IWASE Yusuke
7e6f3f00ed topology: Enable to detect migrations of hosts
Currently, the topology library does not update the position of a host
which was detected before even if the host migrated to another port.

This patch enables to detect the migrations of the hosts when the host
is detected on another port.

Reported-by: Mahmoud Elzoghbi <mahmoud.said.elzoghbi@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-11 22:33:41 +09:00
FUJITA Tomonori
63f81837fd Ryu 4.20
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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>
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>
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