2783 Commits

Author SHA1 Message Date
FUJITA Tomonori
400a98d4a7 Ryu 4.4
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v4.4
2016-06-30 16:21:54 +09:00
Evan Gray
7d15368bf9 topology: ignore cfm packets on packet in
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>
2016-07-01 12:23:17 +09:00
Evan Gray
2a2b2b1762 topology: pep8 fixes
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>
2016-07-01 12:22:58 +09:00
IWASE Yusuke
658c754cbd ofproto: Fix example of OFPSetAsync message
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-01 12:17:53 +09:00
IWAMOTO Toshihiro
0dc79ddd7e Update the readthedoc URL
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>
2016-07-01 12:14:51 +09:00
Jason Kölker
8b038a492e lib/ofctl_utils: Log the datapath sent to
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>
2016-07-01 11:37:09 +09:00
IWAMOTO Toshihiro
b0ab4f1602 Avoid parallel executions of AppManager.close()
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>
2016-07-01 11:30:01 +09:00
fumihiko kakuma
d079bf38e7 python3: Use six.add_metaclass for metaclass
__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>
2016-06-18 13:54:39 +09:00
fumihiko kakuma
c897ae7d8a python3: Use six.string_types instead of basestring
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-18 13:54:37 +09:00
fumihiko kakuma
85023d4fdb python3: Improve Table class in services.protocols.bgp.info_base.base
Remove itervalues() and values() always returns iterator

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-18 13:54:36 +09:00
Fumihiko Kakuma
9f4328682f python 3: Replace deprecated logging.warn with logging.warning
logging.warn is deprecated in Python 3 [1].
This patch switches it to the non-deprecated logging.warning.
This is bug-reported by openstack [2].

[1] https://docs.python.org/3/library/logging.html#logging.warning
[2] https://bugs.launchpad.net/magnum/+bug/1508442

Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-18 13:53:50 +09:00
IWASE Yusuke
f86499373a Python3: Explicit string type encoding
Reviewed-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:27:06 +09:00
IWASE Yusuke
55a88d6805 BGPSpeaker: Remove unused utility modules
Reviewed-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:27:03 +09:00
IWASE Yusuke
c263089e72 BGPSpeaker: Fix unresolved references in Python3
Additionally, this patch enforces the the explicit relative imports

Reviewed-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:26:59 +09:00
IWASE Yusuke
9393af3f06 BGPSpeaker: Support Per-Peer AS
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>
2016-06-09 13:26:53 +09:00
Shinpei Muraoka
7b562c3700 packet_data_generator3/gen: Add some NXAction packets
This patch adds the following test packet.
 - NXActionController
 - NXActionFinTimeout
 - NXActionNote

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:07:48 +09:00
Shinpei Muraoka
7ca8690557 ofproto/nicira_ext: Move the variable and method for Nicira Extension
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>
2016-06-09 13:07:47 +09:00
Shinpei Muraoka
5ebf0fa5c4 tests/test_parser_v10: Update test parameter
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:07:35 +09:00
Shinpei Muraoka
3c3896fd77 ofproto/nx_actions: Update arguments to be compatible with ovs-ofctl
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>
2016-06-09 13:07:33 +09:00
Shinpei Muraoka
ecc3ea296f ofproto/ofproto_v1_0: Delete some NX actions
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>
2016-06-09 13:07:32 +09:00
Shinpei Muraoka
462256198b ofproto/nx_actions: Porting the NX Action definition of ofproto_v1_0_parser
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-09 13:07:30 +09:00
Shinpei Muraoka
5dfdc856bc ofproto/nx_actions: Update serialize and parse
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>
2016-06-09 13:07:29 +09:00
Alan Quillin
35a98fca3e Extend OVSDB api
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>
2016-06-09 13:06:57 +09:00
Yi Tseng
865d6e52d7 Fix RuntimeError of lldp_packet_in_handler
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>
2016-06-05 15:24:42 +09:00
FUJITA Tomonori
d090b291be Ryu 4.3
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v4.3
2016-06-03 08:01:56 +09:00
Atzm Watanabe
24a041ecca nx_match: add tun_ipv6_{src,dst}
Open vSwitch accepts NXM_NX_TUN_IPV6_SRC(109) and
NXM_NX_TUN_IPV6_DST(110) since v2.5.

