Age | Commit message (Collapse) | Author |
|
This patch implements router Ryu application.
packet is forwarded on the static routing table.
The routing table can be set up by the REST commands.
and, Router can handle each vlan groups separately.
--------------------------------------------
* Example
case: Set static route on vlanID=10
From: address(172.16.10.0/24) belongs to the rest_router(switch_id=0000000000000001)
To : address(10.0.255.0/24) belongs to the gateway router(192.168.10.20)
- Following is the rest_router(switch_id=0000000000000001)'s setting.
If the gateway router operates by the rest_router Ryu applicaion too,
same setting is required.
1. add Address data(172.16.10.0/24, default_route=172.16.10.1)
$ curl -X POST -d '{"address":"172.16.10.1/24"}' http://localhost:8080/router/0000000000000001/10
2. add Address data(192.168.10.0/24, default_route=192.168.10.1)
$ curl -X POST -d '{"address":"192.168.10.1/24"}' http://localhost:8080/router/0000000000000001/10
3. add Static route(destination=10.0.255.0/24, gateway=192.168.10.20)
$ curl -X POST -d '{"destination":"10.0.255.0/24","gateway":"192.168.10.20"}' http://localhost:8080/router/0000000000000001/10
- route can not be registered, if gateway's address is not registered as 'address data'
4. check of the registered address data and routing data.
$ curl http://localhost:8080/router/0000000000000001/10
5. you can send packets from host(172.16.10.0/24) to gateway router(192.168.10.20),
and send to host(10.0.255.0/24) if gateway router is set up correctly.
(packet needs to contain vlan-tag=10)
--------------------------------------------
Please refer to rest_router.py comments, for other RESTcommand interfaces.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka@nttcom.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
When ryu starts up, related openstack components (keystone and neutron)
might not be running. They might be during start up process.
In that case, quantum_adapter results in exception as follows.
So in order to avoid ordering of starting up, lazily initialize neutoron
api.
> hub: uncaught exception: Traceback (most recent call last):
> File "/ryu/lib/hub.py", line 48, in _launch
> func(*args, **kwargs)
> File "/ryu/base/app_manager.py", line 173, in _event_loop
> handler(ev)
> File "/ryu/app/quantum_adapter.py", line 398, in dp_handler
> ovs_switch = self._get_ovs_switch(dpid)
> File "/ryu/app/quantum_adapter.py", line 381, in _get_ovs_switch
> ovs_switch = OVSSwitch(dpid, self.nw, self.ifaces, self.logger)
> File "/ryu/app/quantum_adapter.py", line 167, in __init__
> token = _get_auth_token(logger)
> File "/ryu/app/quantum_adapter.py", line 90, in _get_auth_token
> httpclient.authenticate()
> File "/neutronclient/client.py", line 211, in authenticate
> content_type="application/json")
> File "/neutronclient/client.py", line 141, in _cs_request
> raise exceptions.ConnectionFailed(reason=e)
> ConnectionFailed: Connection to neutron failed: [Errno 111] ECONNREFUSED
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Philipp Aeschlimann <aepp@zhaw.ch>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
The order between the notification of ovs port deletion via OVSDB protocol and
the notification network id/port deletion via REST from quantum plugin
isn't deterministic.
So when ovs port is deleted, the corresponding network id may or may not
exist.
The code wrongly assumed the order, so resulted in the following exception.
When ovs port is deleted and the corresponding network id isn't find,
just ignore the exception.
> (19257) accepted ('127.0.0.1', 36841)
> 127.0.0.1 - - [19/Jun/2013 11:24:25] "DELETE /v1.0/tunnels/networks/8179bb70-a63f-4c74-a82e-a21f3c275c9a/key HTTP/1.1" 200 115 0.000383
> hub: uncaught exception: Traceback (most recent call last):
> File "/opt/stack/ryu/ryu/lib/hub.py", line 50, in _launch
> func(*args, **kwargs)
> File "/opt/stack/ryu/ryu/base/app_manager.py", line 104, in _event_loop
> handler(ev)
> File "/opt/stack/ryu/ryu/app/quantum_adapter.py", line 368, in
> port_del_handler
> self._port_handler(ev.dp.id, port.port_no, name, False)
> File "/opt/stack/ryu/ryu/app/quantum_adapter.py", line 336, in _port_handler
> ovs_switch.update_port(port_no, port_name, add)
> File "/opt/stack/ryu/ryu/app/quantum_adapter.py", line 279, in update_port
> self._update_vif_port(old_port, add=False)
> File "/opt/stack/ryu/ryu/app/quantum_adapter.py", line 194, in
> _update_vif_port
> self.network_api.remove_port(network_id, self.dpid, port.ofport)
> File "/opt/stack/ryu/ryu/controller/network.py", line 368, in remove_port
> self.networks.remove(network_id, dpid, port_no)
> File "/opt/stack/ryu/ryu/controller/network.py", line 119, in remove
> raise NetworkNotFound(network_id=network_id)
> NetworkNotFound: no such network id 8179bb70-a63f-4c74-a82e-a21f3c275c9a
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
When tunnel key is registers, network is is not always
registered.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
When tunnel key add/del event fires, the corresponding network_id
does not necessarily exists due to race condition.
So mask it.
(15612) accepted ('127.0.0.1', 45714)
127.0.0.1 - - [25/Jun/2013 12:18:18] "DELETE
/v1.0/networks/462be334-3160-48ae-9ef8-a456dc866f8f HTTP/1.1" 200 115
0.000393
(15612) accepted ('127.0.0.1', 45715)
127.0.0.1 - - [25/Jun/2013 12:18:18] "DELETE
/v1.0/tunnels/networks/462be334-3160-48ae-9ef8-a456dc866f8f/key
HTTP/1.1" 200 115 0.000260
hub: uncaught exception: Traceback (most recent call last):
File "/opt/stack/ryu/ryu/lib/hub.py", line 50, in _launch
func(*args, **kwargs)
File "/opt/stack/ryu/ryu/base/app_manager.py", line 104, in _event_loop
handler(ev)
File "/opt/stack/ryu/ryu/app/gre_tunnel.py", line 233, in
tunnel_key_del_handler
for (dpid, port_no) in self.nw.list_ports(network_id):
File "/opt/stack/ryu/ryu/controller/network.py", line 325, in list_ports
return self.networks.list_ports(network_id)
File "/opt/stack/ryu/ryu/controller/network.py", line 103, in list_ports
raise NetworkNotFound(network_id=network_id)
NetworkNotFound: no such network id 462be334-3160-48ae-9ef8-a456dc866f8f
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
This depends on thread scheduling.
When event handler is invoked, there may not corresponding network_id in
network module.
In fact, Network.remove_network() fires EventNetworkPort(add_del=False)
before EventNetworkDel event so that it is unnecessary to call
_vm_port_mac_handler().
> 127.0.0.1 - - [19/Jun/2013 11:24:25] "DELETE
> /v1.0/networks/8179bb70-a63f-4c74-a82e-a21f3c275c9a HTTP/1.1" 200 115 0.000488
> hub: uncaught exception: Traceback (most recent call last):
> File "/opt/stack/ryu/ryu/lib/hub.py", line 50, in _launch
> func(*args, **kwargs)
> File "/opt/stack/ryu/ryu/base/app_manager.py", line 104, in _event_loop
> handler(ev)
> File "/opt/stack/ryu/ryu/app/gre_tunnel.py", line 210, in network_del_handler
> for (dpid, port_no) in self.nw.list_ports(network_id):
> File "/opt/stack/ryu/ryu/controller/network.py", line 319, in list_ports
> return self.networks.list_ports(network_id)
> File "/opt/stack/ryu/ryu/controller/network.py", line 97, in list_ports
> raise NetworkNotFound(network_id=network_id)
> NetworkNotFound: no such network id 8179bb70-a63f-4c74-a82e-a21f3c275c9a
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Neutron plugin can call remove_port after network deletion for
automatic delete port like router/dhcp port. So ignore NetworkNotFound
exception.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
And make Network.remove_network more robust.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
W: 18,0: Unused import logging
W: 28,0: Unused import event
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
W: 17,0: Unused import logging
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
W: 18,0: Unused import logging
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
normalize str() outputs so that tests like str(msg1) == str(msg2)
more likely succeed.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
normalize str() outputs so that tests like str(msg1) == str(msg2)
more likely succeed.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
factor out guts of StringifyMixin into a separate module.
add methods to convert to/from json.loads/dumps-compatible dictionary.
this is mainly for json representation of of-wire (OFPxxx) classes.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Catch up for rename from quantumclient to neutronclient.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
When independent methods for different dispatchers defined, all methods
are called independent of state. This patch teach event dispatcher state.
The following class
class PacketTesting(app_manager.RyuApp):
@set_ev_cls(ofp_event.EventOFPEchoRequest, MAIN_DISPATCHER)
def _echo_rep_main(self, ev):
print "DEBUG: In Handler for Echo Request (Main)"
@set_ev_cls(ofp_event.EventOFPEchoRequest, CONFIG_DISPATCHER)
def _echo_rep_conf(self, ev):
print "DEBUG: In Handler for Echo Request (Config)"
@set_ev_cls(ofp_event.EventOFPEchoRequest, HANDSHAKE_DISPATCHER)
def _echo_rep_hand(self, ev):
print "DEBUG: In Handler for Echo Request (Handshake)"
output
> EVENT ofp_event->PacketTesting EventOFPEchoRequest
> DEBUG: In Handler for Echo Request (Config)
> DEBUG: In Handler for Echo Request (Dead)
> DEBUG: In Handler for Echo Request (Handshake)
> DEBUG: In Handler for Echo Request (Main)
Reported-by: Alan Barr <alanbarr2002@gmail.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
ryu-client isn't installed any more as it has been moved to ryu/tests.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
ryu.noarch: E: non-executable-script /usr/lib/python2.7/site-packages/ryu/tests/unit/lib/test_hub.py 0644L /usr/bin/env
ryu.noarch: E: non-executable-script /usr/lib/python2.7/site-packages/ryu/lib/hub.py 0644L /usr/bin/env
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
> warning: manifest_maker: MANIFEST.in, line 4: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
> warning: no previously-included files matching '*' found under directory 'doc/build/*/'
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
restore openstack copyright notice for the code taken from them.
> commit f2c6dfe1066aeecb5fdf2fb1cd5ce6476565fd24
> Author: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Date: Fri Nov 30 15:54:12 2012 +0900
>
> set setup.py install_requires properly
>
> Let's enable pip to solve the dependency.
>
> The code is taken from OpenStack.
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
The patch teaches packet library to truncate padding octets.
Change packet_base.parser() to return (header, next_type, rest_of_packet)
The protocol class that knows its payload length should rest_of_packet
where padding octets at the last of packet is truncated.
As bonus,
- fix ipv6 parser as ipv6 header doesn't have options.
It seems copy-and-paste from ipv4
- improve ipv4, tcp a bit
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Shaun Crampton <Shaun.Crampton@metaswitch.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Because it is read-only and to prevent accidental over-write.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Since it is debugging tool for developer, don't install it.
and move it under ryu/rests directory.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
The equivalent fix for of1.2 is the commit 3d90147.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
tuples are json-unfriendly.
(of1.3 version was completely broken until very recently
and the way i fixed it is consistent with this change.)
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
len -> length
as the latter seems to be expected by OFPMultipartReply.parser_stats_body.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Datapath.send_packet_out() requires buffer_id, not dpid.
> 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 "ryu/base/app_manager.py", line 126, in _event_loop
> handler(ev)
> File "/ryu/topology/switches.py", line 697, in packet_in_handler
> self._drop_packet(msg)
> File "/ryu/topology/switches.py", line 640, in _drop_packet
> dp.send_packet_out(dp.id, msg.in_port, [])
> File "/ryu/controller/controller.py", line 242, in send_packet_out
> self.send_msg(packet_out)
> File "/ryu/controller/controller.py", line 216, in send_msg
> msg.serialize()
> File "/ryu/ofproto/ofproto_parser.py", line 119, in serialize
> self._serialize_body()
> File "/ryu/ofproto/ofproto_v1_0_parser.py", line 1987, in _serialize_body
> self.buffer_id, self.in_port, self.actions_len)
> File "/ryu/ofproto/ofproto_parser.py", line 128, in msg_pack_into
> buf += struct.pack(fmt, *args)
> error: 'I' format requires 0 <= number <= 4294967295
> <Greenlet at 0x229bd98: <bound method Switches._event_loop of <switches.Switches object at 0x1c8e690>>> failed with error
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
The logic of counting sent packet seems wrong.
Reported-by: Q Lady <holynn.q@gmail.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|