1656 Commits

Author SHA1 Message Date
Isaku Yamahata
7858adf321 ofproto/ofproto_v1_0_parser: serializer for NXActionResbumit
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-05-01 08:41:29 +09:00
Isaku Yamahata
d435bc605b ofproto/ofproto_v1_0_parser: serializer for nxt_flow_mod_table_id
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-05-01 08:40:58 +09:00
Isaku Yamahata
c88e1845c8 ofproto/ofproto_v1_0_parser: improve NXTRequest initializer
initialize subtype by base class, NXTRequest, instead of subclass.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Reviewed-by: Simon Horman <simon@horms.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-05-01 08:40:16 +09:00
Isaku Yamahata
72bb1a1e85 ofproto/ofproto_v1_0: more constants for nx
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-05-01 08:38:52 +09:00
Isaku Yamahata
d107e8e962 app/wsapi: make WSPathComponent inherit object
Later we create subclass of WSPathComponent so that make super() work.
app/wsapi: super().__init__()

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-05-01 08:35:08 +09:00
Isaku Yamahata
a7d3449668 app/wsapi/WSPathArbitraryString: wrong indent
WSPathArbitraryString.__str__ method should be instance method.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-05-01 08:34:29 +09:00
Isaku Yamahata
d486967bed add missing super().__init__()
- app/event_dumper
- controller/dispatcher
- controller/mac_to_network
- controller/mac_to_port
- app/simple_switch

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-05-01 08:31:40 +09:00
Isaku Yamahata
a7b72545a8 app/simple_isolation: unbreak nx patch
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-05-01 08:31:28 +09:00
Yoshihiro Kaneko
1ce1db030c fix find_flagfile path handling bug
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-04-11 13:46:42 +09:00
FUJITA Tomonori
96c91e59d6 update docs on the license switch
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-04-06 10:33:53 +09:00
FUJITA Tomonori
711301abb3 Switch to Apache 2.0 license
To make the further integration into IaaS OSS (OpenStack and
CloudStack) easier, we switch to Apache 2.0 license.

ryu/app/wsapi.py is still under GPL3 or later. We replace it later.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-04-06 08:38:45 +09:00
FUJITA Tomonori
382f9b3d95 Use the original file license
This file is based on code distributed under GPL3 or later so it
should stick to the same license.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-04-06 08:08:59 +09:00
FUJITA Tomonori
20b25a5f06 ryu 0.2
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v0.2
2012-04-04 02:40:20 +09:00
FUJITA Tomonori
8d2a263694 ignore GreenletExit exception
We get a pretty anonying message every time a datapath has gone since
we kill send_thr gleenlet in the normal termination. Let's ignore the
exception.

In the long term, we should improve error message delivering. Just
printing an error is pretty useless.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-16 02:39:44 +09:00
Simon Horman
006c7cb407 Add NXActionSetTunnel and NXActionSetTunnel64
These actions allow setting of the tunnel id when a packet
is transmitted over a tunnel. For example, to set a tenant-specific
id when transmitting packets over a tunnel used by more than one tenant.

The NXActionSetTunnel64 was added to OpenvSwtich after NXActionSetTunnel.
NXActionSetTunnel64 seems to be the preferred action although GRE tunnels
only support 32bit keys.t

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:44 -07:00
Simon Horman
c5a2dd55ed Allow send_flow_mod() to send NXTFlowMod messages
Allow send_flow_mod() to send NXTFlowMod messages in place of OFPFlowMod
messages if the match includes fields chat can't be encoded by OFPMatch

