tunnel_endpoint_ip: To allow for VTEP IPs other than the implicit local router ID
mac_mobility: To insert an extended community with a sequence number for managing MAC Mobility
If the switch does not buffer the packet (like when using mininet), the example does not work.
For such cases, include the packet contents in OFPPacketOut
This fixes a bug in RYU StreamServer where SSLContext was modified for
each connection. Now the SSLContext of the server socket is modified
only once in __init__
This commit fixes a parsing error when a BGP update contains a "withdraw label"
equal to 0x000000 instead of 0x8000000 as stated in RFC 3107. This commits
treats both labels as "withdraw label"
Signed-off-by: Benjamin Villain <villainb@amazon.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When datapath reconnects/disconnects, waiting requests on old
datapath should be canceled. Otherwise, threads that sent
requests may fall into deadlock because replies possibly never
come.
Signed-off-by: Atzm Watanabe <atzm@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Please note that this is a stop-gap measure. Also add a basic SSL
server test.
Co-authored-by: alex <atoptsoglou@suse.com>
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
According to RFC8227, many vendors don't properly implement RFC3107
related to withdraw label. Indeed, it happens that a speaker sends
a label of 0x000000 in place of 0x800000 to signal a route withdrawal.
As a result, the parser fails to parse the message since it doesn't stop
at the withdraw label and tries to parse more label than there is.
This commit fixes this by considering both 0x800000 and 0x000000 as withdraw
labels.
On architectures like i386 or arm convertion of IPv4 to string
was failing in some cases.
It was like that because some integer values were converted to
long which is not the case on x86_64.
It was like that for example with value "2871386400" which is
used in ryu.tests.unit.ofproto.test_parser_v10:TestOFPMatch unit
test.
Because of that this test was failing when running on architectures
where integer range was too small to handle this value.
Signed-off-by: Slawek Kaplonski <skaplons@redhat.com>
Reviewed-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
It seems tests weren't correctly run because of interactions between
travis CI env and tox venv. Also, run the scenario test on more
recent python3, as python3.4 is going away.
The test uses a lot of memory and fails with pypy, so it's disabled for now.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Ryu is using item_type since commit f77529036, so oslo.config minimum
version needs to be updated.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Due to change [1] in python 3.7 one of ryu's unit tests
was failing with this version of interpreter. It was like that
because of missing __qualname__ attribute in functools.partial
object.
This patch fixes it by adding such attribute if it's not
set already.
[1] https://github.com/python/cpython/pull/4496
Signed-off-by: Slawek Kaplonski <skaplons@redhat.com>
Acked-By: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OVSBridge may have more than one controller. Let get_controller()
return a list of controllers in such cases.
NOTE: this introduces incompatibility if multiple controllers are
configured for a bridge.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, the remote port of neighbor is the hard-coded value 179.
This patch enables to specify the remote port of neighbor in
"BGPSpeaker.neighbor_add()" API.
Suggested-by: Suresh Kumar <knetsolutions2@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
tester.py imported all the classes from the packet library at the top level
namespace. This commit adds CLSNAME_ALIASES dict so that those classes
with the same names can be imported as different names.
This fixes an issue reported by ted.nozaki in ryu-devel:
https://sourceforge.net/p/ryu/mailman/message/36312622/
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
GUIServerController eats up the entire URL space and sometimes causes
problems. See the following thread in ryu-devel for example:
https://sourceforge.net/p/ryu/mailman/message/36312411/
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
set_tunnel and set_field:xxx->tun_id are different actions.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
W605 invalid escape sequence, which was recently added in pycodestyle,
would be a syntax error in future python3 versions.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The constants BGP_FSM_* are str type values and not callable.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The current implementation misses the mandatory attributes when sending
locally generated routes to its Route Reflector (RR) clients, then the
clients will reject the received routes.
This patch fixes to add or update attributes to for sending locally
generated routes its RR clients.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This is to sync with OpenStack requirements.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch removes 'Subtype' byte from SystemCapabilities TLV.
There was an inconsistency in offical IEEE document which was corrected
in 802.1AB-2009/Cor 1-2013.
Signed-off-by: Marcin Chron <marcin_miko1@o2.pl>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, when Ryu failed to negotiate the OpenFlow version with a
switch, Ryu will send the OFPT_ERROR message with an error reason on its
data field.
But on Python 3, error reason string is a str type value and required to
be encoded into a bytes type value, otherwise causes an exception when
sending the message.
This patch fixes to encode the given str value into a bytes type value
in OFPErrorMsg.__init__() and solves this problem.
Signed-off-by: William Fisher <william.w.fisher@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
With this patch, when failed to negotiate the OpenFlow version with a
switch, Ryu will close the socket connecting to the switch after sending
a OFPT_ERROR message.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
If a sender closes a socket immediately after sending some data, a
receiver can fail to receive full data from the sender.
This patch fixes to shutdown a socket with "SHUT_WR" (disallows further
sends only) and enables "Datapath" to wait for a switch to disconnect
the connection.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, Ryu does not provide the way to close a socket connecting to
a switch after sending all enqueued messages, but provides only the way
to close the socket immediately regardless of enqueued messages.
This patch adds a new option "close_socket" into "Datapath.send_msg()"
method and this option enables to close the socket after sending the
given message. This patch is convenient to close the socket after
sending OFPT_ERROR message to the switch.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Because importing "pip" in Python scripts is not supported usage of
"pip", this patch fixes to use "pkg_resources" + "urllib" instead.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch removes unused function "parse_requirements" in order to
avoid using "pip" as a Python library.
Note: Officially "from pip import req as pip_req" is not supported usage
of "pip".
Reported-by: Katsaounis Molyvas Stamatios <mokats@intracom-telecom.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
msgpack-python got renamed to msgpack[1] so use the new name.
[1] https://pypi.python.org/pypi/msgpack/0.5.1
Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
Acked-By: Iwase Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This patch introduces "timestamp" attribute for OpenFlow event classes
which shows when that event was generated by Datapath instance and nearly
equivalent to when Ryu finished receiving the message contained in that
event instance.
Suggested-by: Matthew Hayes <matthew_john_hayes@hotmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
"html_use_smartypants" in conf.py is deprecated in Sphinx 1.6.
This patch fixes to use "smart_quotes" in docutils.conf instead.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The OpenFlow spec forbids multiple occurences of a same instruction
type within a mod_flow message, so make sure
ofp_instruction_from_jsondict doesn't emit such an instruction set.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, OFPErrorExperimenterMsg is not registered into OpenFlow
message events dict as "EventOFPErrorExperimenterMsg", and could not be
converted to events by ofp_event module.
This patch obsolete OFPErrorExperimenterMsg class and fixes to use
EventOFPErrorMsg to handle the experimenter error messages.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds "socket" field to RemoteOvsdb
to get sockets which connects to switches.
e.g.)
@set_ev_cls(ovsdb_event.EventNewOVSDBConnection)
def handle_new_ovsdb_connection(self, ev):
print(ev.client.socket.getsockname()[0])
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To prevent redundant files (e.g., pcap files, json files for tests,
packet data generator) to be installed, this patch separates test
directory from Ryu module.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Using mutable values as default arguments will cause unexpected behavior.
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, EventNewOVSDBConnection only has system_id.
This patch let the class has RemoteOvsdb to get more
informations through it.
e.g.)
@set_ev_cls(ovsdb_event.EventNewOVSDBConnection)
def handle_new_ovsdb_connection(self, ev):
system_id = ev.system_id
remote_addr = ev.client.address
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch introduces "--user-flags" option which enable to add user
original CLI or config file options for their own Ryu applications.
Usage Example)
$ cat user_flags.py
from ryu import cfg
CONF = cfg.CONF
CONF.register_cli_opts([
cfg.StrOpt(
'user-cli-opt', default=None,
help='user original CLI option'),
])
$ ryu-manager --user-flags user_flags.py user_app.py
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, api.set_controller in OVSDB service raises AttributeError if
controller_info is None and controller is not found in current table.
This patch sets the empty dict as the default value and fixes this
problem.
Reported-by: 胡鼎原 <hdyvip@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit adds a new method called ofp_instruction_from_str,
which takes an ovs-ofctl style action string and returns a list of
JSON dictionaries. Currently only a few action strings are understood.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
RFC 5575 says the 'len' field in numeric or bitmask operators
represents that the length of the value field is [1 << 'len'].
But, in serializing FlowSpec messages, the packet library uses
the `len` field as the length of the value field itself.
This patch fixes it to serialize FlowSpec messages properly.
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, ryu.utils.import_module() prefers the Python module path
than the user specified file path, and if the user app name is the
same with the Python module, this function returns the Python module
instead of the user app.
This patch fixes to try to load "file" before finding the loaded
Python module, and fixes this problem.
Note: With this patch, import_module() will reload (override) a module
if the specified module file name is the same.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: Brad Cowie <brad@gizmoguy.net.nz>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To keep readablity if include all class into library reference, this
patch separates library_packet_ref.rst into each protocol.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Omit description of default value The default value is described in the
aut generated API doc of class.
So the default value should not be hardcoded in pydoc.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables to configure the default local preference.
If not specified, the value will be 100 as a default.
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Zebra IPv4/IPv6 route message have asymmetric structure, in other words,
the message structure from Zebra to the protocol daemons and that from
the protocol daemons to Zebra have the different structures.
This patch introduces _ZebraMessageFromZebra in order to distinguish
which daemon sent the message and fixes _ZebraIPRoute to decode IPv4/IPv6
route message from Zebra.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adopts the workaround which is discussing on the eventlet
team at the following:
https://github.com/eventlet/eventlet/issues/401
This workaround is suggested by Raymond Burkholder.
Suggested-by: Raymond Burkholder <ray@oneunified.net>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, when BGPSpeaker advertises IPv4/6 unicast routes
via an iBGP connection, if the Nexthop in the route is omitted,
BGP Speaker advertises the Nexthop with the unspecified address.
This route can be evaluated as invalid by the receiving router.
This patch fixes it by making BGPSpeaker to advertising
the Nexthop with the host's own ip address if the local route
in the RIB has the Nexthop with the unspecified address.
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofctl_v1_5 can't send role request messages,
because of lack of arguments.
This patch fixes it by adding the argument for short_id.
ofctl_v1_5 sets None to short_id.
It means ofctl_v1_5 uses the default value of short_id.
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
With Python3 and OpenFlow v1.0/v1.2/v1.3, Ryu can't dump
the description statistics reply message into JSON,
because the message has byte type values.
This patch fixes it by using to_jsondict().
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables BGPSpeaker to store FlowSpec routes into
the global table and VRF tables and to provide the API
for advertising routes.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch sets the constant value
so that you can omit argument "subtype" for
Traffic Filtering Action of Flow Specification.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, FLOW_SPEC and FLOWSPEC constants are mixed,
so this patch will unify to FLOWSPEC.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Argument "addr" of "_FlowSpecPrefixBase" must be
specified in the network address.
If argument "addr" specified in the host address,
this patch converts the given address into the network address.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The Route Distinguisher did not include in data structure
for VPNv4 Flow Specification.
This patch adds the Route Distinguisher to data structure
for VPNv4 Flow Specification.
For details, refer to Chapter 8 of RFC 5575.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To support the case that user specifies the host address like
'localhost', this patch removes the validation of the given address
as IPv4 address family and fixes to try listening as IPv4 by default.
Then, the validation will be handled in "eventlet.listen()".
This behavior is the same as that of before supporting the unix domain
socket.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
With netaddr.valid_ipv4/6, empty host is not allowed and will fail
to validate.
This patch changes to the default wsgi listen host to "0.0.0.0"
and enable to validate it by using netaddr.
Note: The default behavior is NOT changed.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch implements APIs for performing as Zebra daemon of Quagga
and enables to integrate with other Quagga daemons.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds a new optional requirements, SQLAlchemy, for Zebra
protocol service database.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
With netaddr.valid_ipv4/6, empty host is not allowed and will fail
to validate.
This patch changes to the default openflow listen host to "0.0.0.0"
and enable to validate it by using netaddr.
Note: The default behavior is NOT changed.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch implements APIs for performing as a protocol daemon of Quagga
such as "ripd", "ospfd", "bgpd", for example.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch implements the features for acting as a Route Reflector
which defined in RFC4456.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, "prefix" argument should be an instance of IPv4Prefix or
IPv6Prefix in some Zebra message body classes.
But for the convenience, this patch enables to specify "prefix" in
the str type representation.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cisco/Juniper/Cumulus and undoubtedly more vendors offer a
simplification of the EVPN configuration by not having to
specify individual RD/RT's, e.g. in Cisco NX-OS syntax:
evpn
vni 10311 l2
rd auto
route-target import auto
route-target export auto
This simplifies/unifies the configuration.
All leaf switches/ryu instances share the same ASN (e.g. 65511).
Spine switches in the same layer can share an ASN as well (e.g. 65510).
To facilitate the above, the local ASN has to be accepted in the AS path.
To this end, Cisco includes an 'allowas-in' configuration statement.
See:
http://www.cisco.com/c/en/us/products/collateral/switches/nexus-9000-series-switches/guide-c07-734107.html
search for "MP-eBGP Design with VTEP Leaf Nodes in the Same BGP
Autonomous System"
This patch offers the possibility to specify the number of accepted
occurrences
of the local ASN in incoming AS paths. The default value is 0, which basically
is the same as the code before this patch: local ASN in the path
indicates a loop.
Non-zero values allow the local ASN to appear the specified number of times in
the AS path. A maximum value of 3 should satisfy most deployments.
Signed-off-by: Albert Siersema <albert@mediacaster.nl>
For the interoperability with other MP BGP EVPN VXLAN implementations
(e.g., Cisco NX-OS), this patch enables to advertise the VNI with the
PMSI Tunnel attribute on the Inclusive Multicast Ethernet Tag Route
messages.
Suggested-by: Albert Siersema <albert@mediacaster.nl>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
For the EVPN MAC/IP Advertisement Route, IP Address field might be
omitted in case of the L2VPN MAC advertisement (e.g., Cisco NX-OS).
This patch allows to specify the empty IP Address to advertise.
This patch is suggested by Albert Siersema for the interoperability
with other MP BGP EVPN VXLAN implementations.
Suggested-by: Albert Siersema <albert@mediacaster.nl>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables RyuBGPSpeaker, which is a base Ryu application for
creating user BGP applications, to notify the BGP events corresponding
to 'best_path_change_handler', 'peer_down_handler' and 'peer_up_handler'
of bgpspeaker.BGPSpeaker.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch fixes lib/ofctl_v1_* to use the utility function str_to_int()
instead of the builtin function int().
With this change, lib/ofctl_v1_* can convert the user input values into
integer even if non-decimal string values (e.g. hexadecimal "0x80").
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds the test cases for
Flow Specification NLRI in MP_REAACH NLRI and
Traffic Filtering Actions in EXTENDED_COMMUNITIES.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, BGPSpeaker supports only type 0 (Two-Octet AS-Specific) Route
Target (or Route Distinguisher).
This patch enables to advertise Type 1 (IPv4-Address-Specific) and Type
2 (Four-Octet AS-Specific) Route Targets.
Reported-by: Albert Siersema <albert@mediacaster.nl>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ip address with subnet is ignored in ip option of "docker network connect"
This patch specifies a correct ip format for option.
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
On Python3 Docker image, "python setup.py install" might fail in case
that the current directory contains the symlink to Docker host file
system and the link target is not visible from container.
e.g.)
.tox/py34/include/python3.4m -> /usr/include/python3.4m
This patch fixes to remove .tox directory on Docker container and also
clean the previous builds before installing.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The ovs library has changed its implementation of the idl.Idl class. The
CTOR in ryu.services.protocols.ovsdb.client.Idl updated to be compatible
with the current version.
Patch fix the problem:
if table.cond_changed:
AttributeError: 'TableSchema' object has no attribute 'cond_changed'
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Also, this patch removes the test case for __init__()
with "hlen" is zero,
because "hlen" should be recalculated at serialization.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, if you set fragmented option data
for the packet library of dhcp, Traceback occurs.
This patch fixes to analyze up to options not corrupting data.
The remaining corrupting data will be appended
at the end of option list.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables Activity base to stop the child activity by name.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch moves _send_*_response() function into RpcSession class
to use socket wrapper methods for maintaining the connection state
safely.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch fixes net_ctrl to check whether socket is connected and
to close RPC session when disconnected by RPC peer.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables 'ryu rpc-cli' command to execute a single command
not interactively.
e.g.)
$ ryu rpc-cli --peers=bgp=localhost:50002 \
--command='request bgp operator.show [{"params": ["rib", "ipv4"]}]'
This feature is convenient to controle BGPSpeaker states via shell
commands, for example.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
With WebOB 1.7.0+, "charset" can not be omitted when constructing
Request/Response instance and exception will occur if omitted.
This patch adds wrapper classes of Request/Response for setting
charset="UTF-8" by default.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch fixes unexpected unindent that occur when building.
Also, add ESI type to be specified for argument
esi of evpn_prefix_add and evpn_prefix_del.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenStack added "lxml!=3.7.0" into its requirements file, and this
patch adds the same specification for avoiding VersionConflict
error while installing.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Because the Ryu plugin for OpenStack was deprecated and the description
in "using_with_openstack.rst" is obsoleted, this patch removes the link
to this page from the index and adds the cautions for it.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds test case of NVGRE.
Also, fixes unit tests for GRE to the method using packet capture.
For that reason, add packet capture files.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, rest_router sends ARP reply messages composing own MAC
address in Target MAC Address, and both Sender/Target MAC address
are MAC address of rest_router.
So, with this reply messages, Wireshark will report "Duplicate IP
address detected".
This patch fixes this problem.
This problem was reported by China Shenzhen TICOMM Information
Technology Co. Ltd.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch moves dependencies installation in tox.ini to .travis.yml
in order to avoid to install dependencies repeatedly when running
tox tests on locally.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
With Ubuntu base Docker image, Python 2.7 will always be used on
Scenario test containers if we just install "python-*".
This patch fixes to switch base Docker image and enables to use
the specific Python version.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds the test cases for checking whether the requirements
of Ryu has no conflict with that of other projects (e.g., the global
requirements of OpenStack)
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds the requirements file for building the Ryu documentation.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently a scenario test doesn't use stream option of exec_on_ctn and
this function requires extra module(docker-py).
This patch deletes the unnecessary function.
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Add DHCP options constants to DHCP lib for the following options:
* Domain name option (15)
* Interface MTU (26)
* Classless route (121)
These constants are used in Dragonflow, which uses ryu's DHCP lib to
construct a DHCP responder.
Signed-Off-By: Omer Anson <oaanson@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec does not allow to filter flow entries by priority,
but when with a large amount of flow entries, filtering by priority
is convenient to get statistics efficiently.
This patch enables lib/ofctl_v_* modules to filter flow stats by
priority.
This patch is suggested by China Shenzhen TICOMM Information
Technology Co. Ltd.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
"esi" value should be an instance of EvpnEsi subclass and not int
type value, this patch fixes the default value to "None".
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The ESI field should not be a route key for BGP processing in EVPN
MAC/IP Advertisement route, this patch confirms "esi" is an optional
argument for this route.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In case of the IPv6 address family in MP-BGP, NLRI might has multipule
next_hop addresses (e.g., one is global unicast address and the other
is link local unicast address).
This patch fixes to support multipule next_hop addresses in MP-BGP
NLRIs.
For the backward compatibility, this patch make it to stor the first
next_hop address as next_hop attribute and all next_hop addresses
as next_hop_list.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The decoded mpls_labe should be return as a tuple of (mpls_labe,
is_bos).
This patch fixes to unpack the returned tuple.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, propery type attributes are ignored in the str and json
representations.
If we want to include them, it is required to override to_jsondict()
and from_jsondict() methods.
This patch adds the optional attributes list to specify the addtional
attributes included in the str and json representations.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch fixes to BGPMessage.parser() to return the reference to
its own class and to support multiple BGP messages in a single packet.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, ESI Label in BGPEvpnEsiLabelExtendedCommunity
has 3 byte integer set.
This patch fixes to use the mpls_label for ESI Label
of BGPEvpnEsiLabelExtendedCommunity.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Along with the update of ofctl_rest, the output representation of
the port number in the OUTPUT action has been changed.
e.g.) In case of the OUTPUT action to the OFPP_NORMAL port
OLD:
'OUTPUT:4294967290' # OFPP_NORMAL = 0xfffffffa
NOW:
'OUTPUT:NORMAL'
Currently, rest_firewall suposes the OLD format, and it will fail
to compare the port number, then all firewall rules will be shown
with "actions": "DENY".
This patch fixes to compare the port number in the NEW format and
fixes this problem.
Reported-by: Hong Panha <c011361065@edu.teu.ac.jp>
Reported-by: Ruy Takata <ruy.takata@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch fixes test_vsctl.py to use osrg/ryu-book image as
Mininet container and shortens the testing hours.
Also, this patch removes the Dockerfile for building the Mininet
Docker image.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
If the OVS kernel module is loaded at first time, it might take
a few seconds.
This patch add a sleep before sending OVSDB requests.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Using osrg/ryu Docker image for the base image make it easy to build
the image for the integrated tests, but the installed packages are
remained on the site-packages unless they are explicitly uninstalled.
This problem can cause the miss configured dependency when the
requirment files are updated, for example.
This patch fixes to use Ubuntu:16.04, which is the default for the
base image, and to build the test image on the clean environment.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
paramiko, which python library is used in bgp.operator.ssh, is defined
as the optional requirements.
This patch avoid to import this library in BGPSpeaker by the default.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, in addition to "requirements for tests", test-requires
includes "optional requirements".
This makes it unclear to identify which packages are surely required
to use optional features (e.g., OF-Config, NETCONF, BGP speaker) and
causes the redundant installation when building Docker images.
This patch separates test-requires into two files("test requirements"
and "optional requirements").
Also, this patch reverts the version fixation for some packages.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, RPC requests using rpc_cli.py will crash on Python 3,
because the decoded string through msgpack-rpc is not str type
when the default encoding is not specified into msgpack.Unpacker.
On Python 2, bytes type is the same as str type, and this problem
does not occur.
The old spec of msgpack had no notation of the encoding, but now,
msgpack defines "UTF-8" as the default encoding and has the explicit
type definitions for String and Binary.
https://github.com/msgpack/msgpack/blob/master/spec.md
This patch fixes to specify the encoding to msgpack.Packer/Unpacker
and enable to use Binary type when packing for the Python 3
compatibility.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, test_rpc.py uses long type for PyPy interpreter compatibility,
but log type is obsoleted in Python 3.
This patch fixes test_rpc.py to use numbers.Integral and makes its
implemetation more clean.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Officially, "inspect.getargspec" is obsoleted in Python 3.0,
this patch fixes to avoid using this function.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This issue is suggested by Marcel Grossmann on GitHub PR #53.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch supports on the basis of
the [draft-ietf-bess-evpn-prefix-advertisement-03]
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Also, this patch changes name of is_stack to is_bos.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Also, this patch changes size of ip_len from bit to byte.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables BGPSpeaker to set the capability for IPv6 unicast
address family.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds the test cases for IPv6 unicast and VPNv6 unicast
routes in BGP UPDATE messages.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch fixes to check if the parsed protocols list contains
the BGP message as expected.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Now BGP packet library supports 32 bits AS number and Extended
Length flag in path attributes, this patch fixes to uncomment
out the test case for UPDATE message.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, the Extended Length flag in path attributes is evaluated
only when the length exceeds 1 byte (max 255) field.
This patch enables this flags if explicitly specified.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Because the embedded tinyrpc was removed, tinyrpc is required to
be install for running Ryu application.
This patch moves tinyrpc from test-requires to pip-requires.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds UT cases using Docker for ryu.lib.ovs.
If Docker is not available, these tests will be skipped.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds support to advertise the BGP PMSI Tunnel Attribute
for the Path attributes.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds the support for BGP PMSI Tunnel Attribute [RFC6514].
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
These install packages depended on a scenario test tool.
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This adds some scenario tests using a scenario test tool.
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This provides an environment which test a peer between ryu and quagga.
I also consider that these modules are used from openstack or other
projects. So there may be some functions that are not used by test
for ryu.
This has the following functions.
- build docker image and run ryu and quagga on that container.
- configure ryu and quagga.
- have some operations for ryu, quagga and docker.
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, options for bgp/application.py is not passed to 'ryu-manager',
bgp/application.py does only start RPC server and can not start other
threads including BGP core and SSH server using bgp_sample_conf.py.
This patch enables bgp/application.py to start BGP threads using
the specified configuration file and reconstructs configuration file
format.
With this patch, BGPSpaker application can be started like:
$ ryu-manager --bgp-app-config-file ryu/services/protocols/bgp/bgp_sample_conf.py
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>
Currently, socket.error will be raised when 'quit' command is typed.
This patch enables to quit SSH session without tracebacks.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
logging.config.dictConfig has been added in Python 2.7, this patch
fixes to use dictConfig in the standard library and removes
bgp/utils/dictconfig.py.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds a function for providing the backward compatibility
for 'imp.load_source' in Python 2 and fixes bgp/application.py to
use this wrapper.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OFPErrorMsg.data usually contains the offending OpenFlow message,
but is an ASCII text string if its type is OFPET_HELLO_FAILED.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, VSCtlContext.parse_column_key_value() method fails to
parse "<column>:<key>=<value>" formatted str, which indicates
a "map" type column.
So some implementation to set "map" type column have avoided this
bug with "<column>=<key>=<value>" formatted str (not ":").
This patch fixes this problem and enable to parse the correct format
value.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In Python 2, the builtin function next() can not be applied to
non-iterator object.
This patch fixes to use the list comprehensions and avoid applying
next() to a list type object.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Because contrib.ovs has been removed, we no longer need to update
the path for loading ovs module.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, ovs.vsctl outputs the messages (e.g. just "unchanged" or
"success") in the "info" log level for each transaction, but these
messages are not meaningful for users.
This patch changes the log level of these messages to "debug".
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
On Python3, rest_router fails to compare the type of protocols in
the Packet Library instances, because the non-parsed packet data
is not str type but bytes type.
This patch fixes to compare the protocols instance type with
packet_base.PacketBase and enable to convert the Packet Library
instances to dict.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When disconnecting switches, dpset will fail to unregister ports,
because size of values in the port state dictionary might be
changed when doing the iteration.
This patch fixes to copy the values list and fixes this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When there are files named "*.truncated%d" in the packet_data directories,
they are treated as special instructions; test method are generated
by truncating wire_msg from corresponding "*.packet" files.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OFPT_ERROR_MSG can return truncated messages. Some users want to
see them in human-friendly format [1]. Catch exceptions caused
by such truncated messages and reraise as OFPTruncatedMessage
with incomplete ofpmsg in the exception class.
[1] https://bugs.launchpad.net/dragonflow/+bug/1624826
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The patch resolves issue experienced when decoding certain values of
name field in OFPMP_PORT_DESCRIPTION body. Non-decodable bytes are
replaced with utf-8 replacement character.
This issue was observed while retrieving OFPMP_PORT_DESC reply from
OpenFlow 1.3 compliant HP switch. One of ofp_struct structures
describing OFPP_LOCAL port has a name field with value 4f 46 50 50 5f 4c
4f 43 41 4c 00 81 ff ff ff ff that translates to OFPP_LOCAL.......
Attempt to decode the value, as in modified line, raises an exception
"UnicodeDecodeError: 'utf8' codec can't decode byte 0x81 in position 11:
invalid start byte". In the submitted patch, non-decodable characters
are replaced with utf-8 REPLACEMENT CHARACTER (U+FFFD), which is
sufficient for the get_port_desc method to work seamlessly. Similar
usages of str.decode method may be found in ofctl_v1_3, ofctl_v1_4,
ofctl_v1_5 and need to be fixed in the future.
Signed-off-by: Michal Rzepka <mrzepka@student.agh.edu.pl>
Reviewed-by: Iwase Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enhances the APIs of BGPSpeaker class which call
'operator.show' APIs.
Note: This patch renames the argument 'routetype' of neighbor_get()
into 'route_type' for the consistency of APIs.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
If BGPSpeaker.neighbor_del() is called, an event to notify peer down
via _notify_peer_down() method will be generated.
But when _notify_peer_down() method is called, peer.protocol is
already cleaned up with None, so _notify_peer_down() method will fail
to get the neighbor info (IP address, AS number).
This patch fixes to retrieve the neighbor info from the neighbor
configuration info of Peer class and fixes this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
For example, the packet library detects the TCP payload type by using
the TCP src/dst port, but in case of the BGP packet, the packet
library will try to parse a TCP ACK packet as a BGP packet, and will
fail to parse.
This patch enables to ignore an empty buffer and fixes this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Now OVS 2.6.0 has been released, which is including
Python 3 compatibility.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Henceforth, Ryu-Book includes the source files for application of Ryu.
This patch Integrates the source files for application of Ryu-Book.
Just for information, the source files for application of Ryu-Book
will Integrate as for OpenFlow1.3.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To create GRE tunnel, the local_ip field is not mandatory field.
This patch makes the local_ip field to optional for the convenience.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
According to ovs-vswitchd.conf.db(5), the tag column is an integer
in range 0 to 4095, but OVS may returns the empty list [] as the
default value.
OTOH, Ryu expects an integer type as the default and fails to get
the port information in the table.
This patch enables to catch the empty list as the default and
fixes this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, stplib compares the status of OFPPortStatus message with
that of Datapath instance, but this comparison returns always "equal",
so stplib fails to get the correct port status.
This patch fixes to store the current port status and to compare the
new status with the stored status.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
cmp() func was introduced for Python 3 compatibility before,
but this implementation is not enough, because a MAC address
can not be compared with a Bridge ID (integer value) by com() func.
This patch fixes to convert the MAC address into an integer value
before comparing with Bridge ID and fixes this problem.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, in Python3, api.operator call APIs, which are used by
BGPSpeaker.rib_get() for example, cannot be registered correctly.
So call('operator.show', **kwargs) fails to get the registered
method by the symbol 'operator.show'.
This patch simplifies the registration decorator for api.operator
call APIs and fixes this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Recently, I discovered major multipart message parser flaw. The issue
was observed while testing Aggregate Flow Statistics message in OpenFlow
1.5 and Open vSwitch. Similar (and potentially also vulnerable) code
snippets are also present in other message parsers (e.g. OFPHello). I'd
like to ask for opinions on proposed solution. If accepted, similar
patches should also be applied for other message parsers.
Brief description (steps to reproduce the issue):
1. REST API is called to retrieve aggregate flow stats:
curl http://localhost:8080/stats/aggregateflow/8796750139643
2. Open vSwitch replies to Aggregate Stats Request with Aggregate Stats
Reply:
message buffer: 0x06 0x13 0x00 0x28 0x53 0xfe 0xc4 0xaf 0x00 0x02 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00
(note that due to incomplete OF 1.5 support in OvS, message is
malformed - ofp_stats struct filled with zeros)
3. Message is processed by Ryu parsers:
ofproto_parser.msg -> ofproto_v1_5_parser.msg_parser ->
ofproto_v1_5_parser.OFPMultipartReply.parser
4. Here, message body contents are parsed
(ofproto_v1_5_parser.OFPMultipartReply.parser, lines 1858-1861):
while offset < msg_len:
b = stats_type_cls.cls_stats_body_cls.parser(msg.buf, offset)
body.append(b)
offset += b.length if hasattr(b, 'length') else b.len
5. Due to incorrect message format, zero-filled message part is parsed
as b=OFPAggregateStats(length=0,stats=OFPStats(oxs_fields={})),
resulting in constant offset value, as in each iteration offset += 0.
6. Parser remains trapped in a infinite loop with offset = 16, msg_len =
40. Ryu controller hangs completely.
OFPMultipartReply parser was observed to handle malformed messages
improperly. The patch introduces offset check to fix processing of
malformed messages in ofproto_v1_5_parser.OFPMultipartReply.parser.
Signed-off-by: Michal Rzepka <mrzepka@student.agh.edu.pl>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This fixes the problem of the payload being always shown when another field
differs between ingress and egress test.
Signed-off-by: Monthadar Al Jaberi <monthadar.al-jaberi@infinera.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This Nicira extension field is VLAN VID+CFI+PCP.
OXM_OF_VLAN_VID and OXM_OF_VLAN_PCP should work fine in theory, but
in OvS it seems vlan_tci must be used to access the CFI bit from
NX_LEARN actions.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, when BGPSpeaker instance calls 'core.stop', CORE_MANAGER
fails to stop its own activities and outputs traceback, because the
dictionaries which maps name to instance are changed during iteration.
This patch makes a list copy of items() to avoid this problem and
enable to shutdown gracefully.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To get more detail information about BGP route by using
best_path_change_handler, this patch adds path member into
EventPrefix and implements property to get existing attributes.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, VRF Table supposes the incoming NLRI has MPLS labels
field, but some EVPN NLRI don't have MPLS labels field, and
BGPSpeaker fails to import the incoming routes from the neighbours.
This patch fixes this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds the missing support for importing EVPN Table from
the Global Table to VRF Table when BGPSpeaker recieved a new EVPN
route.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch fixes incorrect conversion of De Morgan's laws.
e.g.) not (A and B) == not A or not B
Original:
if not (vpn_path.source is None
and route_dist == vrf_table.vrf_conf.route_dist):
Incorrect:
if (vpn_path.source is not None and # !!! Should be "or"
route_dist != vrf_table.vrf_conf.route_dist):
Correct:
if (vpn_path.source is not None or
route_dist != vrf_table.vrf_conf.route_dist):
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables to advertise VNI as MPLS lables field in the
MAC/IP Advertisement Route of EVPN.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds support to advertise the BGP Tunnel Encapsulation
Attribute for the Ethernet VPN Routes.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds the support for BGP Encapsulation Extended Community
[RFC5512].
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This is a minimal change to keep the supplied sample code
working with latest software. The sample code is not compatible
with OFP v1.3+, and if there is no requirement on supported version
Ryu will probably accept latest supported OF switch.
Signed-off-by: Monthadar Al Jaberi <monthadar.al-jaberi@infinera.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Invalid OFPFlowMod flag and importance values were observed when using
app/ofctl_rest. This patch restores the proper order of arguments passed
to OFPFlowMod constructor in mod_flow_entry (ofctl_v1_4.py).
Signed-off-by: Michal Rzepka <mrzepka@student.agh.edu.pl>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When the controller receive loop currently accepts an OpenFlow
message, it does not validate the message length. As a result, a
malicious or malfunctioning switch could cause send a message that
would result in the receive loop making no forward progress.
This patch ensures that the message length passed in the OpenFlow
message is validated against the specified minimum, and forced to that
value if it is smaller.
Thanks to Samuel Jero (at Purdue's Dependable and Secure Distributed
Systems Lab) for discovering this issue.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Usage: After installing Ryu (on virtualenv is better), build a
ryu-manager executable as following:
$ pip install PyInstaller==3.1.1
$ cd tools/
$ pyinstaller ryu-manager.spec
$ ./dist/ryu-manager
Note: PyInstaller==3.2 may have a bug of str encoding, please use
Pyinstaller==3.1.1 instead.
https://github.com/pyinstaller/pyinstaller/issues/1976
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Navigates back the stack to locate the module instead of relying on
inspect to locate the module based on the file name.
This patch is suggested by papostolescu as Pull Request(*1)
on GitHub.
(*1) https://github.com/osrg/ryu/pull/26
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Because the NLRI_CLASS of the VRF EVPN Table is the same as the
NLRI_CLASS of the Global EVPN Table, the str representation can not
be distinguished with 'formatted_nlri_str' format.
So, 'show vrf' commands on the SSH console returns the str outputs
with Route Distinguisher (RD) even if the route on the VRF Table
can be identified without RD value.
This patch implements the str representation properties to output
BGP routes on SSH console.
Current: RD '65001:100' is duplicated
bgpd> show vrf all
VPN: ('65001:100', 'evpn')
*> 65001💯multicast_etag(ethernet_tag_id:300,ip_addr:10.10.1.0) None 0.0.0.0 Only Path ?
With this patch:
bgpd> show vrf all
VPN: ('65001:100', 'evpn')
*> multicast_etag(ethernet_tag_id:300,ip_addr:10.10.1.0) None 0.0.0.0 Only Path ?
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, RegisterWithArgChecks validates only required arguments,
so invalid arguments might be passed through if the arguments are
registered as optionals.
This patch fixes to enable validation for optional arguments.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In the validator for the API arguments should raise exception
when the validator detects invalid arguments, otherwise the
decorator for registering API functions, RegisterWithArgChecks,
can pass through the invalid arguments.
This patch fixes this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch fixes to reduce Pylint warnings, to use 'netaddr' utilities
and to reduce redundant if statements.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch remames the internal (not for users) API for the consistency,
and add missing docstring.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables BGPSpeaker to store EVPN routes into the VRF
tables and to provide the API for advertising routes.
Usage example:
speaker = BGPSpeaker(as_number=65001,
router_id='172.17.0.1')
speaker.neighbor_add(address='172.17.0.2', remote_as=65002,
enable_evpn=True)
speaker.vrf_add(route_dist='65001:100',
import_rts=['65001:100'],
export_rts=['65001:100'],
route_family=RF_L2_EVPN)
speaker.evpn_prefix_add(route_type=EVPN_MAC_IP_ADV_ROUTE,
route_dist='65001:100',
esi=0,
ethernet_tag_id=200,
mac_addr='aa:bb:cc:dd:ee:ff',
ip_addr='10.0.0.1',
next_hop='172.19.0.1')
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables BGPSpeaker to advertise BGP EVPN routes and
store the advertised BGP EVPN routes from the neighbors.
TODO:
- To support the VRF table for BGP EVPN routes.
This patch supports the global table only.
- To implement Multihoming Functions.
Currently, ONLY Single-Homing is supported.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, SSH console of BGPSpeaker fails to recieve commands from
user when it is running on Python3 due to the binary conversion.
This patch fixes this problem and enables to use SSH console on
Python3.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch fixes the TCP packet parser to return the BGP packet
parser class if the TCP src or dst port is the reserved BGP port
and enable to parse the entire packet data.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
So far if you set the packet library to OFPPacketOut.data, error occurred.
This patch will be able to set the packet library in OFPPacketOut.data.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To improve Pylint results, this patch fixes to utilise six.moves.builtins
instead of using __builtin__ on Python2 or builtins on Python3.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, the assignment for 'table_id' is missing in the arguments
of str representation.
This patch fixes this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, 'dst_start_end' and 'src_start_end' in NXActionLearn
are not initialized before assignment to convert into string
representation.
This patch fixes this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When a Datapath disconnects, an application may not know about it
until it attempts to send a message to that Datapath.
Ryu's core will detect the failure to send, and will close the
Datapath object - but has no way of letting the application know that
it did so.
With this patch, send_msg() returns True or False, depending on
whether the message that the application was trying to send was able
to be enqueued to send via a given Datapath object.
If the Datapath.send_msg() returns False, the calling application can
thereby determine that the Datapath is no longer valid, and should
clean up any references it has to it.
Existing applications may choose to ignore the return value, and
nothing breaks.
I have patched one utility method that uses send_msg(), since it was
not marked as deprecated. All utility methods marked as deprecated, I
have not altered.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
A quick patch to clean up stale Datapath objects in the ofctl_service application.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Since zone_src in NXActionCT was not possible to specify string,
update zone_src of NXActionCT for the uniformity.
Therefore, you will be able to specify string of OXM/NXM fields for zone_src.
If you want to set the immediate value for zone,
zone_src set the None or empty character string.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch will revert the API of NXAction for the following report.
https://bugs.launchpad.net/dragonflow/+bug/1599367
revert commit id: 3c3896fd77f274ce953dcb78795aa5cc4fde6c65
This patch reverts recently introduced start and end arguments.
Add the utility method for ofs_nbits.
NXActionRegLoad now takes ofs_nbits argument instead of ofs
and nbits even with this revert.
Additionally, update test cases and documents.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, ryu-manager emits traceback messages when killed via
KeyboardInterrupt.
This patch traps the KeyboardInterrupt, and outputs an appropriate
log message instead.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: Alan Fordyce <alan_fordyce@keysight.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
According to OpenFlow Spec 1.3.5, OFPT_PORT_STATUS messages with
the reason value OFPPR_MODIFY should be sent the BOTH port state
and config have changed.
On the other hand, OVS does not send OFPT_PORT_STATUS messages
when the port config has changed and only sends when the port
state has changed.
But, other switch implementation, e.g. Lagopus, sends messages
when the both port state and config have changed.
Therefore, simple_switch_stp_13.py will overproduce the topology
recalculation events and will fail to recalculate the topology.
This patch checks the port state in OFPT_PORT_STATUS messages
and ignores the message if the port state is not changed.
Reported-by: Hong Panha <c011361065@edu.teu.ac.jp>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In Python3, cmp() method is no longer supported and numerical
operations evaluates value type more strictly.
So, stplib get some errors in its calculating process.
This patch fixes these problems and enable to use stplib on
Python3 interpreter.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, rest_qos.py might fail to parse the actions field in
the QoS rules when the actions field does not have any actions
for the QoS (SET_FIELD, METER, SET_QUEUE).
This patch fixes this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
LLDP.OrganizationallySpecificTLV did not set info field and produced
malformed LLDP packets
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Actions to be added are as following.
- NXActionSample2
- NXActionOutputTrunc
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Note: The following actions are not implemented yet,
because ovs-ofctl command is not supported.
- NXActionRegLoad2
- NXActionOutputReg2
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch, update the methods that are to be specified in the NXM or OXM.
Update the oxm_types specified in the bit format to the string.
Update the following NXAction.
- NXActionOutputReg
- NXActionMultipath
- NXActionBundle
- NXActionBundleLoad
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
There is NXAction to be used only in OpenFlow1.0.
These actions are supported by default in OpenFlow1.2 or later.
Therefore, it becomes unnecessary as the NXAction.
But, to add the NXAction in order to be able to use in OpenFlow1.0.
Actions to be added are as following.
- NXActionSetQueue
- NXActionDecTtl
- NXActionPushMpls
- NXActionPopMpls
- NXActionSetMplsTtl
- NXActionDecMplsTtl
- NXActionSetMplsLabel
- NXActionSetMplsTc
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In Python 2.7, array.array cannot be converted correctly into binary
type by using six.binary_type().
So packet.Packet() cannot skip data effectively.
This patch remove to use array.array as input binary in test_packet.
Note: array.array can be used as input binary as the same as before,
but in this case, the padding data will be displayed in str or repr
representation in Python 2.7.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In the Ethernet frame Spec (Both DIX EthernetII and IEEE 802.3),
the frame size must be at least 64 bytes long (not including the preamble).
64 bytes = 14 bytes (Header) + 46 bytes (Payload) + 4 bytes (FCS)
This patch appends padding if the payload is less than 46 bytes long.
Reported-by: Kawai, Hiroaki <kawai@iij.ad.jp>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, BGPSpeaker skips sending the Update messages with an
IPv4/IPv6 prefix when the peer does not support MP-BGP.
This patch fixes capability check in order to send IP prefix when
MP-BGP not suppored by the peer.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To test VLAN_PCP, VLAN_VID must match.
Table miss test was testing VLAN_VID instead of VLAN_PCP,
because the packet had mismatching VLAN_VID.
Fixes to set only OFPVID_PRESENT bit in the match field.
Reviewed-by: Iwase Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit will allow the host_discovery_packet_in_handler to ignore invalid
cfm packets. Ryu will fail to parse cfm packets with an interval of 0 -- We
discovered this when one of our systems sent cfm packets with an interval of 0.
Signed-off-by: Evan Gray <evanscottgray@gmail.com>
Reviewed-by: Iwase Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Normal pep8 fixes, there were also two instances where I updated a commented
LOG.debug to include exc_info=True so that the traceback will be logged
instead of relying on the error passed in the except.
Signed-off-by: Evan Gray <evanscottgray@gmail.com>
Reviewed-by: Iwase Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The hosting site has changed to use readthedocs.io instead of
readthedocs.org.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
If a controller has multiple switches connected it is useful to be able
to distinguish which datapath the msg is being sent to.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
If an AppManager.close call is started and all AppManager.services
are stopped, AppManager.run_apps starts another close() call,
resulting in a KeyError exception in close() (*1). Prevent that using
a semaphore.
(*1) https://launchpad.net/bugs/1589746
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
__metaclass__ can't be used with python 3 as metaclass syntax has been
changed in python 3.
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables to override the AS number of BGPSpeaker instance
by the "local_as" argument of BGPSpeaker.neighbor_add().
e.g.)
speaker = BGPSpeaker(as_number=65001, # the default AS number
router_id='10.0.0.1',
...)
speaker.neighbor_add(address='10.0.0.2',
remote_as=65101,
local_as=65002, # override AS number
...)
Additionally, this patch fixes a typo and sorts the comments of
BGPSpeaker.neighbor_add() method.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Move variable and method that exist in the ofproto_v1_0.py to the nicira_ext.py.
Move the oxm_types that exists in the nx_match.py to the nicira_ext.py.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch, update the methods that are to be specified in the NXM or OXM.
Update the value specified in the bit format to the start and end formats.
Update the following NXAction.
- NXActionRegLoad
- NXActionOutputReg
- NXActionMultipath
- NXActionBundle
- NXActionBundleLoad
- NXActionCT
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch deletes some NX Actions in ofproto_v1_0_parser
and fixes to use actions in nx_actions.py.
Together, delete Obsolete action in OVS.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The serialize within each class has been changed to serialize_body.
And serialize_body is executed by the serialize of NXAction.
Also update the data format designated method in serialize_body and perse.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Adds more ovsdb methods for setting key/values to other_config and
external_ids, adds bility to set the controller for a bridge, and adds the
ability to create a new port/interface on a bridge
Signed-off-by: Alan Quillin <alanquillin@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Items should not be removed during iteration
Error message
```
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/ryu/base/app_manager.py", line 290, in _event_loop
handler(ev)
File "/usr/local/lib/python3.4/dist-packages/ryu/topology/switches.py", line 821, in lldp_packet_in_handler
for host in self.hosts.values():
RuntimeError: dictionary changed size during iteration
```
Signed-off-by: Yi Tseng <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Because ovs-ofctl increments the xid field automatically, the xid
of the generated packets is set to be 0x02.
So, we should specify {"xid": 2} in json data, but when Ryu dumping
json data from message instance, "xid" are omitted and this causes
assertion error in test_parser.py
This patch enables to clear the xid filed in the generated packets
and solves this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, Ryu does not have the parser for Controller-to-Switch
one-way messages, but when testing Actions or Match fields,
OFPFlowMod parser is convenient in order to test them.
This patch implements the parser for OFPFlowMod messages.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, test_bgp uses packet_data/bgp4/* files which contain only
BGP protocol binary data.
This patch convert packet_data file into pcap file and enable to test
BGP packet library with pcap file.
With pcap file, we can easily check packet data validity by using
Wireshark or other packet sniffer tools.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Current specified Pylint(==0.25.0) are not enough to support Python 3.
This patch updates test-requires to use the latest one.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Requiring a dev version of ovs here causes version conflict issues
for projects which don't want to use dev versions of libraries. [1]
Make it optional and document it in README instead.
[1] https://bugs.launchpad.net/neutron/+bug/1584858
Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
IANA has assigned the value 4789 for the VXLAN UDP destination port,
this patch registers dst_port 4789 into UDP packet parser.
Additionally, early adopters might be using UDP dst_port 8472,
we register this number for the backward compatibility.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit fixes up the commit 7d42aecb, which added __eq__ without
adding __hash__ and left some copy-paste error.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
IANA has registered TCP port 6653 for OpenFlow, but 6633 was the
de facto standard for a long while.
So some applications might be using 6633 as the default.
But now, Mininet has adopted port 6653 as the default, we migrate
to port 6653 too.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In Python 3, the key objects of dict must be hashable,
but RouteFamily class does not have '__hash__' method.
This patch adds this method.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To improve maintainability, this patch moves the descriptions of
"Ryu application API" into each source code.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Because ryu/app/rest_nw_id.py has been deleted, the reference for
NW_ID_UNKNOWN can not be resolved now.
This patch fixes this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To notify ofp_port state change, this patch implements
ofp_event.EventOFPPortStateChange.
This event performs like EventOFPPortStatus, but ofp_handler will
send this event after updating "ports" dict of datapath instances.
And, this patch suppresses the warning when user app accessing
to datapath.ports for backward compatibility.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch removed unused match field in Openflow1.2 or later.
The following is removed match filed.
- dl_dst
- dl_src
- dl_type
- dl_vlan
- nw_src
- nw_dst
- nw_proto
- tp_src
- tp_dst
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch will not be converted to quotes and dashes to typographically correct entities.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds Openflow version to the Match message and Actions message.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To check the code coverage of the unit tests on web, this patch
add integration of Coveralls.io (https://coveralls.io/).
Usage:
1. Sign in to Coveralls.io with your GitHub account.
2. Add repos at your account page.
3. Execute tests on Travis-CI.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
>From Ubuntu 16.04 LTS, the default version of Python 3 has been
upgraded to 3.5.1.
e.g.)
$ python3 --version
Python 3.5.1+
This patch enables to run unit tests on Python 3.5 environment.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds the test cases for the following actions.
- Copy Field Action
- Meter Action
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, OFCtlUtil._reserved_num_from_user() fails to convert
an user specified value when it is a numeric string.
This patch enhances this conversion to enable to convert an user
value as follows.
e.g.)
- Integer: 1 -> 1
- Numeric string: "1" -> 1
- Reserved number: "OFPP_ANY" -> 0xffffffff
- Invalid value: "foobar" -> "foobar" (do not conversion)
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In Python 3, webob.Request.body is a byte type value and json.loads()
cannot parse it, because json.loads() suppose a str type value.
This patch fixes to use webob.Request.json to parse request body
and avoids this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Add test cases of specify the port number for get queues config.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In Python 3, the data field in OFPExperimenter must be a binary
type value, but when data_type='ascii', ofctl_utils may get it
as a str type value.
This patch confirms the data field is a binary type value.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Because Python does not provides features to unimport modules which
ware imported before, this patch separates dummy modules to test
import features of Ryu.
e.g.) If 'aaa' was imported in the previous test case,
'aaa' affects the subsequent test cases.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currentry, the *reference* of sys.path is temporarily stored before
appending a path to the user modules.
However, the *value* of sys.path should be stored because the type
of sys.path is list (mutable object) type.
Reported-by: Xandaros <mz.bremerhaven@gmail.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Adds the ability to filter the OVSDB scheme to only include specified
tables from the config as well as filter out (exclude) specific table
columns. If neither of the values are defined in the config, then the
discovered schema is used unchanged. The is needed to calm down noise with
unused tables/columns to help with scale problems on hosts with a large
number of bridges and interfaces.
Signed-off-by: Alan Quillin <alanquillin@gmail.com>
Acked-By: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Recently, Paramiko updates the requirements to 'cryptography>=1.1',
cryptography 1.0 is not compatible with PyPy < 2.6, but PyPy version
of Travis-CI is older than 2.6.
So this causes CI test error.
This patch upgrades PyPy interpreter version to 2.6 in tox environment.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Tested-by: Andy Hill <hillad@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Adds support for setting TCP flags using the nicira extensions for
OF1.0 and OF1.2+ Allows using the extensions with OF1.2+ for OVS
versions < 2.4 where the TCP flags OF extension is not yet supported.
Signed-off-by: Alan Quillin <alanquillin@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Paramaterizes type converions in function to allow calling code to
specify if responses should be converted to user friendly display
(strings) or type perserved.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Useful for debugging calling code that waits for or uses reponses.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The version of pip on Ubuntu 14.04 can't handle the version
condition. So force ovs>=2.6.0dev0 for python2.7 users too.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Jason Kölker <jason@koelker.net>
Add the control flags constants and a helper function to test which
flags are on.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Note:
The list of 'deprecated_value' are used by '_reserved_num_to_user()' to
ignore values those are deprecated in OpenFlow Spec.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
If the specified value of group_type is empty, cause an error.
This patch fixes this problem.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
If there is an empty value in the reply msg, there are cases where those methods cause an error.
This patch fixes this problem.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Create an api helper function for correlation of system_id given a
datapath_id.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
At times is it convient to read from all clients at the same time. In
particular when searching for what system_id a port or bridge (datapath)
belongs to.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Upstream ovs added the `Idl.readonly` property after ryu embeded ovs.
Add the property for compatability.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The upstream `ovs.vlog` plays nice with python logging. No need for the
workaround.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds the following test cases.
- Specify the port number for get ports stats.
- Specify the group id for get group stats.
- Specify the meter id for get meter stats.
- Specify the meter id for get meter config.
- Specify the port number and queue id for get queue stats.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds attributes of the following messages.
- Add the port number for get ports stats.
- Add the group id for get group stats.
- Add the meter id for get meter stats.
- Add the meter id for get meter config.
- Add the port number and queue id for get queue stats.
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables to specify the port number and the queue id to get the queue stats.
Usage)
$ curl -X GET http://localhost:8080/stats/queue/<dpid>[/<port>[/<queue_id>]]
Note: Specification of port number and queue id are optional.
If you want to omitting the port number and setting the queue id,
please specify the keyword "ALL" to the port number.
e.g. GET /stats/queue/1/ALL/1
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables to specify the meter id to get the meter config.
Usage)
$ curl -X GET http://localhost:8080/stats/meterconfig/<dpid>[/<meter_id>]
Note: Specification of meter id is optional
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables to specify the meter id to get the meter stats.
Usage)
$ curl -X GET http://localhost:8080/stats/meter/<dpid>[/<meter_id>]
Note: Specification of meter id is optional
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables to specify the group id to get the group stats.
Usage)
$ curl -X GET http://localhost:8080/stats/group/<dpid>[/<group_id>]
Note: Specification of group id is optional
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables to specify the port number to get the port stats.
Usage)
$ curl -X GET http://localhost:8080/stats/port/<dpid>[/<port>]
Note: Specification of port number is optional
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Calling GreenThread.wait() should return the value of the greenthread or
reraise the exception. As it is being wrapped to mimic gevent's .join
behaviour introduce the `raise_error` kwarg to allow callers to specify
the behavior they expect while maintaining backwards compatability.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Prevent `client.discover_schemas` from blocking while calling into the
`ovs` library by emulating `jsonrpc.Connection.transact_block` to not
block and explicitly allow greenlet switching every loop.
Works with both the embeded ryu.contrib.ovs and upstream ovs python
packages.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Previous patch referred to the wrong config names
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
A set of minor cleanups.
1) Remove the unused import of MAIN_DISPATCHER from ryu.controller.handler.
2) Remove the extraneous "close_requested" variable.
3) Ensure use of equality instead of identity for testing against DEAD_DISPATCHER.
4) Alter the exit condition for the _send_loop.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch makes it possible for ofctl_v1_3 to use the action type of experimenter.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Add a new feature: an echo request loop, which implements a liveness
check for connected Datapaths. This feature is off by default, but can
be enabled by setting the config file option
maximum_unreplied_echo_requests to a positive integer value.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Change socket-timeout from being a CLI option to being a config file
option, since this should not *normally* need to be set on the command
line.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Also, temporarily work around a bug in eventlet's Queue.put() by
wrapping the send_q with a semaphore.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In order to prevent an exception from terminating the execution of the
event loop. Wrapper name also added to hub.py for GreenletExit.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
It does not include an internal counter.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Due to a discovered bug in eventlet queue put(). This is a temporary
workaround until eventlet is fixed.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The 'parseable' output format of pylint is deprecated.
This patch updates the option from 'output-format=parseable' into
equivalent output format by using 'msg-template'.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In the latest mininet, the default controller port has been updated
to 6653, but currently the default port of Ryu is 6633.
This patch specifies the controller port by using the constant from
Ryu ofproto module.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec defines that the data field should contain at least
64 bytes of the failed request that caused the error message to be
generated, unless otherwise specified.
But, the data field can be empty in some switch implementation,
this patch checks the data field length and skips parsing it if the
field does not contain enough bytes to parse.
Reported-by: Yury Yurochko <y.yurochko@brain4net.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The following types are presents in Openflow Spec v1.4.0 and 1.4.1.
OFPTFPT_EXPERIMENTER_SLAVE = 0xFFFE
OFPTFPT_EXPERIMENTER_MASTER = 0xFFFF
Prefix of async config property type should be 'OFPACPT_' but the above are starting with 'OFPTFPT_'.
Because these types have been fixed in Openflow v1.5.0, this patch fixes the above types in ofproto_v1_4.py as follows.
OFPTFPT_EXPERIMENTER_SLAVE = 0xFFFE <-- treated as deprecated[*1]
OFPTFPT_EXPERIMENTER_MASTER = 0xFFFF <-- treated as deprecated[*1]
OFPACPT_EXPERIMENTER_SLAVE = 0xFFFE
OFPACPT_EXPERIMENTER_MASTER = 0xFFFF
[*1] OFPTFPT_EXPERIMENTER_SLAVE/MASTER are left in ofproto_v1_4.py for backward compatibility.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
simple_switch_* apps have conflicting two faces of its purpose.
One is the example apps for beginners, the other is the utility
apps for the L2 switching in the user environments.
These are difficult to be compatible.
This patch adds an example app for begginers and separates
from simple_switch_* apps.
This makes it easy to improve the L2 switching function of
simple_switch_* apps.
To simplify example_switch_13, the following features are dropped
from simple_switch_* apps.
- FlowMod and Packet-Out messages using "buffer_id".
- Checking the expected "miss_send_length" field.
- Ignoring the LLDP packets
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The Python core team[*1] stopped supporting python 2.6. Some Python
libraries started following the same path and trying to support 2.6
becomes painful...
For example, most of you already noticed, oslo.config dropped 2.6
support. I tried to work around it with the following commit:
2250171098
But this forces users of decent distributions (e.g Ubuntu 14.04) to
upgrade pip (old pip versions can't understand version conditions).
[*1]
http://www.curiousefficiency.org/posts/2015/04/stop-supporting-python26.html
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The OpenStack Neutron's of_interface code generates flows with
NXActionRegLoad. It's not required but better to be able to
parse them.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
"features" field is introduced in OpenFlow 1.5, but this field is
not defined in ofproto_v1_5_parser.py.
This patch adds this missing field.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Note: Though tests may not be enough, as far as running unit test,
this patch makes compatible with PyPy interpreter.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Some fields missing in the JSON dict that to_jsondict of OFPActionSetField is returnd.
This patch fixes this problem.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Helpful to track down why the bgp server is stopping when the user
running ryu does not have CAP_NET_BIND_SERVICE.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Ovs has changed the definition of conntrack flags in commit
63bc9fb1c69fa81f3b30c2669d25962da3119d0f, and packet_data_generator3
now generates different test data. Update the data and corresponding
json data accordingly.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This action is for the conntrack Nicira extension.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When using the icmp.dest_unreach and icmp.TimeExceeded classes, we
should ensure that it is in compliance with RFC 4884. As such, the
data_len parameter passed to the constructor of each should be
interpreted in 32 bit units. Furthermore - any data that is passed in
must be zero padded to a 32 bit boundary.
The only sample application known to use either of these types is rest_router.
This patch corrects its use of these classes.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
According to RFC 4884 (which supersedes RFC 792), the Destination
Unreachable and Time Exceeded ICMP message get a new “length” field.
This length field, for ICMPv4, is interpreted in 32 bit units.
In the constructor, we cannot validate that the length specified
matches the length of the data passed; the length may need to be
larger (in 32 bit units) in order to accommodate the data that is
actually being sent. We *should*, however, ensure that the data_len
parameter passed fits into a single byte.
It may make sense to document the fact that the length is specified 32
bit units, for when users of the icmp class get a ValueError back
from these constructors.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When byte-compiled, base.py in the bgp protocol service generates a large number of SyntaxErrors for me.
This patch cleans up the SyntaxErrors, while retaining the original (intended?) semantics.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds ports to the EventDPReconnected in dpset, and adds an EventSwitchReconnected to the topology module.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In the wireless network, when host attaches AP, it will send many ARP
requests which Src IP were used before. This causes the last IP in
the list may not be the newest one and we also cannot know which IP in
the list is the newest.
So this patch can solve it.
Signed-off-by: Chia-Lin Cho <fox91119@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
While attempting to peer with a vendor switch, parsing its
BGPOptParamCapabilityGracefulRestart excepted due to the length of the
identifier tuples not being a multiple of 4 octets.
It appears that this might be common as other implementations also stop
when the buffer is < 4.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Should allow AppManager.run_apps to terminate.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
An exception during server.accept() should not cause the server thread
to terminate. Log the exception and continue instead.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
If the client closes the connection during setup, the socket's FD is
closed out automatically, ignore the errors while forcably shuting down
the socket.
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
disable the rpc unittest with large file for now because it doesn't
work with eventlet 0.18 and later. Ryu doesn't have any use cases like
this test but should be investigated.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Exception error occurs when NXActionUnknown parsing,
because _subtype(NXActionUnknown class member variable) is not defined.
This patch fixes this problem.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, there is different OFPActionExperimenter implementation of between of_parser_v14 and v13/5.
Because the implementation of v13/5 is better than v14, this patch fixes to of_parser_v14 for unification the implementation.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, test_ofctl compares the sent messages in binary, so it
is difficult to figure out the differences of the sent messages
and the expected messages.
This patch fixes to compare the sent messages in json representation
in order to make easy to debug.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
modify the default argument from list to None,
because default value {}/[] as argument is dangerous.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Just cleaning up where the patch you previously applied for me is the original version, and not the corrected version.
Thanks for applying the original!
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
If a switch connects multiple times, there are a number of potential
causes. A potential cause is that the OF agent on the switch crashed,
and was re-launched - but, because of the crash, Ryu believes that the
switch is still connected.
Should this occur, the newly re-launched OF agent on the switch often
clears the flow tables on the switch, before connecting to the
controller. When the switch agent re-connects to Ryu, the state of
the flow tables on the switch may not match what Ryu expects.
As a result, I suggest generating a new event: EventDPReconnected
Extending the existing EventDP would change semantics, and would break
apps others have written that rely on those semantics.
Applications registering a handler for EventDPReconnected would then
be able to choose whether to wipe the flow tables on the switch and
re-send flow rules, or whether to probe the switch with a flow-stats
message, and re-send rules more carefully.
Adding EventDPReconnected is the best solution to not break existing
apps, and to implement the following portion of section 6.3.3
(“Connection Interruption”) of the OpenFlow 1.3.4 specification, for
switches that have connected multiple times:
" When the OpenFlow channel is reestablished, the flow entries present
in the flow tables at that time are preserved and normal OpenFlow
operation resumes. If desired, the controller has then the option of
reading all flow entries with a flow-stats request (see 7.3.5.2), to
re-synchronise its state with the switch state. Alternatively, the
controller then has the option of deleting all flow entries with a
flow-mod request (see 6.4), to start from a clean state on the switch.
"
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
We have found, in production usage, a race condition in the transition to config mode.
If a sufficient number of events is being received, the reply to the FeaturesRequest may be received before the datapath is able to move into CONFIG_DISPATCHER state. As a result, the EventOFPSwitchFeatures handler may never fire (because the reply is received before the datapath has changed state).
This patch also includes a minor typo fix.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
While continuing to run our application with the stability patch I submitted earlier, I discovered additional failure modes for some of our hardware switches were causing unexpected exceptions.
This revision better handles these situations.
Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
* modify from "flow" to "meter" the argument of meter_mod
* modify the default argument from {} to None of the following methods
because default value []/{} as argument is dangerous.
- get_flow_stats
- get_aggregate_flow_stats
- mod_meter_entry
* fix some log messages for better readability
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Because Ryu always sends SET_CONFIG message when a datapath connecting,
the switch configurations of user applications will be overwritten by
the default values of Ryu when the datapath re-connecting.
This patch removes sending SET_CONFIG message from ofp_handler and
avoids this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
TODO: Add test cases for the other messages after adding test cases
for ofproto/test_parser.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When loading OFPQueueGetConfigReply message from json dict,
ofproto_parser can not set the property field in OFPQueueProp,
because __init__() of OFPQueueProp sub-classes do not pass any
argument to its own super-class.
This patch fixes this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When Ryu getting multiple OpenFlow messages in a single packet,
_recv_loop() can pass the messages data including the subsequent
OpenFlow message binary data to ofproto_parser.msg().
If the received OpenFlow message containing a binary data field
(e.g. Echo-Reply, Packet-In), the parser may compose messages
class with the subsequent messages data into the data field.
This patch splits the received message buffer by the recieved
OpenFlow message lenght and passes it to the parser.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
If a switch gets disconnected via a network interruption on the control plane (or a similar event),
the datapath associated with that switch might not be properly cleaned up.
At the same time, the socket associated with that datapath can get leaked.
This ultimately results in file descriptor resource exhaustion for Ryu,
as a socket had the potential to be leaked on each reconnect.
Also, a small typo was corrected in a method name in DPSet.
These are a Nicira extension for conntrack.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Recently, installed packages are cached by Wheel. It is serious when the package is using 2to3 with setuptools (use_2to3) for adapting python3. Because Wheel is caching the contents of translated. If the contents of translated are cached, it can't work properly in python2
Signed-off-by: Satoshi KOBAYASHI <satoshi-k@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When omit the parameter of "flags" in mod_meter_entry(), following error log will be shown.
example)
1.use mod_meter_entry() with omitting the parameter of "flags".
curl -X POST -d '{
"dpid": 1,
"meter_id": 1
}' http://localhost:8080/stats/meterentry/delete
2.following error log will be shown.
Unknown flags: 0
This patch fixes the problem.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
According to RFC 7313 [Enhanced Route Refresh Capability for BGP-4], Ryu bgps needs to send "Start-of-RIB" before it advertises the Adj-RIB-Out. And then, Ryu bgps needs to send "End-of-RIB" after it advertises the Adj-RIB-Out.
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
this patch makes ofctl_rest enable use of OFPTableStats message.
Get table stats:
usage)
URI: /stats/table/<dpid>
method: GET
e.g.)
$ curl -X GET http://localhost:8080/stats/table/1
More infomation about this feature is described in the following URL.
http://ryu.readthedocs.org/en/latest/app/ofctl_rest.html#get-table-stats
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
It looks VRRPManager can't handle virtual_ip_address properly as bellow.
$ sudo ryu-manager ryu.services.protocols.vrrp.rpc_manager.py
loading app ryu.services.protocols.vrrp.rpc_manager.py
loading app ryu.services.protocols.vrrp.manager
instantiating app ryu.services.protocols.vrrp.manager of VRRPManager
instantiating app ryu.services.protocols.vrrp.rpc_manager.py of RpcVRRPManager
instantiating app None of VRRPInterfaceMonitorNetworkDevice
instantiating app None of VRRPRouterV3
handle EventVRRPStateChanged
VRID:1 VRRP-Router-VRRPInterfaceNetworkDevice<00:00:00:00:00:00, 192.168.0.2, None, eth1>-1-ipv4: None -> Initialize
handle EventVRRPStateChanged
VRID:1 VRRP-Router-VRRPInterfaceNetworkDevice<00:00:00:00:00:00, 192.168.0.2, None, eth1>-1-ipv4: Initialize -> Backup
hub: uncaught exception: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 52, in _launch
func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", line 276, in _event_loop
handler(ev)
File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/vrrp/router.py", line 234, in master_down_handler
self.state_impl.master_down(ev)
File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/vrrp/router.py", line 613, in master_down
self._master_down()
File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/vrrp/router.py", line 579, in _master_down
vrrp_router.send_advertisement()
File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/vrrp/router.py", line 219, in send_advertisement
packet_.serialize()
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/packet.py", line 74, in serialize
data = p.serialize(self.data, prev)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/vrrp.py", line 394, in serialize
return self.serialize_static(self, prev)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/vrrp.py", line 625, in serialize_static
*[conv(x) for x in vrrp_.ip_addresses])
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/addrconv.py", line 27, in text_to_bin
return self._addr(text, **self._addr_kwargs).packed
File "/usr/local/lib/python2.7/dist-packages/netaddr/ip/__init__.py", line 314, in __init__
% (addr, self._module.version))
AddrFormatError: base address '.' is not IPv4
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Note: OpenFlow 1.0 does not mention IPv6, but some implemetation
of the switch (e.g. Open vSwitch) can deal with IPv6 header field
in some OpenFlow1.0 match/actions.
So this patch includes tester.py to test match/actions with IPv6.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec 1.0 does not define clearly the match value when the
corresponding wildcard flags are set, but OpenFlow 1.3.2 mandate
that masked value must be 0-bits in match.
This patch fixes wildcarded match value (dl_src) into 0-bits.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Python bundles dictConfig since 2.7. Try the bundled version first
as the version included in Ryu will not work with python3.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fix the leftover of previos types.*Type removal. Also, as python3
doesn't have long type, use six.integer_types instead.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, Ryu-Documentation page adopts 'haiku' for Sphinx
html_theme, but 'haiku' does not have page-index and no sidebar.
This patch changes Sphinx html_theme to 'sphinx_rtd_theme', which
outputs page-index for each page and a mobile-friendly sphinx
theme that was made for readthedocs.org.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Because too broad exception handling obscures errors while testing,
it makes difficult to detect the bugs in tester.py or the test
pattern files.
This patch removes an except statement and avoid this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In accordance with the upgrade of the ofputil in OVS libraries,
this patch fixes to use struct eth_addr.
FYI: The appropriate commit on OVS GitHub
74ff3298c8
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To support query whether a match instance contains a specific field,
This patch adds __contains__ method into OFPMatch.
Example:
>>> if 'nw_src' in match:
... print match['nw_src']
...
'192.168.0.1'
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
If all field is specified, wildcards field should be lower than
(NW_DST_WILDCARD << 14 | NW_SRC_WILDCARD << 8), but the given
value of this test case is larger than this value.
So some test cases which check the wildcards field raise errors.
This patch fixes the wildcards parameter to the possible value.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In OF1.0, OFPMatch is required to specify MAC address as a binary
type value and to specify IPv4 Address as an int type value.
This behavior is differ from that in OF1.2+.
This patch makes OFPMatch in OF1.0 enable to support human readable
representation of MAC/IPv4 address like OF1.2+ API.
The current API in OF1.0:
>>> match = parser.OFPMatch(dl_src=b'\x01\x02\x03\x04\x05\x06',
... nw_src=167772163)
>>> match.dl_src
'\x01\x02\x03\x04\x05\x06'
>>> match.nw_src
167772163
The introduced API (the same as OF1.2+ API):
>>> match = parser.OFPMatch(dl_dst='aa:bb:cc:dd:ee:ff',
... nw_dst='192.168.0.1')
>>> match['dl_dst']
'aa:bb:cc:dd:ee:ff'
>>> match['nw_dst']
'192.168.0.1'
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Open vSwitch, which installed with the kernel module, has a cache in
the kernel for the flow table and the cached flow entries have a
hard timeout of 5 seconds.
tester.py attempts to confirm its flow modifications with a barrier
request, but Open vSwitch sends a barrier reply back regardless of
the the state of the cached entries in the kernel module.
So in some cases, Open vSwtich needs the interval between each test
case.
This patch adds an option for setting interval for the workaround.
Note: With a zero seconds interval, the whole test suite runs in
20-30 minutes, but with a 10 seconds interval between each test,
the entire suite takes 3-4 hours.
Reported-by: Alan Deikman <alan.deikman@znyx.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OFPT_REQUESTFORWARD is defined as Asynchronous Message which sent
from OF-Switch to Controller, but currently, OFPRequestForward class
does not have parser() method.
This patch adds parser() method into OFPRequestForward class and
OFPGroupMod/OFPMeterMod classes which forwarded by OFPRequestForward
message.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The representation of oxm_type/oxs_type is an int type value if
OXM/OXS in OpenFlowBasic class, but a tuple type value if in
Experimenter class.
So, Python3 may fail to sort a list of OXM/OXS fields by using
oxm_type/oxs_type.
This patch adds 'key' parameter into sort() method and enables to
sort a list which contains both OpenFlowBasic and Experimenter.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Because Travis-CI has a limit of the log file to 4MB, this patch
suppress the output of unit tests by setting NOSE_VERBOSE in tox.ini.
tox.ini does not effect when running run_tests.sh locally,
so please run run_tests.sh, if the full log messages are needed.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Because the Nicira Experimenter OXMs are independent of the OpenFlow
version, this patch separates the NX OXMs definitions into nx_match.py
and enable to use the NX OXM in all OpenFlow 1.2+.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OFPMatchField and its subclasses are parser classes for old API of
OFPMatch, but in OF1.4+, OFPMatch drops old API supports.
This patch removes these unused classes from ofproto_v1_[45]_parser.py
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The documentation for `OFPActionSetField()` contains the
following example:
set_field = OFPActionSetField(eth_src="00:00:00:00:00")
However, this MAC address lacks one byte. Thus add it.
Currently, ofproto_v1_0_parser does not support query with a match
field name like ofproto_v1_[2345]_parser support.
This patch adds __getitem__ method in order to get the match value
witch a match field name.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This reverts commit 9414322f307fe607f7fefb8611871bbf810b5ee4,
as the workaround for readthedocs seems to be no longer necessary.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
_is_edge_port(port) in switches.py will return `False` if the port belongs to link.
Signed-off-by: Chia-Lin Cho <fox91119@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow 1.5.1 adds new error OFPBAC_BAD_METER for bad meter in
flow-mod (EXT-530).
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, the error message event log which is output by ofp_handler.py
is difficult to understand what is wrong in the previous OpenFlow request
message.
This patch improves the readability of this output to find out errors.
*** Output Example ***
EventOFPErrorMsg received.
version=0x4, msg_type=0x1, msg_len=0x4c, xid=0xecc7f07b
`-- msg_type: OFPT_ERROR(1)
OFPErrorMsg(type=0x4, code=0x9, data=b'\x04\x0e\x00\x58\xec\xc7\xf0\x7b\x00\x0
0\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x2b\x67\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x0
0\x01\x00\x0c\x80\x00\x18\x04\xc0\xa8\x00\x01\x00\x00\x00\x00')
|-- type: OFPET_BAD_MATCH(4)
|-- code: OFPBMC_BAD_PREREQ(9)
`-- data: version=0x4, msg_type=0xe, msg_len=0x58, xid=0xecc7f07b
`-- msg_type: OFPT_FLOW_MOD(14)
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Because repr() is not enough to escape ascii code or control code,
MsgBase.__str__() may collapse representation with binary data.
This patch add binary_str() in order to convert binary data into a
sequence of '\x00' style string.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch simplifies hex_array() and unifies its output into
'0x%02x' format.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
TODO: Because Open vSwitch (lib/ofp-util) does not support Egress
Tables [EXT-306] yet, re-generate the packet data by using
packet_data_generator2 when Open vSwitch supports it.
Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, ofctl_v1_[23].py always converts metadata field into str
type for display, but does not convert pbb_isid and tunnel_id fields
even if these fields are masked.
So ofctl_v1_3.py fails to convert masked pbb_isid and tunnel_id fields.
This patch fixes to convert masked match field into str type and not
to convert non-masked field.
These changes will improve maintainability when ofctl_v1_*.py will
support new match fields.
Reported-by: Weijie Liu <wliu43@illinois.edu>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds explicit integer conversions to the IGMP timer
fields. This is necessary because Python 3's pack(...) does not
automatically coerce floating-point values to integers (Python 3
actually throws a struct.error on struct.pack('B', 1.0)).
This fixes IgmpQuerier._send_query and IgmpSnooper._do_query under
Python 3, and possibly other functions that pass/assign floats to the
`maxresp' attribute.
Signed-off-by: Fadi Moukayed <smfadi@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds a table of contents into the ofctl_rest API
reference in order to improve its readability.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
If the path has a next hop value set, it should be used in the BGP
Update message first. This changes to logic to use the check for the
next hop in the order prefix/path->peer config->speaker config. This
will allow for sending the nexthop as part of the add_prefix message and
allow for overiding the nexthop of the peer if one is set.
Based-on: Alan Quillin <alanquillin@gmail.com>
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Host could be added into edge port if host packet arrived before lldp
packet.
Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, snort_integrate page is not included into toctree,
and it is difficult for user to find this page.
This patch adds snort_integrate page into toctree,
and removes warnings when building this page.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch is the implementation for the following TODO.
- # TODO: add ofp_queue_prop_experimenter
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch backports OFPTableFeatureProp class from
ofproto_v1_[45]_parser.py.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch fixes to parse experimenter_data of ofp_*_prop_experimenter
as a list of uint32_t values at OFPPropCommonExperimenter4ByteData.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The backport from ofproto_v1_5_parser: This patch moves get_rest()
and serialize() from OFPTableFeatureProp to OFPPropBase in order
to share it with other subclass.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
TODO: Because Open vSwitch (lib/ofp-util) does not support OF1.5
packet_out structure [EXT-427] yet, re-generate the packet data by
using packet_data_generator2 when Open vSwitch supports it.
Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow 1.5 supports setting all pipeline field of the packet
in the Packet-Out message.
This patch adds match field in packet_out message and moves the
in_port field into the match field.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
TODO: Because Open vSwitch (lib/ofp-util) does not support
controller connection status messages [EXT-454] yet,
re-generate the packet data by using packet_data_generator2
when Open vSwitch supports it.
Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec 1.5 introduces controller status multipart messages
to query status of controller connections.
This patch adds controller status multipart messages support.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec 1.5 introduces controller status message to inform
controller of changes in connection status.
This patch adds controller status message support.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec 1.5 introduces short_id to identify controller
themselves and enables ofp_role_request to set short_id.
This patch adds short_id field into OFPRoleRequest message.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This event is generated when a new host is added to a switch.
Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet_data_generator3 works as a UNIX domain socket server and
executes ovs-ofctl to collect flow_mod packets.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Be able to specify xid in packet.json files, as data generated by
packet_data_generator3 have non-zero xid. Also, give some detail
on data mismatch in order to ease debugging.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
It was missing in the previous commit.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The existing Makefile seems to suppose the BSD environment.
This patch renames existing Makefile into "Makefile.BSD" and
adds "Makefile.GNU" for GNU environment.
Usage Example:
- For BSD environment
$ make -f Makefile.BSD
- For GNU environment
$ make -f Makefile.GNU
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec 1.5 introduces bundle features request/reply messages
to query a switch about its bundle capabilities.
This patch adds bundle features request/reply messages support.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec 1.5 introduces a new ofp_table_features structures
in accordance with table feature request commands for simpler table
features updates.
This patch fixes OFPTableFeaturesStats class to support the new
structure of ofp_table_features.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
TODO: Because Open vSwitch (lib/ofp-util) does not support time
scheduled bundles [EXT-340] yet, re-generate the packet data by
using packet_data_generator2 when Open vSwitch supports it.
Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
TODO: Because Open vSwitch (lib/ofp-util) does not support Egress
Tables [EXT-306] yet, re-generate the packet data by using
packet_data_generator2 when Open vSwitch supports it.
Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec 1.5 introduces bundle features properties to indicate
the bundle-related features that are supported by the switch.
This patch adds bundle features properties support.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Re-generate the packet data by using packet_data_generator2.
(This patch is to complete the TODO of b7b8e2fca3 )
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Re-generate the packet data by using packet_data_generator2.
(This patch is to complete the TODO of d0733220f3 )
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
TODO: Because Open vSwitch (lib/ofp-util) does not support
Extensible Flow Entry Statistics [EXT-334] yet, re-generate
the packet data by using packet_data_generator2 when
Open vSwitch supports it.
Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec 1.5 introduces OXS into flow statistics multipart
and flow aggregate multipart.
This patch fixes these multipart to use OXS.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To support Python3, buffer() type need to be replaced with
six.binary_type().
Note: ofproto_v1_[0234]_parser was done in previous commits.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
TODO: Because Open vSwitch (lib/ofp-util) does not support OF1.5
group_desc structure [EXT-350] yet, re-generate the packet data by
using packet_data_generator2 when Open vSwitch supports it.
Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec 1.5 adds properties field which is a list of group
properties.
This patch adds properties field support in group description
multipart reply message.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec 1.5 adds bucket_id and properties fields.
And also introduces command_bucket_id field which indicates
Bucket Id used as part of the new commands, OFPGC_INSERT_BUCKET
and OFPGC_REMOVE_BUCKET.
This patch adds these fields support and fixes the example of
usage according to this changes.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec 1.5 introduces group bucket properties to extend
group buckets and redefine bucket fields weight, watch_port and
watch_group as group bucket properties.
This patch adds group bucket properties support and restructures
bucket fields.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
TODO:Open vSwtich (lib/ofp-util) support OF1.5 port_desc_request, but it has a bug[1].
So, re-generate the packet data by using packet_data_generator2 when Open vSwitch fix the bug.
ref: 1) http://openvswitch.org/pipermail/discuss/2015-July/018253.html
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
TODO:Open vSwtich (lib/ofp-util) support OF1.5 group_desc_request, but it has a bug[1].
So, re-generate the packet data by using packet_data_generator2 when Open vSwitch fix the bug.
ref: 1) http://openvswitch.org/pipermail/discuss/2015-July/018253.html
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
TODO: Because Open vSwitch (lib/ofp-util) does not support queue_desc request,
re-generate the packet data by using packet_data_generator2 when Open vSwitch supports it.
Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
iteritems() was renamed as items() to support Python3.
In accordance with this change, this patch adds items() into
OFPMatch/OFPStats class for convenience.
Reported-by: Ed Kiefer <ehk8@cornell.edu>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Allows listening on a socket for OVSDB clients, reacting to their events
and modifying their database.
Co-Authored-By: Chris Hansen <chris.hansen.career@gmail.com>
Co-Authored-By: Ravi Kamachi <ravi.kamachi@rackspace.com>
Signed-off-by: Jason Kölker <jason@koelker.net>
Signed-off-by: Chris Hansen <chris.hansen.career@gmail.com>
Signed-off-by: Ravi Kamachi <ravi.kamachi@rackspace.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In accordance with the upgrade of ofputil_packet_in structure
in OVS libraries, this patch fixes the usage of struct
ofputil_packet_in when initializing the flow metadata field.
FYI: The appropriate commit on OVS GitHub
50dcbd8ed4
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
There is no port information in output string of ENQUEUE in ofctl_v1_0.py
This patch fixes this problem.
Execution example is as follows.
curl -X GET http://localhost:8080/stats/flow/1
{
"1": [
{
"actions": [
"ENQUEUE:2:3" # ENQUEUE:<port>:<queue_id>
],
"byte_count": 0,
"cookie": 0,
"duration_nsec": 864000000,
"duration_sec": 107,
"hard_timeout": 0,
"idle_timeout": 0,
"match": {
"in_port": 5
},
"packet_count": 0,
"priority": 32768,
"table_id": 0
}
]
}
Reported-by: Weijie Liu <wliu43@illinois.edu>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec 1.5 mandates that Experimenter OXMs encode the
experimenter type in the oxm_field field of the OXM header
(EXT-380).
Assumption: This can be applied for OXSs too.
This patch initializes exp_type value of _Experimenter class
with oxm_field/oxs_field value.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This class is parser class for OFPPDPT_RECIRCULATE type
in Port Description Properties.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This class is parser class for OFPPDPT_PIPELINE_INPUT and
OFPPDPT_PIPELINE_OUTPUT type in Port Description Properties.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch moves get_rest() and serialize() from OFPTableFeatureProp
to OFPPropBase in order to share it with other subclass.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch sorts out the inheritance relation of properties field class.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To reflect the name of struct ofp_port_desc_prop_* in OpenFlow Spec 1.4/1.5,
this patch renames "OFPPortProp" to "OFPPortDescProp".
e.g.) in OpenFlow Spec 1.4
struct ofp_port_desc_prop_header {
uint16_t type; /* One of OFPPDPT_*. */
uint16_t length; /* Length in bytes of this property. */
};
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Sepc 1.5 allows wildcard to be used in set-field
action (EXT-314).
This patch enables setting mask in set-field action.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec 1.5 introduces Copy-Field action which allows to copy
the value from one header or pipeline field into another header or
pipeline field (EXT-320).
This patch add Copy-Field action support.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow Spec 1.5 introduces new instruction OFPIT_STAT_TRIGGER
to define a set of statistics thresholds using OXS (EXT-335).
This patch adds OFPIT_STAT_TRIGGER instruction support.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds the ability to match and set registers 1-7
in openflow.
Verified to work with OVS 2.3.1
Signed-off-by: Gal Sagie <gal.sagie@huawei.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
They are bugs found during python3 compatibility work.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In python2, binary_type + bytearray gives bytearray, but it gives
binary_type in python3. Make sure the result is bytearray in both
cases. Also, remove some redundunt str()s rather than converting
them to six.binary_type.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Use next(i) instead of i.next() for iteration, which works both
in python2 and 3.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
checksum() was modifying argument when it is bytearray. Make sure
checksum() doesn't modify its argument.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Some packet data are ascii type. Use {encode,decode} to make
python3's struct.pack happy.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
AsciiStringType data are mostly IP addresses and they must be
text_type in python3 for text_to_bin to work.
Also introduce AsciiStringListType, which is suitable for lists of
IP addresses.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
These are several kinds of python3 compatibility idioms.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
While msgpack has default binary-unicode conversion, the feature is
somehow disabled in ryu. As the other parts of ryu requires binary_type
data where they directly appear on-wire, simply follow the policy.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
These "user" test data are similar to ones that are initialized from
JSON. So it makes more sense to define them as str not binary_type.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This partially reverts 227b8fd984fc2fa5a37b4d8ae5d64dbd8166cc18.
These tests are testing __str__ method and shouldn't have been changed.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This unittest was not run from a certain time.
This patch fixes this problem.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
b64encode is mainly used to encode binary data into JSON. As binary_type
isn't JSON serializable in python3, it makes more sense to convert to
binary_type early. Also, allow text_type to be base64 encoded.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Some test data look like human readable strings, but the data that
directly appear on-wire should be defined as binary_type from first place.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Use b'str' instead of 'str' where binary data is expected.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
map() has been changed to return an iterator in python3. Iterators aren't
JSON serializable, and can be used only once for for loops.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
- Method in Python3 is obtained as a mere function from class attributes
Signed-off-by: Satoshi KOBAYASHI <satoshi-k@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In python3, b'abc'[0] isn't a string but a int value and ord() should not
be used.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The last release of xml_compare is 7 years ago and doesn't support python3.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Usage of types.MethodType has changed and means a bound method in python3.
This is probably the reason why self must be passed explicitly in python3.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
python3 doesn't have buffer(). They are mostly needed by the fact that
python2.6's unpack doesn't take bytearray. Replace them with
six.binary_type or remove them where not needed.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This is the partial patch to supporting python 3.
unicode was removed in python 3. So we use six.text_type instead of unicode.
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fix issues introduced in commit c3c2112cb16a60271f4eb595f82721b1f1adc633,
reported by Satoshi KOBAYASHI on ryu-devel.
Use six.moves to handle module name changes.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch is generated by "2to3 -f dict" and irrevant parts were
hand-removed.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
With this change, you can run "tox -e py34" to test python3 compatibility.
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds OPFStats class which has simpler API with OFPMatch class.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds OXS class parser for Extensible Flow Entry
Statistics in OpenFlow Spec 1.5.
And this implementation introduces oxx_fields.py to share
the logic functions with oxm_fields.py.
note: This pacth has no implementation for specific OXS
Experimenter classes as oxm_fields.py has.
(eg. ONF Experimenter, Nicira Experimenter)
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofctl_rest caused an exception when run delete_flow_entry command in OpenFlow1.0.
this patch fixes this problem.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This is a workaround oslo.config related failures on readthedocs.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
A motivation of this change is UTs comparing on-wire binaries;
some of NX actions (eg. learn) includes OXM/NXMs fields and
Open vSwitch prefers legacy NXMs over OXMs when encoding them.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
A motivation of this change is UTs comparing on-wire binaries;
some of NX actions (eg. learn) includes OXM/NXMs fields and
Open vSwitch prefers legacy NXMs over OXMs when encoding them.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
oslo packages got away from namespaces while ago.
Update ryu to use the new namespace-less import path.
Bump oslo.config requirement version accordingly.
Reference:
https://blueprints.launchpad.net/oslo-incubator/+spec/drop-namespace-packages
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This "raise" makes the following code to fall back to non-color
unreachable. While this has been so since the initial version,
recently it started biting us on travis-ci.
(I haven't investigated why. It might or might not be related to
recently released tox 2.0's "ENV isolation".)
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
UserWarning is always shown when ryu.controller.dpset.DPset is loaded. It is noisy.
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
I haven't investigated since when it has been broken.
The versions of unittest and nose might be relevant.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Avoid the automatic modification of sys.path because it hurts
ryu-as-a-library use cases.
An example is the recent versions of neutron OVS-agent,
which optionally imports OVS python bindings, and ends up to
use a wrong copy in ryu.contrib.ovs.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Revert recent py3 changes under ryu/contrib,
namely parts of the following commits:
- commit e2dfdbf5800742ce7b3af6cf6bffb7a95b73198c
("Treatment was not enough") and
- commit 325c9ae9c345d4bb043ae81efb748b19adc9dd91
("Syntax level compatibility with Python 3")
Because:
- Some of them are broken (stream.py)
- Changes like these should go to upstream
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Necessary for neutron functional tests so that a test won't
interfere the next test in a run.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Some of ofputil_encode_xxx functions does not fill in
the correct value for the length field in the ofp header.
Fix it up before writing out the message to a file.
NOTE: For Open vSwitch, ofconn_send() fixes it up before
sending out the message to the peer.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Datapath#ports is kept for compatibility with the previous openflow versions (< 1.3). Datapath#ports is not updated when received EventOFPPortStatus. This behavior may confuse users. Wherefore, showing warning message when the user accesses to Datapath#ports with the currently openflow versions (>= 1.3) is friendly.
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
We use syntaxes which can be used only in Python2 at many locations. But we should reduce the use of the syntaxes. This patch serves syntax level compatibility with Python3. However, for full compatibility is required still a lot of work because many API changes are made between 2 to 3.
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, ofctl_v1_[23].py adds non-existing match fields
when getting unknown match fields, then parser returns KeyError.
This patch fixes ofctl_v1_[23].py to ignore unkown match fields and
output error messages.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This reverts commit 8fc25ca6c8c3f4510980b14db2604e62af043a2d.
The workaround is no longer necessary because the relevant fix
in devstack [1] has been merged.
[1] https://review.openstack.org/#/c/165709/
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This partially reverts commit bf58a6dcf3dcf6241fc1c9e58f3e43d2aa9ea7f2.
devstack (stable/juno) fails to process comments in this file.
While a fix for devstack has been proposed [1], it might take some time
to be merged. I guess it's best to fix it in ryu, at least for a while.
[1] https://review.openstack.org/#/c/165709/
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fix some typos in the code.
This fixes a crash reported on ryu-devel@.
http://sourceforge.net/p/ryu/mailman/message/33607025/
Reported-by: Jason Syu <newdongfong@gmail.com>
Tested-by: Jason Syu <newdongfong@gmail.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
% ryu-manager bmpstation.py --verbose
loading app bmpstation.py
instantiating app bmpstation.py of BMPStation
BRICK bmpstation
listening on 0.0.0.0:11019
Traceback (most recent call last):
File "/usr/lib/python2.7/logging/__init__.py", line 851, in emit
msg = self.format(record)
File "/usr/lib/python2.7/logging/__init__.py", line 724, in format
return fmt.format(record)
File "/usr/lib/python2.7/logging/__init__.py", line 464, in format
record.message = record.getMessage()
File "/usr/lib/python2.7/logging/__init__.py", line 328, in getMessage
msg = msg % self.args
TypeError: not enough arguments for format string
Logged from file bmpstation.py, line 51
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In OpenFlow Spec 1.3.4, ipv6_exthdr is maskable match field,
but ofctl_v1_3 does not support mask.
This patch makes ofctl_v1_3 enable to set masked ipv6_exthdr.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Move some non pure python requirements (namely lxml and paramiko)
from pip-requires to test-requires. Document it in README.rst.
Motivations:
- Make this pip-installable with pypy
- Less distribution package requirements (deb/rpm/etc) in case
a user do not actually need the functionality
Note: while paramiko itself is pure python, it requires pycrypto.
Note: msgpack has pure python fallback implementation.
Separating ryu into smaller packages would be a better alternative.
However, it would involve a lot more work than this workaround.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Ryu-plugin is obsolete and has been removed in the development version
of OpenStack/Networking.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Deferred formatting to the logging system:
---------------------------------------------
In general
logger.debug('xxx %s yyy %d zzz' % (a, b, c))
can be written as:
logger.debug('xxx %s yyy %d %zzz', a, b, c)
This is faster, as Python logging doesn't bother doing the format
operation (which is slow) if the log message won't be logged.
We measured that a significant amount of CPU time in the BGP service
was attributable to these formatting operations.
Removed unneeded calls to str() and repr()
------------------------------------------
since formatting operations %s and %r will make these calls when
(and if) the formatting is performed.
Signed-off-by: Jerry Cen <zhiweic@google.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Because Ryu is based on Eventlet, GreenSocket is used by default and
blocking flags is disabled. So MSG_WAITALL flag is not available.
This patch removes MSG_WAITALL flag, and fixes snortlib.py to check
received buffer size in _recv_loop_nw_sock().
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This might be necessary for future vesions of Neutron OVS agent.
1. The agent parses options, including command line options, using
oslo.config.cfg.CONF ConfigOpt instance.
2. Depending on options, it might lazily import ryu modules.
3. The ryu modules might have import-time register_cli_opts calls
against ryu.cfg.CONF.
3. As ryu.cfg.CONF is same as oslo.config.cfg.CONF, oslo.config
raises an exception, complaining register_cli_opts is used after
parsing command line options.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
A motivation of this change is a better modularity.
I.e. Make packet lib independent from ofproto.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Disable pep8 "W503 line break before binary operator" warning for now.
The check was recently introduced by pep8 1.6.2.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
BGPPathAttributeNextHop and BGPPathAttributeMpReachNLRI is already in
new_pathattr. so stop construct and append it to new_pathattr list.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
A motivation of this change is a better modularity.
I.e. Make packet lib independent from ofproto.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Invalid error code OFPQCFC_EPERM should be OFPSCFC_EPERM instead.
This is EXT-208 that was included in Openflow v1.3.1.
OFPSCFC_EPERM is backported to ofproto_v1_2 so that any new or updated
application could consistently use OFPSCFC_EPERM to handle all protocol
versions.
OFPQCFC_EPERM is left in ofproto_v1_2 and ofproto_v1_3 definitions for
backward compatibility.
Signed-off-by: Shu Shen <shu.shen@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Work done:
- The baseline is copied over from ofproto_v1_4.py and
ofproto_v1_4_parser.py and into ofproto_v1_5.py and
ofproto_v1_5_parser.py respectively.
- Most of structs, enums, and pack strings in ofproto_v1_5.py has been
updated to spec. Exception is oxs_fields has not been done yet.
- ofproto_v1_5_parser.py has not been updated except those necessary to
allow run_tests.sh to complete successfully
- ofproto_protocol.py imports ofproto_v1_5 and ofproto_v1_5_parser now
- oxm_fields.py is updated for OFPXMC_PACKET_REGS
- Tests are updated to include Openflow v1.5 when it's obvious. But not
much work has been done to acutally test v1.5 yet. I also found tests
for v1.4 are scarce.
TODO:
- Add oxs_fields support. It shall be similar to oxm_fields
- Update and implement ofproto_v1_5_parser.py
- More tests, tests, tests.
Signed-off-by: Shu Shen <shu.shen@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
You can understand adj-RIB-in information through new api.
- received-routes : paths received and not withdrawn by given peer
- sent-routes : paths sent and not withdrawn to given peer
(sample log of show neighbor)
INFO:bgpspeaker.api.base:API method operator.show called with args: {'params': ['neighbor', 'received-routes', '192.168.101.101', 'all'], 'format': 'cli'}
Status codes: x filtered
Origin codes: i - IGP, e - EGP, ? - incomplete
Timestamp Network Labels Next Hop Metric LocPrf Path
2015/02/06 06:52:04 192.168.1.0/30 None 192.168.101.101 100 None [65010] i
2015/02/06 06:52:04 192.168.2.0/30 None 192.168.101.101 100 None [65010] i
2015/02/06 06:52:04 0.0.0.0/0 None 192.168.101.101 100 None [65010, 65001] i
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When a single peer is specified for BGPSpeaker the server value was not
being set upon return.
Signed-off-by: Alan Quillin <alanquillin@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The field of "Path" has not displayed in properly as bellow.
It looks the raw data of Origin code has displayed instead.
bgpd> show neighbor received-routes 192.168.101.101 all
Status codes: x filtered
Origin codes: i - IGP, e - EGP, ? - incomplete
Timestamp Network Labels Next Hop Metric LocPrf Path
2015/02/05 07:39:05 192.168.1.0/30 None 192.168.101.101 100 None [65010] 2
2015/02/05 07:39:05 192.168.2.0/30 None 192.168.101.101 100 None [65010] 2
2015/02/05 07:39:05 0.0.0.0/0 None 192.168.101.101 100 None [65010, 65001] 2
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Eventlet's monkey patch overwrite Python standard threading library by default. It affects to Python debugger working. This will be often an issue for the user of Python debugger. Therefore, it's necessary to add the option which doesn't overwrite Python standard threading library.
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Current implementation of bmp client uses Peer._construct_update()
which modifies original BGPUpdate message for sending to peers.
This function is not appropriate to use for bmp client, because
bmp client must send a BGPUpdate message which contains unmodified path
attributes. Fix this by introducing BMPClient._construct_update().
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Add parsing libpcap and reading/writing PCAP file for debugging.
Now you can easily dump the PCAP file in ryu controller.
Here is the quick example for dumping the data packets:
from ryu.lib import pcaplib
class SimpleSwitch13(app_manager.RyuApp):
OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
def __init__(self, *args, **kwargs):
super(SimpleSwitch13, self).__init__(*args, **kwargs)
self.mac_to_port = {}
# Creating an instance with a PCAP filename
self.pcap_pen = Writer(open('mypcap.pcap', 'wb'))
@set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER)
def _packet_in_handler(self, ev):
msg = ev.msg
# Dump the data packet into PCAP file
self.pcap_pen.write_pkt(msg.data)
Signed-off-by: Che-Wei Lin <linton.tw@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Having class attributes and instance attributes of the same name
confuses StringifyMixin.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Will be used for NX learn implementation.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Will be used for NX learn implementation.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Also, improve experimenter action related code so that
it can handle unknown actions as unknown.
Only OpenFlow 1.3 for now because this is planned to be used
for Neutron OVS agent and 1.3 is the version to be used there.
(https://blueprints.launchpad.net/neutron/+spec/ovs-ofctl-to-python)
Following the style of oxm_fields, make an OpenFlow version independent
module generate OpenFlow version specific code so that it's easier to
add the functionality to other OpenFlow versions later.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
this patch makes ofctl_rest enable use of OFPAggregateStats message.
Get aggregate flow stats:
usage)
URI: /stats/aggregateflow/<dpid>
method: GET
e.g.)
$ curl -X GET http://localhost:8080/stats/aggregateflow/1
{
"1": [
{
"packet_count": 18,
"byte_count": 756,
"flow_count": 3
}
]
}
Get aggregate flow stats filtered by fields:
usage)
URI: /stats/aggregateflow/<dpid>
method: POST
the message body is as follows.
table_id Table ID (int)
out_port Require matching entries to include this as an output port (int)
out_group Require matching entries to include this as an output group (int)
cookie Require matching entries to contain this cookie value (int)
cookie_mask Mask used to restrict the cookie bits that must match (int)
match Fields to match (dict)
e.g.)
$ curl -X POST -d '{
"table_id": 0,
"out_port": 2,
"cookie": 1,
"cookie_mask": 1,
"match":{
"in_port":1
}
}' http://localhost:8080/stats/aggregateflow/1
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Following Open vSwitch, introduce "dp_hash" OXM for testing.
>From their commit log: (commit 508a933809f8a8ede4fb93f1c1e3212799efc16a)
> Testing experimenter OXM is tricky because I do not know of any in
> widespread use. Two ONF proposals use experimenter OXMs: EXT-256 and
> EXT-233. EXT-256 is not suitable to implement for testing because its use
> of experimenter OXM is wrong and will be changed. EXT-233 is not suitable
> to implement for testing because it requires adding a new field to struct
> flow and I am not yet convinced that that field and the feature that it
> supports is worth having in Open vSwitch. Thus, this commit assigns an
> experimenter OXM code point to an existing OVS field that is currently
> restricted from use by controllers, "dp_hash", and uses that for testing.
> Because controllers cannot use it, this leaves future versions of OVS free
> to drop the support for the experimenter OXM for this field without causing
> backward compatibility problems.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
These will be used for coming REG_MOVE support.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In case of selecting new best path, Ryu BGPSpeaker send withdraw messages.
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, clear flow entries command (/stats/flowentry/clear/<dpid>)
in ofctl_rest deletes flow entries from only table 0.
This patch fixes the command to delete flow entries from all tables.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, rest_qos is impossible to set the "priority" of QoS rule on a switch.
Also, "priority" is should be described in the same depth as "match" and "actions".
This patch fixes these problems.
Now, rest_qos is possible to set the "priority" with the following curl command.
e.g.)
$ curl -X POST -d '{"priority":"5",
"match": {"nw_dst": "10.0.0.1", "nw_proto": "UDP", "tp_dst": "5002"},
"actions":{"queue": "1"}}' http://localhost:8080/qos/rules/0000000000000001
Reported-by: Jace Liang <b436412@gmail.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To make it possible to refer the usage of vlan_vid match field
at Ryu-documentation, This patch adds notes into ofproto_v1_[234]_parser.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Ryu BGP sets self-BGP ID as Peer BGP ID in BMP Message.
Signed-off-by: Yuji Oshima <yuji.oshima0x3fd@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Currently, when VLAN ID match field is specified,
ofctl_v1_[23] is compatible with only match combination 1) of
the following three match combinations.
This patch makes it possible to set the all three combinations.
Match combinations for VLAN ID :
1) To match only packets with VLAN tag and VID equal value
2) To match only packets without a VLAN tag
3) To match only packets with a VLAN tag regardless of its value
In order to set the match combinations 2) or 3), please describe
"dl_vlan" field as hexadecimal string value like as follows.
Before applying this patch:
{"dl_vlan": 3 } # int
After applying this patch:
{"dl_vlan": 3 } # int (same as before applying)
{"dl_vlan": "0x0000"} # hexadecimal string without mask
{"dl_vlan": "0x1000/0x1000"} # hexadecimal string with mask
NOTE: When "dl_vlan" field is described as decimal int value,
OFPVID_PRESENT(0x1000) bit is automatically applied.
OTOH, OFPVID_PRESENT(0x1000) bit is NOT automatically applied
to hexadecimal string value.
For curl command examples, please refer to the following page in Ryu-documentation.
http://ryu.readthedocs.org/en/latest/app/ofctl_rest.html#example-of-vlan-id-match-field
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
I'm very sorry I didn't include rest_firewall.py and rest_qos.py in my patch.
I suggested for ofctl_rest.py only...
Here is the patch for rest_firewall.py and rest_qos.py.
---------------------------------------------------------------
Subject: [PATCH] fix security problem of some RESTful apps
It is not safe to use eval function because input data(request body) is not checked
For example, someone can send this data to remove all files in the directory
"import('os').system('rm -rf .')"
I suggest to use json.loads to parse the request body if the data is json format
or disable builtin functions like:
eval(req.body, {"__builtins__":None})
Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
RyuBGP doesn't work properly becase of handling wrong nexthop address.
Therefore, in spite of receiving BGP UPDATE Message in the peering router,
the router fails to learn a new route entry from RyuBGP in BGP table.
(Memo: this issue has not occurred in Vpnv4/mpBGP environment.)
(1) register route entry as prefix_add(prefix='x,x,x,x', next_hop='y.y.y.y')
static eBGP
------- R1 ------------ RyuBGP ---------> Router
x.x.x.x y.y.y.y z.z.z.z => Drop UPDATE(Nexthop: y.y.y.y)
(2) receiving BGP UPDATE Message from iBGP session
iBGP eBGP
------- R1 -----------> RyuBGP ---------> Router
x.x.x.x y.y.y.y z.z.z.z => Drop UPDATE(Nexthop: y.y.y.y)
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The parameter buf is an instance of bytearray, but Ryu tries to convert it as string,
and outputs the error messages as a result.
This patch fixes this problem.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
RyuBGP doesn't work well regarding the advertisement of BGP MED Attribute as follows.
(1) In spite of receiving BGP MED:"500" from iBGP(R2), RyuBGP can't advertise BGP MED:"100" to eBGP(R3).
R1 -------------> R2 -------------> RyuBGP -------------> R3
eBGP(MED:500) iBGP(MED:500) ^ eBGP(MED:500)
(MED:100)
(2) When RyuBGP has received BGP MED:"200" from eBGP(R3), RyuBGP has sended BGP with missing-MED to iBGP(R2).
As result, PolicyBaseRouting in R2(other RyuBGP) doesn't work properly becase of selecting wrong BestPath.
eBGP(MED:100)
R1 ------------------------------------>+
|
R3 -------------> RyuBGP -------------> R2(RyuBGP) => Wrong result [BestPath is "R3-R2"]
eBGP(MED:200) iBGP(MED:N/A)
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In ryu/app/ofctl_rest.py found some mistypes. Error gets when using
stats/groupdesc/<dpid> and /stats/groupfeatures/<dpid>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
It is not safe to use eval function because input data(request body)
is not checked For example, someone can send this data to remove all
files in the directory "import('os').system('rm -rf .')"
I suggest to use json.loads to parse the request body if the data is
json format or disable builtin functions like: eval(req.body,
{"__builtins__":None})
In this patch, ast.literal_eval() is used to evaluate REST body,
because ofctl_rest needs to be compatible with hexadecimal value
or ascii byte array (e.g. "\x00\x00\x00\x01" in Experimenter)
in order to keep usability.
Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
three connect modes are supported
CONNECT_MODE_ACTIVE: try to connect from us. don't listen
CONNECT_MODE_PASSIVE: just listen
CONNECT_MODE_BOTH: try both methods
dynamic change of connect modes is also supported
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
show neighbor sent-routes/received-routes commands used to show the
routes in local rib, but the right behavior is to show adjacency rib
in/out.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This avoids to send two packets (FlowMod & PacketOut).
OF v1.3.1 (the specification most switch vendors implemented) mentions
in A.3.4.1 on page 65 that this is a valid way to avoid two packets.
Signed-off-by: Benny Eggerstedt <benjamin.eggerstedt@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Added a logging when running in --verbose as truncated packets in packet_in
have caused some confusion and this would hopefully help others
Signed-off-by: Benjamin Eggerstedt <benjamin.eggerstedt@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
BGPSpeaker is aware of "best_path_change_handler" in MPLS-VPN topology.
This feature is available in calculating Best Path Selection of VPNv4/6 prefixes.
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The match_to_str() function in ryu/lib/ofctl_v1_0.py does not convert
nw_tos correctly. As a result, we cannot obtain nw_tos value of any
flow entry by invoking get_flow_stats()
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reported by Ian Y. Choi on ryu-devel.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Note: It wasn't clear to me which NXM stands for "Extensible" or
"Extended". I chose the latter because it's in the primary
specification. (nicira-ext.h)
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Also, run pep8 in a separate environment.
The way to specify python versions might seem awkward.
(Well, it seems so to me.)
But it follows one of examples referenced in the official
documentation:
http://docs.travis-ci.com/user/languages/python/https://github.com/twisted/klein/blob/master/.travis.yml
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
I'm not quite sure how it happens to work with the current
test environment. But the current coding doesn't work when
running via testr probably due to different PYTHONPATH.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To make this able to run via testr.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In generally, iBGP session is established between loopback interfaces.
Therefore, we need to specify loopback interface as neighbour_source_address.
This parameter is just like update-source command in cisco router.
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
send_stats_request never catches hub.Timeout exception because it
has been caught by the event wait function itself.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In openflow spec 1.2 and 1.3.4, in order to match only packets without a VLAN tag,
the value of OFPXMT_OFB_VLAN_VID must be set to OFPVID_NONE (0x0000).
Old API of ofproto_v1_2/3_parser is now enabled to setting the oxm_value to OFPVID_NONE(0x0000) as follows:
e.g.)
match = ofproto_v1_2_parser.OFPMatch()
match.set_vlan_vid_none()
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Support next_hop_self.
BGPSpeaker can replace a path's next_hop address with its own address
when it sends the path to iBGP peer.
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fix name of class member variables in OFPMeterFeaturesStats
to reflect OpenFlow Specification.
Accordingly, fix json pattern files for unit tests.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
I midified ryu.topology.js to dinamicaly add or remove switch
using WebSocket on Ryu Topology Viewer.
Signed-off-by: Yoshiharu Yamashita <dyson.yamashita@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
According to RFC 2545, both a global address and a link-local address
can be sent as a next_hop address in BGPUpdate message.
Since the link-local address is not needed in Ryu BGP,
Ryu BGP ignore it if the address family is IPv6 unicast.
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In of1.4 spec, enum name has been changed as follows:
of1.3.4 spec:
OFPR_NO_MATCH = 0, / * No matching flow (table-miss flow entry). * /
of1.4 spec:
OFPR_TABLE_MISS = 0, / * No matching flow (table-miss flow entry). * /
Along with this change, AttributeError has occurred in the process of comparison of the received message.
This patch fixes this problem.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In OF1.2 and OF1.3 Spec, the group type need not be specified
for the group delete request.
However, an error occurs at mod_group_entry in ofctl_v1_[23].py
without specifying group type to delete a group entry.
This patch adds default value to type field of OFPGroupMod
at mod_group_entry in order to reflect OpenFlow Specification.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fix Enum Names and Values in OpenFlow Header files Update no matching
name in packet-in reason as specified in OpenFlow 1.4 Update queeu
stats name in in multipart type as specified in OpenFlow 1.4 Add
additional constants as defined in OpenFlow 1.4
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
add local preference support in bgp. It is possible to apply local
preference to specific paths by using AttributeMap.
Unfortunately this patch supports only IPv4 path and I'm going to
start writing patches for other route families after this.
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
You can specify the port number in the options when sw test tool is started.
The example is as follows:
ryu-manager --test-switch-target_recv_port 4 (default:1)
--test-switch-target_send_port_1 5 (default:2)
--test-switch-target_send_port_2 6 (default:3)
--test-switch-tester_send_port 7 (default:1)
--test-switch-tester_recv_port_1 8 (default:2)
--test-switch-tester_recv_port_2 9 (default:3)
ryu/tests/switch/tester.py
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
following fields is not set at mod_flow_stats command:
* out_port, buffer_id
this patch fixes this problem.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When packet_in_filter discards a packet, it is always logging. However,
it may be felt noisy.
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Remove the wrong way to get IP and bind with it.
Binding with '0.0.0.0' and listen on all host.
Update and fix typos in the snort_integrate.rst document.
Fix the problem about pigrelay reconnect to ryu will not be accepted.
Pigrelay is a program running on Snort that receive Snort alert
from UNIX socket and send to Ryu via network socket.
Signed-off-by: Che-Wei Lin <linton.tw@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This is used along line 252 in peer_manager.py
Signed-off-by: Jerry Cen <zhiweic@google.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Differentiate BMP messages from different BMP clients, and modify the
debug logg ing message for client connected and disconnected.
Signed-off-by: Peng Xiao <xiaoquwl@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When SocketError occurs, an event may not be notified to an other client.
It is because rpc_clients is changed in the loop.
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Dict Comprehension is available in Python 2.7+ but Ryu should work
with Python2.6. Currently, It will become syntax error when we try to
operate BGP of Ryu on the platform of Python2.6.
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When there is a Snort alert message, Ryu will receive an event called EventAlert.
You can easily define the event handler in the method which using ‘set_ev_cls’
decorator with snortlib.EventAlert parameter.
The simple_switch_snort.py can install a flow that mirroring incoming packets to the snort's NIC
which correspond the OpenFlow switch on port 3 (by default).
There are two methods that sending alert message to Ryu.
1. Ryu and Snort are both on the same machine.
Ryu receives alert message via Unix Domain Socket.
2. Ryu and Snort are separate on different machines.
Ryu receives alert message via Network Socket.
More detail see doc/snort_integrate.rst
Signed-off-by: Che-Wei Lin <linton.tw@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
In case of locating some Ryu-BGPs in the same Topology for BGP/MPLS VPNs :
When same label has been assigned '100 (defalut label)' by each Ryu-BGP, it is difficult to analyze for trouble shooting of RIB for vpnv4 .
Therefore, each Ryu-BGPs should assign different label for vpnv4 prefix according to own label_range .
bgpd> show rib all
Status codes: * valid, > best
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Labels Next Hop Reason Metric LocPrf Path
Family: rtfilter
*> 65001:65010:101 None 0.0.0.0 Only Path ?
Family: vpnv6
Family: vpnv4
*> 65010:101:192.168.104.0/30 [100] 172.16.0.102 Only Path 65002 ?
*> 65010:101:192.168.201.0/24 [43] 192.168.100.101 Only Path 100 65010 65011 i
*> 65010:101:10.10.10.1/32 [38] 192.168.100.101 Only Path 100 65010 65011 ?
*> 65010:101:192.168.103.0/30 [100] 0.0.0.0 Only Path ?
*> 65010:101:192.168.101.0/30 [42] 192.168.100.101 Only Path 100 65010 ?
*> 65010:101:192.168.102.0/30 [40] 192.168.100.101 Only Path 100 65010 ?
*> 65010:101:10.10.10.2/32 [37] 192.168.100.101 Only Path 100 65010 65012 ?
*> 65010:101:192.168.202.0/24 [44] 192.168.100.101 Only Path 100 65010 65012 i
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
this patch enables ofctl_rest to get OFPFlowStats messages
filtered by the OFPFlowStatsRequest fields in OpenFlow specification.
usage)
URI: /stats/flow/<dpid>
method: POST
the message body is as follows:
table_id ID of table.
out_port Require matching entries to include this as an output port.
out_group Require matching entries to include this as an output group.
(Not supported in of1.0)
cookie Require matching entries to contain this cookie value.
(Not supported in of1.0)
cookie_mask Mask used to restrict the cookie bits that must match.
(Not supported in of1.0)
match Fields to match.
e.g.)
curl -X POST -d '{"table_id": 0,
"out_port": 2,
"cookie": 1,
"cookie_mask": 1,
"match":{"in_port":1}}'
http://localhost:8080/stats/flow/1
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
reduced duplicate codes and put together to a static function.
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
you can specify listening HOST and PORT by setting env variable
'RYU_BMP_SERVER_HOST' and 'RYU_BMP_SERVER_PORT'.
'RYU_BMP_OUTPUT_FILE' specifes the output file name
'RYU_BMP_FAILED_DUMP' specifes the file name of the error dump
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
reserved field must be 0. this patch add an assertion and
make reserved field invisible when stringified
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
the AddrPrefix which variable 'nlri' has is not limited to
_BinAddrPrefix. this patch enables to encode to/decode from json dict
with various AddrPrefix in 'nlri'.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
class variable '_class_suffixes' can be used for the same purpose as
'_class_prefixes' but match with the suffix of the class name.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
_IPAddrPrefix can be inherited by labeled addr prefix.
In that case, variable 'addr' is tuple and not string. so declare to
parse 'addr' in 'ascii' format in _IPAddrPrefix cause following error.
this patch fix this bug.
p = LabelledIPAddrPrefix(28, ([1], '192.168.0.0'))
p.to_jsondict()
Traceback (most recent call last):
File "./parse_labeled_addr_prefix.py", line 11, in <module>
p.to_jsondict()
File "/home/wataru/ryu/ryu/lib/stringify.py", line 210, in to_jsondict
dict_[k] = encode(k, v)
File "/home/wataru/ryu/ryu/lib/stringify.py", line 208, in <lambda>
encode = lambda k, x: self._encode_value(k, x, encode_string)
File "/home/wataru/ryu/ryu/lib/stringify.py", line 155, in
_encode_value
return cls._get_encoder(k, encode_string)(v)
File "/home/wataru/ryu/ryu/lib/stringify.py", line 56, in encode
return unicode(v, 'ascii')
TypeError: coercing to Unicode: need string or buffer, tuple found
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
SubmittingPatches.rst was renamed to CONTRIBUTING.rst.
setup.py sdist will check this dependency.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When Ryu BGP received 'RouteRefresh' Message from the peering router, BGP session has closed as follows .
DEBUG 2014-08-15 02:20:08,718 speaker 447 Received msg from ('192.168.100.100', '34939') << BGPRouteRefresh(afi=1,demarcation=1,len=23,safi=128,type=5)
DEBUG 2014-08-15 02:20:08,719 speaker 566 Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/speaker.py", line 560, in _recv_loop
self.data_received(next_bytes)
File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/speaker.py", line 275, in data_received
self._data_received(next_bytes)
File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/speaker.py", line 355, in _data_received
self._handle_msg(msg)
File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/speaker.py", line 508, in _handle_msg
self._peer.handle_msg(msg)
File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/peer.py", line 1585, in handle_msg
self._handle_route_refresh_msg(msg)
File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/peer.py", line 1619, in _handle_route_refresh_msg
afi = msg.route_family.afi
AttributeError: 'BGPRouteRefresh' object has no attribute 'route_family'
INFO 2014-08-15 02:20:08,722 peer 1901 Connection to peer 192.168.100.100 lost, reason: 'BGPRouteRefresh' object has no attribute 'route_family' Resetting retry connect loop: False
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
We might want a bgp speaker to talk with multiple bmp servers in the
future so I renamed these functions. Note that currently a speaker can
connect to only one bmp server.
I also update the example code on how to make the speaker to connect
to a bmp server.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
You can't pass ssh.py to run command any more. If you need ssh CLI,
update the bgp config file and then:
ryu run —-config-file /path/to/ryu.conf /path/to/ryu/ryu/services/protocols/application.py
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
implemented draft-ietf-idr-ix-bgp-route-server-05 partially.
you can enable this function like below
> speaker = BGPSpeaker(as_number=64512, router_id='10.10.0.1')
> speaker.neighbor_add('10.0.0.1', 64514, is_route_server_client=True)
> speaker.neighbor_add('10.10.0.2', 64513, is_route_server_client=True)
add multiple rib function is a future work
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The field of 'Labels' has not displayed in properly because of extracting 'label_list' in python slicing tuples.
INFO:bgpspeaker.api.base:API method operator.show called with args: {'params': ['rib', 'all'], 'format': 'cli'}
Status codes: * valid, > best
Network Labels Next Hop Reason Metric LocPrf Path/Origin
Family: rtfilter
*> 64512:64511:101 None 0.0.0.0 Only Path 2
Family: vpnv6
Family: vpnv4
*> 64511:101:10.10.0.1/32 ([17],) 192.168.100.100 Only Path 0 64511 2
*> 64511:101:10.20.2.0/24 ([100],) 0.0.0.0 Only Path 2
*> 64511:101:10.20.1.0/24 ([100],) 0.0.0.0 Only Path 2
*> 64511:101:10.20.3.0/24 ([100],) 0.0.0.0 Only Path 2
Family: ipv4
Family: ipv6
Reported-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The field of 'Path(Origin)' has not displayed in properly ,because Origin codes '2 (incomplete)' is not defined in the latest code .
Therfore, I've patched the codes for formatting as follows .
INFO:bgpspeaker.api.base:API method operator.show called with args: {'params': ['rib', 'all'], 'format': 'cli'}
Status codes: * valid, > best
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Labels Next Hop Reason Metric LocPrf Path
Family: rtfilter
*> 64512:64511:101 None 0.0.0.0 Only Path ?
Family: vpnv6
Family: vpnv4
*> 64511:101:10.10.0.1/32 [17] 192.168.100.100 Only Path 0 64511 ?
*> 64511:101:10.20.2.0/24 [100] 0.0.0.0 Only Path ?
*> 64511:101:10.20.1.0/24 [100] 0.0.0.0 Only Path ?
*> 64511:101:10.20.3.0/24 [100] 0.0.0.0 Only Path ?
Family: ipv4
Family: ipv6
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
But the result looks unexpected regarding of show_command .
I can’t find the advertised labels or assigned labels for vpnv4 prefix .
(reference: http://sourceforge.net/p/ryu/mailman/message/32686423/ )
Therfore, I've patched the codes for formatting as follows .
=> needs for fixing labels attribute after that .
INFO:bgpspeaker.api.base:API method operator.show called with args: {'params': ['rib', 'all'], 'format': 'cli'}
Status codes: * valid, > best
Network Labels Next Hop Reason Metric LocPrf Path/Origin
Family: rtfilter
*> 64512:64511:101 None 0.0.0.0 Only Path 2
Family: vpnv6
Family: vpnv4
*> 64511:101:10.10.0.1/32 ([17],) 192.168.100.100 Only Path 0 64511 2
*> 64511:101:10.20.2.0/24 ([100],) 0.0.0.0 Only Path 2
*> 64511:101:10.20.1.0/24 ([100],) 0.0.0.0 Only Path 2
*> 64511:101:10.20.3.0/24 ([100],) 0.0.0.0 Only Path 2
Family: ipv4
Family: ipv6
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
BMP Peer Down Notification packet must have a per-peer header.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
this parameter will support to display like cli as follows.
Status codes: * valid, > best
Network Next Hop Reason Metric LocPrf Path
VPN: ('64511:101', 'ipv4')
*> 10.20.2.0/24 0.0.0.0 Only Path 2
*> 10.20.1.0/24 0.0.0.0 Only Path 2
*> 10.20.3.0/24 0.0.0.0 Only Path 2
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
this parameter will support to display like cli as follows.
Status codes: * valid, > best
Network Next Hop Reason Metric LocPrf Path
*> 10.20.2.0/24 0.0.0.0 Only Path i
*> 10.20.3.0/24 0.0.0.0 Only Path i
*> 10.20.1.0/24 0.0.0.0 Only Path i
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofctl_rest is now enable to modify and delete with strict matching.
usage)
URI: /stats/flowentry/modify_strict
/stats/flowentry/delete_strict
method: POST
e.g. )
curl -X POST -d '{"dpid": 1,
"actions":[{"port":3, "type":"OUTPUT"}],
"match":{"in_port":2}}'
http://localhost:8080/stats/flowentry/modify_strict
curl -X POST -d '{"dpid": 1,
"match":{"in_port":2}}'
http://localhost:8080/stats/flowentry/delete_strict
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The third is fix to a conflict of PEER_NEXT_HOP value in neighbors.py.
There is a conflict between PEER_NEXT_HOP in neighbors.py and NEXT_HOP in api/base.py.
As a result of the conflict, the correct validator for PEER_NEXT_HOP is not used when
neighbir_add is executed.
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The second is patch to add or skip RD 0:0 label for the next_hop address in MP_REACH_NLRI attribute.
According to RFC, next_hop address seems to be required to contain RD of 0 when advertise VPN prefix.
This is defined in RFC 4659(3.2.1.1. BGP Speaker Requesting IPv6 Transport) for VPN-IPv6
and in RFC 4364(4.3.2. Route Distribution Among PEs by BGP) for VPN-IPv4.
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fujita-san,
thank you for your comment and finding the bug that causes test case failure.
I fixed the second and resend the whole patch.
The first is the addition of site_of_origins parameter to neighbor_add and
vrf_add method and fixes to some import error.
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
now ryu bgp can send internal information through BGP monitoring protocol
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
previous implementation apply all filters to all paths regardless of
its route family. this implementation cause error like one shown below.
ryu.lib.hub l.60 | ERROR | hub: uncaught exception:
Traceback (most recent call last):
File "/home/wataru/ryu/ryu/lib/hub.py", line 52, in _launch
func(*args, **kwargs)
File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 650,
in _process_outgoing_msg_list
self._send_outgoing_route(outgoing_msg)
File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 599,
in _send_outgoing_route
block, blocked_cause = self._apply_out_filter(path)
File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 505,
in _apply_out_filter
return self._apply_filter(self._out_filters, path)
File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 490,
in _apply_filter
policy, is_matched = filter_.evaluate(path)
File "/home/wataru/ryu/ryu/services/protocols/bgp/info_base/base.py",
line 953, in evaluate
net = netaddr.IPNetwork(prefix.formatted_nlri_str)
File "/usr/local/lib/python2.7/dist-packages/netaddr/ip/__init__.py",
line 941, in __init__
raise AddrFormatError('invalid IPNetwork %s' % addr)
AddrFormatError: invalid IPNetwork 100💯20.0.0.0/24
To fix this bug, this patch introduce the Ipv4PrefixFilter and Ipv6PrefixFilter
class which is only applied to the ipv4 path and ipv6 path.
other condition bug related to applying filter is also fixed.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
for BGPPathAttributeMpUnreachNLRI, use 'withdrawn_routes' instead of
'nlri_list'
bgpspeaker.speaker l.566 | DEBUG | Traceback (most recent
call last):
File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
560, in _recv_loop
self.data_received(next_bytes)
File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
275, in data_received
self._data_received(next_bytes)
File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
355, in _data_received
self._handle_msg(msg)
File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
508, in _handle_msg
self._peer.handle_msg(msg)
File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 1567,
in handle_msg
self._handle_update_msg(msg)
File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 1234,
in _handle_update_msg
self._extract_and_handle_mpbgp_withdraws(mp_unreach_attr)
File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 1496,
in _extract_and_handle_mpbgp_withdraws
w_nlris = mp_unreach_attr.nlri_list
AttributeError: 'BGPPathAttributeMpUnreachNLRI' object has no attribute
'nlri_list'
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
variable 'nlri_str' was not defined in peer.py
bgpspeaker.speaker l.566 | DEBUG | Traceback (most recent call last):
File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
560, in _recv_loop
self.data_received(next_bytes)
File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
275, in data_received
self._data_received(next_bytes)
File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
355, in _data_received
self._handle_msg(msg)
File "/home/wataru/ryu/ryu/services/protocols/bgp/speaker.py", line
508, in _handle_msg
self._peer.handle_msg(msg)
File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 1564,
in handle_msg
self._handle_update_msg(msg)
File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 1230,
in _handle_update_msg
self._extract_and_handle_mpbgp_new_paths(update_msg)
File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 1445,
in _extract_and_handle_mpbgp_new_paths
self._adj_rib_in[nlri_str] = received_route
NameError: global name 'nlri_str' is not defined
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
'core.reset_neighbor' was synchronous API and the caller had to wait
until neighbor comes up. This behavior doesn't work well with rpc_cli.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
looks like,
bgpd> show neighbor
IP Address AS Number BGP State
10.0.0.1 64514 Established
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
- change the name of the filter class from PrefixList to PrefixFilter to
make it easy to understand the role of this class.
- update docs
- fix bugs
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
rtconf is basically for static configuration and filter is
dynamic and also specific configuration for peer instance.
move filter things under peer instance, and change rtconf to do only
static configuration things from a configuration file
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
this will be used when in-bound and out-bound filter changed at runtime
and to implement BMP(BGP monitering protocol) client
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
move filter class from bgpspeaker.py to info_base/base.py to fix the error
shown below.
$ sudo env PYTHONPATH=/home/wataru/ryu ~/ryu/bin/ryu run --config-file=~/etc/ryu01.conf ./application.py
loading app ./application.py
instantiating app ./application.py of RyuBGPSpeaker
INFO 2014-07-21 06:14:48,066 base 207 API method core.start called with
args: {'router_id': '10.10.0.1', 'label_range': (100, 100000), 'waiter':
<ryu.lib.hub.Event object at 0x1a15dd0>, 'local_as': 64512,
'bgp_server_port': 179, 'refresh_max_eor_time': 0,
'refresh_stalepath_time': 0}
Traceback (most recent call last):
File "/home/wataru/ryu/bin/ryu", line 20, in <module>
main()
File "/home/wataru/ryu/ryu/cmd/ryu_base.py", line 75, in main
subcmd.run(base_conf.subcommand_args)
File "/home/wataru/ryu/ryu/cmd/ryu_base.py", line 58, in run
self.entry(args=args, prog=prog)
File "/home/wataru/ryu/ryu/cmd/manager.py", line 81, in main
services.extend(app_mgr.instantiate_apps(**contexts))
File "/home/wataru/ryu/ryu/base/app_manager.py", line 486, in
instantiate_apps
t = app.start()
File "/home/wataru/ryu/ryu/services/protocols/bgp/application.py",
line 93, in start
self._start_core(settings)
File "/home/wataru/ryu/ryu/services/protocols/bgp/application.py",
line 168, in _start_core
call('core.start', waiter=waiter, **common_settings)
File "/home/wataru/ryu/ryu/services/protocols/bgp/api/base.py", line
210, in call
import all # noqa
File "/home/wataru/ryu/ryu/services/protocols/bgp/api/all.py", line 4,
in <module>
import prefix
File "/home/wataru/ryu/ryu/services/protocols/bgp/api/prefix.py", line
29, in <module>
from ryu.services.protocols.bgp.core import BgpCoreError
File "/home/wataru/ryu/ryu/services/protocols/bgp/core.py", line 37,
in <module>
from ryu.services.protocols.bgp import core_managers
File
"/home/wataru/ryu/ryu/services/protocols/bgp/core_managers/__init__.py",
line 19, in <module>
from peer_manager import PeerManager
File
"/home/wataru/ryu/ryu/services/protocols/bgp/core_managers/peer_manager.py",
line 6, in <module>
from ryu.services.protocols.bgp.peer import Peer
File "/home/wataru/ryu/ryu/services/protocols/bgp/peer.py", line 32,
in <module>
from ryu.services.protocols.bgp.bgpspeaker import PrefixList
File "/home/wataru/ryu/ryu/services/protocols/bgp/bgpspeaker.py", line
56, in <module>
from ryu.services.protocols.bgp.application import RyuBGPSpeaker
File "/home/wataru/ryu/ryu/services/protocols/bgp/application.py",
line 64, in <module>
def_desc='Unknown bootstrap exception.')
File "/home/wataru/ryu/ryu/services/protocols/bgp/base.py", line 105,
in add_bgp_error_metadata
'already defined.' % (code, sub_code))
ValueError: BGPSException with code 300 and sub-code 1 already defined.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
when enclosed the value of "ip_proto" in double quotes,
following match fields is not set at mod_flow_stats command:
* tcp_dst, tcp_src
this patch fixes this problem.
Reported-by: jalee <jalee@inno-tech.com.tw>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
added neighbor_update method to BGPSpeaker class.
Currently only MED value can be changed.
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Sorry, I changed parameter name for MED to uniform with add_vrf.
I resend patches for neighbor_add method and neighbor_update and
please ignore the patches that I sent before.
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
this patch shut up the warning shown below
/home/wataru/etc/bgpconf01.py:1: RuntimeWarning: Parent module
'bgpspeaker' not found while handling absolute import
import os
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
BGPOpen that is set to sent_open_msg and recv_open_msg doesn't have
caps and BGP capabilities are stored in opt_param as List.
I changed the way of checking BGP capabilities.
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
RouteFamily objects are treated as a singleton object.
However they are created in peer.py, so I added method to
get RouteFamily object in bgp.py and changed codes to use it.
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Added out-filter function to Ryu BGPSpeaker. It supports IPv4 and
IPv6.
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
this patch makes ofctl_rest enable use of Port Modification Message.
usage)
URI: /stats/portdesc/modify
method: POST
the message body is as follows:
dpid
port_no (default:0)
config (default:0)
hw_addr (default:automatic-setting)
mask (default:0)
advertise (default:automatic-setting)
e.g. )
curl -X POST -d '{"dpid": 1,
"port_no": 1,
"mask": 0b0000001,
"config": 0b0000001}' http://localhost:8080/stats/portdesc/modify
Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
No spec change. The issue occurs at the time of "one_way=True"
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
"\x11"*4 is an invalid value for TCP option, because it
would be decoded as Kind=17 and Length=17, but actual
size is 4.
If we'd like to set some non-zero value for TCP option
here, Kind=1(NOOP) is better.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The following causes an error at mod_flow_entry command
- ofctl_v1_2.py
* match field: metadata, mpls_label
- ofctl_v1_3.py
* match field: in_phy_port
and the following causes an error at get_flow_stats command
- ofctl_v1_2.py
* action: POP_MPLS
* match field: metadata, ipv6_nd_target
- ofctl_v1_3.py
* action: POP_MPLS
* match field: ipv6_nd_target
this patch fixes them.
Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch just adds the ability to parse Float values from a config
using oslo.config.cfg FloatOpt class
Signed-off-by: AJ Ragusa <aragusa@grnoc.iu.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
A lost path's is_withdraw is not True so we can't use it. Let's pass
path and is_withdraw information separately to emit_signal().
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
OpenFlow spec describes "DSCP values that do not encode a drop
precedence are not modified".
Diffserv Assured Forwarding described in rfc2597(+rfc3260) has
DSCP values which encodes "drop precedence".
I think we'd better test OFPMBT_DSCP_REMARK works on AF21 -> AF22
rating, for example.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This patch adds a wrapper to relay the log of the wsgi server to the logger.
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
For Ubuntu 14.04, downgrade the required version of msgpack-python.
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This enables you to use Ryu BGP feature as 'bgp speaker' python
library, that is, without ryu-manager, RPC API, REST API, or other Ryu
stuff, you can use Ryu BGP feature in your python application (just
import bgpspeaker.py). The sample code and the API reference docs are
included too.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
For example, app-A has app-X in CONTEXTS, and app-B depends on app-X as
SERVICE. When app-B is specified in the app-lists before app-A, the
instantiating app-X fails by an assertion.
$ PYTHONPATH=. bin/ryu-manager ryu.app.quantum_adapter ryu.app.gre_tunnel
loading app ryu.app.quantum_adapter
loading app ryu.app.gre_tunnel
loading app ryu.controller.dpset
loading app ryu.controller.ofp_handler
loading app ryu.controller.ofp_handler
loading app ryu.controller.ofp_handler
instantiating app None of QuantumIfaces
creating context quantum_ifaces
instantiating app None of ConfSwitchSet
creating context conf_switch
instantiating app None of Network
creating context network
instantiating app None of Tunnels
creating context tunnels
instantiating app None of DPSet
creating context dpset
instantiating app ryu.app.gre_tunnel of GRETunnel
instantiating app ryu.controller.dpset of DPSet
Traceback (most recent call last):
File "/opt/stack/ryu/bin/ryu-manager", line 19, in <module>
main()
File "/opt/stack/ryu/ryu/cmd/manager.py", line 77, in main
services.extend(app_mgr.instantiate_apps(**contexts))
File "/opt/stack/ryu/ryu/base/app_manager.py", line 434, in instantiate_apps
self._instantiate(app_name, cls, *args, **kwargs)
File "/opt/stack/ryu/ryu/base/app_manager.py", line 421, in _instantiate
register_app(app)
File "/opt/stack/ryu/ryu/base/app_manager.py", line 50, in register_app
assert app.name not in SERVICE_BRICKS
AssertionError
This patch avoid the double loading of app in context and service.
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Added an option command to enable the queue setting to interface
individually. Also, some minor fixes.
Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This fixes a regression introduced by commit d3f8f4eb.
("RyuApp: delete a key without handlers when unregistering a handler")
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
following match fields caused an exception at get_flow_stats command:
ipv6_nd_sll, ipv6_nd_tll
this patch fixes this problem.
Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Attribute 'bgp4_format' was intended to be used to decide whether to
construct UPDATE msg in bgp4 format or mpbgp format.
But we can decide this simply by checking the path type which we are going
update. If the path type is IPv4, we use bgp4 format. In other cases,
we use mpbgp format.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Instead of BGPPathAttributeNextHop, keep nexthop value as a string.
Convert it to string as we get Update msg.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
port from wiki.
dummy quantumclient is necessary to import ryu.app.quantum_adapter by
sphinx.ext.autodoc.
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
These test files aim to examine 'group action' of FlowMod message.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This change is for tests that use group_table.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
E:1026, 8: Instance of 'DummyDatapath' has no 'set_xid' member (but some types could not be inferred) (maybe-no-member)
E:1027, 8: Instance of 'DummyDatapath' has no 'send_msg' member (but some types could not be inferred) (maybe-no-member)
NOTE: These methods are never called. This patch is only for avoiding pylint error.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
All of _test_xxx_exist_chk() are merged as _test_exist_chk().
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
All of xxx_stats_reply_handler() are merged as stats_reply_handler().
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
_test_initialize_flow_tester() is merged into _test_initialize_flow().
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlowSw.del_test_flow() and OpenFlowSw.del_flows_for_throughput_analysis() are merged as OpenFlowSw.del_flows().
And rename OpenFlowSw.del_test_meter() to OpenFlowSw.del_meters(), like OpenFlowSw.del_flows().
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
TargetSw and TesterSw are merged as OpenFlowSw.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
- API
- @websocket decorator
- WSGIApplication#websocketmanager()
- bugfix
- Even if a connection is cut, it continues remaining
- remove restriction
- Two or more connections can be accepted
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Reviewed-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Add the pep8 section to tox.ini and specify ignoring E113.
Many E113 errors appeared on comments. It seems a bug of pep8, so it can be ignored.
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This module is intended for operation in a pipeline on a flow table.
It supports setting of the queue, (Currently, only support
OpenvSwitch), packet marking, queuing, regitation to meter table,
perform this simple QoS.
Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
BGP session can be closed by sending inappropriate messages.
So touching socket by get_peername() after sending messages may cause an
exception. Though we can handle this by try..exception, I fixed to simply
call get_peername() before sending messages because session disconnection by
sending messages is an ordinary procedure and not an exception(the peer will
send notification before disconnection).
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
add ssh client which has basic bash keybinds and tab complement.
to use, you have to create ssh key at first then specify the location of
the key in ryu configuration files.
configuration file will be like this.
> ryu.conf
> ==
> [DEFAULT]
> cli_ssh_hostkey=/home/user/.ssh/id_rsa
after this, run operator/ssh.py with application.py
$ ryu-manager --config-file=ryu.conf application.py operator/ssh.py
you can login by
$ ssh ryu@localhost -p 4990
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
set binded ip and port properly regardless of the direction of connection
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
update msg without MpReachNlri or MpUnReachNlri is now normal
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Here is added queue status request to ofctl.
Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Here is added the command of QoS-related, such as the following:
ovs-vsctl -- set port eth1 qos=@newqos \
-- --id=@newqos create qos type=linux-htb other-config:max-rate=30000000 queues=0=@q0,1=@q1 \
-- --id=@q0 create queue other-config:min-rate=1000000 other-config:max-rate=1000000 \
-- --id=@q1 create queue other-config:min-rate=2000000 other-config:max-rate=2000000
Also, operation that delete QoS is supported.
Note that It supports only deletion of relationships with QoS record.
Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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.
This patch modifies lengths of pad fields as follows:
- Add 18 bytes for MAC frames (including ARP, without VLAN/MPLS/PBB).
- Add 18 bytes for MAC frames related to POP_MPLS/POP_PBB.
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>
Enable disabled MPLS tests, they appear to be supported by Open vSwitch.
I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the set NW TTL action.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.
In terms of the above MPLS TTL actions are inconsistent if the flow
does not match on one of the MPLS dl_types.
This patch add such a match for the flows that have MPLS TTL actions.
Also enable these tests, they appear to be supported by Open vSwitch.
I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the set NW TTL action.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.
In terms of the above pop MPLS actions are inconsistent if the flow
does not match on one of the MPLS dl_types.
This patch add such a match for the flow that has a pop MPLS action.
Also enable the pop MPLS test, it appears to be supported by Open vSwitch.
I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the set NW TTL action.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.
In terms of the above the set-field actions for IPv6 addresses are
inconsistent if it the flow does not match on the IPv6 dl_type.
This patch add such a match for those that have set-field actions
for IPv6 addresses.
Also enable these tests, they appear to be supported by Open vSwitch.
I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the set NW TTL action.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Enable ARP tests, they appear to be supported by Open vSwitch.
I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the set NW TTL action.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.
In terms of the above the set NW TTL action is inconsistent if
it the flow does not match on the IPv4 or IPv6 dl_type because
the action manipulates either the IPv4 TTL or the IPv6 hop limit.
This patch splits the testing of the set NW TTL action into two tests,
one for each of IPv4 and IPv6, including a match on the corresponding
dl_type in the flow.
Also enable these tests, they appear to be supported by Open vSwitch.
I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the set NW TTL action.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.
In terms of the above a set-field action for a VLAN tag is considered
inconsistent if it the flow does not match on a VLAN tag.
This patch add such a match for the flow that has a set-field action
for a VLAN tag.
I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for set-field actions for
VLAN tags.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.
In terms of the above the pop ttl action is considered inconsistent if
it the flow does not match on a VLAN tag.
This patch add such a match for the flow that has a pop VLAN action.
I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the pop VLAN TTL action.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OpenFlow 1.2 section 6.7 describes inconsistent action in a flow
as an action whose operation is inconsistent with the flows match.
In terms of the above the dec NW TTL action is inconsistent if
it the flow does not match on the IPv4 or IPv6 dl_type because
the action manipulates either the IPv4 TTL or the IPv6 hop limit.
This patch splits the testing of the dec NW TTL action into two tests,
one for each of IPv4 and IPv6, including a match on the corresponding
dl_type in the flow.
I noticed this when using Open vSwitch's "make ryu-check" as
Open vSwitch enforces action consistency for the dec NW TTL action.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
and add some comments. no functional changes.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When QUERY timeout expires, a variable for flooding is overwritten unexpectedly.
So querier stops sending a query message any longer.
This patch fixes the problem.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Newly add an api network.add to add a ipv4 network to propagate.
Networks can be registered in configure file using networks direction
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
changed to enable bgp4 and disable mpbgp and enhanced refresh in default
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
and correct the inaccurate dispatchers.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
These test files aim to examine 'meter instruction' of FlowMod message.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The format is for throughput analysis.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Methods of STATE_FLOW_MATCH_CHK and STATE_UNMATCH_PACKET_SEND have similar processes that send a packet.
This patch refactors this redundancy.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The format is for sending packets continuously.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Due to Nagle, an OF message that an application sends might be not
delivered to a switch immediately. This patch disables Nagle. This has
bad effect on throughput. I think that the latency matters for any
management channel. To avoid throughput drop, we could use TCP_CORK on
Linux but it's linux specific.
Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
this is similar to handler.register_service but for client-server
style applications. register_service is not appropriate for such
applications becuase normally the client does not consume
(in the sense of set_ev_cls) asynchronous events from the server.
note: this automatically load the server only if "api" module is
directly loaded from the module defining the client application.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The way to handle multiple connections from the same datapath I took
is mostly the same as in dpset, but it's always good to reinstall
the LDAP Packet-In flows even while switch tries to reconnect to us.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Bundle Add Message and Request Forward Message, which is part of OpenFlow
1.4, encapsulates an OpenFlow message in side an OpenFlow message.
This patch prepares for this by adding a MsgInMsgBase class, a subclass of
MsgBase which allows its subclasses to include subclasses of either
MsgInMsgBase or MsgBase when when parsing classes from JSON: The MsgBase
class does not allow this.
This change has three parts:
* Remove the assertion in
ofproto_parser.py:StringifyMixin::cls_from_jsondict_key()
that cls is not a subclass of MsgBase.
* Pass **additional_args to various stringify.py:StringifyMixin decoder
methods to make the datapath available when instantiating
MsgBase subclasses.
* Override _decode_value() in MsgInMsgBase to pass **additional_args
to decoder. The method in the parent class, StringifyMixin,
does not pass **additional_args.
The effect is to pass a datapath argument if
the class is a subclass of MsgInMsgBase but not if the
class is a direct subclass of MsgBase.
By only making messages which allow messages inside them
subclasses of MsgInMsgBase this allows the datapath
argument to be passed to the decoder if and only if needed.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Hi,
I tried to support for whole of match field with ofctl_v1_2.(same as ofctl_v1_3)
Also, changed table_id of get_flow_stats method from fixed 0 to OFPTT_ALL for enable to select arbitrary table_id by client side.
Thank you.
Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Openflow 1.1 and later versions allow the use of IP address with
arbitrary bitmask in match fields. This adds arbitrary bitmask
support to related functions.
After applying this patch, it's no longer compatible with ACL
hybrid CIDR format (Cisco-like ACL bitmasks) because such format
exists only in some router's ACL configuration.
Reported-by: Yi-Ching Lee <potatoching11@gmail.com>
Reported-by: Li-Der Chou <cld@csie.ncu.edu.tw>
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Disconnection of switches has caused a RyuInternalError because target_sw/tester_sw is set to NoneType.
This patch fixes the problem.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OFP_ASYNC_CONFIG_PACK_STR and OFP_ASYNC_CONFIG_SIZE are based
on the OpenFlow 1.3 implementation and specification. However,
the Openflow 1.4 specification defines a rather different structure:
struct ofp_async_config {
struct ofp_header header; /* OFPT_GET_ASYNC_REPLY or OFPT_SET_ASYNC. */
/* Async config Property list - 0 or more */
struct ofp_async_config_prop_header properties[0];
};
OFP_ASSERT(sizeof(struct ofp_async_config) == 8);
In implementation terms this means that OFP_ASYNC_CONFIG_PACK_STR
is empty and OFP_ASYNC_CONFIG_SIZE is zero. In the new implementation
these values are unused so simply remove them.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The current get async reply and get async implementations follows that of
of_protocol and OpenFlow 1.3. However, OpenFlow 1.4 defines a rather
different format. This patch updates the implementation to follow the
OpenFlow 1.4 specification.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This will be used by a revised implementations of
get async request reply and set async
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Update ofproto dependency to include a merge of the mainline
v5 branch which includes:
* Bundle messages
* Flow monitor messages
* Request Forward message
* Table Status message
* Fix for length of Flow Update Full entry of Flow Monitor reply message
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This will be used by flow monitor reply messages
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
dpset might be initialied implicitly like OFPHandler.
In that case, _CONTEXTS are passed to dpset. so we should ignore them.
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This enables match_ip*_to_str() functions to output IP address with
dotted decimal subnet mask if the mask cannot be represented in CIDR
format.
Reported-by: Yi-Ching Lee <potatoching11@gmail.com>
Reported-by: Li-Der Chou <cld@csie.ncu.edu.tw>
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The initialization error of the flow tables causes forced termination of the test,
and has become the hindrance of execution of other tests.
This patch changes operation of the flow tables initialization error
to avoid forced termination of the test.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When using type 'ALL', the log unsuitable is outputted:
Unknown type: ALL
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofproto_v1_3.OFPGT_ALL is 0 and 0 is False on Python. When using type 'ALL', the following is set to True.
if not type_:
LOG.debug('Unknown type: %s', group.get('type'))
Therefore, the log unsuitable is outputted:
Unknown type: ALL
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reported by Sebastian Gebhard on ryu-devel@.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
the current version of generated_classes was written by hand.
this plugin allows it to be auto-generated from the yang module
of OF-Config if/when it's available.
unfortunately, there seems to be no yang modules usable for this
purpose publically available yet, though.
the yang module of OF-Config 1.1.1 is embedded in pdf. besides that
it's hard to extract from the pdf, its license is unclear.
OF-Config 1.2 says that its yang module is distributed as a separate
file. but i couldn't find it on ONF site.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
also, make CONF accessible via RyuApp.CONF.
add a comment to explain the intention.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofp_listen_port was obsoleted and users should use ofp_tcp_listen_port
(or ofp_ssl_listen_port if ssl enabled) instead.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This enables to_match_ip() to accept IPv4 address with dotted decimal
subnet mask or ACL hybrid CIDR.
Given 3 match field values below:
'192.168.1.0/24'
'192.168.1.0/255.255.255.0'
'192.168.1.0/0.0.0.255'
These addresses are logically equivalent.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Change experimenter data from a list of 32-bit words to bytes.
Discussed on ryu-devel@.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
* Document properties
* The valid flags for OpenFlow 1.4 are OFPTC_EVICTION and OFPTC_VACANCY_EVENTS
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
* Flags is a bitmap of OFPMF_* values rather than a
single OFPMF_* value
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
* Flags is a bitmap of OFPFF_* values rather than a
single OFPFF_* value
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
* Flags is a bitmap of OFPC_FRAG_* values rather than a
single OFPC_FRAG_* value
* OFPC_FRAG_MASK is not a valid bitmap field
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
* Flags is a bitmap of OFPC_FRAG_* values rather than a
single OFPC_FRAG_* value
* OFPC_FRAG_MASK is not a valid bitmap field
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
* Flags is a bitmap of OFPFF_* values rather than a
single OFPFF_* value
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
* Flags is a bitmap of OFPMF_* values rather than a
single OFPMF_* value
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
* Flags is a bitmap of OFPC_FRAG_* values rather than a
single OFPC_FRAG_* value
* OFPC_FRAG_MASK is not a valid bitmap field
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
* Flags is a bitmap of OFPC_FRAG_* values rather than a
single OFPC_FRAG_* value
* OFPC_FRAG_MASK is not a valid bitmap field
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
python-six package from Ubuntu 12.04 LTS remains version 1.1.0,
which prevents ryu-manager from being started and raises exception
"AttributeError: 'module' object has no attribute 'add_metaclass'".
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This is more in keeping with the names used for
other properties as the property is ofp_queue_stats_prop
in the OF1.4 specification.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This may be used in port stats and port status messages
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This may be used in port stats and port status messages
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This will be used by role status messages.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
There are several different experimenter properties in OF1.4 which
are identical in structure. They have experimenter, exp_type
and data fields. The data field is an array of 4-byte words.
This patch adds OFPPropCommonExperimenter4ByteData which provides
a parser and serializer for such properties and can be inherited
by a subclass which implements one of the properties.
This patch also uses OFPPropCommonExperimenter4ByteData to implement
queue desc properties and table mod properties.
It is planned to use OFPPropCommonExperimenter4ByteData to implement
role properties.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This may be used by queue desc request and reply messages
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This may be used by queue desc request and reply messages
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
With this change the initialiser of OFPTableMod now
requires a properties argument. This is incompatible with
Ryu v3.6. If it is important to maintain compatibility
then things can be reworked a little to make the properties
argument optional.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This will be used by at least the serialisation of
flow mod messages with properties.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This may be table status and table desc messages.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This may be table mod, table status and table desc messages.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Since transaction ID of PacketOut message is not hold,
an error message to this PacketOut is not able to be received.
This patch fixes it.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The length check assert was added by FUJITA since the spec says that
lenght of data should be a multiple of 8.
Signed-off-by: Rob Udechukwu <rnudechu@ncsu.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
"The Pop PBB header action does not remove the backbone VLAN
header (B-TAG)" as described in openflow spec 1.3.3.
The format of I-TAG TCI is pcp,..,I-SID,C-DA,C-SA as in
802.1Q-2011 Figure 9-3.
Change the test senario, converting
from B-MAC/I-TAG/S-TAG/C-TAG/ethertype/Data
to C-MAC/S-TAG/C-TAG/ethertype/Data
looks more common.
Reported-by: Hiroaki KAWAI <kawai@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Add following reports to the output of a switch test tool.
This report outputs the test item of each error type, and the number of errors.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
suggested by some openstack folks.
see https://review.openstack.org/#/c/71791
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
They are necessary for switches that don't support the feature of
modifying 'running' configuration directly; instead, needs to modify
'candidate' configuration and then commit (or discard).
Also fix do_get method's comment typo.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Like ryu-manager, this agent serves Ryu applications and acts an OpenFlow
controller to control switches. The neutron agent logic, which we will
push to the neutron repo, is implemented as a Ryu application.
Implements: OpenStack blueprint ryu-ml2-driver
https://blueprints.launchpad.net/neutron/+spec/ryu-ml2-driver
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OfTester._test_initialize() expects the transaction id as a return
value of TargetSw.del_test_flow() for checking the error. but this
method at current version does not return the transaction id.
this patch gets del_test_flow() to return the transaction id.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
according to OF spec, the instruction is treated as the set. this
means that the order of instructions which flow_stat message returns
is inconstant. this patch corrects the comparison method of
instructions by sorting in a particular order before comparison.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
When test tool receives a malformed packet(length value is unusual,
for example), detecting differences between expected and received is
a failure. In this case, 'Internal error.' is not suitable as a log
message and should notify tool receives a malformed packet.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The value of match(ipv6_exthdr) of the
of13/match/39_IPV6_EXTHDR.json test file is wrong.
The correct value matching to a ipv6(ext_hdrs=[hop_opts,auth])
is ipv6_exthdr=001000100=68.
This patch corrects it.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The value of instruction(write metadata) of the test file is wrong.
In the table-miss test of of13/match/02_METADATA* test files,
metadata=255 or 240(mask=0xf0) is specified as match.
In order to make it table-miss, it needed to write metadata except 255.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
fix the following crash.
from Yuichi Ito. minor editorialization by me.
> Traceback (most recent call last):
> File "/usr/local/bin/ryu-manager", line 9, in <module>
> load_entry_point('ryu==3.6', 'console_scripts', 'ryu-manager')()
> File "/usr/local/lib/python2.7/dist-packages/ryu/cmd/manager.py", line 73, in main
> services.extend(app_mgr.instantiate_apps(**contexts))
> File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", line 368, in instantiate_apps
> self._instantiate(app_name, cls, *args, **kwargs) > File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", line 350, in _instantiate
> ofproto_protocol.set_app_supported_versions(cls.OFP_VERSIONS)
> File "/usr/local/lib/python2.7/dist-packages/ryu/ofproto/ofproto_protocol.py", line 40, in set_app_supported_versions
> _versions &= set(vers)
> UnboundLocalError: local variable '_versions' referenced before assignment
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
stop inheriting RyuApp class to make the implementation of
other tests (tests.cmd.test_manager) easiler.
this module is for packet_in_filter decorator and does not
start ryu app anyway.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
OFPFC_* enumerations are declared for flow mod commands, not for groups.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
currently OFP classes takes the Datapath object, which is too complex
for this purpose. this class, ProtocolDesc, is intended to be
a simpler replacement for that.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Reviewed-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
as proposed while ago, import ofproto_v1_3 with a version agnostic name
to reduce differences between parser modules.
the name 'ofproto' was chosen to match with ofproto_v1_4_parser.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
as proposed while ago, import ofproto_v1_2 with a version agnostic name
to reduce differences between parser modules.
the name 'ofproto' was chosen to match with ofproto_v1_4_parser.
update tests accordingly.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
as proposed while ago, import ofproto_v1_0 with a version agnostic name
to reduce differences between parser modules.
the name 'ofproto' was chosen to match with ofproto_v1_4_parser.
update tests accordingly.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Add generic OFPropBase class and make OFPPortProp a subclass of it.
This is to allow other properties classes to be implemented as subclasses
of OFPPropBase, simplifying their implementation.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This corrects what appears to be a typo as
OFPPortDescPropUnknown is never called but
OFPPortPropUnknown, which does not exist, is called.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
These will be used my meter mod message support which
is added by a subsequent patch.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This is a purely cosmetic change to move some code to
the same location it is found in the of1.3 implementation,
aiding comparison between the two codebases. It also
move the code closer to where it is used.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This appears to be necessary for wire tests
to pass if matches are in an order different
from that defined by Ryu.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This is in line with 4a394aae2f1a3b82
("Fix OFPInstructionWriteMetadata JSON decode") which fixes
the following for OF1.3:
CLS <class 'ryu.ofproto.ofproto_v1_3_parser.OFPInstructionWriteMetadata'>
ARG {u'metadata_mask': 18446744073709551615L, u'type': 2, u'len': 24, u'metadata': 18446744069414584320L}
KWARG {u'type_': 2, u'metadata_mask': 18446744073709551615L, u'len_': 24, u'metadata': 18446744069414584320L}
Traceback (most recent call last):
File "a.py", line 19, in <module>
msg = ofproto_parser.ofp_msg_from_jsondict(dp, m)
File "/Users/fujita/git/ryu/ryu/ofproto/ofproto_parser.py", line 100, in ofp_msg_from_jsondict
return cls.from_jsondict(v, datapath=dp)
File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 291, in from_jsondict
kwargs = cls._restore_args(_mapdict_kv(decode, dict_))
File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 46, in <lambda>
_mapdict_kv = lambda f, d: dict([(k, f(k, v)) for k, v in d.items()])
File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 290, in <lambda>
decode = lambda k, x: cls._decode_value(k, x, decode_string)
File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 234, in _decode_value
return cls._get_decoder(k, decode_string)(json_value)
File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 242, in _decode
v = map(_decode, json_value)
File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 245, in _decode
v = cls.obj_from_jsondict(json_value)
File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 223, in obj_from_jsondict
return obj_cls.from_jsondict(v)
File "/Users/fujita/git/ryu/ryu/lib/stringify.py", line 293, in from_jsondict
return cls(**dict(kwargs, **additional_args))
TypeError: __init__() got an unexpected keyword argument 'type_'
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This is in keeping with 1368fd6899722a9c ("of13: set default attributes for
OFPMultipartRequest subclasses").
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This is in keeping with
e08ac471d44db846 ("ofproto_v1_3_parser: put some assertions").
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-02-04 18:41:32 +09:00
1535 changed files with 310187 additions and 32177 deletions
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.