flowspec: add the redirect-to-IP action (draft-ietf-idr-flowspec-redirect-ip-16) - #3535
Closed
takehaya wants to merge 2 commits into
Closed
flowspec: add the redirect-to-IP action (draft-ietf-idr-flowspec-redirect-ip-16)#3535takehaya wants to merge 2 commits into
takehaya wants to merge 2 commits into
Conversation
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>
Member
|
Great, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
RedirecttypesThose 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,
redirectparses 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
copysets the C bit.docs/sources/flowspec.mddocuments the action with transcripts from a runninggobgpd.