2504 Commits

Author SHA1 Message Date
FUJITA Tomonori
c0723eb0a6 Ryu 3.26
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v3.26
2015-10-02 04:25:01 +09:00
Yusuke Iwase
b1c1adf79a switch/tester: Add sleep interval for each test case
Open vSwitch, which installed with the kernel module, has a cache in
the kernel for the flow table and the cached flow entries have a
hard timeout of 5 seconds.
tester.py attempts to confirm its flow modifications with a barrier
request, but Open vSwitch sends a barrier reply back regardless of
the the state of the cached entries in the kernel module.
So in some cases, Open vSwtich needs the interval between each test
case.
This patch adds an option for setting interval for the workaround.

Note: With a zero seconds interval, the whole test suite runs in
20-30 minutes, but with a 10 seconds interval between each test,
the entire suite takes 3-4 hours.

Reported-by: Alan Deikman <alan.deikman@znyx.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-10-01 13:27:45 +09:00
Yusuke Iwase
40acc4bc82 ofproto_v1_[45]_parser: Add parser() for OFPRequestForward
OFPT_REQUESTFORWARD is defined as Asynchronous Message which sent
from OF-Switch to Controller, but currently, OFPRequestForward class
does not have parser() method.
This patch adds parser() method into OFPRequestForward class and
OFPGroupMod/OFPMeterMod classes which forwarded by OFPRequestForward
message.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-30 23:06:59 +09:00
FUJITA Tomonori
927cda4392 remove old Ryu OpenStack plugin stuff
The plugin that uses these was removed from OpenStack long ago.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-28 22:23:21 +09:00
FUJITA Tomonori
50ad776a32 packet: lldp: python3 fix
iterator doesn't has next method.

Reported-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Tested-by: Takeshi <a86487817@gmail.com>
2015-09-28 22:11:06 +09:00
FUJITA Tomonori
571f6a1c5a bgp: support disabling listening socket
Setting bgp_server_port to 0 disables listening socket

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-23 13:14:32 +09:00
FUJITA Tomonori
448ebe99e9 bgp: python3 fixes
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-21 21:18:40 +09:00
Yusuke Iwase
95ae3c7211 test_parser_ofpmatch: Add tests for Experimenter OXMs
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:32:18 +09:00
Yusuke Iwase
be5b00996d OXM/OXS: Enable to sort Experimenter oxm_type/oxs_type in Python3
The representation of oxm_type/oxs_type is an int type value if
OXM/OXS in OpenFlowBasic class, but a tuple type value if in
Experimenter class.
So, Python3 may fail to sort a list of OXM/OXS fields by using
oxm_type/oxs_type.
This patch adds 'key' parameter into sort() method and enables to
sort a list which contains both OpenFlowBasic and Experimenter.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:32:09 +09:00
Yusuke Iwase
1d1777c891 test_parser_ofpmatch: Add test cases for OF1.4 and OF1.5
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:31:59 +09:00
Yusuke Iwase
033d99474a .travis.yml: Suppress the output of unit tests
Because Travis-CI has a limit of the log file to 4MB, this patch
suppress the output of unit tests by setting NOSE_VERBOSE in tox.ini.
tox.ini does not effect when running run_tests.sh locally,
so please run run_tests.sh, if the full log messages are needed.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:31:44 +09:00
Yusuke Iwase
4ada0bbd9c ofproto: Sort out the NX OXMs definition
Because the Nicira Experimenter OXMs are independent of the OpenFlow
version, this patch separates the NX OXMs definitions into nx_match.py
and enable to use the NX OXM in all OpenFlow 1.2+.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:30:29 +09:00
Yusuke Iwase
81208354e9 ofproto: Refine module import
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:30:27 +09:00
Yusuke Iwase
5116d1f84f ofproto_v1_[45]_parser: Remove unused OFPMatchField
OFPMatchField and its subclasses are parser classes for old API of
OFPMatch, but in OF1.4+, OFPMatch drops old API supports.
This patch removes these unused classes from ofproto_v1_[45]_parser.py

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:29:59 +09:00
Minoru TAKAHASHI
7872ba275c doc/ofproto_v1_2_ref: Add description for Port Structures
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:27:42 +09:00
Minoru TAKAHASHI
2079d06d6f doc/ofproto_v1_3_ref: Add description for Port Structures
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:27:42 +09:00
Minoru TAKAHASHI
950a506494 doc/ofproto_v1_4_ref: Add description for Port Structures
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:27:42 +09:00
Minoru TAKAHASHI
c36bafea26 doc/ofproto_v1_5_ref: Add description for Port Structures and Controller Status Structure
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:27:42 +09:00
Steffen Gebert
c638c345dd Examples contain invalid MAC addresses
The documentation for `OFPActionSetField()` contains the
following example:

    set_field = OFPActionSetField(eth_src="00:00:00:00:00")

