Skip to content

feat(ovs): add opt-in VXLAN source admission - #6

Closed
gmelikov wants to merge 1 commit into
masterfrom
sdn-min
Closed

gmelikov wants to merge 1 commit into
masterfrom
sdn-min

Conversation

@gmelikov

@gmelikov gmelikov commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Changes

Add [ovs] restrict_tunnel_sources, disabled by default. Existing configurations keep unrestricted VXLAN source admission. Exordos explicitly enables the option in its generated connector config.

With the option enabled, table 0 admits each next-hop address learned from EVPN Type 2, 3 and 5 paths once. The existing VXLAN/VNI classifiers move to table 3 with their actions preserved. Admission and classification require approximately N + M rules, instead of N VTEPs × M classifiers.

Fail-static retains the source admission rules and classifiers. Legacy classifiers are moved behind the source check; qualified snapshot classifiers restore their admitted sources, while unqualified classifiers cannot admit a source by themselves.

The address set is maintained automatically. The trust boundary is accepted EVPN announcements; this does not authenticate the outer source address.

Example OVS flows

For routed VNI 10000, with VXLAN on ofport 65278 and two EVPN-learned VTEPs (10.10.10.2 and 10.10.10.3), the ingress pipeline looks like this (GBP disabled; unrelated flows and dump counters omitted).

With restrict_tunnel_sources = False (the default):

table=0,priority=10,in_port=65278,tun_id=10000 actions=set_field:10000->reg2,resubmit(,1)
table=0,priority=0 actions=drop

With restrict_tunnel_sources = True:

table=0,priority=10,in_port=65278,tun_src=10.10.10.2 actions=resubmit(,3)
table=0,priority=10,in_port=65278,tun_src=10.10.10.3 actions=resubmit(,3)
table=0,priority=0 actions=drop

table=3,priority=10,in_port=65278,tun_id=10000 actions=set_field:10000->reg2,resubmit(,1)
table=3,priority=0 actions=drop

An unknown outer source IP reaches the table 0 drop. An admitted source with an unconfigured VNI reaches the table 3 drop. Each VTEP gets one admission rule shared by all VNI classifiers. The connector updates the rules automatically as EVPN next hops appear or disappear. IPv6 outer sources use tun_ipv6_src instead of tun_src. With GBP enabled, the existing GBP-to-packet-mark action is preserved in the VNI classifier.

Verification

  • 71 connector unit tests passed on Python 3.8, 3.12 and 3.14; full flake8/hacking passed.
  • Linear-growth regression: 100 classifiers + 20 VTEPs produce 121 rules including the table 3 drop, instead of 2000 source-qualified classifiers. The regression fails on the previous PR head.
  • Real OVS fabric: all previous 14 cases passed, plus a new legacy-qualified snapshot recovery case (15 cases across these runs).
  • Enabled mode: unknown source/wrong VNI rejection, host addition/last-route withdrawal, asymmetric RT ECMP, RR loss and restart after flushing OVS flows. Both current and legacy-qualified snapshots restore valid forwarding while rejecting unknown sources.
  • Disabled/default mode: real VXLAN ingress from a source outside the learned VTEPs remains accepted when the option is absent.
  • Previous physical two-hypervisor validation tested the earlier implementation; this table revision has not been deployed there.

CI passed on the updated PR heads: connector lint and unit tests on Python 3.8/3.14, and SDK lint, Python 3.10–3.14 tests, libvirt, coverage, all 15 fabric and 95 dataplane tests. The fabric job checked out connector 29d5ba3f1fb22e5290a6bdfbfa4b5e3800a142f2.

@gmelikov gmelikov changed the title feat(ovs): restrict VXLAN ingress to learned VTEPs feat(ovs): add opt-in VXLAN source admission Oct 12, 2026
@gmelikov

Copy link
Copy Markdown
Member Author

@exordy /review

Gate ingress behind [ovs] restrict_tunnel_sources, disabled by default.
Learn VTEPs from all EVPN Type 2, 3 and 5 paths on each RIB read.

Admit each VTEP once in table 0 and classify its VNI in table 3,
preserving the existing actions without multiplying classifiers by
sources. Normalize legacy fail-static classifiers behind the gate and
restore qualified snapshot sources. Count the final flows sent to OVS.

Cover both settings, linear flow growth, multipath next hops, address
replacement, withdrawal, and snapshot recovery.

@exordy exordy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exo-review: LGTM

Intent: Add opt-in OVS VXLAN source admission from EVPN next hops, with fail-static support.

Verify before merge

  • Run the privileged-sink security pass on OVS: trace packet paths, priorities, restart, and fail-static.
  • Peer import policy and route-target scoping are absent; inspect them and test whether an untrusted or out-of-scope route can authorize its next hop.
  • The full OVS pipeline is absent; inspect all table-0 rules and ingress paths for a higher-priority or alternate bypass.
  • No OVS or namespace repro was available; run the enabled-mode fabric cases on the reviewed head and inspect the installed flows.
Coverage: 6 axes clean · 0 checks run · mode pre-prod

Threat model:

  • A tenant or compromised VTEP may try to send traffic into another tenant's VNI.
  • A guest can send arbitrary frames through its attached port toward the host's forwarding pipeline.
  • An EVPN peer can supply route announcements and next hops to the connector.
  • An underlay neighbor may send VXLAN traffic or spoof an outer source address.
  • A local user may tamper with snapshots if their permissions allow it; file permissions were not supplied.
  • Assets: tenant traffic, OVS forwarding state, and the host underlay; boundaries: BGP RIB to connector, then connector to OVS.

Clean axes: security pass: The option defaults off and is wired from configuration into the service.; For shown table-0 VXLAN classifiers, the helper moves classification to table 3 and adds source matches in table 0.; Fail-static normalizes the target and saved flows; included unit cases cover qualified and unqualified snapshots.; scope — all hunks serve opt-in source admission; compatibility — skipped: this table revision is not deployed; reconciliation — fail-static normalization and withdrawal paths are covered; tests — additions cover source collection, growth, withdrawal, and snapshot restore; production readiness — no WIP markers, debug code, or process comments added

0 tool calls · 140s

@gmelikov gmelikov closed this Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants