The distributed load balancer route redistribution series [0] emits one
Advertised_Route per (VIP, backend LSP) pair and gates it on the
Service_Monitor of the backend, so the fabric can steer a VIP to a
chassis that hosts a healthy local backend. Deployments that expose an
overlay VIP through a floating IP, the way ovn-octavia-provider adds the
floating IP as an extra VIP of the load balancer, still hit several
problems:

- northd_handle_lb_data_changes() gave up on any change that involved a
  load balancer with a health check, which a distributed load balancer
  needs for its routes to be gated, so a backend added to such a load
  balancer and every status change reported by ovn-controller rebuilt
  all logical flows.
- In the controller, the flow that ct_lb_mark_local encodes to was not
  reprocessed when a backend got bound or unbound.
- In the controller, the tracked_port of a route whose backend lives on
  a non-local datapath resolved to nothing, which route_run() treated as
  "no tracked port" and advertised everywhere.
- In northd, the NAT route of an address that is also a VIP of a
  distributed load balancer shadowed the load balancer routes.
- In northd, every VIP of every load balancer was announced, including a
  VIP of a private network that another tenant uses as well.

Patch 1 fixes the FreeBSD 14 build of ovn-parallel-hmap.c by including
<sys/stat.h> for the sem_open() mode constants. It was found while
testing the rest and can be taken separately.

Patch 2 makes northd process load balancers with health checks
incrementally. Every service monitor remembers the load balancers whose
backends it probes and every load balancer remembers the monitors it
uses. A Service_Monitor status change rebuilds only the flows of the
load balancers that share the monitor, and a load balancer change drops
the monitors it no longer needs without a recompute.

Patch 3 registers the port binding lookup of ct_lb_mark_local as an
lflow reference, so binding or unbinding a backend reprocesses the flows
whose encoded group depends on the local backends.

Patch 4 treats a tracked_port that the controller IDL does not hold as
bound elsewhere under local-only advertisement, instead of advertising
the route from every chassis at the default priority.

Patch 5 skips the NAT route of an address that a distributed load
balancer of the same router advertises through the same port. The load
balancer routes carry the locality and health of the address, and the
NAT route kept the gateway chassis advertised after they were withdrawn
there.

Patch 6 adds the Load_Balancer option dynamic-routing-advertise-vips, so
that only the listed VIPs of a load balancer are advertised and
forwarded. It keeps the VIP of a private network private when a floating
IP exposes the load balancer on the provider network.

Patch 7 adds two warnings. One reports a VIP that is about to be
advertised and falls inside a subnet that more than one logical switch
uses, which the fabric cannot tell apart. The other reports an entry of
dynamic-routing-advertise-vips that matches no VIP of the load balancer.

Patch 8 adds the Logical_Router option
dynamic-routing-advertise-prefixes, with a Logical_Router_Port override,
which limits the advertisement of load balancer VIPs and NAT external
IPs to the listed prefixes. A CMS lists the address space that may be
advertised to the fabric, for example the subnet pools that share the
address scope of the provider network, so one list on the router
replaces one list per load balancer, and a load balancer without a list
of its own cannot leak a private address through a port of the router.

Patch 9 lets an overlay client reach a distributed load balancer from a
chassis that has no healthy backend of it. The switch ingress flow of
such a load balancer gets a fallback form of ct_lb_mark_local, and
ovn-controller selects among all backends when none is local. The reply
of a client on a logical switch port returns through the conntrack zone
of its own switch on its own chassis, so the rewrite is undone whichever
chassis the backend is on. The router flow, which serves the traffic the
fabric steers to a chassis, and switches with a localnet, l2gateway,
vtep or remote port keep local-only delivery. This fallback was proposed
during the review of the distributed load balancer RFC and set aside
over the reply path of the router case [1]. An established connection
keeps the backend it was given, only new connections move when a local
backend appears.

Two points about patch 4 are worth noting:

- With local-only advertisement a distributed NAT entry whose logical
  port is on a non-local datapath is no longer advertised from chassis
  that do not host the port, the same treatment load balancer backends
  already get.
