Skip to content

flowspec: add the redirect-to-IP action (draft-ietf-idr-flowspec-redirect-ip-16) - #3535

Closed
takehaya wants to merge 2 commits into
osrg:masterfrom
takehaya:flowspec-redirect-to-ip
Closed

flowspec: add the redirect-to-IP action (draft-ietf-idr-flowspec-redirect-ip-16)#3535
takehaya wants to merge 2 commits into
osrg:masterfrom
takehaya:flowspec-redirect-to-ip

Conversation

@takehaya

@takehaya takehaya commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Why

Implements the "Flow-spec Redirect to IP" action from draft-ietf-idr-flowspec-redirect-ip-16, requested in #2810, in both forms the draft defines: IPv4 (type 0x01, sub-type 0x0c) and IPv6 (type 0x000c, RFC 5701).
The code points are IANA-assigned and the draft is in the RFC Editor queue.

Why not the existing Redirect types

Those implement redirect-to-VRF (RFC 8955 section 7.4), where the value is a route target naming a VRF. Here the value is the address traffic is forwarded toward. GoBGP previously decoded such communities into the generic IPv4AddressSpecificExtended, losing the action, and could only originate one by hand-crafting bytes.

The CLI gets its own verb for the same reason, redirect parses itsargument as a route target

$ gobgp global rib -a ipv4-flowspec add \
    match destination 192.0.2.1/32 destination-port '==61001' \
    then redirect-to-ip 198.51.100.11 [copy]

Trailing copy sets the C bit. docs/sources/flowspec.md documents the action with transcripts from a running gobgpd.

Add the redirect-to-IP action of draft-ietf-idr-flowspec-redirect-ip-16,
IPv4 (type 0x01, sub-type 0x0c) and IPv6 (type 0x000c, RFC 5701). The
Global Administrator carries the forwarding target, the Local
Administrator's low bit the C (copy) flag, kept as a bool since the
draft requires the remaining bits to be zero and ignored.

Unlike the existing Redirect* types, whose value is a route target
(redirect-to-VRF, RFC 8955 section 7.4), this names an address; such
communities previously decoded to the generic
IPv4AddressSpecificExtended, losing the action.

MarshalJSON emits target and copy as separate fields, following
TrafficAction and TrafficRate: type and subtype already name the
action, and a "value" string would hide the copy flag.

Closes osrg#2810 (packet layer).

Signed-off-by: Takeru Hayasaka <hayatake396@gmail.com>
Expose the new types over the gRPC API and add CLI syntax:

  gobgp global rib -a ipv4-flowspec add match destination 192.0.2.1/32 \
    destination-port '==61001' then redirect-to-ip 198.51.100.11 [copy]

"redirect" is left alone: it parses a route target, this takes an
address, and one verb cannot accept both unambiguously. The IPv6 form
goes to IP6ExtendedCommunitiesAttribute only, since a 20-octet RFC 5701
community does not fit the 8-octet attribute.

docs/sources/flowspec.md gains the action and CLI transcripts.

Signed-off-by: Takeru Hayasaka <hayatake396@gmail.com>
@fujita

fujita commented Aug 12, 2026

Copy link
Copy Markdown
Member

Great, thanks!

@fujita fujita closed this Aug 12, 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