Signed-off-by: Atzm Watanabe <atzm@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:43:01 +09:00
IWASE Yusuke
1bcb23e556 packet_data_generator3: Clear xid into zero
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>
2016-06-01 20:40:17 +09:00
IWASE Yusuke
709b3ad28f ofproto: Implement OFPFlowMod parser
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>
2016-06-01 20:40:12 +09:00
IWASE Yusuke
f3e931b03f doc: Add PCAP file library reference
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:40:04 +09:00
IWASE Yusuke
ad481c7de8 test_pcaplib: Add unit tests for pcaplib
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:39:59 +09:00
IWASE Yusuke
6643bae823 pcaplib: Reduce Pylint warnings
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:39:54 +09:00
IWASE Yusuke
35fc29a8d3 test_bgp: Enable to test parser with pcap file
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>
2016-06-01 20:39:03 +09:00
IWASE Yusuke
b3b8238e6c packet/bgp: Reduce Pylint warnings
This patch removes the following Pylint warnings:
  - anomalous-backslash-in-string
  - arguments-differ
  - bad-builtin
  - bad-staticmethod-argument
  - superfluous-parens
  - super-init-not-called
  - unidiomatic-typecheck
  - unused-variable
  - wrong-import-order

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:38:57 +09:00
IWASE Yusuke
171b35f0db bgp: fix typos
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:38:50 +09:00
IWASE Yusuke
9b57e7bd07 test-requires: Update to use the latest Pylint
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>
2016-06-01 20:38:39 +09:00
IWASE Yusuke
4fa85d1e4b test-requires: Add tinyrpc for RPC controller in wsgi
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-06-01 20:38:27 +09:00
YAMAMOTO Takashi
9e3aaaf2d8 Make ovs optional
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>
2016-05-26 23:30:49 +09:00
IWASE Yusuke
a6c3d38789 packet: Add VXLAN parser
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>
2016-05-23 12:48:08 +09:00
IWAMOTO Toshihiro
7f38397442 packet/bgp: Add missing __hash__ function
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>
2016-05-18 17:49:25 +09:00
IWASE Yusuke
a7e804fdec controller: Add backward compatibility for 6633 port
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-18 16:01:23 +09:00
IWASE Yusuke
7d446f3f79 Update default OpenFlow port to 6653
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>
2016-05-18 16:01:22 +09:00
IWASE Yusuke
a20b9e1fcd BGP: Make RouteFamily class hashable
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>
2016-05-18 16:01:16 +09:00
IWASE Yusuke
13ae023f2d doc: Remove warnings when building doc pages
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-18 16:00:51 +09:00
IWASE Yusuke
9d9f28519f doc: Move Ryu App API doc into each source code
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>
2016-05-18 16:00:34 +09:00
IWASE Yusuke
68025e66b1 network: Fix unresolved reference
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>
2016-05-18 16:00:09 +09:00
IWASE Yusuke
3cccf23238 doc: Add description for EventOFPPortStateChange
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-18 15:59:22 +09:00
IWASE Yusuke
9774eb60af controller: Implement EventOFPPortStateChange
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>
2016-05-18 15:59:13 +09:00
Shinpei Muraoka
af2ae13ae3 doc/app/ofctl_rest: Remove unused match field
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>
2016-05-16 15:02:40 +09:00
Shinpei Muraoka
3f60665d1f doc/source/conf: Set the False to SmartyPants
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>
2016-05-16 15:02:40 +09:00
Shinpei Muraoka
d435446ef5 doc/app/ofctl_rest: Add a description for openflow1.5
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-16 15:02:40 +09:00