- Patch 4 deliberately changes nothing when local-only is off: a tracked
  port missing from the replica is still advertised at the default
  priority and the Service_Monitor gate does not apply to it. The gate
  matches Service_Monitor rows by the port name, which only the
  Port_Binding row carries, and a chassis without the row cannot recover
  it from the raw UUID. Fixing this needs northd to publish the name
  with the route. Local-only advertisement, the mode this feature is
  built around, has no such gap: a chassis advertises only when it holds
  the tracked port, so its gate always finds the monitors.

For a CMS mapping: Neutron knows which subnets share the address scope
of the provider network and can compute the lists of patches 6 and 8
from it. A VIP behind a NAT boundary then stays private while a VIP of
the same address space as the provider network is advertised as itself,
which is the behaviour address scopes promise.

Every patch but the first carries tests: controller tests for the
backend binding reprocessing and the switch fallback, a system test for
the non-local tracked port, a multinode test for the fallback with
traffic across chassis, and northd tests for the monitor handling, the
NAT skip, both filters, both warnings and the fallback flows. ovn-trace
follows one VIP packet from a client port, which the switch load
balances, and from a router port, which it does not.

Changes since v1:
- Patch 7: a logical switch with a localnet port no longer counts when
  looking for a subnet shared between switches. A physical network is
  routed by the fabric and a CMS may bridge it through more than one
  switch, which made the warning fire for every provider VIP. The test
  covers a provider subnet bridged through two localnet switches.
- Patch 9 added: fallback to any backend on the switch flow of a
  distributed load balancer when the chassis has no local backend. A
  load balancer on overlay switches only keeps one switch ingress row
  per VIP, one attached to overlay and localnet switches at once gets
  two, one per form of the action. northd timings are unchanged, and on
  a chassis without a local backend one select group per VIP is
  installed, which is what a non-distributed load balancer installs.

Two follow-ups are deferred:

- Extending the Service_Monitor gate of patch 4 to the default mode
  needs a way to find the monitors of a tracked port that the controller
  IDL does not hold.
- The br-controller lflow node encodes ct_lb actions through its own
  callbacks without port binding references.

 [0] https://mail.openvswitch.org/pipermail/ovs-dev/2026-August/434957.html
 [1] https://mail.openvswitch.org/pipermail/ovs-dev/2025-October/427029.html

Dmitrii Shcherbakov (9):
  lib: Include sys/stat.h for sem_open() mode constants.
  northd: Process load balancers with health checks incrementally.
  controller: Track local LB backend binding dependencies.
  controller: Treat an unresolved tracked port as bound elsewhere.
  northd: Skip the NAT route for a distributed LB VIP.
  northd: Add option to advertise a subset of LB VIPs.
  northd: Warn about LB VIPs that cannot be steered per network.
  northd: Add option to advertise only addresses in listed prefixes.
  northd, controller: Serve overlay clients without a local LB backend.

 NEWS                              |  16 +
 controller/lflow.c                |   9 +
 controller/route.c                |  20 +
 include/ovn/actions.h             |   2 +
 lib/actions.c                     | 133 +++--
 lib/ovn-parallel-hmap.c           |   1 +
 lib/ovn-util.c                    |   2 +-
 northd/en-advertised-route-sync.c | 642 ++++++++++++++++++++++--
 northd/en-advertised-route-sync.h |   6 +
 northd/en-northd.c                |  64 ++-
 northd/en-northd.h                |   5 +
 northd/inc-proc-northd.c          |   6 +-
 northd/lb.c                       |   2 +
 northd/lb.h                       |   6 +
 northd/northd.c                   | 516 +++++++++++++++++---
 northd/northd.h                   |  17 +-
 ovn-nb.xml                        | 103 +++-
 ovn-sb.xml                        |  11 +-
 tests/multinode-macros.at         |   4 +-
 tests/multinode.at                | 106 ++++
 tests/ovn-controller.at           | 339 +++++++++++++
 tests/ovn-inc-proc-graph-dump.at  |   4 +-
 tests/ovn-northd.at               | 990 +++++++++++++++++++++++++++++++++++++-
 tests/ovn.at                      |  79 +++
 tests/system-ovn.at               | 139 ++++++
 25 files changed, 3047 insertions(+), 175 deletions(-)


base-commit: 3cc2b5bcbd6087fff32d1dc76b1845ab166db31a
-- 
2.54.0 (Apple Git-157)


_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to