The flow format will be upgraded as necessary

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:42 -07:00
Simon Horman
a36af279b6 Add match_tuple() and flow_format() methods to ClsRule
This will be used to allow send_flow_mod() to
send either OFPFlowMod or NXTFlowMod messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:41 -07:00
Simon Horman
797b5ef385 Add NXTFlowMod
Allow Nicira Extension NXT_FLOW_MOD vendor messages
to be serialised. This is to allow setting flows
which require the use of NXM matches, for example
matching on the tunnel id.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:36 -07:00
Simon Horman
07b1afbcfa NXM: Add MFIPDSCP and MFIPECN classes
This is to handle IP_DSCP and IP_ECN NXM fields respectively.
This will be used when sending NXT_FLOW_MOD messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:34 -07:00
Simon Horman
3d780e2ce8 NXM: Add MFEthType class
This is to handle ETH_TYPE NXM fields.
This will used when sending NXM_FLOW_MOD messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:33 -07:00
Simon Horman
eb3fbc5d46 NXM: Add MFEthSrc class
This is to handle ETH_SRC NXM fields.
This will be used when sending NXM_FLOW_MOD messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:32 -07:00
Simon Horman
36a62fa2f1 NXM: Add MFEthDst class
This is to handle ETH_DST NXM fields.
This will used when sending NXT_FLOW_MOD messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:31 -07:00
Simon Horman
bb7d3e8dd2 NXM: Add MFTunId class
This is to handle TUN_ID and TUN_ID_W NXM fields.
This will be used when sending NXT_FLOW_MOD messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:30 -07:00
Simon Horman
cda7026742 NXM: Add MFInPort class
This is to handle IN_PORT NXM fields.
This will be used when sending NXT_FLOW_MOD messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:28 -07:00
Simon Horman
8033beab94 Add base for serialising NXM matches
This will be used when sending NXT_FLOW_MOD messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:27 -07:00
Simon Horman
85fe60abe0 Add support for NXT_SET_FLOW_FORMAT
This message may be used to request that the NXM
flow format may be used. NXM is used as the match
in NX vendor extension messages such as NXT_FLOW_MOD.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:25 -07:00
Simon Horman
0f8c795c99 Add Nicira vendor extensions
Add framework for Nicira vendor request messages.
This will be used to add support for NXT_SET_FLOW_FORMAT
and NXT_FLOW_MOD messages.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-13 21:41:22 -07:00
Isaku Yamahata
cdb513cce7 ryu/handler: class decorator should return class object
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-08 05:54:20 +09:00
Isaku Yamahata
ba5ce1a72e controller: print stack trace when datapath main loop goes wrong and log it
log errors when serving datapath. And a comment to clarify the intention.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-08 05:54:19 +09:00
Isaku Yamahata
828f58b2a7 controller/network: fix key error
This patch fixes key error exception.
The switch may connect to the controller before network creation API call.

> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.7/gevent/greenlet.py", line 390, in run
>     result = self._run(*self.args, **self.kwargs)
>   File "/ryubin/ryu/controller/controller.py", line 237, in datapath_connection_factory
>     datapath.serve()
>   File "/ryubin/ryu/controller/controller.py", line 184, in serve
>     self._recv_loop()
>   File "/ryubin/ryu/controller/controller.py", line 63, in deactivate
>     method(self)
>   File "/ryubin/ryu/controller/controller.py", line 136, in _recv_loop
>     self.ev_q.queue(ofp_event.ofp_msg_to_ev(msg))
>   File "/ryubin/ryu/controller/dispatcher.py", line 106, in queue
>     self._dispatcher(ev)
>   File "/ryubin/ryu/controller/dispatcher.py", line 170, in __call__
>     self.dispatch(ev)
>   File "/ryubin/ryu/controller/dispatcher.py", line 187, in dispatch
>     handled = self._dispatch(ev, self.events.get(ev.__class__, []))
>   File "/ryubin/ryu/controller/dispatcher.py", line 178, in _dispatch
>     ret = h(ev)
>   File "/ryubin/ryu/app/simple_isolation.py", line 45, in switch_features_handler
>     self.nw.add_datapath(ev.msg)
>   File "/ryubin/ryu/controller/network.py", line 137, in add_datapath
>     self.port_added(datapath, port_no)
>   File "/ryubin/ryu/controller/network.py", line 144, in port_added
>     dp = self.dpids[datapath.id]
> KeyError: None

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-08 05:54:18 +09:00
Simon Horman
bd73873882 Avoid loop in OFPAction.parser()
OFPAction.parser() should call the parser of one of the classes registered
in _ACTION_TYPES() rather than calling itself until a buffer underflow
occurs.

