2618 Commits

Author SHA1 Message Date
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
IWASE Yusuke
de2602bac7 test_parser: Add expected 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 10:52:08 +09:00
IWASE Yusuke
aa3a2d5949 packet_data_generator2: Add some OFP13/15 messages
Add the following OFP13/15 Messages.

 - OFP13/15 Handshake
     Implemented: OFPT_FEATURES_REPLY
     TODO:        OFPT_FEATURES_REQUEST
 - OFP13/15 Switch Configuration Messages
     Implemented: OFPT_SET_CONFIG, OFPT_GET_CONFIG_REPLY
     TODO:        OFPT_GET_CONFIG_REQUEST

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:07 +09:00
IWASE Yusuke
7d626a55b2 lib/ofctl_v1_*: Confirm hw_addr is str in mod_port_behavior
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 10:51:55 +09:00
IWASE Yusuke
a40efc3a45 test_ofctl: Compare sent messages in json representation
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>
2016-01-19 10:51:47 +09:00
Chia-Lin Cho
beb3353e39 Remove old link when link updates
Signed-off-by: Chia-Lin Cho <fox91119@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-01-19 10:22:06 +09:00
Minoru TAKAHASHI
ecfd21e5f9 fixes for mutable default arguments
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>
2016-01-19 10:03:57 +09:00
Victor Orlikowski
7826290ba6 Cleanup variable name for clarity
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>
2016-01-08 22:05:35 +09:00
FUJITA Tomonori
2250171098 cap oslo.config version only in python2.6
https://bugs.launchpad.net/neutron/+bug/1531837

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Reviewed-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
2016-01-08 21:07:35 +09:00
FUJITA Tomonori
cd779e2c55 Ryu 3.29
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v3.29
2016-01-04 09:50:45 +09:00
Victor Orlikowski
27ca64c726 Generate new datapath event for switch connecting multiple times
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>
2015-12-30 14:21:01 +09:00
Victor Orlikowski
6945ad3ef1 Fix handling of state transition to config mode
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>
2015-12-30 14:18:39 +09:00
Victor Orlikowski
46f4ced165 Clean up for stability patch submitted previously
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>
2015-12-30 14:18:39 +09:00
IWAMOTO Toshihiro
c085c0d40e Ensure to terminate threads where RyuApp.start() gives a thread object
Otherwise, AppManager.run_apps fails to terminate.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-25 10:03:53 +09:00
Minoru TAKAHASHI
4feded18f3 ofctl_v1/2/3: Some improvements
* 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>
2015-12-25 10:03:53 +09:00
Minoru TAKAHASHI
3e86414b02 of14: Add action experimenter to flow stats reply unit test
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-25 10:03:53 +09:00
IWASE Yusuke
541dc65026 test_tcp: Update test cases for tcp option
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>
2015-12-25 10:03:53 +09:00
IWASE Yusuke
9521e46181 lib/packet/tcp: Parse TCP Option field
Suggested-by: Ramana Reddy <gtvrreddy@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>
2015-12-25 10:03:52 +09:00
ISHIDA Wataru
d9ecfccdc8 bgp: fix handling unknown and unsupported transitive path
attributes

we must forward optional transitive path attributes.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-12-25 10:03:52 +09:00
IWASE Yusuke
fede089e93 ofp_handler: Remove sending SET_CONFIG message
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>
2015-12-22 14:13:16 +09:00