2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

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>
This commit is contained in:
Romain Lenglet
2013-04-22 10:01:14 -07:00
committed by Ben Pfaff
parent d8558b4ae8
commit 29089a540c
32 changed files with 10768 additions and 238 deletions

View File

@@ -389,6 +389,34 @@ parse_metadata(struct ofpbuf *b, char *arg)
om->metadata = htonll(str_to_u64(arg));
}
static void
parse_sample(struct ofpbuf *b, char *arg)
{
struct ofpact_sample *os = ofpact_put_SAMPLE(b);
char *key, *value;
while (ofputil_parse_key_value(&arg, &key, &value)) {
if (!strcmp(key, "probability")) {
os->probability = str_to_u16(value, "probability");
if (os->probability == 0) {
ovs_fatal(0, "invalid probability value \"%s\"", value);
}
} else if (!strcmp(key, "collector_set_id")) {
os->collector_set_id = str_to_u32(value);
} else if (!strcmp(key, "obs_domain_id")) {
os->obs_domain_id = str_to_u32(value);
} else if (!strcmp(key, "obs_point_id")) {
os->obs_point_id = str_to_u32(value);
} else {
ovs_fatal(0, "invalid key \"%s\" in \"sample\" argument",
key);
}
}
if (os->probability == 0) {
ovs_fatal(0, "non-zero \"probability\" must be specified on sample");
}
}
static void
parse_named_action(enum ofputil_action_code code, const struct flow *flow,
char *arg, struct ofpbuf *ofpacts)
@@ -591,12 +619,17 @@ parse_named_action(enum ofputil_action_code code, const struct flow *flow,
ofpact_put_POP_MPLS(ofpacts)->ethertype =
htons(str_to_u16(arg, "pop_mpls"));
break;
case OFPUTIL_NXAST_STACK_PUSH:
nxm_parse_stack_action(ofpact_put_STACK_PUSH(ofpacts), arg);
break;
case OFPUTIL_NXAST_STACK_POP:
nxm_parse_stack_action(ofpact_put_STACK_POP(ofpacts), arg);
break;
case OFPUTIL_NXAST_SAMPLE:
parse_sample(ofpacts, arg);
break;
}
}