2637 Commits

Author SHA1 Message Date
IWASE Yusuke
f2bb13dbb5 run_mininet: Adopt utility methods of Mininet class
Currently, run_mininet uses low level APIs of mininet.
This patch fixes to use utility methods of Mininet class.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 20:40:07 +09:00
IWASE Yusuke
6b10a3b45a run_mininet: Support protocols option of ovs-vsctl
To support user-specified OpenFlow version, this patch adds protocols
option support into run_mininet script.

Usage example)
  $ sudo python run_mininet.py --protocols OpenFlow13

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 20:40:02 +09:00
IWASE Yusuke
7b5d6bd24a ofp_handler: Handle empty data field in OFPErrorMsg
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>
2016-02-27 20:39:55 +09:00
Minoru TAKAHASHI
51fcda83b5 lib/ofctl: add test files for ofctl_v14
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 20:39:34 +09:00
Minoru TAKAHASHI
31d56d0d32 lib/ofctl: add ofctl_v1_4 library
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 20:39:28 +09:00
Minoru TAKAHASHI
c56edd5890 app/ofctl_rest: support OpenFlow1.4
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-27 20:39:24 +09:00
Minoru TAKAHASHI
6b3c4dfd43 ofproto: Fixes invalid async config property types
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>
2016-02-18 13:24:06 +09:00
IWASE Yusuke
ede171c529 simple_switch: Separate simple_switch for beginners
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>
2016-02-18 08:42:30 +09:00
FUJITA Tomonori
af5e6b5fb7 drop python2.6 support
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>
2016-02-18 06:54:47 +09:00
Corey Bryant
27409a544e Fix i386 test failures
Signed-off-by: Corey Bryant <corey.bryant@canonical.com>
Reviewed-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-18 06:51:53 +09:00
IWAMOTO Toshihiro
5552348c7c test_parser: add an NXActionRegLoad test
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 14:47:46 +09:00
IWAMOTO Toshihiro
d4c6e154d5 packet_data_generator3: generate an NXActionRegLoad packet
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 14:47:45 +09:00
IWAMOTO Toshihiro
8830f61caf Implement NXActionRegLoad
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>
2016-02-10 14:47:44 +09:00
IWASE Yusuke
efc859eebf test_parser: Fix ofp_multipart_type in OFPFlowStatsRequest
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 13:52:56 +09:00
IWASE Yusuke
5cb8f8ccc7 ofproto_v1_5_parser: Add missing field in OFPMeterFeaturesStats
"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>
2016-02-10 13:52:53 +09:00
IWASE Yusuke
a1fd26f89a ofproto_v1_5_parser: Fix unresolved structure references
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 13:52:48 +09:00
IWASE Yusuke
e24fd2fd79 test_parser: Add missing packet data for OFP15
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 13:52:38 +09:00
IWASE Yusuke
2ae4f884ab tox: Adapt to PyPy interpreter
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>
2016-02-10 13:46:35 +09:00
Minoru TAKAHASHI
4dc709d90d of12/3/4/5: fix to_jsondict of OFPActionSetField
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>
2016-02-10 13:35:13 +09:00
Jason Kölker
00c7d2918d protocols/bgp: Log socket creation error
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>
2016-02-10 13:35:12 +09:00
FUJITA Tomonori
4f1a4db7a4 Ryu 3.30
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v3.30
2016-02-02 09:27:53 +09:00
IWAMOTO Toshihiro
1076dfd3b4 Update conntrack test json and binary packets
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>
2016-02-01 16:49:00 +09:00
IWAMOTO Toshihiro
135a1cb4cd test_parser: add conntrack NAT tests
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-01 16:38:38 +09:00
IWAMOTO Toshihiro
1d75182e9e packet_data_generator3: add a couple of conntrack packets
Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-01 16:38:37 +09:00
IWAMOTO Toshihiro
9fe0126b93 Implement NXActionNAT
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>
2016-02-01 16:38:34 +09:00
Victor Orlikowski
28cb1d59d9 rest_router: Ensure that usage of icmp.dest_unreach and icmp.TimeExceeded complies with RFC 4884
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>
2016-02-01 09:00:46 +09:00
Victor Orlikowski
8f7d302fd5 packet: Better validate parameters to constructors better icmp
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>
2016-01-31 14:54:06 +09:00
FUJITA Tomonori
0b00bfb274 doc: remove obsolete OpenStack info
ofagent is obsolete. Ryu became the part of OVS agent.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-31 14:20:38 +09:00
Victor Orlikowski
0bfdd1e8fb bgp: Clean up syntax in services/protocols/bgp/operator/views/base.py to avoid SyntaxErrors
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>
2016-01-31 13:40:47 +09:00
Victor Orlikowski
e3d0721892 Reconnected event additions and cleanups
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>
2016-01-31 13:19:27 +09:00
Victor Orlikowski
14379f280b test: Yet another typo fix
This patch merely cleans up a typo.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-31 13:09:54 +09:00
Ygor Amaral
8a90e9a830 test: ImportError fix, error caused by unordered import Link
Signed-off-by: Ygor Amaral <ygor.amaral@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-31 12:50:44 +09:00
Chia-Lin Cho
648ac64fd6 topology: Make sure the last IP in the list is the newest IP.
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>
2016-01-31 12:46:48 +09:00
Victor Orlikowski
63f9502ea0 Message cleanup in ofproto_parser
Minor message text cleanup.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-30 23:56:37 +09:00
Victor Orlikowski
849a9e3a4d Typo cleanup
Minor message text cleanup.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-30 23:56:15 +09:00
Victor Orlikowski
9386be6ebc Typo fixes in lib/packet/bgp.py
A couple of minor typo fixes.