However, this MAC address lacks one byte. Thus add it.
2015-09-17 12:03:22 +02:00
Yusuke Iwase
388adf152c ofproto_v1_0_parser: Add __getitem__ method into OFPMatch
Currently, ofproto_v1_0_parser does not support query with a match
field name like ofproto_v1_[2345]_parser support.
This patch adds __getitem__ method in order to get the match value
witch a match field name.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-15 17:02:17 +09:00
Yusuke Iwase
5cda019b3c test_parser_v10: Add test case for __getitem__ of OFPMatch
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-15 17:02:16 +09:00
Minoru TAKAHASHI
b874ae839d doc/app/ofctl_rest: Add command examples for WRITE/CLEAR_ACTIONS
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-15 17:01:54 +09:00
IWAMOTO Toshihiro
992bf7318d Uncap pbr version
This reverts commit 9414322f307fe607f7fefb8611871bbf810b5ee4,
as the workaround for readthedocs seems to be no longer necessary.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-15 17:01:53 +09:00
Chia-Lin Cho
2b527f67ef topology: Fixed conditional statement
_is_edge_port(port) in switches.py will return `False` if the port belongs to link.

Signed-off-by: Chia-Lin Cho <fox91119@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-15 17:00:46 +09:00
Yusuke Iwase
4c6b03ab02 ofproto_v1_5: Add OFPBAC_BAD_METER
OpenFlow 1.5.1 adds new error OFPBAC_BAD_METER for bad meter in
flow-mod (EXT-530).

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-15 16:59:36 +09:00
ISHIDA Wataru
66eeb5b1fe bgp: enable nexthop_self for locally generated routes
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:32:17 +09:00
Minoru TAKAHASHI
969b4b6837 test_ofctl: improving readability
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:20:49 +09:00
Minoru TAKAHASHI
dc2d5a90b7 test_ofctl: Add unit test for OFPIT_[WRITE/CLEAR]_ACTIONS
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:20:49 +09:00
Minoru TAKAHASHI
91af6a5ada ofctl_v1_[23]: Add support for OFPIT_[WRITE/CLEAR]_ACTIONS
This patch makes ofctl_rest enable setting instruction type of OFPIT_WRITE/CLEAR_ACTIONS.

  e.g.)

  $ curl -X POST -d '{
        "dpid": 1,
        "cookie": 1,
        "cookie_mask": 1,
        "table_id": 0,
        "idle_timeout": 30,
        "hard_timeout": 30,
        "priority": 11111,
        "flags": 1,
        "match":{
            "in_port":1
        },
        "actions":[
            {
                "type":"WRITE_ACTIONS",
                "actions":[
                    {
                        "type":"POP_VLAN",
                    },
                    {
                        "type":"OUTPUT",
                        "port": 2
                    }
                    ]
            }
        ]
     }' http://localhost:8080/stats/flowentry/add

  $ curl -X POST -d '{
        "dpid": 1,
        "cookie": 1,
        "cookie_mask": 1,
        "table_id": 0,
        "idle_timeout": 30,
        "hard_timeout": 30,
        "priority": 11111,
        "flags": 1,
        "match":{
            "in_port":1
        },
        "actions":[
            {
                "type":"CLEAR_ACTIONS"
            }
        ]
     }' http://localhost:8080/stats/flowentry/add

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:20:49 +09:00
Yusuke Iwase
b6e280172a ofp_handler: Output human readable error msg ev log
Currently, the error message event log which is output by ofp_handler.py
is difficult to understand what is wrong in the previous OpenFlow request
message.
This patch improves the readability of this output to find out errors.

