Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
  • Loading branch information
fujita committed Dec 9, 2011
0 parents commit aa5051a
Show file tree
Hide file tree
Showing 70 changed files with 15,847 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.py[co]
*~
*.egg-info/
build/
dist/

GTAGS
GRTAGS
GPATH
GSYMS
674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GPL v3 only
10 changes: 10 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include COPYING LICENSE
include README.rst
include MANIFEST.in
graft contrib
graft doc
graft etc
recursive-exclude doc/build/*/ *
global-exclude *~
global-exclude *.pyc
global-exclude .gitignore
75 changes: 75 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
****************************
Ryu Network Operating System
****************************

For details, please see the documentation under doc/ directory and
make html (or make <format you prefer>). If you have any
questions, suggestions, and patches, the mailing list is available at
`ryu-devel ML
<https://lists.sourceforge.net/lists/listinfo/ryu-devel>`_.

Ryu Official site is `<http://www.osrg.net/ryu/>`_.


Overview
========
Ryu is an open-sourced Network Operating System (NOS) licensed under
GPL v3. It's fully written in Python.

Ryu aims to provide a logically centralized control and well defined
API that make it easy for operators to create new network management
and control applications. Currently, Ryu supports OpenFlow protocol to
modify the behavior of network devices.

We aim at the de facto OSS NOS implementation and NOS API.

Currently, Ryu is shipped with one control application for `OpenStack
<http://openstack.org/.>`_ network management L2 segregation of
tenants without using VLAN. The application includes changes to
OpenStack (nova, quantum ovs plugin, etc).

The project goal is to develop an OSS Network Operating System that
has high quality enough for use in large production environment in
code quality/functionality/usability.


TODO
====
* OpenFlow Protocol version 1.2 (right after the spec release)
* The better API for control applications
* Cluster support
* ...too many for here.


Quick Start
===========
Get source code::

% git clone git://github.com/osrg/ryu.git

Then just type::

% cd ryu; python ./setup.py install

and run ryu-manager command which is installed.
Then set up your openflow switch (hardware switch or OVS) to connect the ip
address and port to which ryu-manager is listening.
If you want to use it with Openstack (nova and quantum with ovs plugin),
please refer detailed documents under doc/ directory.


Requirement
===========
* python-setuptools
* python-gevent >= 0.13
* python-gflags
* python-sphinx


Project Members
===============
* OHMURA Kei <ohmura.kei at lab.ntt.co.jp>
* MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
* Isaku Yamahata <yamahata at valinux co jp>
* FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>

55 changes: 55 additions & 0 deletions bin/ryu-client
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env python
#
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import sys
from optparse import OptionParser

from ryu.app.client import OFPClient


def client_test():
parser = OptionParser(usage="Usage: %prog [OPTIONS] <command> [args]")
parser.add_option("-H", "--host", dest="host", type="string",
default="127.0.0.1", help="ip address rest api service")
parser.add_option("-p", "--port", dest="port", type="int", default="8080")

options, args = parser.parse_args()
if len(args) == 0:
parser.print_help()
sys.exit(1)

client = OFPClient(options.host + ':' + str(options.port))
commands = {
'list_nets': lambda a: sys.stdout.write(client.get_networks()),
'create_net': lambda a: client.create_network(a[1]),
'update_net': lambda a: client.update_network(a[1]),
'delete_net': lambda a: client.delete_network(a[1]),
'list_ports': lambda a: sys.stdout.write(client.get_ports(a[1])),
'create_port': lambda a: client.create_port(a[1], a[2], a[3]),
'update_port': lambda a: client.update_port(a[1], a[2], a[3]),
'delete_port': lambda a: client.delete_port(a[1], a[2], a[3])
}

# allow '-', instead of '_'
commands.update(dict([(k.replace('_', '-'), v)
for (k, v) in commands.items()]))

cmd = args[0]
commands[cmd](args)

if __name__ == "__main__":
client_test()
69 changes: 69 additions & 0 deletions bin/ryu-manager
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/bin/env python
#
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import gevent
import gflags
import logging
import sys

from gevent import monkey
monkey.patch_all()

from ryu import log
log.earlyInitLog(logging.DEBUG)

from ryu import flags
from ryu import utils
from ryu.base.app_manager import AppManager
from ryu.controller import controller
from ryu.app import wsapi
from ryu.app import rest
from ryu.controller import network


FLAGS = gflags.FLAGS
gflags.DEFINE_multistring('app_lists',
['ryu.app.simple_isolation.SimpleIsolation',
'ryu.app.rest.restapi'],
'application module name to run')


def main():
utils.find_flagfile()
args = FLAGS(sys.argv)
log.initLog()

nw = network.network()

app_mgr = AppManager()
app_mgr.load_apps(FLAGS.app_lists, network=nw)

services = []

ctlr = controller.OpenFlowController()
thr = gevent.spawn_later(0, ctlr)
services.append(thr)

# NOX webservice API
ws = wsapi.wsapi()
thr = gevent.spawn_later(0, ws)
services.append(thr)

gevent.joinall(services)

if __name__ == "__main__":
main()
130 changes: 130 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

clean:
-rm -rf $(BUILDDIR)/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ryu.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ryu.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/ryu"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ryu"
@echo "# devhelp"

epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
Empty file added doc/source/_static/.placeholder
Empty file.
Empty file.
Loading

0 comments on commit aa5051a

Please sign in to comment.