Here is added queue status request to ofctl.
Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Openflow 1.1 and later versions allow the use of IP address with
arbitrary bitmask in match fields. This adds arbitrary bitmask
support to related functions.
After applying this patch, it's no longer compatible with ACL
hybrid CIDR format (Cisco-like ACL bitmasks) because such format
exists only in some router's ACL configuration.
Reported-by: Yi-Ching Lee <potatoching11@gmail.com>
Reported-by: Li-Der Chou <cld@csie.ncu.edu.tw>
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This enables match_ip*_to_str() functions to output IP address with
dotted decimal subnet mask if the mask cannot be represented in CIDR
format.
Reported-by: Yi-Ching Lee <potatoching11@gmail.com>
Reported-by: Li-Der Chou <cld@csie.ncu.edu.tw>
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofproto_v1_3.OFPGT_ALL is 0 and 0 is False on Python. When using type 'ALL', the following is set to True.
if not type_:
LOG.debug('Unknown type: %s', group.get('type'))
Therefore, the log unsuitable is outputted:
Unknown type: ALL
Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This enables to_match_ip() to accept IPv4 address with dotted decimal
subnet mask or ACL hybrid CIDR.
Given 3 match field values below:
'192.168.1.0/24'
'192.168.1.0/255.255.255.0'
'192.168.1.0/0.0.0.255'
These addresses are logically equivalent.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
this patch fixes the following bugs:
- "SET_FIELD" action caused an exception at mod_flow_entry command.
- following match fields caused an exception at get_flow_stats command:
* mpls_label, arp_spa, arp_tpa
- following fields in "SET_FIELD" were displayed as classes:
* eth_dst, eth_src, vlan_vid, mpls_label
- "arp_spa" and "arp_tpa" were not displayed as IPv4 address
Signed-off-by: Yuichi Ito <ito.yuichi0@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>
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 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>
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 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>
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>
ofctl_v1_3 lacks of get_desc_stats & get_port_stats methods which is available
in ofctl_v1_0. I copied the code from ofctl_v1_0 and it works fine. The only
change to get_port_stats in ofctl_v1_3 is using OFPP_ANY as argument to call
OFPPortStatsRequest.
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>