*** Output Example ***
EventOFPErrorMsg received.
version=0x4, msg_type=0x1, msg_len=0x4c, xid=0xecc7f07b
 `-- msg_type: OFPT_ERROR(1)
OFPErrorMsg(type=0x4, code=0x9, data=b'\x04\x0e\x00\x58\xec\xc7\xf0\x7b\x00\x0
0\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x2b\x67\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x0
0\x01\x00\x0c\x80\x00\x18\x04\xc0\xa8\x00\x01\x00\x00\x00\x00')
 |-- type: OFPET_BAD_MATCH(4)
 |-- code: OFPBMC_BAD_PREREQ(9)
 `-- data: version=0x4, msg_type=0xe, msg_len=0x58, xid=0xecc7f07b
     `-- msg_type: OFPT_FLOW_MOD(14)

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:14:58 +09:00
Yusuke Iwase
f5932480c5 ofproto_parser: Unify str representation of MsgBase
This patch unifies str representation of MsgBase into comma-separated
array of 'key=value' style.

before:
  version: 0x1 msg_type 0x0 xid 0x660a4ade OFPHello()

after:
  version=0x1,msg_type=0x0,msg_len=0x8,xid=0x660a4ade,OFPHello()

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:14:58 +09:00
Yusuke Iwase
23b2fc4b41 utils: Add binary_str() method to print binary data
Because repr() is not enough to escape ascii code or control code,
MsgBase.__str__() may collapse representation with binary data.
This patch add binary_str() in order to convert binary data into a
sequence of '\x00' style string.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:14:58 +09:00
Yusuke Iwase
27befc18fa utils: Unify output str format of hex_array()
This patch simplifies hex_array() and unifies its output into
'0x%02x' format.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:14:58 +09:00
Minoru TAKAHASHI
97906ee740 doc: Add some JSON examples to openflow api reference for of1.5
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:06:43 +09:00
Minoru TAKAHASHI
62a53a548d test_parser: Add expected json outputs for OF1.5
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:06:43 +09:00
Minoru TAKAHASHI
5b0106eb45 doc: Add openflow api reference for of1.5
Update OpenFlow API document.
- add OpenFlow 1.5 API Reference
- update OpenFlow API Reference index for OF1.5

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:06:43 +09:00
Minoru TAKAHASHI
182e2e7067 test_parser: Add test case for OFP15 table_features_reply
TODO: Because Open vSwitch (lib/ofp-util) does not support Egress
Tables [EXT-306] yet, re-generate the packet data by using
packet_data_generator2 when Open vSwitch supports it.

Reference: OpenFlow 1.1+ support status of Open vSwitch
https://github.com/openvswitch/ovs/blob/master/OPENFLOW-1.1%2B.md

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-10 11:06:42 +09:00
FUJITA Tomonori
8726f8b0bf Ryu 3.25
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v3.25
2015-09-04 08:20:05 +09:00
FUJITA Tomonori
396c32d4aa packet: dhcp should set _MIN_LEN
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-03 22:47:35 +09:00
FUJITA Tomonori
e47c5bf16a packet: udp should detect dhcp
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-03 22:35:02 +09:00
Minoru TAKAHASHI
22387e09e4 ofctl_v1_[23]: Fix the output result of get_flow_stats()
Add flows OFPIT_APPLY_ACTIONS and OFPIT_WRITE_ACTIONS and
OFPIT_CLEAR_ACTIONS as the type of instructions, respectively.
Then, the output results of get_flow_stats() are the same.
This patch fix this problem.

before applying this patch:

 * case OFPIT_APPLY_ACTIONS and OFPIT_WRITE_ACTIONS

{
    "1": [
        {
            "actions": [
                "OUTPUT:2",
                "OUTPUT:3"
            ],
        ...
        }
    ]
}

 * case OFPIT_CLEAR_ACTIONS

{
    "1": [
        {
            "actions": [],
        ...
        }
    ]
}

after apply this patch:

 * case OFPIT_APPLY_ACTIONS

{
    "1": [
        {
            "actions": [
                "OUTPUT:2",
                "OUTPUT:3"
            ],
        ...
        }
    ]
}

 * case OFPIT_WRITE_ACTIONS

{
    "1": [
        {
            "actions": [
                {
                    "WRITE_ACTIONS": [
                        "OUTPUT:4",
                        "OUTPUT:5"
                    ]
                }
            ],
        ...
        }
    ]
}

 * case OFPIT_CLEAR_ACTIONS

{
    "1": [
        {
            "actions": [
                "CLEAR_ACTIONS"
            ],
        ...
        }
    ]
}

Reported-by: Liu, Weijie <wliu43@illinois.edu>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-03 22:26:57 +09:00
Yusuke Iwase
2701fa129f ofctl_v1_[23]: Convert masked match value into str
Currently, ofctl_v1_[23].py always converts metadata field into str
type for display, but does not convert pbb_isid and tunnel_id fields
even if these fields are masked.
So ofctl_v1_3.py fails to convert masked pbb_isid and tunnel_id fields.

This patch fixes to convert masked match field into str type and not
to convert non-masked field.
These changes will improve maintainability when ofctl_v1_*.py will
support new match fields.

Reported-by: Weijie Liu <wliu43@illinois.edu>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-30 14:21:51 +09:00
Fadi Moukayed
9bca06c31c packet/igmp: Python 3: truncate IGMP timer fields to integers before packing
This patch adds explicit integer conversions to the IGMP timer
fields. This is necessary because Python 3's pack(...) does not
automatically coerce floating-point values to integers (Python 3
actually throws a struct.error on struct.pack('B', 1.0)).

This fixes IgmpQuerier._send_query and IgmpSnooper._do_query under
Python 3, and possibly other functions that pass/assign floats to the
`maxresp' attribute.

Signed-off-by: Fadi Moukayed <smfadi@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-30 14:17:30 +09:00
Yusuke Iwase
7028704b3f doc: ofctl_rest: Add table of contents
This patch adds a table of contents into the ofctl_rest API
reference in order to improve its readability.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-30 14:04:38 +09:00
FUJITA Tomonori
08edfa067e README.rst: add OF 1.5 support
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-25 04:55:43 +09:00
ISHIDA Wataru
2a4423fda3 bgp: Added support to indicate the next hop IP address for the BGP module
If the path has a next hop value set, it should be used in the BGP
Update message first.  This changes to logic to use the check for the
next hop in the order prefix/path->peer config->speaker config.  This
will allow for sending the nexthop as part of the add_prefix message and
allow for overiding the nexthop of the peer if one is set.

Based-on: Alan Quillin <alanquillin@gmail.com>
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-24 14:37:27 +09:00
FUJITA Tomonori
1a9008b73e bgp: add neighbor_state_get method
Can be used to get the state of peer(s).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-24 14:23:44 +09:00
Takeshi
0d405de657 Remove hosts from edge port when link added
Host could be added into edge port if host packet arrived before lldp
packet.

Signed-off-by: Takeshi <a86487817@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-24 14:04:09 +09:00
Minoru TAKAHASHI
65695e47a6 ofproto_v1_5_parser: Fix typo in comment
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-24 14:00:43 +09:00
Minoru TAKAHASHI
d24b96c40f ofproto_v1_4_parser: Fix typo in comment
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-08-24 14:00:43 +09:00