Age | Commit message (Collapse) | Author |
|
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>
|
|
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>
|
|
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>
|
|
ofctl_v1_0 has changed nw_src/dst into ipv4_src/dst or arp_spa/tpa automatically like ovs-ofctl.
since ofctl_v1_2/3 change nw_src/dst only into ipv4_src/dst, it cannot create the match conditions which use arp_spa/tpa.
this patch fixes this problem.
before applying this patch (using ofctl_rest):
curl -X POST -d '{"dpid": 1,
"match": {"dl_type": 2048,
"nw_src": "192.168.0.0/24"},
"actions": [{"type": "OUTPUT",
"port": 2}]}' http://localhost:8080/stats/flowentry/add
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x0, duration=3.602s, table=0, n_packets=0, n_bytes=0, priority=0,ip,nw_src=192.168.0.0/24 actions=output:2
curl -X POST -d '{"dpid": 1,
"match": {"dl_type": 2054,
"nw_src": "192.168.0.0/24"},
"actions": [{"type": "OUTPUT",
"port": 2}]}' http://localhost:8080/stats/flowentry/add
no flow entry was installed.
after applying this patch (using ofctl_rest):
curl -X POST -d '{"dpid": 1,
"match": {"dl_type": 2048,
"nw_src": "192.168.0.0/24"},
"actions": [{"type": "OUTPUT",
"port": 2}]}' http://localhost:8080/stats/flowentry/add
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x0, duration=3.602s, table=0, n_packets=0, n_bytes=0, priority=0,ip,nw_src=192.168.0.0/24 actions=output:2
curl -X POST -d '{"dpid": 1,
"match": {"dl_type": 2054,
"nw_src": "192.168.0.0/24"},
"actions": [{"type": "OUTPUT",
"port": 2}]}' http://localhost:8080/stats/flowentry/add
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x0, duration=2.555s, table=0, n_packets=0, n_bytes=0, priority=0,arp,arp_spa=192.168.0.0/24 actions=output:2
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
In bpdu.py only one version was permitted with one type, before.
This patch improves parser so that it may be based on multiple versions and types.
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although 'band_types' of MeterFeatures were bitmaps of supported band types, it was expressed numerically.
this patch makes 'band_types' human-readable.
e.g.)
curl http://localhost:8080/stats/meterfeatures/8796750050962
{
"8796750050962": [
{
"max_meter": 16777216,
"max_color": 0,
"max_band": 255,
"band_types": ["DROP", "DSCP_REMARK"]
}
]
}
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
this patch makes ofctl_rest possible to:
- support the GROUP action in the FlowMod message
- support the GroupMod message
- support the GroupStats message
- support the GroupFeatures message
- support the GroupDesc message
see following examples.
FlowMod with the group action:
e.g.)
curl -X POST -d '{"dpid": 1,
"match": {},
"actions": [{"type": "GROUP,
"group_id": 1}]}' http://localhost:8080/stats/flowentry/add
GroupMod:
usage)
URI: /stats/groupentry/{cmd}
METHOD: POST
NOTE: the value of 'cmd' is one of follows: 'add', 'modify', or 'delete'.
the message body is as follows:
type Group types. 'ALL', 'SELECT', 'INDIRECT', or 'FF'.
group_id Group Identifier. (default: 0)
buckets a list of buckets.
where each bucket has the following members:
weight Relative weight of bucket. (default: 0)
watch_port Port whose state affects whether this bucket is live. (default: OFPP_ANY)
watch_group Group whose state affects whether this bucket is live. (default: OFPG_ANY)
actions a list of actions. the format is the same as that of FlowMod.
e.g.)
curl -X POST -d '{"dpid": 1,
"type": "FF",
"group_id": 1,
"buckets": [{"watch_port": 2,
"actions": [{"type": "OUTPUT",
"port": 3}]}]}' http://localhost:8080/stats/groupentry/add
GroupStats:
usage)
URI: /stats/group/{dpid}
METHOD: GET
e.g.)
curl http://localhost:8080/stats/group/1
{
"1": [
{
"bucket_stats": [
{
"packet_count": 0,
"byte_count": 0
}
],
"byte_count": 0,
"ref_count": 0,
"duration_nsec": 231000000,
"packet_count": 0,
"duration_sec": 11238,
"group_id": 1
}
]
}
GroupFeatures:
usage)
URI: /stats/groupfeatures/{dpid}
METHOD: GET
e.g.)
curl http://localhost:8080/stats/groupfeatures/1
{
"1": [
{
"actions": [
{"ALL": ["OUTPUT", "COPY_TTL_OUT", "COPY_TTL_IN", "SET_MPLS_TTL", "DEC_MPLS_TTL", "PUSH_VLAN", "POP_VLAN", "PUSH_MPLS", "POP_MPLS", "SET_QUEUE", "GROUP", "SET_NW_TTL", "DEC_NW_TTL", "SET_FIELD"]},
{"SELECT": []},
{"INDIRECT": []},
{"FF": []}
],
"max_groups": [
{"ALL": 4294967040},
{"SELECT": 4294967040},
{"INDIRECT": 4294967040},
{"FF": 4294967040}
],
"capabilities": ["SELECT_WEIGHT", "SELECT_LIVENESS", "CHAINING"],
"types": []
}
]
}
GroupDesc:
usage)
URI: /stats/groupdesc/{dpid}
METHOD: GET
e.g.)
curl http://localhost:8080/stats/groupdesc/1
{
"1": [
{
"buckets": [
{
"actions": ["OUTPUT:2"],
"watch_group": 4294967295,
"weight": 0,
"watch_port": 3
}
],
"group_id": 1,
"type": "FF"
}
]
}
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
import ryu.contrib by ourself for the benefit of programs
which doesn't use other ryu.contrib stuffs like oslo.config.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
this patch makes ofctl_rest enable use of OFPExperimenter message.
usage)
URI: /stats/experimenter/{dpid}
method: POST
the message body is as follows:
experimenter Experimenter ID. (default: 0)
exp_type Experimenter defined type. (default:0)
data_type Data encoding type. 'ascii' or 'base64'. (default: 'ascii')
data Experimenter-defined arbitrary additional data. (default: '')
e.g.)
curl -X POST -d '{"experimenter": 8992,
"exp_type": 10,
"data": "\x00\x00\x00\x01"}' http://localhost:8080/stats/experimenter/1
curl -X POST -d '{"experimenter": 8992,
"exp_type": 10.
"data_type": "base64",
"data": "AAAAAQ=="}' http://localhost:8080/stats/experimenter/1
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
this application provides the simple example of IGMP snooping.
the module "igmplib" mainly offers 2 functions:
- listening on in the IGMP conversation between multicast routers and hosts
- emulating of the querier function of multicast servers
the former operates a switch as a snooping switch and controls transmission of an unnecessary multicasting packet.
the latter realizes the IGMP conversation in the environment without multicast routers.
the module "simple_switch_igmp" is a variation of "simple_switch".
the switch receives the "EventPacketIn" event instead of the "EventOFPPacketIn" event from the module "igmplib" in order to except IGMP.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
this patch implements the match conditions using IPv6.
NOTE: OpenFlow1.0 does not support IPv6.
e.g. using ofctl_rest)
curl -X POST -d '{"dpid": 1,
"match": {"eth_type": 34525,
"ipv6_src": "fe08:2001::/64",
"ipv6_dst": "ff02::1"},
"actions": [{"type": "OUTPUT",
"port": 2}]}' http://localhost:8080/stats/flowentry/add
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
|
|
this patch gets match field names to support OXM field names.
NOTE: OpenFlow1.0 does not support OXM field names.
the compatibility is as follows:
dl_src eth_src
dl_dst eth_dst
dl_type eth_type
dl_vlan vlan_vid
nw_src ipv4_src
nw_dst ipv4_dst
nw_proto ip_proto
tp_src tcp_src or udp_src
tp_dst tcp_dst or udp_dst
for example, the following commands for ofctl_rest install the same flow entry.
curl -X POST -d '{"dpid": 1,
"match": {"dl_type": 2048,
"nw_src": "192.168.1.1"},
"actions": [{"type": "OUTPUT",
"port": 2}]}' http://localhost:8080/stats/flowentry/add
curl -X POST -d '{"dpid": 1,
"match": {"eth_type": 2048,
"ipv4_src": 192.168.1.1"},
"actions": [{"type": "OUTPUT",
"port": 2}]}' http://localhost:8080/stats/flowentry/add
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
|
|
this patch makes ofctl_rest enable use of OpenFlow1.2.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
|
|
for convenience of api consumers, allows both of of-config style
element names (eg. logical-switches) and python style attribute
names (eg. logical_switches).
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>
|
|
tweak method to take of_config.classes classes instead of xml.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
some python classes for a set of OF-Config 1.1.1 types.
the goal is to allow programmers use OF-Config without direct
XML manipulations.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Changes v2 -> v3:
- correct the following description
this patch implements a REST API for OFPMeterConfigStats.
e.g., when you send a MeterMod message as:
curl -X POST -d '{"dpid": 1,
"meter_id": 1,
"flags": "KBPS",
"bands": [{"type": "DROP", "rate": 1000},
{"type": "REMARK", "rate": 2000},
{"type": "EXPERIMENTER", "rate": 3000}
]}' http://localhost:8080/stats/meterentry/add
and you do the following command:
curl http://localhost:8080/stats/meterconfig/1
then you will get the configuration as:
{"1": [{"bands": [{"burst_size": 0, "rate": 1000, "type": "DROP"},
{"prec_level": 0, "burst_size": 0, "rate": 2000, "type": "REMARK"},
{"burst_size": 0, "rate": 3000, "experimenter": 0, "type": "EXPERIMENTER"}],
"flags": "KBPS",
"meter_id": 1}]}
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
also use the default priority for FlowMod.
Signed-off-by: Srini Seetharaman <srini.seetharaman@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
- add the insufficient handlers
- correct the using instance
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Support meter in FlowMod instructions and support MeterMod, MeterStats, MeterFeatures.
see following examples.
FlowMod with the meter instruction:
flow = {'match': {},
'actions': [{'type': 'METER',
'meter_id': 1}]
curl -X POST -d '{"dpid": 1, "match": {}, "actions": [{"type": "METER", "meter_id": 1}]}' http://localhost:8080/stats/flowentry/add
MeterMod:
meter = {'meter_id': 1,
'flags': 'KBPS',
'bands': [{'type': 'DROP',
'rate': 1000}]}
curl -X POST -d '{"dpid": 1, "meter_id": 1, "flags": "KBPS", "bands": [{"type": "DROP", "rate": 1000}]}' http://localhost:8080/stats/meterentry/add
NOTE: flags: 'KBPS', 'PKTPS', 'BURST', 'STATS'
type: 'DROP', 'REMARK', 'EXPERIMENTER'
MeterStats:
curl http://localhost:8080/stats/meter/1
MetetFeatures:
curl http://localhost:8080/stats/meterfeatures/1
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Support metadata in FlowMod instructions and match.
both a decimal number and a hexadecimal number are able to use in 'metadata' and 'metadata_mask'.
all the following examples express the same flow entry.
flow = {'match': {'metadata': '12345/4095'},
'actions': [{'type': 'WRITE_METADATA',
'metadata': '12345',
'metadata_mask': '4095'}]}
flow = {'match': {'metadata': '12345/4095'},
'actions': [{'type': 'WRITE_METADATA',
'metadata': 12345,
'metadata_mask': 4095}]}
flow = {'match': {'metadata': '0x3039/0xfff'},
'actions': [{'type': 'WRITE_METADATA',
'metadata': '0x3039',
'metadata_mask': '0xfff'}]}
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
feeding bytearray to struct.unpack() crashes on some environment.
(depends on the interpreter versions? i'm not sure.)
this fixes the following crash in the unit test.
the crash was seen on travis-ci, too.
https://travis-ci.org/osrg/ryu/jobs/15578909
https://s3.amazonaws.com/archive.travis-ci.org/jobs/15578909/log.txt
======================================================================
ERROR: test_hello (packet.test_ospf.Test_ospf)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/yamamoto/git/ryu/ryu/tests/unit/packet/test_ospf.py", line 68, in test_hello
msg2, cls, rest = ospf.OSPFMessage.parser(binmsg)
File "/Users/yamamoto/git/ryu/ryu/lib/packet/ospf.py", line 443, in parser
kwargs = subcls.parser(binmsg)
File "/Users/yamamoto/git/ryu/ryu/lib/packet/ospf.py", line 501, in parser
n = addrconv.ipv4.bin_to_text(n)
File "/Users/yamamoto/git/ryu/ryu/lib/addrconv.py", line 30, in bin_to_text
return str(self._addr(self._strat.packed_to_int(bin),
File "/Users/yamamoto/git/ryu/.venv/lib/python2.7/site-packages/netaddr/strategy/ipv4.py", line 196, in packed_to_int
return _struct.unpack('>I', packed_int)[0]
error: unpack requires a string argument of length 4
----------------------------------------------------------------------
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
this patch makes the max_len of flow_mod message more flexible.
before applying this patch:
ofctl_v1_0: 128 bytes for packet_in (fixed size) and none for others (fixed)
ofctl_v1_2: 128 bytes for packet_in (fixed size) and 0 for others (fixed size)
ofctl_v1_3: 0 for all by default (flexible)
ofctl_v1_3 will send 0 byte length data in a packet_in message if max_len is not specified.
after applying this patch:
all version: MAX_LEN for all by default (flexible)
NOTE: MAX_LEN is 65535 for OF1.0, and is OFPCML_MAX for OF1.2/1.3.
max_len is omissible by every ofctl.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
this patch makes some json members of several packet libraries human-readable.
ex) ethernet.ethernet
before applying this patch:
{'ethernet': {'ethertype': 2048, 'dst': 'ZmY6ZmY6ZmY6ZmY6ZmY6ZmY=', 'src': 'MDA6MDA6MDA6MDA6MDA6MDA='}}
after applying this patch:
{'ethernet': {'ethertype': 2048, 'dst': u'ff:ff:ff:ff:ff:ff', 'src': u'00:00:00:00:00:00'}}
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
Signed-off-by: Wataru ISHIDA <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
I'm resending the patches which appease pep8
fletcher checksum function for OSPF LSA checksum.
refer to RFC1008.
Signed-off-by: Wataru ISHIDA <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
the length of opt_header has to be a multiple of 8.
wrong:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| nxt | size | (opt)type=1 | (opt)len=6 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| (opt)data='\x00\x00\x00\x00\x00\x00' (6 octet) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
right:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| nxt | size | (opt)type=1 | (opt)len=4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| (opt)data='\x00\x00\x00\x00' (4 octet) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
to_jsondict() JSON-izes public member variables of the object.
from_jsondict() calls the constructor using JSON members as the arguments.
LACP has the public member that is not required for the constructor, so TypeError occurs in from_jsondict().
this patch suppresses the output of to_jsondict() by changing unnecessary public members into protected members.
examination code:
from ryu.lib.packet import slow
msg1 = slow.lacp()
print msg1
jsondict = msg1.to_jsondict()
msg2 = slow.lacp.from_jsondict(jsondict['lacp'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
lacp(actor_key=0,actor_length=20,actor_port=0,actor_port_priority=0,actor_state=0,actor_state_activity=0,actor_state_aggregation=0,actor_state_collecting=0,actor_state_defaulted=0,actor_state_distributing=0,actor_state_expired=0,actor_state_synchronization=0,actor_state_timeout=0,actor_system='00:00:00:00:00:00',actor_system_priority=0,actor_tag=1,collector_length=16,collector_max_delay=0,collector_tag=3,partner_key=0,partner_length=20,partner_port=0,partner_port_priority=0,partner_state=0,partner_state_activity=0,partner_state_aggregation=0,partner_state_collecting=0,partner_state_defaulted=0,partner_state_distributing=0,partner_state_expired=0,partner_state_synchronization=0,partner_state_timeout=0,partner_system='00:00:00:00:00:00',partner_system_priority=0,partner_tag=2,subtype=1,terminator_length=0,terminator_tag=0,version=1)
CLS <class 'ryu.lib.packet.slow.lacp'>
ARG {'actor_state_distributing': 0, 'actor_length': 20, 'actor_system': 'MDA6MDA6MDA6MDA6MDA6MDA=', 'collector_max_delay': 0, 'terminator_length': 0, 'collector_length': 16, 'partner_state_synchronization': 0, 'partner_state_timeout': 0, 'partner_state_distributing': 0, 'partner_state_collecting': 0, 'actor_state_synchronization': 0, 'actor_state_expired': 0, 'actor_state_defaulted': 0, 'partner_state_expired': 0, 'partner_state': 0, 'partner_system_priority': 0, 'actor_state_aggregation': 0, 'version': 1, 'partner_port': 0, 'partner_length': 20, 'collector_tag': 3, 'partner_state_defaulted': 0, 'actor_state_timeout': 0, 'actor_port_priority': 0, 'partner_state_activity': 0, 'actor_state_activity': 0, 'terminator_tag': 0, 'actor_system_priority': 0, 'actor_key': 0, 'partner_system': 'MDA6MDA6MDA6MDA6MDA6MDA=', 'partner_tag': 2, 'actor_state': 0, 'actor_port': 0, 'partner_state_aggregation': 0, 'partner_port_priority': 0, 'actor_tag': 1, 'subtype': 1, 'partner_key': 0, 'actor_state
_collecting': 0}
KWARG {'actor_state_distributing': 0, 'actor_length': 20, 'actor_system': '00:00:00:00:00:00', 'collector_max_delay': 0, 'terminator_length': 0, 'collector_length': 16, 'partner_state_synchronization': 0, 'partner_state_timeout': 0, 'partner_state_distributing': 0, 'partner_state_collecting': 0, 'actor_state_synchronization': 0, 'actor_state_expired': 0, 'actor_state_defaulted': 0, 'partner_state_expired': 0, 'partner_state': 0, 'partner_system_priority': 0, 'actor_state_aggregation': 0, 'version': 1, 'partner_port': 0, 'partner_length': 20, 'collector_tag': 3, 'partner_state_defaulted': 0, 'actor_state_timeout': 0, 'actor_port_priority': 0, 'partner_state_activity': 0, 'actor_state_activity': 0, 'terminator_tag': 0, 'actor_system_priority': 0, 'actor_key': 0, 'partner_system': '00:00:00:00:00:00', 'partner_tag': 2, 'actor_state': 0, 'actor_port': 0, 'partner_state_aggregation': 0, 'partner_port_priority': 0, 'actor_tag': 1, 'subtype': 1, 'partner_key': 0, 'actor_state_collecting'
: 0}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 293, in from_jsondict
return cls(**dict(kwargs, **additional_args))
TypeError: __init__() got an unexpected keyword argument 'actor_length'
after applying this patch:
lacp(actor_key=0,actor_port=0,actor_port_priority=0,actor_state_activity=0,actor_state_aggregation=0,actor_state_collecting=0,actor_state_defaulted=0,actor_state_distributing=0,actor_state_expired=0,actor_state_synchronization=0,actor_state_timeout=0,actor_system='00:00:00:00:00:00',actor_system_priority=0,collector_max_delay=0,partner_key=0,partner_port=0,partner_port_priority=0,partner_state_activity=0,partner_state_aggregation=0,partner_state_collecting=0,partner_state_defaulted=0,partner_state_distributing=0,partner_state_expired=0,partner_state_synchronization=0,partner_state_timeout=0,partner_system='00:00:00:00:00:00',partner_system_priority=0,version=1)
lacp(actor_key=0,actor_port=0,actor_port_priority=0,actor_state_activity=0,actor_state_aggregation=0,actor_state_collecting=0,actor_state_defaulted=0,actor_state_distributing=0,actor_state_expired=0,actor_state_synchronization=0,actor_state_timeout=0,actor_system='00:00:00:00:00:00',actor_system_priority=0,collector_max_delay=0,partner_key=0,partner_port=0,partner_port_priority=0,partner_state_activity=0,partner_state_aggregation=0,partner_state_collecting=0,partner_state_defaulted=0,partner_state_distributing=0,partner_state_expired=0,partner_state_synchronization=0,partner_state_timeout=0,partner_system='00:00:00:00:00:00',partner_system_priority=0,version=1)
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although SCTP is using internal classes, no class is registered into '_class_prefixes'.
therefore, AssertionError occurs in from_jsondict() when the argument 'param' was processed.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import sctp
msg1 = sctp.sctp(chunks=[sctp.chunk_init(params=[sctp.param_cookie_preserve()])])
print msg1
jsondict = msg1.to_jsondict()
msg2 = sctp.sctp.from_jsondict(jsondict['sctp'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
sctp(chunks=[chunk_init(a_rwnd=0,flags=0,i_tsn=0,init_tag=0,length=0,mis=0,os=0,params=[param_cookie_preserve(length=0,value=0)])],csum=0,dst_port=0,src_port=0,vtag=0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 291, in from_jsondict
kwargs = cls._restore_args(_mapdict_kv(decode, dict_))
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 46, in <lambda>
_mapdict_kv = lambda f, d: dict([(k, f(k, v)) for k, v in d.items()])
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 290, in <lambda>
decode = lambda k, x: cls._decode_value(k, x, decode_string)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 234, in _decode_value
return cls._get_decoder(k, decode_string)(json_value)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 242, in _decode
v = map(_decode, json_value)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 245, in _decode
v = cls.obj_from_jsondict(json_value)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 223, in obj_from_jsondict
return obj_cls.from_jsondict(v)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 293, in from_jsondict
return cls(**dict(kwargs, **additional_args))
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/sctp.py", line 273, in __init__
assert isinstance(one, param)
AssertionError
after applying this patch:
sctp(chunks=[chunk_init(a_rwnd=0,flags=0,i_tsn=0,init_tag=0,length=0,mis=0,os=0,params=[param_cookie_preserve(length=0,value=0)])],csum=0,dst_port=0,src_port=0,vtag=0)
sctp(chunks=[chunk_init(a_rwnd=0,flags=0,i_tsn=0,init_tag=0,length=0,mis=0,os=0,params=[param_cookie_preserve(length=0,value=0)])],csum=0,dst_port=0,src_port=0,vtag=0)
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although LLDP is using internal classes, no class is registered into '_class_prefixes'.
therefore, from_jsondict() does not work correctly.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import lldp
msg1 = lldp.lldp([lldp.ChassisID(subtype=lldp.ChassisID.SUB_MAC_ADDRESS, chassis_id='\x00\x00\x00\x00\x00\x00')])
print msg1
jsondict = msg1.to_jsondict()
msg2 = lldp.lldp.from_jsondict(jsondict['lldp'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
lldp(tlvs=[ChassisID(chassis_id='\x00\x00\x00\x00\x00\x00',len=7,subtype=4,typelen=519)])
lldp(tlvs=[{'ChassisID': {'subtype': 4, 'typelen': 519, 'chassis_id': '\x00\x00\x00\x00\x00\x00', 'len': 7}}])
False
after applying this patch:
lldp(tlvs=[ChassisID(chassis_id='\x00\x00\x00\x00\x00\x00',len=7,subtype=4,typelen=519)])
lldp(tlvs=[ChassisID(chassis_id='\x00\x00\x00\x00\x00\x00',len=7,subtype=4,typelen=519)])
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although LLDP is using internal classes, no class is registered into '_class_prefixes'.
therefore, AssertionError occurs in from_jsondict() when the argument 'control' was processed.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import llc
msg1 = llc.llc(dsap_addr=66, ssap_addr=66, control=llc.ControlFormatI())
print msg1
jsondict = msg1.to_jsondict()
msg2 = llc.llc.from_jsondict(jsondict['llc'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
llc(control=ControlFormatI(pf_bit=0,receive_sequence_number=0,send_sequence_number=0),dsap_addr=66,ssap_addr=66)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 293, in from_jsondict
return cls(**dict(kwargs, **additional_args))
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/llc.py", line 140, in __init__
assert getattr(control, 'TYPE', None) in self._CTR_TYPES
AssertionError
after applying this patch:
llc(control=ControlFormatI(pf_bit=0,receive_sequence_number=0,send_sequence_number=0),dsap_addr=66,ssap_addr=66)
llc(control=ControlFormatI(pf_bit=0,receive_sequence_number=0,send_sequence_number=0),dsap_addr=66,ssap_addr=66)
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although IPv6 is using internal classes, no class is registered into '_class_prefixes'.
therefore, AssertionError occurs in from_jsondict() when the argument 'ext_hdrs' was processed.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import ipv6
msg1 = ipv6.ipv6(ext_hdrs=[ipv6.hop_opts()])
print msg1
jsondict = msg1.to_jsondict()
msg2 = ipv6.ipv6.from_jsondict(jsondict['ipv6'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
ipv6(dst='::',ext_hdrs=[hop_opts(data=None,nxt=6,size=0)],flow_label=0,hop_limit=255,nxt=6,payload_length=0,src='::',traffic_class=0,version=6)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 293, in from_jsondict
return cls(**dict(kwargs, **additional_args))
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/packet/ipv6.py", line 86, in __init__
assert isinstance(ext_hdr, header)
AssertionError
after applying this patch:
ipv6(dst='::',ext_hdrs=[hop_opts(data=None,nxt=6,size=0)],flow_label=0,hop_limit=255,nxt=6,payload_length=0,src='::',traffic_class=0,version=6)
ipv6(dst='::',ext_hdrs=[hop_opts(data=None,nxt=6,size=0)],flow_label=0,hop_limit=255,nxt=6,payload_length=0,src='::',traffic_class=0,version=6)
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although ICMPv6 is using internal classes, no class is registered into '_class_prefixes'.
therefore, from_jsondict() does not work correctly.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import icmpv6
msg1 = icmpv6.icmpv6(data=icmpv6.nd_neighbor())
print msg1
jsondict = msg1.to_jsondict()
msg2 = icmpv6.icmpv6.from_jsondict(jsondict['icmpv6'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
icmpv6(code=0,csum=0,data=nd_neighbor(dst='::',option=None,res=0),type_=0)
icmpv6(code=0,csum=0,data={'nd_neighbor': {'res': 0, 'dst': '::', 'option': None}},type_=0)
False
after applying this patch:
icmpv6(code=0,csum=0,data=nd_neighbor(dst='::',option=None,res=0),type_=0)
icmpv6(code=0,csum=0,data=nd_neighbor(dst='::',option=None,res=0),type_=0)
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although ICMP is using internal classes, no class is registered into '_class_prefixes'.
therefore, from_jsondict() does not work correctly.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import icmp
msg1 = icmp.icmp(data=icmp.echo())
print msg1
jsondict = msg1.to_jsondict()
msg2 = icmp.icmp.from_jsondict(jsondict['icmp'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
icmp(code=0,csum=0,data=echo(data=None,id=0,seq=0),type=8)
icmp(code=0,csum=0,data={'echo': {'data': None, 'id': 0, 'seq': 0}},type=8)
False
after applying this patch:
icmp(code=0,csum=0,data=echo(data=None,id=0,seq=0),type=8)
icmp(code=0,csum=0,data=echo(data=None,id=0,seq=0),type=8)
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although DHCP is using internal classes, no class is registered into '_class_prefixes'.
therefore, from_jsondict() does not work correctly.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import dhcp
msg1 = dhcp.dhcp(op=dhcp.DHCP_BOOT_REQUEST, chaddr='00:00:00:00:00:00', options=dhcp.options())
print msg1
jsondict = msg1.to_jsondict()
msg2 = dhcp.dhcp.from_jsondict(jsondict['dhcp'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
dhcp(boot_file='',chaddr='00:00:00:00:00:00',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=17,hops=0,htype=1,op=1,options=options(magic_cookie='99.130.83.99',option_list=[],options_len=0),secs=0,siaddr='0.0.0.0',sname='',xid=2430470794,yiaddr='0.0.0.0')
dhcp(boot_file='',chaddr='00:00:00:00:00:00',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=17,hops=0,htype=1,op=1,options={'options': {'option_list': [], 'magic_cookie': '99.130.83.99', 'options_len': 0}},secs=0,siaddr='0.0.0.0',sname='',xid=2430470794,yiaddr='0.0.0.0')
False
after applying this patch:
dhcp(boot_file='',chaddr='00:00:00:00:00:00',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=17,hops=0,htype=1,op=1,options=options(magic_cookie='99.130.83.99',option_list=[],options_len=0),secs=0,siaddr='0.0.0.0',sname='',xid=1161619526,yiaddr='0.0.0.0')
dhcp(boot_file='',chaddr='00:00:00:00:00:00',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=17,hops=0,htype=1,op=1,options=options(magic_cookie='99.130.83.99',option_list=[],options_len=0),secs=0,siaddr='0.0.0.0',sname='',xid=1161619526,yiaddr='0.0.0.0')
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
to_jsondict() JSON-izes public member variables of the object.
from_jsondict() calls the constructor using JSON members as the arguments.
BPDU has the public member that is not required for the constructor, so TypeError occurs in from_jsondict().
this patch suppresses the output of to_jsondict() by changing unnecessary public members into protected members.
examination code:
from ryu.lib.packet import bpdu
msg1 = bpdu.RstBPDUs()
print msg1
jsondict = msg1.to_jsondict()
msg2 = bpdu.RstBPDUs.from_jsondict(jsondict['RstBPDUs'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
RstBPDUs(bpdu_type=2,bridge_mac_address='00:00:00:00:00:00',bridge_priority=32768,bridge_system_id_extension=0,flags=0,forward_delay=15,hello_time=2,max_age=20,message_age=0,port_number=0,port_priority=128,protocol_id=0,root_mac_address='00:00:00:00:00:00',root_path_cost=0,root_priority=32768,root_system_id_extension=0,version_1_length=0,version_id=2)
CLS <class 'ryu.lib.packet.bpdu.RstBPDUs'>
ARG {'max_age': 20, 'bpdu_type': 2, 'bridge_mac_address': 'MDA6MDA6MDA6MDA6MDA6MDA=', 'hello_time': 2, 'protocol_id': 0, 'bridge_priority': 32768, 'message_age': 0, 'version_id': 2, 'port_priority': 128, 'flags': 0, 'root_priority': 32768, 'version_1_length': 0, 'root_path_cost': 0, 'port_number': 0, 'root_mac_address': 'MDA6MDA6MDA6MDA6MDA6MDA=', 'root_system_id_extension': 0, 'forward_delay': 15, 'bridge_system_id_extension': 0}
KWARG {'max_age': 20, 'bpdu_type': 2, 'bridge_mac_address': '00:00:00:00:00:00', 'hello_time': 2, 'protocol_id': 0, 'bridge_priority': 32768, 'message_age': 0, 'version_id': 2, 'port_priority': 128, 'flags': 0, 'root_priority': 32768, 'version_1_length': 0, 'root_path_cost': 0, 'port_number': 0, 'root_mac_address': '00:00:00:00:00:00', 'root_system_id_extension': 0, 'forward_delay': 15, 'bridge_system_id_extension': 0}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/stringify.py", line 293, in from_jsondict
return cls(**dict(kwargs, **additional_args))
TypeError: __init__() got an unexpected keyword argument 'bpdu_type'
after applying this patch:
RstBPDUs(bridge_mac_address='00:00:00:00:00:00',bridge_priority=32768,bridge_system_id_extension=0,flags=0,forward_delay=15,hello_time=2,max_age=20,message_age=0,port_number=0,port_priority=128,root_mac_address='00:00:00:00:00:00',root_path_cost=0,root_priority=32768,root_system_id_extension=0)
RstBPDUs(bridge_mac_address='00:00:00:00:00:00',bridge_priority=32768,bridge_system_id_extension=0,flags=0,forward_delay=15,hello_time=2,max_age=20,message_age=0,port_number=0,port_priority=128,root_mac_address='00:00:00:00:00:00',root_path_cost=0,root_priority=32768,root_system_id_extension=0)
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
although BGP is using internal classes, no class is registered into '_class_prefixes'.
therefore, from_jsondict() does not work correctly.
this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'.
examination code:
from ryu.lib.packet import bgp
msg1 = bgp.BGPUpdate(withdrawn_routes=[bgp.BGPWithdrawnRoute(length=0, addr='192.168.0.1')])
print msg1
jsondict = msg1.to_jsondict()
msg2 = bgp.BGPUpdate.from_jsondict(jsondict['BGPUpdate'])
print msg2
print str(msg1) == str(msg2)
before applying this patch:
BGPUpdate(len=None,marker='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff',nlri=[],path_attributes=[],total_path_attribute_len=None,type=2,withdrawn_routes=[BGPWithdrawnRoute(addr='192.168.0.1',length=0)],withdrawn_routes_len=None)
BGPUpdate(len=None,marker='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff',nlri=[],path_attributes=[],total_path_attribute_len=None,type=2,withdrawn_routes=[{'BGPWithdrawnRoute': {'length': 0, 'addr': '192.168.0.1'}}],withdrawn_routes_len=None)
False
after applying this patch:
BGPUpdate(len=None,marker='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff',nlri=[],path_attributes=[],total_path_attribute_len=None,type=2,withdrawn_routes=[BGPWithdrawnRoute(addr='192.168.0.1',length=0)],withdrawn_routes_len=None)
BGPUpdate(len=None,marker='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff',nlri=[],path_attributes=[],total_path_attribute_len=None,type=2,withdrawn_routes=[BGPWithdrawnRoute(addr='192.168.0.1',length=0)],withdrawn_routes_len=None)
True
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
the variable '_class_prefixes' of stringify.StringifyMixin is used to help the method 'from_jsondict()' to create the class instance.
'_class_prefixes' requires a list of the class names.
some classes have another list of the class names already.
this patch adds a method which makes '_class_prefixes' by using the existing list.
before applying this patch:
(e.g. ryu.lib.packet.ipv6)
# append the name to another list
@ipv6.register_header_type(inet.IPPROTO_HOPOPTS)
class hop_opts(opt_header):
...
@ipv6.register_header_type(inet.IPPROTO_DSTOPTS)
class dst_opts(opt_header):
....
# append the name again
ipv6._class_prefixes = ['hop_opts', 'dst_opts', ...]
after applying this patch:
(e.g. ryu.lib.packet.ipv6)
# append the name to another list
@ipv6.register_header_type(inet.IPPROTO_HOPOPTS)
class hop_opts(opt_header):
...
@ipv6.register_header_type(inet.IPPROTO_DSTOPTS)
class dst_opts(opt_header):
....
# create the new list from another list
ipv6.set_classes(ipv6._IPV6_EXT_HEADER_TYPE)
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
ryu/lib/stplib.py : Support OpenFlow 1.2/1.3
ryu/app/simple_switch_stp.py : Correspondence to parameter change of stplib.EventPortStateChange
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka@nttcom.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|
|
The number of threads was reduced for the simplification of processing.
There was three sending BPDU threads before.
- send Config BPDU thread
- send TopologyChange BPDU thread
- send TopologyChangeNotification BPDU thread
They were unified to one thread.
- send BPDU thread
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka@nttcom.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
|