2810 Commits

Author SHA1 Message Date
FUJITA Tomonori
fbafa4b950 Ryu 4.5
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v4.5
2016-08-02 11:07:47 +09:00
Victor Orlikowski
12d6584bee Ensure that send() and send_msg() in controller return status to calling applications
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>
2016-08-02 11:02:31 +09:00
Victor Orlikowski
9ee265ab45 Clean up stale Datapath objects in the ofctl_service application
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>
2016-08-02 11:01:52 +09:00
Shinpei Muraoka
d0992e24ae packet lib: Add packet library of GRE
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-29 05:55:32 +09:00
Shinpei Muraoka
4ca81f9624 ofproto/nx_actions: Update argument of NXActionCT
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>
2016-07-27 19:46:04 +09:00
Shinpei Muraoka
64ba9f1cdc ofproto/nx_actions: Revert API of NXAction
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>
2016-07-27 19:46:03 +09:00
IWASE Yusuke
882262d861 manager: Except KeyboardInterrupt to suppress traceback
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>
2016-07-27 14:50:35 +09:00
IWASE Yusuke
3c0bd5b024 stplib: Handle the port state not changed events
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>
2016-07-27 14:31:27 +09:00
IWASE Yusuke
f52bb7007e stplib: Adopt to Python3
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>
2016-07-27 14:31:21 +09:00
IWASE Yusuke
a909fa3044 rest_qos: Fix to handle the case without QoS action
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>
2016-07-27 14:30:47 +09:00
Michael Haro
c631c46163 packet: support relayed DHCP packet
https://tools.ietf.org/html/draft-ietf-dhc-implementation-02#section-4.7.2

states that DHCP relays should use source port 67 and dest port 67.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-27 14:25:49 +09:00
Jonas Grunert
99d641c7d4 Fix: LLDP.OrganizationallySpecific not ignoring info field
LLDP.OrganizationallySpecificTLV did not set info field and produced
malformed LLDP packets

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-14 17:34:15 +09:00
Shinpei Muraoka
b09b39c11d test_parser: Add test data for some NXAction
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-12 13:21:47 +09:00
Shinpei Muraoka
0288ae2cfa ofproto/nx_actions: Support some NXAction
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>
2016-07-12 13:21:41 +09:00
Shinpei Muraoka
eed14371b8 ofproto/nx_actions: Add comment for Ryu documents
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-12 13:21:36 +09:00
Shinpei Muraoka
8b8162ca1f test_parser: Add test data for missing NXAction
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>
2016-07-12 13:21:30 +09:00
Shinpei Muraoka
89f6945b7e ofproto/nx_actions: Support missing NXAction
Actions to be added are as following.
 - NXActionDecTtlCntIds
 - NXActionStackPush
 - NXActionStackPop
 - NXActionSample
 - NXActionOutputReg2
 - NXActionRegLoad2
 - NXActionController2

Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-12 13:21:26 +09:00
Shinpei Muraoka
6daa1eedc5 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 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>
2016-07-12 13:21:20 +09:00
Shinpei Muraoka
8e30b1f444 test_parser: Add test data for NXAction used only in OpenFlow1.0
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-12 13:21:13 +09:00
Shinpei Muraoka
3b1a314bd0 ofproto/nx_actions: Add NXAction used only in OpenFlow1.0
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>
2016-07-12 13:21:05 +09:00
IWASE Yusuke
8cb23e19a7 test_packet: Avoid to use array.array as input binary
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>
2016-07-11 16:46:30 +09:00
IWASE Yusuke
3736ab76a5 packet: Fix minimum ethernet frame length
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>
2016-07-11 16:46:27 +09:00
IWASE Yusuke
81d3d5647c test_peer: Unit test for peer.py of BGPSpeaker
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-11 16:46:13 +09:00
IWASE Yusuke
55d955f484 BGPSpeaker: Support Four-Octet AS number
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-11 16:45:43 +09:00
IWASE Yusuke
2039347560 packet/bgp: Support Four-Octet AGGREGATOR Path Attribute
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-07-11 16:45:36 +09:00
IWASE Yusuke
a6c5f27cbe BGPSpeaker: Fix capability check when MP-BGP not supported
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>
2016-07-11 16:45:31 +09:00
Kawai, Hiroaki
04b4bbbe01 fix of13 VLAN_PCP test case
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>
2016-07-11 16:44:22 +09:00
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