From fb8f22c186b89cd36059c37908f940a1aa5e1569 Mon Sep 17 00:00:00 2001 From: Benli Ye Date: Mon, 13 Jun 2016 14:44:09 -0700 Subject: ipfix: Add support for exporting ipfix statistics. It is meaningful for user to check the stats of IPFIX. Using IPFIX stats, user can know how much flows the system can support. It is also can be used for performance check of IPFIX. IPFIX stats is added for per IPFIX exporter. If bridge IPFIX is enabled on the bridge, the whole bridge will have one exporter. For flow IPFIX, the system keeps per id (column in Flow_Sample_Collector_Set) per exporter. 1) Add 'ovs-ofctl dump-ipfix-bridge SWITCH' to export IPFIX stats of the bridge which enable bridge IPFIX. The output format: NXST_IPFIX_BRIDGE reply (xid=0x2): bridge ipfix: flows=0, current flows=0, sampled pkts=0, \ ipv4 ok=0, ipv6 ok=0, tx pkts=0 pkts errs=0, ipv4 errs=0, ipv6 errs=0, tx errs=0 2) Add 'ovs-ofctl dump-ipfix-flow SWITCH' to export IPFIX stats of the bridge which enable flow IPFIX. The output format: NXST_IPFIX_FLOW reply (xid=0x2): 2 ids id 1: flows=4, current flows=4, sampled pkts=14, ipv4 ok=13, \ ipv6 ok=0, tx pkts=0 pkts errs=0, ipv4 errs=0, ipv6 errs=0, tx errs=0 id 2: flows=0, current flows=0, sampled pkts=0, ipv4 ok=0, \ ipv6 ok=0, tx pkts=0 pkts errs=0, ipv4 errs=0, ipv6 errs=0, tx errs=0 flows: the number of total flow records, including those exported. current flows: the number of current flow records cached. sampled pkts: Successfully sampled packet count. ipv4 ok: successfully sampled IPv4 flow packet count. ipv6 ok: Successfully sampled IPv6 flow packet count. tx pkts: the count of IPFIX exported packets sent to the collector(s). pkts errs: count of packets failed when sampling, maybe not supported or other error. ipv4 errs: Count of IPV4 flow packet in the error packets. ipv6 errs: Count of IPV6 flow packet in the error packets. tx errs: the count of IPFIX exported packets failed when sending to the collector(s). Signed-off-by: Benli Ye Signed-off-by: Ben Pfaff --- include/openflow/nicira-ext.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/openflow') diff --git a/include/openflow/nicira-ext.h b/include/openflow/nicira-ext.h index 895033512..5ab026c46 100644 --- a/include/openflow/nicira-ext.h +++ b/include/openflow/nicira-ext.h @@ -774,6 +774,23 @@ struct nx_aggregate_stats_request { */ }; OFP_ASSERT(sizeof(struct nx_aggregate_stats_request) == 8); + +struct nx_ipfix_stats_reply { + ovs_be64 total_flows; + ovs_be64 current_flows; + ovs_be64 pkts; + ovs_be64 ipv4_pkts; + ovs_be64 ipv6_pkts; + ovs_be64 error_pkts; + ovs_be64 ipv4_error_pkts; + ovs_be64 ipv6_error_pkts; + ovs_be64 tx_pkts; + ovs_be64 tx_errors; + ovs_be32 collector_set_id; /* Range 0 to 4,294,967,295. */ + uint8_t pad[4]; /* Pad to a multiple of 8 bytes. */ +}; +OFP_ASSERT(sizeof(struct nx_ipfix_stats_reply) == 88); + /* NXT_SET_CONTROLLER_ID. * -- cgit v1.2.1