2058 Commits

Author SHA1 Message Date
YAMAMOTO Takashi
aae00a8ba5 tox.ini: Add pep8 environment
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-14 10:54:36 +09:00
YAMAMOTO Takashi
459baf87d3 pyang_plugins: pep8 style fix
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-14 10:54:36 +09:00
FUJITA Tomonori
9bfba7fd54 bgp: fix pep8 warnings
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-11 17:00:44 +09:00
Toshiki Tsuboi
5fc3113d73 bgp: supporting loopback interface as neighbour_source_address for iBGP
In generally, iBGP session is established between loopback interfaces.
Therefore, we need to specify loopback interface as neighbour_source_address.
This parameter is just like update-source command in cisco router.

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-11 10:30:31 +09:00
Wei-Li Tang
5aa14c61a1 bfdlib: follow TTL/hop limit in RFC5881 explicitly.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-10 18:10:47 +09:00
Wei-Li Tang
49aa2ff9ae doc: add lib.packet.bfd classes to library_packet_ref.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-10 10:25:43 +09:00
Wei-Li Tang
0b42159893 lib: add IPv4 single hop BFD (RFC5881) support.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-10 10:25:43 +09:00
Wei-Li Tang
44437ea06d unit test for lib.packet.bfd
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-10 10:25:43 +09:00
Wei-Li Tang
d1f9408314 packet lib: add BFD support.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-10 10:25:43 +09:00
Wei-Li Tang
bcc2c13484 ofctl_v1_0/2/3: check lock timeout by lock.is_set().
send_stats_request never catches hub.Timeout exception because it
has been caught by the event wait function itself.

Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-10 09:38:50 +09:00
Minoru TAKAHASHI
39f06bff87 test: add unittests for of1.3 parser
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-09 23:51:56 +09:00
Minoru TAKAHASHI
1e72c73685 of12/3: support setting the oxm_value to OFPVID_NONE
In openflow spec 1.2 and 1.3.4, in order to match only packets without a VLAN tag,
the value of OFPXMT_OFB_VLAN_VID must be set to OFPVID_NONE (0x0000).
Old API of ofproto_v1_2/3_parser is now enabled to setting the oxm_value to OFPVID_NONE(0x0000) as follows:

e.g.)
    match = ofproto_v1_2_parser.OFPMatch()
    match.set_vlan_vid_none()

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-09 23:51:55 +09:00
YAMAMOTO Takashi
baf4b7a01a ofproto_v1_4_parser: Handle experimenter OXMs in TableFeatures
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-09 23:44:20 +09:00
YAMAMOTO Takashi
8e16d24bd1 ofproto_v1_3_parser: Handle experimenter OXMs in TableFeatures
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-09 23:44:20 +09:00
YAMAMOTO Takashi
9c83c8dba9 oxm_fields: Add a comment
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-09 23:44:20 +09:00
Hiroshi Yokoi
75753841aa bgp: support next_hop_self
Support next_hop_self.
BGPSpeaker can replace a path's next_hop address with its own address
when it sends the path to iBGP peer.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-10-09 23:44:20 +09:00
FUJITA Tomonori
dca514f198 Ryu 3.14
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v3.14
2014-10-02 12:31:15 +09:00
Yusuke Iwase
2a4ba63d55 doc: Add ryu.app.ofctl_rest document
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-30 11:33:28 +09:00
IWASE Yusuke
223dab9afe of: Fix name of class member variables
Fix name of class member variables in OFPMeterFeaturesStats
to reflect OpenFlow Specification.

Accordingly, fix json pattern files for unit tests.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-30 10:53:45 +09:00
Yoshiharu Yamashita
8f07bb29a9 gui_topology: fix to work using WebSocket
I midified ryu.topology.js to dinamicaly add or remove switch
using WebSocket on Ryu Topology Viewer.

Signed-off-by: Yoshiharu Yamashita <dyson.yamashita@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-27 18:44:25 +09:00
Hiroshi Yokoi
ff064e662a bgp: ignore link-local address
According to RFC 2545, both a global address and a link-local address
can be sent as a next_hop address in BGPUpdate message.
Since the link-local address is not needed in Ryu BGP,
Ryu BGP ignore it if the address family is IPv6 unicast.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-27 18:28:20 +09:00
Hiroshi Yokoi
594fb6a191 bgp: local preference support IPv6, VPNv4/v6 route family
local preference supports IPv6 and VPNv4/v6 route family.
sorry, previous patch contains pep8 warnings, so I cleaned them.
Please discard previous one.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-27 18:28:20 +09:00
Sriram Natarajan
0fff3fa73c Improve debug messages for unsupported request Log correct debug message
Signed-off-by: Sriram Natarajan <natarajan.sriram@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-27 18:28:20 +09:00
Sriram Natarajan
97c9e79743 Fix spell check in group feature message Maintain name consistency in meter type in Meter Features message in OF 1.3 Add length field in group statistics reply in OF 1.2
Signed-off-by: Sriram Natarajan <natarajan.sriram@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-27 18:28:20 +09:00
Minoru TAKAHASHI
2674a272f2 sw test tool: fix an error caused by changing enum name in of1.4
In of1.4 spec, enum name has been changed as follows:

of1.3.4 spec:
     OFPR_NO_MATCH = 0, / * No matching flow (table-miss flow entry). * /

of1.4 spec:
     OFPR_TABLE_MISS = 0, / * No matching flow (table-miss flow entry). * /

Along with this change, AttributeError has occurred in the process of comparison of the received message.
This patch fixes this problem.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-27 18:28:20 +09:00
Yusuke Iwase
5239336206 ofctl: Add default value to type field of OFPGroupMod
In OF1.2 and OF1.3 Spec, the group type need not be specified
for the group delete request.
However, an error occurs at mod_group_entry in ofctl_v1_[23].py
without specifying group type to delete a group entry.

This patch adds default value to type field of OFPGroupMod
at mod_group_entry in order to reflect OpenFlow Specification.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-27 18:28:19 +09:00
Sriram Natarajan
9bcce6010f of: Add missing fields in OpenFlow statistics messages
update statistics structure to reflect OpenFlow specification.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-18 14:45:18 +09:00
Sriram Natarajan
72556a68b4 of: Fix Enum Names and Values
Fix Enum Names and Values in OpenFlow Header files Update no matching
name in packet-in reason as specified in OpenFlow 1.4 Update queeu
stats name in in multipart type as specified in OpenFlow 1.4 Add
additional constants as defined in OpenFlow 1.4

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-18 14:39:54 +09:00
Sriram Natarajan
33ecedd81e of: Fix Enum Name for Bad Instruction Code Corrected Reset Count enum name
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-18 14:38:25 +09:00
Hiroshi Yokoi
fad987254d bgp: local preference support
add local preference support in bgp. It is possible to apply local
preference to specific paths by using AttributeMap.

Unfortunately this patch supports only IPv4 path and I'm going to
start writing patches for other route families after this.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 14:33:50 -07:00
Minoru TAKAHASHI
43ab3472ff sw test tool: add unit test
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 09:04:46 -07:00
Minoru TAKAHASHI
688351a817 sw test tool: add a comment about specifying the port number support
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 09:04:46 -07:00
Minoru TAKAHASHI
d2d5c4d25d sw test tool: support specifying the port number
You can specify the port number in the options when sw test tool is started.
The example is as follows:

  ryu-manager --test-switch-target_recv_port 4   (default:1)
              --test-switch-target_send_port_1 5 (default:2)
              --test-switch-target_send_port_2 6 (default:3)
              --test-switch-tester_send_port 7   (default:1)
              --test-switch-tester_recv_port_1 8 (default:2)
              --test-switch-tester_recv_port_2 9 (default:3)
               ryu/tests/switch/tester.py

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 09:04:46 -07:00
Minoru TAKAHASHI
2b202aff8b ofctl_v1_0: correct flow modify message
following fields is not set at mod_flow_stats command:

  * out_port, buffer_id

this patch fixes this problem.

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 09:04:46 -07:00
YAMAMOTO Takashi
4565fa4122 ryu.cfg: Fix a comment
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 09:04:46 -07:00
YAMAMOTO Takashi
891eb5edf6 ofa_neutron_agent: Add a comment to explain what uses this
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 09:04:46 -07:00
Satoshi Kobayashi
9e8e241652 ofp_pktinfilter: add 'logging' option
When packet_in_filter discards a packet, it is always logging. However,
it may be felt noisy.

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-12 09:04:46 -07:00
Che-Wei Lin
aa21f3d052 Snort Integrate:
Remove the wrong way to get IP and bind with it.
Binding with '0.0.0.0' and listen on all host.

Update and fix typos in the snort_integrate.rst document.

Fix the problem about pigrelay reconnect to ryu will not be accepted.

Pigrelay is a program running on Snort that receive Snort alert
from UNIX socket and send to Ryu via network socket.

Signed-off-by: Che-Wei Lin <linton.tw@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-07 22:32:16 +09:00
Toshiki Tsuboi
acec421180 bgp: rpc-api 'core.start' method in Network Controller
When net_ctrl has received 'core.start' method through RPC-Session, if has occurred ERROR as follows .

(rpc-client)
$ PYTHONPATH=. ./rpc_cli.py --peers=bgps=localhost:50002
(Cmd) request bgps core.start [{'router_id': '10.0.0.7', 'local_as': 65000}]
RPC ERROR 500.1 - 'waiter'

