Skip to content

vpp-manager: fix DHCPv6 ip6tables hop-limit workaround#961

Open
aritrbas wants to merge 1 commit intomasterfrom
abasu-fix-ttl-hack
Open

vpp-manager: fix DHCPv6 ip6tables hop-limit workaround#961
aritrbas wants to merge 1 commit intomasterfrom
abasu-fix-ttl-hack

Conversation

@aritrbas
Copy link
Copy Markdown
Collaborator

@aritrbas aritrbas commented Mar 25, 2026

This patch replaces the ip6tables hop-limit workaround with the VPP ttl_fixup plugin, which provides protocol-agnostic TTL/hop-limit preservation for host-originated traffic forwarded through VPP.

The ttl_fixup plugin introduces a two-phase dataplane behavior:

  1. Input phase on source interfaces: Mark packets as locally originated so rewrite nodes skip TTL decrement.
  2. Output phase on destination interfaces: Decrement TTL/hop-limit post-rewrite for routed traffic.

Changes

  • Enabled ttl_fixup input on host tap setup path in vpp-manager.
  • Enabled ttl_fixup output on pod interface setup and disabled it on teardown.
  • Removed prior DHCPv6-specific ip6tables workaround logic from vpp-manager startup/restore path.
  • Generated vpplink bindings for the ttl_fixup plugin.

Resulting behavior:

  • tap -> uplink: TTL preserved (transparent forwarding semantics)
  • tap -> pod: TTL decremented (router hop semantics)
  • No protocol-specific host ip6tables hack required.

@aritrbas aritrbas self-assigned this Mar 25, 2026
@aritrbas aritrbas marked this pull request as draft March 26, 2026 16:09
Replace the ip6tables hop-limit workaround with the VPP ttl_fixup
plugin, which provides protocol-agnostic TTL/hop-limit preservation
for host-originated traffic forwarded through VPP.

The plugin uses a two-phase approach:
  - Input features on tap0: Set VNET_BUFFER_F_LOCALLY_ORIGINATED to
    prevent ip4/ip6-rewrite from decrementing TTL. This preserves
    TTL=1 for link-local protocols (DHCPv6, BGP, etc.) that would
    otherwise be dropped.
  - Output features on pod interfaces: For packets that originated
    from tap0, decrement TTL post-rewrite and send ICMP time-exceeded
    if needed. This restores normal router-hop behaviour for
    host-to-pod traffic while keeping TTL preserved for host-to-uplink
    (transparent forwarding).

This ensures:
  - tap → uplink: TTL preserved (VPP transparent, DHCPv6 works)
  - tap → pod: TTL decremented (VPP acts as router hop)

Signed-off-by: Aritra Basu <aritrbas@cisco.com>
@aritrbas aritrbas force-pushed the abasu-fix-ttl-hack branch from 9c749c3 to dec9cb9 Compare March 28, 2026 04:28
@aritrbas aritrbas marked this pull request as ready for review March 28, 2026 04:47
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.

1 participant