Skip to content

Commit aa5051a

Browse files
committed
initial commit
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
0 parents  commit aa5051a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+15847
-0
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*.py[co]
2+
*~
3+
*.egg-info/
4+
build/
5+
dist/
6+
7+
GTAGS
8+
GRTAGS
9+
GPATH
10+
GSYMS

COPYING

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GPL v3 only

MANIFEST.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include COPYING LICENSE
2+
include README.rst
3+
include MANIFEST.in
4+
graft contrib
5+
graft doc
6+
graft etc
7+
recursive-exclude doc/build/*/ *
8+
global-exclude *~
9+
global-exclude *.pyc
10+
global-exclude .gitignore

README.rst

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
****************************
2+
Ryu Network Operating System
3+
****************************
4+
5+
For details, please see the documentation under doc/ directory and
6+
make html (or make <format you prefer>). If you have any
7+
questions, suggestions, and patches, the mailing list is available at
8+
`ryu-devel ML
9+
<https://lists.sourceforge.net/lists/listinfo/ryu-devel>`_.
10+
11+
Ryu Official site is `<http://www.osrg.net/ryu/>`_.
12+
13+
14+
Overview
15+
========
16+
Ryu is an open-sourced Network Operating System (NOS) licensed under
17+
GPL v3. It's fully written in Python.
18+
19+
Ryu aims to provide a logically centralized control and well defined
20+
API that make it easy for operators to create new network management
21+
and control applications. Currently, Ryu supports OpenFlow protocol to
22+
modify the behavior of network devices.
23+
24+
We aim at the de facto OSS NOS implementation and NOS API.
25+
26+
Currently, Ryu is shipped with one control application for `OpenStack
27+
<http://openstack.org/.>`_ network management L2 segregation of
28+
tenants without using VLAN. The application includes changes to
29+
OpenStack (nova, quantum ovs plugin, etc).
30+
31+
The project goal is to develop an OSS Network Operating System that
32+
has high quality enough for use in large production environment in
33+
code quality/functionality/usability.
34+
35+
36+
TODO
37+
====
38+
* OpenFlow Protocol version 1.2 (right after the spec release)
39+
* The better API for control applications
40+
* Cluster support
41+
* ...too many for here.
42+
43+
44+
Quick Start
45+
===========
46+
Get source code::
47+
48+
% git clone git://github.com/osrg/ryu.git
49+
50+
Then just type::
51+
52+
% cd ryu; python ./setup.py install
53+
54+
and run ryu-manager command which is installed.
55+
Then set up your openflow switch (hardware switch or OVS) to connect the ip
56+
address and port to which ryu-manager is listening.
57+
If you want to use it with Openstack (nova and quantum with ovs plugin),
58+
please refer detailed documents under doc/ directory.
59+
60+
61+
Requirement
62+
===========
63+
* python-setuptools
64+
* python-gevent >= 0.13
65+
* python-gflags
66+
* python-sphinx
67+
68+
69+
Project Members
70+
===============
71+
* OHMURA Kei <ohmura.kei at lab.ntt.co.jp>
72+
* MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
73+
* Isaku Yamahata <yamahata at valinux co jp>
74+
* FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
75+

bin/ryu-client

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env python
2+
#
3+
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
4+
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
5+
#
6+
# This program is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, version 3 of the License
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
import sys
19+
from optparse import OptionParser
20+
21+
from ryu.app.client import OFPClient
22+
23+
24+
def client_test():
25+
parser = OptionParser(usage="Usage: %prog [OPTIONS] <command> [args]")
26+
parser.add_option("-H", "--host", dest="host", type="string",
27+
default="127.0.0.1", help="ip address rest api service")
28+
parser.add_option("-p", "--port", dest="port", type="int", default="8080")
29+
30+
options, args = parser.parse_args()
31+
if len(args) == 0:
32+
parser.print_help()
33+
sys.exit(1)
34+
35+
client = OFPClient(options.host + ':' + str(options.port))
36+
commands = {
37+
'list_nets': lambda a: sys.stdout.write(client.get_networks()),
38+
'create_net': lambda a: client.create_network(a[1]),
39+
'update_net': lambda a: client.update_network(a[1]),
40+
'delete_net': lambda a: client.delete_network(a[1]),
41+
'list_ports': lambda a: sys.stdout.write(client.get_ports(a[1])),
42+
'create_port': lambda a: client.create_port(a[1], a[2], a[3]),
43+
'update_port': lambda a: client.update_port(a[1], a[2], a[3]),
44+
'delete_port': lambda a: client.delete_port(a[1], a[2], a[3])
45+
}
46+
47+
# allow '-', instead of '_'
48+
commands.update(dict([(k.replace('_', '-'), v)
49+
for (k, v) in commands.items()]))
50+
51+
cmd = args[0]
52+
commands[cmd](args)
53+
54+
if __name__ == "__main__":
55+
client_test()

bin/ryu-manager

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env python
2+
#
3+
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
4+
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
5+
#
6+
# This program is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, version 3 of the License
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
import gevent
19+
import gflags
20+
import logging
21+
import sys
22+
23+
from gevent import monkey
24+
monkey.patch_all()
25+
26+
from ryu import log
27+
log.earlyInitLog(logging.DEBUG)
28+
29+
from ryu import flags
30+
from ryu import utils
31+
from ryu.base.app_manager import AppManager
32+
from ryu.controller import controller
33+
from ryu.app import wsapi
34+
from ryu.app import rest
35+
from ryu.controller import network
36+
37+
38+
FLAGS = gflags.FLAGS
39+
gflags.DEFINE_multistring('app_lists',
40+
['ryu.app.simple_isolation.SimpleIsolation',
41+
'ryu.app.rest.restapi'],
42+
'application module name to run')
43+
44+
45+
def main():
46+
utils.find_flagfile()
47+
args = FLAGS(sys.argv)
48+
log.initLog()
49+
50+
nw = network.network()
51+
52+
app_mgr = AppManager()
53+
app_mgr.load_apps(FLAGS.app_lists, network=nw)
54+
55+
services = []
56+
57+
ctlr = controller.OpenFlowController()
58+
thr = gevent.spawn_later(0, ctlr)
59+
services.append(thr)
60+
61+
# NOX webservice API
62+
ws = wsapi.wsapi()
63+
thr = gevent.spawn_later(0, ws)
64+
services.append(thr)
65+
66+
gevent.joinall(services)
67+
68+
if __name__ == "__main__":
69+
main()

doc/Makefile

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
PAPER =
8+
BUILDDIR = build
9+
10+
# Internal variables.
11+
PAPEROPT_a4 = -D latex_paper_size=a4
12+
PAPEROPT_letter = -D latex_paper_size=letter
13+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
14+
15+
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
16+
17+
help:
18+
@echo "Please use \`make <target>' where <target> is one of"
19+
@echo " html to make standalone HTML files"
20+
@echo " dirhtml to make HTML files named index.html in directories"
21+
@echo " singlehtml to make a single large HTML file"
22+
@echo " pickle to make pickle files"
23+
@echo " json to make JSON files"
24+
@echo " htmlhelp to make HTML files and a HTML help project"
25+
@echo " qthelp to make HTML files and a qthelp project"
26+
@echo " devhelp to make HTML files and a Devhelp project"
27+
@echo " epub to make an epub"
28+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
29+
@echo " latexpdf to make LaTeX files and run them through pdflatex"
30+
@echo " text to make text files"
31+
@echo " man to make manual pages"
32+
@echo " changes to make an overview of all changed/added/deprecated items"
33+
@echo " linkcheck to check all external links for integrity"
34+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
35+
36+
clean:
37+
-rm -rf $(BUILDDIR)/*
38+
39+
html:
40+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
41+
@echo
42+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
43+
44+
dirhtml:
45+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
46+
@echo
47+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
48+
49+
singlehtml:
50+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
51+
@echo
52+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
53+
54+
pickle:
55+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
56+
@echo
57+
@echo "Build finished; now you can process the pickle files."
58+
59+
json:
60+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
61+
@echo
62+
@echo "Build finished; now you can process the JSON files."
63+
64+
htmlhelp:
65+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
66+
@echo
67+
@echo "Build finished; now you can run HTML Help Workshop with the" \
68+
".hhp project file in $(BUILDDIR)/htmlhelp."
69+
70+
qthelp:
71+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
72+
@echo
73+
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
74+
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
75+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ryu.qhcp"
76+
@echo "To view the help file:"
77+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ryu.qhc"
78+
79+
devhelp:
80+
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
81+
@echo
82+
@echo "Build finished."
83+
@echo "To view the help file:"
84+
@echo "# mkdir -p $$HOME/.local/share/devhelp/ryu"
85+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ryu"
86+
@echo "# devhelp"
87+
88+
epub:
89+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
90+
@echo
91+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
92+
93+
latex:
94+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
95+
@echo
96+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
97+
@echo "Run \`make' in that directory to run these through (pdf)latex" \
98+
"(use \`make latexpdf' here to do that automatically)."
99+
100+
latexpdf:
101+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
102+
@echo "Running LaTeX files through pdflatex..."
103+
$(MAKE) -C $(BUILDDIR)/latex all-pdf
104+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
105+
106+
text:
107+
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
108+
@echo
109+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
110+
111+
man:
112+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
113+
@echo
114+
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
115+
116+
changes:
117+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
118+
@echo
119+
@echo "The overview file is in $(BUILDDIR)/changes."
120+
121+
linkcheck:
122+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
123+
@echo
124+
@echo "Link check complete; look for any errors in the above output " \
125+
"or in $(BUILDDIR)/linkcheck/output.txt."
126+
127+
doctest:
128+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
129+
@echo "Testing of doctests in the sources finished, look at the " \
130+
"results in $(BUILDDIR)/doctest/output.txt."

doc/source/_static/.placeholder

Whitespace-only changes.

doc/source/_templates/.placeholder

Whitespace-only changes.

0 commit comments

Comments
 (0)