summaryrefslogtreecommitdiff
path: root/include/openflow/nicira-ext.h
diff options
context:
space:
mode:
authorRomain Lenglet <rlenglet@vmware.com>2013-04-22 10:01:14 -0700
committerBen Pfaff <blp@nicira.com>2013-04-22 14:33:58 -0700
commit29089a540cfa30a834e3ee19a8b4c52ff2e331b2 (patch)
tree7fd0c5d666c5f18fbd7ad463edc8d908636999f3 /include/openflow/nicira-ext.h
parentd8558b4ae86f0f64afe520c4c1d99f55a94063d8 (diff)
downloadopenvswitch-29089a540cfa30a834e3ee19a8b4c52ff2e331b2.tar.gz
Implement IPFIX export
Define a new NXAST_SAMPLE OpenFlow vendor action and the corresponding OFPACT_SAMPLE OVS action, to do per-flow packet sampling, translated into a new SAMPLE "flow_sample" dp action. Make the userspace action's userdata size vary depending on the union member used. Add a new "flow_sample" upcall to do per-flow packet sampling. Add a new "ipfix" upcall to do per-bridge packet sampling to IPFIX collectors. Extend the OVSDB schema to support configuring IPFIX collector sets. Add support for configuring multiple IPFIX collectors for per-flow packet sampling. Add support for configuring per-bridge IPFIX sampling. Automatically generate standard IPFIX entity definitions from the IANA specs. Send one IPFIX data record message for every packet sampled by an OpenFlow sample action or received by a bridge configured with IPFIX sampling, and periodically send IPFIX template set messages. Signed-off-by: Romain Lenglet <rlenglet@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'include/openflow/nicira-ext.h')
-rw-r--r--include/openflow/nicira-ext.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/openflow/nicira-ext.h b/include/openflow/nicira-ext.h
index 54fc4f95e..c80ff9560 100644
--- a/include/openflow/nicira-ext.h
+++ b/include/openflow/nicira-ext.h
@@ -312,6 +312,7 @@ enum nx_action_subtype {
NXAST_DEC_MPLS_TTL, /* struct nx_action_header */
NXAST_STACK_PUSH, /* struct nx_action_stack */
NXAST_STACK_POP, /* struct nx_action_stack */
+ NXAST_SAMPLE, /* struct nx_action_sample */
};
/* Header for Nicira-defined actions. */
@@ -2233,4 +2234,29 @@ struct nx_action_mpls_ttl {
};
OFP_ASSERT(sizeof(struct nx_action_mpls_ttl) == 16);
+/* Action structure for NXAST_SAMPLE.
+ *
+ * Samples matching packets with the given probability and sends them
+ * each to the set of collectors identified with the given ID. The
+ * probability is expressed as a number of packets to be sampled out
+ * of USHRT_MAX packets, and must be >0.
+ *
+ * When sending packet samples to IPFIX collectors, the IPFIX flow
+ * record sent for each sampled packet is associated with the given
+ * observation domain ID and observation point ID. Each IPFIX flow
+ * record contain the sampled packet's headers when executing this
+ * rule. If a sampled packet's headers are modified by previous
+ * actions in the flow, those modified headers are sent. */
+struct nx_action_sample {
+ ovs_be16 type; /* OFPAT_VENDOR. */
+ ovs_be16 len; /* Length is 24. */
+ ovs_be32 vendor; /* NX_VENDOR_ID. */
+ ovs_be16 subtype; /* NXAST_SAMPLE. */
+ ovs_be16 probability; /* Fraction of packets to sample. */
+ ovs_be32 collector_set_id; /* ID of collector set in OVSDB. */
+ ovs_be32 obs_domain_id; /* ID of sampling observation domain. */
+ ovs_be32 obs_point_id; /* ID of sampling observation point. */
+};
+OFP_ASSERT(sizeof(struct nx_action_sample) == 24);
+
#endif /* openflow/nicira-ext.h */