mbox series

[ovs-dev,v1,0/3] Add ovn drop debugging

Message ID 20220613161054.2896553-1-amorenoz@redhat.com
Headers show
Series Add ovn drop debugging | expand

Message

Adrian Moreno June 13, 2022, 4:10 p.m. UTC
Very often when troubleshooting networking issues in an OVN cluster one
would like to know if any packet (or a specific one) is being dropped by
OVN.

Currently, this cannot be known because of two main reasons:

1 - Implicit drops: Some tables do not have a default action
(priority=0, match=1). In this case, a packet that does not match any
rule will be silently dropped.

2 - Even on explicit drops, we only know a packet was dropped. We lack
information about that packet.

In order to improve this, this series proposes a two-fold solution:

- First, create a debug-mode option. When enabled, it makes:
   - northd add a default (match = "1") "drop;" action to those tables
   that currently lack one.
   - ovn-controller add an explicit drop action on those tables are not
   associated with logical flows (i.e: physical-to-logical mappings).

- Secondly, allow sampling of all drops. By introducing a new OVN
  action: "sample" (equivalent to OVS's), OVN can make OVS sample the
  packets as they are dropped. In order to be able to correlate those
  samples back to what exact rule generated them, the user specifies the
  a 8-bit observation_domain_id. Based on that, the samples contain
  the following fields:
  - obs_domain_id:
     - 8 most significant bits = the provided observation_domain_id.
     - 24 least significant bits = the datapath's tunnely key if the
       drop comes from a lflow or zero otherwise.
  - obs_point_id: the first 32-bits of the lflow's UUID (i.e: the
    cookie) if the drop comes from an lflow or the table number
    otherwise.

Based on the above changes in the flows, all of which are optional,
users can collect IPFIX samples of the packets that are dropped by OVN
which contain header information useful for debugging.

* Note on observation_domain_ids:
By allowing the user to specify only the 8 most significant bits of the
obs_domain_id and having OVN combine it with the datapath's tunnel key,
OVN could be extended to support more than one "sampling" application.
For instance, ACL sampling could be developed in the future and, by
specifying a different observation_domain_id, it could co-exist with the
drop sampling mode implemented in the current series while still
allowing to uniquely identify the flow that created the sample.

Adrian Moreno (3):
  actions: add sample action
  northd: add drop-debug-mode to add explicit drops
  northd: add drop sampling

 controller/lflow.c          |   1 +
 controller/ovn-controller.c |  50 ++++++++++
 controller/physical.c       |  80 +++++++++++++++-
 controller/physical.h       |   7 ++
 include/ovn/actions.h       |  16 ++++
 lib/actions.c               | 119 +++++++++++++++++++++++
 northd/automake.mk          |   2 +
 northd/debug.c              | 108 +++++++++++++++++++++
 northd/debug.h              |  41 ++++++++
 northd/northd.c             | 115 ++++++++++++++--------
 ovn-nb.xml                  |  32 +++++++
 tests/ovn-northd.at         |  76 +++++++++++++++
 tests/ovn.at                | 184 +++++++++++++++++++++++++++++++++++-
 tests/test-ovn.c            |   3 +
 utilities/ovn-trace.c       |   2 +
 15 files changed, 793 insertions(+), 43 deletions(-)
 create mode 100644 northd/debug.c
 create mode 100644 northd/debug.h