Signed-off-by: Victor J. Orlikowski <vjo@duke.edu>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-30 23:55:05 +09:00
Jan Keler
c1c78269ac Fix: "AddrFormatError: address '...' is not an EUIv48"
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-30 23:35:28 +09:00
Jason Kölker
73416eacb1 packet/bgp: Gaurd against extra data in the buffer
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>
2016-01-30 22:19:05 +09:00
Jason Kölker
a71c2a9e1b protocols/ovsdb: Forcably kill the main_thread
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>
2016-01-30 22:18:51 +09:00
Jason Kölker
636de20197 protocols/ovsdb: Handle accept() errors
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>
2016-01-30 22:18:45 +09:00
Jason Kölker
df065f5bb1 protocols/ovsdb: Handle disconnects gracefully
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>
2016-01-30 22:18:40 +09:00
FUJITA Tomonori
5d04752421 test: disable rpc unittest with large file for now
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>
2016-01-30 22:00:19 +09:00
Minoru TAKAHASHI
75fe76c4a5 ofproto/NXAction: Fix NXActionUnknown parsing
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>
2016-01-21 23:01:17 +09:00
Minoru TAKAHASHI
97ebd2fc56 of14_parser: unify OFPActionExperimenter implementation
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>
2016-01-21 23:01:16 +09:00
IWASE Yusuke
dbbd05f7bb test_ofctl: Update json representations
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 13:38:19 +09:00
IWASE Yusuke
001a6956f2 test_ofctl_utils: Add unit tests for ofctl_utils.py
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 13:38:18 +09:00
IWASE Yusuke
19e49c861f lib/ofctl: Add utility library for ofctl_v1_*.py
This patch enables ofctl_v1_*.py to use the reserved OpenFlow
numbers (e.g. port numbering such as "OFPP_CONTROLLER") in the
request and reply parameters of ofctl_rest.py.

Example:
  - When adding a flow entry:
    $ curl -X POST -d '{
        "dpid": 1,
        "actions":[
            {
                "type": "OUTPUT",
                "port": "CONTROLLER"
            }
        ]
     }' http://localhost:8080/stats/flowentry/add

  - When getting flows stats:
    $ curl -X GET http://localhost:8080/stats/flow/1
    {
      "1": [
        {
          ...
          "actions": [
            "OUTPUT:CONTROLLER"
          ],
          ...
        }
      ]
    }

Suggested-by: Sergio Andres Rivera Polanco <sergiorivera88@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 13:38:12 +09:00
IWASE Yusuke
9571fde7dd doc: Add Nicira Extension Structures references
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 10:52:21 +09:00
IWASE Yusuke
a2d71f3198 doc: ofproto_ref: Update supported actions/matches list
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 10:52:19 +09:00
IWASE Yusuke
6d2b1c5035 packet_data: regen
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 10:52:10 +09:00