Skip to content

[Networking] Geneve tunnel conncheck#3277

Open
cheina97 wants to merge 7 commits into
liqotech:masterfrom
cheina97:frc/genevetunnelping
Open

[Networking] Geneve tunnel conncheck#3277
cheina97 wants to merge 7 commits into
liqotech:masterfrom
cheina97:frc/genevetunnelping

Conversation

@cheina97

@cheina97 cheina97 commented May 4, 2026

Copy link
Copy Markdown
Member

Summary

This PR adds an active connectivity health-check (ping) mechanism for Geneve tunnels, tracking connection status and latency directly on the GeneveTunnel CRD.

What changed:

  • GeneveTunnel CRD extended — added a Status subresource with value (Connected/Error) and latency fields, plus kubectl get print columns for quick status inspection.
  • Gateway InternalNodeReconciler — on reconcile, lazily initialises a ConnChecker bound to the gateway's inner Geneve IP; registers a UDP ping sender per tunnel and wires a callback that writes connectivity results back to GeneveTunnel status. Senders are stopped when the corresponding InternalNode is deleted.
  • Fabric InternalFabricReconciler — lazily starts a ConnChecker receiver bound to the node's inner Geneve IP, so the fabric side can respond to pings from the gateway.
  • ConnChecker improvements:
    • Supports binding to a specific IP (BindIP option), enabling per-interface isolation between Geneve and WireGuard ping traffic.
    • Latency is now smoothed with an EWMA (PingLatencyAlpha option, default 0.1) instead of using raw per-packet measurements.
  • New flags (gateway geneve-fabric component):
    • --geneve-ping-enabled (default true)
    • --geneve-ping-port (default 12346)
    • --geneve-ping-interval (default 2s)
    • --geneve-ping-loss-threshold (default 5)
    • --geneve-ping-update-status-interval (default 10s)
    • --geneve-ping-latency-alpha (default 0.1)
  • New flag (fabric component): --geneve-ping-port must match the gateway value.
  • New flag (connection component): --ping-latency-alpha applies the same EWMA smoothing to WireGuard connection checks.

How it works

Gateway InternalNodeReconciler
  └─ ConnChecker (sender, bound to gateway inner IP)
       └─ UDP ping → Fabric node inner IP : geneve-ping-port
            └─ ConnChecker (receiver, bound to node inner IP)
       └─ pong → callback → GeneveTunnel.Status.{Value, Latency}

When --geneve-ping-enabled=false the status is set to Connected immediately without running the ping loop.

Test plan

  • Deploy two clusters peered with Geneve mode.
  • Verify kubectl get genevetunnels shows Connected and a latency value after a few seconds.
  • Delete an InternalNode; verify no goroutine leak (sender is stopped).
  • Test with --geneve-ping-enabled=false; verify status is immediately Connected.

@adamjensenbot

Copy link
Copy Markdown
Collaborator

Hi @cheina97. Thanks for your PR!

I am @adamjensenbot.
You can interact with me issuing a slash command in the first line of a comment.
Currently, I understand the following commands:

  • /rebase: Rebase this PR onto the master branch (You can add the option test=true to launch the tests
    when the rebase operation is completed)
  • /merge: Merge this PR into the master branch
  • /build Build Liqo components
  • /test Launch the E2E and Unit tests
  • /hold, /unhold Add/remove the hold label to prevent merging with /merge

Make sure this PR appears in the liqo changelog, adding one of the following labels:

  • feat: 🚀 New Feature
  • fix: 🐛 Bug Fix
  • refactor: 🧹 Code Refactoring
  • docs: 📝 Documentation
  • style: 💄 Code Style
  • perf: 🐎 Performance Improvement
  • test: ✅ Tests
  • chore: 🚚 Dependencies Management
  • build: 📦 Builds Management
  • ci: 👷 CI/CD
  • revert: ⏪ Reverts Previous Changes

@github-actions github-actions Bot added the feat Adds a new feature to the codebase label May 4, 2026
@cheina97
cheina97 force-pushed the frc/genevetunnelping branch from ee5dcff to 68f9eb6 Compare May 4, 2026 08:21
@cheina97

cheina97 commented May 5, 2026

Copy link
Copy Markdown
Member Author

/build

@cheina97
cheina97 force-pushed the frc/genevetunnelping branch from 68f9eb6 to c90370f Compare July 16, 2026 15:11
@cheina97
cheina97 force-pushed the frc/genevetunnelping branch 4 times, most recently from 55a42bf to c854f19 Compare July 16, 2026 16:06
@cheina97
cheina97 force-pushed the frc/genevetunnelping branch 3 times, most recently from 0e38cb0 to 4ff859a Compare July 16, 2026 21:29
@cheina97

Copy link
Copy Markdown
Member Author

/rebase test=true

Comment thread pkg/gateway/tunnel/metrics.go Outdated
Comment thread pkg/gateway/tunnel/metrics.go Outdated
@cheina97
cheina97 force-pushed the frc/genevetunnelping branch 2 times, most recently from 32e3c77 to 26838e2 Compare July 17, 2026 11:48
cheina97 and others added 3 commits July 17, 2026 13:49
…vetunnels.yaml

Co-authored-by: Fulvio Risso <fulvio.risso@polito.it>
…vetunnels.yaml

Co-authored-by: Fulvio Risso <fulvio.risso@polito.it>
cheina97 and others added 2 commits July 17, 2026 13:49
Co-authored-by: Fulvio Risso <fulvio.risso@polito.it>
@cheina97
cheina97 force-pushed the frc/genevetunnelping branch 2 times, most recently from 76f3521 to 84a6398 Compare July 17, 2026 11:53
@cheina97

Copy link
Copy Markdown
Member Author

/rebase test=true

Co-authored-by: Fulvio Risso <fulvio.risso@polito.it>
@cheina97
cheina97 force-pushed the frc/genevetunnelping branch from 84a6398 to 830350b Compare July 17, 2026 13:10
@cheina97

Copy link
Copy Markdown
Member Author

/rebase test=true

Comment thread pkg/gateway/fabric/flag.go Outdated
Comment on lines +59 to +68
flagset.BoolVar(&opts.PingEnabled, FlagNameGenevePingEnabled.String(), true,
"Enable geneve tunnel ping health check")
flagset.IntVar(&opts.ConnCheckOptions.PingPort, FlagNameGenevePingPort.String(), 12346,
"UDP port used for geneve tunnel ping health check")
flagset.DurationVar(&opts.ConnCheckOptions.PingInterval, FlagNameGenevePingInterval.String(), 2*time.Second,
"Interval between geneve tunnel pings")
flagset.UintVar(&opts.ConnCheckOptions.PingLossThreshold, FlagNameGenevePingLossThreshold.String(), 5,
"Number of consecutive lost pings before a geneve tunnel is declared down")
flagset.DurationVar(&opts.PingUpdateStatusInterval, FlagNameGenevePingUpdateStatusInterval.String(), 10*time.Second,
"Minimum interval between GeneveTunnel status updates")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would be nice to have some of these configurable from Helm like we have for wireguard ping

@cheina97
cheina97 force-pushed the frc/genevetunnelping branch from e13d559 to d103c5d Compare July 19, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat Adds a new feature to the codebase size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants