Implement new fragment handling policy.
authorBen Pfaff <blp@nicira.com>
Thu, 20 Oct 2011 04:33:44 +0000 (21:33 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 21 Oct 2011 22:07:36 +0000 (15:07 -0700)
commit7257b535ab8e5fafd811c5f6788205eefdd44948
tree75072ea003837f756ce6910fb5e0ba3113db30be
parent4edb9ae90e4092f5f56b9d914d2b88783c49860d
Implement new fragment handling policy.

Until now, OVS has handled IP fragments more awkwardly than necessary.  It
has not been possible to match on L4 headers, even in fragments with offset
0 where they are actually present.  This means that there was no way to
implement ACLs that treat, say, different TCP ports differently, on
fragmented traffic; instead, all decisions for fragment forwarding had to
be made on the basis of L2 and L3 headers alone.

This commit improves the situation significantly.  It is still not possible
to match on L4 headers in fragments with nonzero offset, because that
information is simply not present in such fragments, but this commit adds
the ability to match on L4 headers for fragments with zero offset.  This
means that it becomes possible to implement ACLs that drop such "first
fragments" on the basis of L4 headers.  In practice, that effectively
blocks even fragmented traffic on an L4 basis, because the receiving IP
stack cannot reassemble a full packet when the first fragment is missing.

This commit works by adding a new "fragment type" to the kernel flow match
and making it available through OpenFlow as a new NXM field named
NXM_NX_IP_FRAG.  Because OpenFlow 1.0 explicitly says that the L4 fields
are always 0 for IP fragments, it adds a new OpenFlow fragment handling
mode that fills in the L4 fields for "first fragments".  It also enhances
ovs-ofctl to allow users to configure this new fragment handling mode and
to parse the new field.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Bug #7557.
39 files changed:
NEWS
datapath/datapath.c
datapath/datapath.h
datapath/flow.c
datapath/flow.h
datapath/tunnel.c
include/linux/openvswitch.h
include/openflow/nicira-ext.h
include/openflow/openflow.h
lib/classifier.c
lib/classifier.h
lib/dpif-linux.c
lib/dpif-netdev.c
lib/dpif-provider.h
lib/dpif.c
lib/dpif.h
lib/flow.c
lib/flow.h
lib/meta-flow.c
lib/meta-flow.h
lib/nx-match.c
lib/nx-match.def
lib/odp-util.c
lib/ofp-print.c
lib/ofp-util.c
lib/ofp-util.h
ofproto/netflow.c
ofproto/ofproto-dpif.c
ofproto/ofproto-provider.h
ofproto/ofproto.c
tests/flowgen.pl
tests/odp.at
tests/ofproto-dpif.at
tests/ovs-ofctl.at
tests/test-classifier.c
tests/test-flows.c
utilities/ovs-dpctl.c
utilities/ovs-ofctl.8.in
utilities/ovs-ofctl.c