94 Commits

Author SHA1 Message Date
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
Isaku Yamahata
de3308d10c doc: update using_with_openstack.rst to catch up openstack
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-22 20:26:48 +09:00
Isaku Yamahata
6461c84cb7 add HACKING.rst: style guide
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-22 20:25:15 +09:00
Isaku Yamahata
c7d42280cf doc: update osrg/nova, quantum repository
Updated the documentation to refer the repository as I updated the repos,
github.com/osrg/nova.git and github.com/osrg/quantum.git

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-17 11:35:12 +09:00
Isaku Yamahata
95f72ed9f2 setup.py: typo autor -> author
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-17 11:34:49 +09:00
Isaku Yamahata
8cca418059 dpset: pep8
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-14 06:29:57 +09:00
Isaku Yamahata
f5f36ea30d ryu/controller/handler: pep8
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-14 06:29:56 +09:00
Isaku Yamahata
79a4cce08a ofproto_parser: pep8
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-14 06:29:50 +09:00
Isaku Yamahata
95bfa7ad1d ofproto_v1_0_parser: typo
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-14 06:29:49 +09:00
Isaku Yamahata
9637144d00 ofproto/ofproto_v1_0_parser: unbreak 0bff34ca87af74b7eb13d9c996fd869172a7f0a4
The c/s 774088c3064604482e0d080f1bee2557ea705836 and
0bff34ca87af74b7eb13d9c996fd869172a7f0a4 have conflicted changes.
This patch unbreaks it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-14 06:29:48 +09:00
Isaku Yamahata
74858adb16 doc: sample configuration files
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-14 06:28:57 +09:00
Isaku Yamahata
a110a9c956 doc: step-by-step example
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-14 06:28:54 +09:00
Isaku Yamahata
6d4206d494 app/simple_isolation: various improvement
- add drop action when external network id
- improve handling port status change

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-02-10 16:45:30 +09:00