If there is an empty value in the reply msg, there are cases where those methods cause an error.
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>
This patch enables to specify the port number and the queue id to get the queue stats.
Usage)
$ curl -X GET http://localhost:8080/stats/queue/<dpid>[/<port>[/<queue_id>]]
Note: Specification of port number and queue id are optional.
If you want to omitting the port number and setting the queue id,
please specify the keyword "ALL" to the port number.
e.g. GET /stats/queue/1/ALL/1
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch enables to specify the port number to get the port stats.
Usage)
$ curl -X GET http://localhost:8080/stats/port/<dpid>[/<port>]
Note: Specification of port number is optional
Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
* modify from "flow" to "meter" the argument of meter_mod
* modify the default argument from {} to None of the following methods
because default value []/{} as argument is dangerous.
- get_flow_stats
- get_aggregate_flow_stats
- mod_meter_entry
* fix some log messages for better readability
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
this patch makes ofctl_rest enable use of OFPTableStats message.
Get table stats:
usage)
URI: /stats/table/<dpid>
method: GET
e.g.)
$ curl -X GET http://localhost:8080/stats/table/1
More infomation about this feature is described in the following URL.
http://ryu.readthedocs.org/en/latest/app/ofctl_rest.html#get-table-stats
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
There is no port information in output string of ENQUEUE in ofctl_v1_0.py
This patch fixes this problem.
Execution example is as follows.
curl -X GET http://localhost:8080/stats/flow/1
{
"1": [
{
"actions": [
"ENQUEUE:2:3" # ENQUEUE:<port>:<queue_id>
],
"byte_count": 0,
"cookie": 0,
"duration_nsec": 864000000,
"duration_sec": 107,
"hard_timeout": 0,
"idle_timeout": 0,
"match": {
"in_port": 5
},
"packet_count": 0,
"priority": 32768,
"table_id": 0
}
]
}
Reported-by: Weijie Liu <wliu43@illinois.edu>
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
this patch makes ofctl_rest enable use of OFPAggregateStats message.
Get aggregate flow stats:
usage)
URI: /stats/aggregateflow/<dpid>
method: GET
e.g.)
$ curl -X GET http://localhost:8080/stats/aggregateflow/1
{
"1": [
{
"packet_count": 18,
"byte_count": 756,
"flow_count": 3
}
]
}
Get aggregate flow stats filtered by fields:
usage)
URI: /stats/aggregateflow/<dpid>
method: POST
the message body is as follows.
table_id Table ID (int)
out_port Require matching entries to include this as an output port (int)
out_group Require matching entries to include this as an output group (int)
cookie Require matching entries to contain this cookie value (int)
cookie_mask Mask used to restrict the cookie bits that must match (int)
match Fields to match (dict)
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/aggregateflow/1
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
The match_to_str() function in ryu/lib/ofctl_v1_0.py does not convert
nw_tos correctly. As a result, we cannot obtain nw_tos value of any
flow entry by invoking get_flow_stats()
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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>
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>
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>
this patch makes ofctl_rest enable use of Port Modification Message.
usage)
URI: /stats/portdesc/modify
method: POST
the message body is as follows:
dpid
port_no (default:0)
config (default:0)
hw_addr (default:automatic-setting)
mask (default:0)
advertise (default:automatic-setting)
e.g. )
curl -X POST -d '{"dpid": 1,
"port_no": 1,
"mask": 0b0000001,
"config": 0b0000001}' http://localhost:8080/stats/portdesc/modify
Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@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>
- add ip match support
- add match_to_str() and actions_to_str() instead of action_to_str()
Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch provides the raw OF interface. We can talk with a switch
by using the OF interface via some protocols such as REST.
Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>