Also, it is not necessary to increment offset as the parser method of the
registered classes re-parse the type and length and thus do not expect it
to be incremented.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-07 15:31:20 +09:00
Simon Horman
4bd7c5026c Increment offset in OFPFlowStats.parser()
After reading the third portion of the header the offset needs
to be incremented as it is used to parse actions later on
in the function.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-06 08:37:29 +09:00
Simon Horman
abd83137e1 Use struct.unpack_from() in OFPFlowStats.parser()
struct.unpack_from() is needed in place of
struct.unpack() when an offset argument is passed.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-06 08:37:26 +09:00
FUJITA Tomonori
4556ac62fe doc: update README.rst (OpenStack mainline inclusion status)
Update OpenStack mainline inclusion status

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 15:10:03 +09:00
Simon Horman
6aa847a84e Correct typos in OFPFlowStatsRequestBase class
These changes correct what appear to be typos
* Parameters should be separated by a comma
* The type of the class is OFPFlowStatsRequestBase

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 10:02:10 +09:00
FUJITA Tomonori
d7ee5d2282 yield the CPU to other greenlets
We need to yield the CPU to other greenlets. Otherwise, ryu can't
accept new switches or handle the existing switches. The limit is
arbitrary. I guess that we need to think about the better approach in
the future (e.g. non greenlet framework).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:11:29 +09:00
FUJITA Tomonori
f6741e9c93 avoid reading too much data from socket
Currently, we try to read OFP_MSG_SIZE_MAX (65535) from sockets. This
hurts the performance badly. This patch changes ryu to read a single
request from socket.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:11:26 +09:00
FUJITA Tomonori
d0e3264a84 limit the queue size (send_q)
cbench in throughtput mode doesn't work with ryu. We need to limit
queue size to prevent the queue from eating memory up.

The size is arbitrary. It can be the startup parameter. But I think
that we should solve this in the better way. So let's not make it
global for now

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:11:01 +09:00
FUJITA Tomonori
e44c9d6089 kill recv_q
Using Queue hurts the performance badly. So let's kill recv_q. It's
not useufl.

Killing send_q is difficult because letting multiple greenlets to send
data to a switch is tricky.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:09:55 +09:00
Isaku Yamahata
d08c5c9ca8 dispatcher: eliminate weakref.WeakValueDictionary
For dispatcher to track children, WeakValueDictionary is used.
By using explicit destructor, don't use it

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:07:01 +09:00
Isaku Yamahata
1ca3314a66 dispatcher: eliminate use of weakref for EventQueue event queue
event queue for EventQueue event can be normal reference by assuming
the queue is never freed.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:06:54 +09:00
Isaku Yamahata
68b1424ef3 controller: eliminate weakref of datapath.ev_q.aux
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:06:48 +09:00
Isaku Yamahata
d650102e51 dispatcher: use TrackInstances and kill some WeakValueDictionary
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:06:38 +09:00
Isaku Yamahata
6b2e6521a3 lib: mixin class to track all instances of a given class
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:06:30 +09:00
Isaku Yamahata
0275604621 controller: make Controller::serve more robust
Even when exception occurred, kill other thread.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:06:21 +09:00
Isaku Yamahata
e546c1b812 ryu/controller/ofp_event: use utils.load_module
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:06:15 +09:00
Isaku Yamahata
de4c848844 ryu/utils: make import_module() reliable
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-03-01 09:06:08 +09:00
Isaku Yamahata
f3ba502bca controller/dispatcher: eliminate unregistering handlers
This patch eliminates unregistering handlers and inheritable handlers.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-24 10:10:28 +09:00
FUJITA Tomonori
92b58c2a41 enable OF1.2 support
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-23 12:57:51 +09:00
FUJITA Tomonori
bee5d55e80 add initial OF1.2 support
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-23 12:57:22 +09:00