(Ryu-Bgp)
.. snip
DEBUG 2014-09-06 08:29:03,160 net_ctrl 337 NetworkController started listening for connections...
DEBUG 2014-09-06 08:29:21,277 base 345 Connect request received from client for port 127.0.0.1:45654
CRITICAL 2014-09-06 08:29:21,280 net_ctrl 121 RPC Session to ('127.0.0.1', 45654) started
DEBUG 2014-09-06 08:29:21,281 net_ctrl 199 NetworkController processing outgoing request list.
DEBUG 2014-09-06 08:29:21,281 net_ctrl 166 NetworkController started processing incoming messages
DEBUG 2014-09-06 08:29:39,582 net_ctrl 373 Request from NetworkController<<: core.start [{'router_id': '10.0.0.7', 'local_as': 65000}]
INFO 2014-09-06 08:29:39,582 base 208 API method core.start called with args: {'router_id': '10.0.0.7', 'local_as': 65000}
ERROR 2014-09-06 08:29:39,599 base 226 Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/api/base.py", line 221, in call
    return call(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/ryu/services/protocols/bgp/api/core.py", line 40, in start
    waiter = kwargs.pop('waiter')
KeyError: 'waiter'

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-07 16:15:08 +09:00
Jerry Cen
0d2d1836e1 import BGPPathAttributeCommunities in peer manager
This is used along line 252 in peer_manager.py

Signed-off-by: Jerry Cen <zhiweic@google.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-04 09:48:29 +09:00
Peng Xiao
41d95ac699 bmp: add client information to each bmp message
Differentiate BMP messages from different BMP clients, and modify the
debug logg ing message for client connected and disconnected.

Signed-off-by: Peng Xiao <xiaoquwl@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-03 10:02:41 +09:00
FUJITA Tomonori
f77f84942f Ryu 3.13
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v3.13
2014-09-01 20:10:03 +09:00
Satoshi Kobayashi
5b8e7178c2 ws_topology: bugfix an event is dropped
When SocketError occurs, an event may not be notified to an other client.
It is because rpc_clients is changed in the loop.

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-01 15:16:05 +09:00
Satoshi Kobayashi
4cfc239b30 bgp: should not use dict comprehension
Dict Comprehension is available in Python 2.7+ but Ryu should work
with Python2.6. Currently, It will become syntax error when we try to
operate BGP of Ryu on the platform of Python2.6.

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-01 15:16:05 +09:00
John-Lin
bbb7724423 Snort integrate: Add the snort lib supporting snort integration. Add an sample application simple_switch_snort.py which can dump alert message.
When there is a Snort alert message, Ryu will receive an event called EventAlert.
You can easily define the event handler in the method which using ‘set_ev_cls’
decorator with snortlib.EventAlert parameter.

The simple_switch_snort.py can install a flow that mirroring incoming packets to the snort's NIC
which correspond the OpenFlow switch on port 3 (by default).

There are two methods that sending alert message to Ryu.

1. Ryu and Snort are both on the same machine.
Ryu receives alert message via Unix Domain Socket.

2. Ryu and Snort are separate on different machines.
Ryu receives alert message via Network Socket.

More detail see doc/snort_integrate.rst

Signed-off-by: Che-Wei Lin <linton.tw@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-09-01 15:16:05 +09:00
FUJITA Tomonori
86550bf898 packet lib: add linux cooked header support
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-30 19:26:33 +09:00
FUJITA Tomonori
2651909844 doc: update obsolete Linux kernel SubmittingPatches url
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-29 22:39:33 +09:00
FUJITA Tomonori
6b5cec7a51 packet bmp: fix Peer Down Reason
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-27 15:04:46 +09:00
Toshiki Tsuboi
dd795150f3 bgp: add parameter 'label_ranges' for 'core.start' method in BGPSpeaker
In case of locating some Ryu-BGPs in the same Topology for BGP/MPLS VPNs :
When same label has been assigned '100 (defalut label)' by each Ryu-BGP, it is difficult to analyze for trouble shooting of RIB for vpnv4 .
Therefore, each Ryu-BGPs should assign different label for vpnv4 prefix according to own label_range .

bgpd> show rib all
Status codes: * valid, > best
Origin codes: i - IGP, e - EGP, ? - incomplete
     Network                          Labels   Next Hop             Reason          Metric LocPrf Path
Family: rtfilter
 *>  65001:65010:101                  None     0.0.0.0              Only Path                     ?
Family: vpnv6
Family: vpnv4
 *>  65010:101:192.168.104.0/30       [100]    172.16.0.102         Only Path                     65002 ?
 *>  65010:101:192.168.201.0/24       [43]     192.168.100.101      Only Path       100           65010 65011 i
 *>  65010:101:10.10.10.1/32          [38]     192.168.100.101      Only Path       100           65010 65011 ?
 *>  65010:101:192.168.103.0/30       [100]    0.0.0.0              Only Path                     ?
 *>  65010:101:192.168.101.0/30       [42]     192.168.100.101      Only Path       100           65010 ?
 *>  65010:101:192.168.102.0/30       [40]     192.168.100.101      Only Path       100           65010 ?
 *>  65010:101:10.10.10.2/32          [37]     192.168.100.101      Only Path       100           65010 65012 ?
 *>  65010:101:192.168.202.0/24       [44]     192.168.100.101      Only Path       100           65010 65012 i

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-22 01:27:28 -07:00
Yusuke Iwase
04766aaa93 ofctl_rest: support OFPFlowStats filtered by fields
this patch enables ofctl_rest to get OFPFlowStats messages
filtered by the OFPFlowStatsRequest fields in OpenFlow specification.

usage)

  URI:    /stats/flow/<dpid>
  method: POST

  the message body is as follows:

  table_id     ID of table.
  out_port     Require matching entries to include this as an output port.
  out_group    Require matching entries to include this as an output group.
               (Not supported in of1.0)
  cookie       Require matching entries to contain this cookie value.
               (Not supported in of1.0)
  cookie_mask  Mask used to restrict the cookie bits that must match.
               (Not supported in of1.0)
  match        Fields to match.

e.g.)

  curl -X POST -d '{"table_id": 0,
                    "out_port": 2,
                    "cookie": 1,
                    "cookie_mask": 1,
                    "match":{"in_port":1}}'
  http://localhost:8080/stats/flow/1

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-08-20 05:25:10 -07:00