2916 Commits

Author SHA1 Message Date
Shinpei Muraoka
8d9ce87653 BGPSpeaker: Support to advertise PMSI Tunnel Attribute
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>
2016-10-29 06:32:18 +09:00
Shinpei Muraoka
6e22fb4a05 packet/bgp: Add PMSI Tunnel Attribute
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>
2016-10-29 06:32:11 +09:00
Shinpei Muraoka
5360524b96 packet/vxlan: Add method to convert the format of vni
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-29 06:32:05 +09:00
Shinpei Muraoka
a582b0b0dc packet/mpls: Add method to convert the format of label
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-29 06:31:59 +09:00
Shinpei Muraoka
ec1749beca lib/ip: Add method to convert the format of Ipv4 or Ipv6
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-29 06:31:53 +09:00
fumihiko kakuma
df1434a9bb Enable to run a scnario test for ryu bgp on travis
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-29 06:27:56 +09:00
fumihiko kakuma
76061634a0 Add scripts which install a dependency package
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>
2016-10-29 06:27:54 +09:00
fumihiko kakuma
cd068e53ea Add bgp scenario tests
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>
2016-10-29 06:27:49 +09:00
fumihiko kakuma
0a60252208 Add bgp scenario tests tool
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>
2016-10-29 06:27:10 +09:00
IWASE Yusuke
649d31afbe bgp/application: Re-implement base BGP application
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>
2016-10-25 22:41:21 +09:00
IWASE Yusuke
1dfe90d17a flags: Add CLI options for BGP application
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 22:41:08 +09:00
IWASE Yusuke
bc7f43aba3 BGPSpeaker: Enable to specify settings for SSH CLI
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 22:41:01 +09:00
IWASE Yusuke
09e57c5993 bgp/operator/ssh: Enable to quit gracefully
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>
2016-10-25 22:40:49 +09:00
IWASE Yusuke
252591aaae bgp/operator/ssh: Reduce pylint warnings
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 22:40:43 +09:00
IWASE Yusuke
e635d68bfd BGPSpeaker: Use dictConfig in the standard library
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>
2016-10-25 22:40:37 +09:00
IWASE Yusuke
a7721fcce4 utils: Backward compatibility for 'imp.load_source'
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>
2016-10-25 22:40:28 +09:00
IWAMOTO Toshihiro
6792d6df2a Log OFPErrorMsg.data as ascii when type is OFPET_HELLO_FAILED
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>
2016-10-25 16:23:07 +09:00
IWASE Yusuke
df95d2c660 ovs/vsctl: Fix API for parsing column/key/value set
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>
2016-10-25 16:22:53 +09:00
IWASE Yusuke
d7cfe6687b ovs/vsctl: Add missing Controller commands in OVS v2.6.0
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:51 +09:00
IWASE Yusuke
05b3738359 ovs/vsctl: Add missing Port commands in OVS v2.6.0
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:46 +09:00
IWASE Yusuke
2744d0a9e3 ovs/vsctl: Add missing Interface commands in OVS v2.6.0
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:41 +09:00
IWASE Yusuke
3e19c38e9e ovs/vsctl: Add missing Bridge commands in OVS v2.6.0
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:35 +09:00
IWASE Yusuke
934e8dcd1a ovs/vsctl: Sort out commands order
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:28 +09:00
IWASE Yusuke
3aa49895fa ovs/bridge: Add APIs for missing Database commands
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:22 +09:00
IWASE Yusuke
589823beb5 ovs: Add API corresponding to ovs-vsctl remove command
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:20 +09:00
IWASE Yusuke
c21ad1237d ovs: Add API corresponding to ovs-vsctl add command
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:19 +09:00
IWASE Yusuke
c09c4e87a0 ovs: Add API corresponding to ovs-vsctl list command
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:13 +09:00
IWASE Yusuke
d19e7a3213 ovs: Add API corresponding to ovs-vsctl add-bond command
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:07 +09:00
IWASE Yusuke
fe83cfd66d ovs/vsctl: Update command list with OVS v2.6.0
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:22:06 +09:00
IWASE Yusuke
513bf4c48c ovs/vsctl: Avoid applying next() to non-iterator object
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>
2016-10-25 16:22:01 +09:00
IWASE Yusuke
895ddfca26 ovs/vsctl: Add missing required argument for find_vlan_bridge
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:21:54 +09:00
IWASE Yusuke
b9aab0af3f ovs: Reduce pylint warnings
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:21:46 +09:00
IWASE Yusuke
5748031635 ovs: Revert ovs module path
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>
2016-10-25 16:21:38 +09:00
IWASE Yusuke
4d1bfc8585 ovs/vsctl: Fix VSCtlCommand to inherit StringifyMixin
For convenience when printing command results, this patch fixes
VSCtlCommand to inherit StringifyMixin.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:21:31 +09:00
IWASE Yusuke
a354b456ea ovs/vswitch_idl: Update OVSDB schema with v7.14.0
This patch regenerates OVSDB schema with vswitchd/vswitch.ovsschema
v7.14.0 included in OVS v2.6.0 release.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-25 16:21:09 +09:00
IWASE Yusuke
55dc1158b8 ovs/vsctl: Change log level of redundant messages
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>
2016-10-25 16:21:02 +09:00
IWASE Yusuke
2ebb9218b2 rest_router: Fix conversion of Packet Library to dict
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>
2016-10-25 16:20:12 +09:00
IWASE Yusuke
e80a36317a dpset: Fix iteration error when disconnecting switches
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>
2016-10-25 16:20:11 +09:00
IWAMOTO Toshihiro
022406507a test_parser: Add an truncate packet test
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-12 09:08:57 +09:00
IWAMOTO Toshihiro
e8809649e6 test_parser: Enable tests for truncated packets
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>
2016-10-12 09:08:55 +09:00
IWAMOTO Toshihiro
6aa4adb070 ofproto_v1_3_parser: Raise OFPTruncatedMessage exception on truncated messages
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>
2016-10-12 09:08:52 +09:00
Shinpei Muraoka
b9a9f81ff0 ofproto/nicira_ext: Add missing NXMs in OVS v2.6.0
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-12 09:08:36 +09:00
Michał Rzepka
8d93787a6c ryu/lib/ofctl_v1_3: port name decoding fix
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>
2016-10-08 22:52:36 +09:00
IWASE Yusuke
6522ea1c83 BGPSpeaker: Enhance APIs for operator.show
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>
2016-10-08 22:36:47 +09:00
FUJITA Tomonori
7201a6085d Ryu 4.7
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v4.7
2016-10-04 07:56:38 +09:00
IWASE Yusuke
81d5d8f568 BGPSpeaker: Fix to enable to notify peer down
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>
2016-10-04 07:45:53 +09:00
FUJITA Tomonori
a3ab6c8ab3 use old cryptography version
Looks like that the latest version (1.5.2) doesn't work:

https://s3.amazonaws.com/archive.travis-ci.org/jobs/164527154/log.txt

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-04 07:38:03 +09:00
IWASE Yusuke
35973fcc20 packet: Avoid parsing an empty buffer
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>
2016-10-01 21:37:58 +09:00
IWASE Yusuke
51e0abd365 pip-requires: Add ovs>=2.6.0
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>
2016-10-01 21:28:52 +09:00
IWASE Yusuke
a443be9433 doc: Add API reference for REST EVPN switch
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-01 21:28:52 +09:00