Internet-Draft | RPKI-Router Protocol | September 2024 |
Bush & Austein | Expires 31 March 2025 | [Page] |
In order to validate the origin Autonomous Systems (ASes) and Autonomous System relationships behind BGP announcements, routers need a simple but reliable mechanism to receive Resource Public Key Infrastructure (RFC6480) prefix origin data and Router Keys from a trusted cache. This document describes a protocol to deliver them.¶
This document describes version 2 of the RPKI-Router protocol. [RFC6810] describes version 0, and [RFC8210] describes version 1. This document is compatible with both.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 31 March 2025.¶
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
In order to verifiably validate the origin Autonomous Systems (ASes) and AS paths of BGP announcements, routers need a simple but reliable mechanism to receive cryptographically validated Resource Public Key Infrastructure (RPKI) [RFC6480] prefix origin data and Router Keys from a trusted cache. This document describes a protocol to deliver them. The design is intentionally constrained to be usable on much of the current generation of ISP router platforms.¶
This specification documents version 2 of the RPKI-RTR protocol. Earlier versions are documented in [RFC6810] and [RFC8210]. Though this version is, of course, preferred, the earlier versions are expected to continue to be productively deployed indefinitely, and Section 7 details how to downgrade from this version to earlier versions as needed in order to interoperate.¶
Section 3 describes the deployment structure, and Section 4 then presents an operational overview. The binary payloads of the protocol are formally described in Section 5, and the expected Protocol Data Unit (PDU) sequences are described in Section 8. The transport protocol options are described in Section 9. Section 10 details how routers and caches are configured to connect and authenticate. The traditional security and IANA considerations end the document.¶
The protocol is extensible in order to support new PDUs with new semantics, if deployment experience indicates that they are needed. PDUs are versioned should deployment experience call for change.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This section summarizes the significant changes between [RFC8210] and the protocol described in this document.¶
A new ASPA (Autonomous System Provider Authorization) PDU type (Section 5.12) has been added to support [I-D.ietf-sidrops-aspa-profile].¶
A small Section 11 has been added to handle two possible ROA (Route Origination Authorization) PDU race conditions, Make Before Break and Shorter Prefix First.¶
Language was clarified when multiple caches are configured, and an interesting affect is noted.¶
The protocol version number incremented from 1 (one) to 2 (two) and Section 7 on Protocol Version Negotiation has been updated accordingly.¶
The following terms are used with special meaning.¶
Deployment of the RPKI to reach routers has a three-level structure as follows:¶
A router establishes and keeps open a transport connection to one or more caches with which it has client/server relationships. It is configured with a semi-ordered list of caches and establishes a connection to the most preferred cache, or set of caches with that same priority, which accept the connections.¶
The router MUST choose the most preferred, by configuration, cache or set of caches so that the operator may control load on their caches and the Global RPKI.¶
A Validated ROA Payload (VRP, see [RFC6811]) is effective if it is in the fetched set from any of the currently preferred caches. Therefore, a VRP takes effect on the router when the first cache serves that VRP, and the VRP is in effect until the last cache withdraws that VRP. Thus, in a global sense, the effect of a VRP announcement propagates more quickly than a withdraw.¶
Periodically, the router sends a Serial Query to the cache specifying the most recent Serial Number for which it has received data from that cache, i.e., the router's current Serial Number for that cache, in the form of a Serial Query. When a router establishes a new session with a cache or wishes to reset a current relationship, it sends a Reset Query.¶
The cache responds to the Serial Query with all data changes which took place since the given Serial Number. This may be the null set, in which case the End of Data PDU (Section 5.8) is still sent. Note that the Serial Number comparison used to determine "since the given Serial Number" MUST take wrap-around into account; see [RFC1982].¶
When the router receives an End of Data PDU, it has received all current data from the cache. It then sets its current Serial Number for that cache to that of the Serial Number in the received End of Data PDU.¶
When the cache updates its database, it sends a Notify PDU to every currently connected router. This is a hint that now would be a good time for the router to poll for an update, but it is only a hint. The protocol requires the router to poll for updates periodically in any case.¶
Strictly speaking, a router could track a cache simply by asking for a complete data set every time it updates, but this would be very inefficient. The Serial-Number-based incremental update mechanism allows an efficient transfer of just the data records which have changed since the last update. As with any update protocol based on incremental transfers, the router must be prepared to fall back to a full transfer if for any reason the cache is unable to provide the necessary incremental data. Unlike some incremental transfer protocols, this protocol requires the router to make an explicit request to start the fallback process; this is deliberate, as the cache has no way of knowing whether the router has also established sessions with other caches that may be able to provide better service.¶
As cache servers must evaluate signed objects (see [RFC6480]) with time dependent validity periods, servers' clocks MUST be correct within a tolerance of an hour.¶
Barring errors, transport connections remain up as long as the cache and router remain up and the router is not reconfigured to no longer use the cache.¶
Should a transport connection be lost for unknown reasons, the router SHOULD try to reestablish one; being careful to not abuse the cache with two many failed requests.¶
The exchanges between the cache and the router are sequences of exchanges of the following PDUs according to the rules described in Section 8.¶
Reserved fields (marked "zero" in PDU diagrams) MUST be zero on transmission and MUST be ignored on receipt.¶
PDUs contain the following data elements:¶
0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | Session ID | | 2 | 0 | | +-------------------------------------------+ | | | Length=12 | | | +-------------------------------------------+ | | | Serial Number | | | `-------------------------------------------'¶
The cache notifies the router that the cache has new data.¶
The Session ID reassures the router that the Serial Numbers are commensurate, i.e., the cache session has not been changed.¶
Upon receipt of a Serial Notify PDU, the router MAY issue an immediate Serial Query (Section 5.3) or Reset Query (Section 5.4) without waiting for the Refresh Interval timer (see Section 6) to expire.¶
Serial Notify is the only message that the cache MAY send that is not in response to a message from the router.¶
If the router receives a Serial Notify PDU during the initial startup period where the router and cache are still negotiating to agree on a protocol version, the router MUST simply ignore the Serial Notify PDU, even if the Serial Notify PDU is for an unexpected protocol version. See Section 7 for details.¶
0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | Session ID | | 2 | 1 | | +-------------------------------------------+ | | | Length=12 | | | +-------------------------------------------+ | | | Serial Number | | | `-------------------------------------------'¶
The router sends a Serial Query to ask the cache for all announcements and withdrawals which have occurred since the Serial Number specified in the Serial Query.¶
The cache replies to this query with a Cache Response PDU (Section 5.5) if the cache has a (possibly null) record of the changes since the Serial Number specified by the router, followed by zero or more payload PDUs and an End Of Data PDU (Section 5.8).¶
When replying to a Serial Query, the cache MUST return the minimum set of changes needed to bring the router into sync with the cache. That is, if a particular prefix, Router Key, or ASPA underwent multiple changes between the Serial Number specified by the router and the cache's current Serial Number, the cache MUST merge those changes to present the simplest possible view of those changes to the router. In general, this means that, for any particular prefix/AS, Router Key. or ASPA/Customer, the data stream will include at most one withdrawal followed by at most one announcement, and if all of the changes cancel out, the data stream will not mention the prefix/AS, Router Key, or ASPA/Customer at all.¶
In the data responding to a Serial Query, should the router receive duplicate announcements or withdrawals, the router should raise an Error with Error Code 7, Duplicate Announcement Received.¶
The rationale for this approach is that the entire purpose of the RPKI-Router protocol is to offload work from the router to the cache, and it should therefore be the cache's job to simplify the change set, thus reducing work for the router.¶
If the cache does not have the data needed to update the router, perhaps because its records do not go back to the Serial Number in the Serial Query, then it responds with a Cache Reset PDU (Section 5.9).¶
The Session ID tells the cache what instance the router expects to ensure that the Serial Numbers are commensurate, i.e., the cache session has not been changed.¶
0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | zero | | 2 | 2 | | +-------------------------------------------+ | | | Length=8 | | | `-------------------------------------------'¶
The router tells the cache that it wants to receive the total active, current, non-withdrawn database. The cache responds with a Cache Response PDU (Section 5.5), followed by zero or more payload PDUs and an End of Data PDU (Section 5.8).¶
0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | Session ID | | 2 | 3 | | +-------------------------------------------+ | | | Length=8 | | | `-------------------------------------------'¶
The cache responds to queries with zero or more payload PDUs. When replying to a Serial Query (Section 5.3), the cache sends the set of announcements and withdrawals necessary to bring the router's state current with all changes that have occurred since the Serial Number sent by the client router. When replying to a Reset Query (Section 5.4), the cache sends the set of all data records it has; in this case, the announce/withdraw field in the payload PDUs MUST have the value 1 (announce).¶
In response to a Reset Query, the new value of the Session ID tells the router the instance of the cache session for future confirmation. In response to a Serial Query, the Session ID being the same reassures the router that the Serial Numbers are commensurate, i.e., the cache session has not been changed.¶
0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | zero | | 2 | 4 | | +-------------------------------------------+ | | | Length=20 | | | +-------------------------------------------+ | | Prefix | Max | | | Flags | Length | Length | zero | | | 0..32 | 0..32 | | +-------------------------------------------+ | | | IPv4 Prefix | | | +-------------------------------------------+ | | | Autonomous System Number | | | `-------------------------------------------'¶
This PDU carries a VRP for an IPv4 ROA [RFC6811].¶
The lowest-order bit of the Flags field is 1 for an announcement and 0 for a withdrawal.¶
In the RPKI, there is an actual need for what might appear to a router as identical IPvX PDUs. This can occur when an upstream certificate is being reissued or there is an address ownership transfer up the validation chain. The ROA would be identical in the router sense, i.e., have the same {Prefix, Len, Max-Len, AS}, but it would have a different validation path in the RPKI. This is important to the RPKI but not to the router.¶
The cache server MUST ensure that it has told the router client to have one and only one IPvX PDU for a unique {Prefix, Len, Max-Len, AS} at any one point in time. Should the router client receive an IPvX PDU with a {Prefix, Len, Max-Len, AS} identical to one it already has active, it SHOULD raise a Duplicate Announcement Received error.¶
0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | zero | | 2 | 6 | | +-------------------------------------------+ | | | Length=32 | | | +-------------------------------------------+ | | Prefix | Max | | | Flags | Length | Length | zero | | | 0..128 | 0..128 | | +-------------------------------------------+ | | +--- ---+ | | +--- IPv6 Prefix ---+ | | +--- ---+ | | +-------------------------------------------+ | | | Autonomous System Number | | | `-------------------------------------------'¶
This PDU carries a VRP for an IPv6 ROA [RFC6811].¶
Analogous to the IPv4 Prefix PDU, it has 96 more bits and no magic.¶
0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | Session ID | | 2 | 7 | | +-------------------------------------------+ | | | Length=24 | | | +-------------------------------------------+ | | | Serial Number | | | +-------------------------------------------+ | | | Refresh Interval | | | +-------------------------------------------+ | | | Retry Interval | | | +-------------------------------------------+ | | | Expire Interval | | | `-------------------------------------------'¶
A cache sends an End of Data record to tell the router it has no more data for the request.¶
The Session ID and Protocol Version MUST be the same as that of the corresponding Cache Response which began the (possibly null) sequence of payload PDUs.¶
The Refresh Interval, Retry Interval, and Expire Interval are all 32-bit elapsed times measured in seconds. They express the timing parameters which the cache expects the router to use in deciding when to send subsequent Serial Query or Reset Query PDUs to the cache. See Section 6 for an explanation of the use and the range of allowed values for these parameters.¶
Note that the End of Data PDU changed significantly between versions 0 and 1. The Version 2 End of Data PDU is the same as that of Version 1.¶
0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | zero | | 2 | 8 | | +-------------------------------------------+ | | | Length=8 | | | `-------------------------------------------'¶
The cache sends a Cache Reset PDU in response to a Serial Query in order to inform the router that the cache cannot provide an incremental update starting from the Serial Number specified by the router. The router must decide whether to issue a Reset Query or perhaps switch to a different cache.¶
0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | | Version | Type | Flags | zero | | 2 | 9 | | | +-------------------------------------------+ | | | Length | | | +-------------------------------------------+ | | +--- ---+ | Subject Key Identifier | +--- ---+ | | +--- ---+ | (20 octets) | +--- ---+ | | +-------------------------------------------+ | | | AS Number | | | +-------------------------------------------+ | | ~ Subject Public Key Info ~ | | `-------------------------------------------'¶
The Router Key PDU transports they payload of a Router Key [RFC8635].¶
The lowest-order bit of the Flags field is 1 for an announcement and 0 for a withdrawal.¶
The cache server MUST ensure that it has told the router client to have one and only one Router Key PDU for a unique {SKI, AS, Subject Public Key} at any one point in time. Should the router client receive a Router Key PDU with a {SKI, AS, Subject Public Key} identical to one it already has active, it SHOULD raise a Duplicate Announcement Received error.¶
Note that a particular AS may appear in multiple Router Key PDUs with different Subject Public Key values, while a particular Subject Public Key value may appear in multiple Router Key PDUs with different ASes. In the interest of keeping the announcement and withdrawal semantics as simple as possible for the router, this protocol makes no attempt to compress either of these cases.¶
Also note that it is possible, albeit very unlikely, for multiple distinct Subject Public Key values to hash to the same SKI. For this reason, implementations MUST compare Subject Public Key values as well as SKIs when detecting duplicate PDUs.¶
As the Subject Public Key Info is a variable length field, it must be decoded to determine where the PDU terminates.¶
0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | Error Code | | 2 | 10 | | +-------------------------------------------+ | | | Length | | | +-------------------------------------------+ | | | Length of Encapsulated PDU | | | +-------------------------------------------+ | | ~ Erroneous PDU ~ | | +-------------------------------------------+ | | | Length of Arbitrary Text | | | +-------------------------------------------+ | | | Arbitrary Text | ~ of ~ | Error Diagnostic Message | | | `-------------------------------------------'¶
This PDU is used by either party to report an error to the other.¶
Error reports are only sent as responses to other PDUs, not to report errors in Error Report PDUs.¶
Error codes are described in Section 12.¶
The Erroneous PDU field is a binary copy of the PDU causing the error condition, including all fields.¶
If the error is generic (e.g., "Internal Error") and not associated with the PDU to which it is responding, the Erroneous PDU field MUST be empty and the Length of Encapsulated PDU field MUST be zero.¶
An Error Report PDU MUST NOT be sent for an Error Report PDU. If an erroneous Error Report PDU is received, the session SHOULD be dropped.¶
If the error is associated with a PDU of excessive length, i.e., too long to be any legal PDU other than another Error Report, or a possibly corrupt length, the Erroneous PDU field MAY be truncated.¶
The Arbitrary Text field is optional; if not present, the Length of Arbitrary text field MUST be zero. If Arbitrary Text is present, it MUST be a string in UTF-8 encoding (see [RFC3629]) in the Queen's English.¶
0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | | Version | Type | Flags | zero | | 2 | 11 | | | +-------------------------------------------+ | | | Length | | | +-------------------------------------------+ | | | Customer Autonomous System Number | | | +-------------------------------------------+ | | ~ Provider Autonomous System Numbers ~ | | `-------------------------------------------/¶
The ASPA PDU supports [I-D.ietf-sidrops-aspa-profile].¶
The Customer Autonomous System Number is the 32-bit Autonomous System Number of the customer which authenticated the ASPA RPKI data.¶
There are zero or more 32-bit Provider Autonomous System Number fields in increasing numeric order. See [I-D.ietf-sidrops-aspa-profile].¶
The Flags field is as described in Section 5.¶
The router MUST see at most one ASPA from a particular cache for a particular Customer Autonomous System Number active at any time. As a number of conditions in the global RPKI may present multiple valid ASPA RPKI records for a single customer to a particular RP cache, this places a burden on the cache to form the union of multiple ASPA records it has received from the global RPKI into one ASPA PDU.¶
Receipt of an ASPA PDU announcement (announce/withdraw flag == 1) when the router already has an ASPA PDU with the same Customer Autonomous System Number from that cache replaces the previous one. The cache MUST deliver the complete data of an ASPA record in a single ASPA PDU.¶
For the ASPA PDU, the announce/withdraw Flag is set to 1 to indicate either the announcement of a new ASPA record or a replacement for a previously announced record from that cache with the same Customer Autonomous System Number. For an announcement, the PDU MUST contain at least one Provider Autonomous System Number or an Error PDU with code 9, ASPA Provider List Error is returned.¶
If the announce/withdraw flag is set to 0, the entire ASPA record from that cache for that Customer AS MUST be removed from the router. In this case, the customer AS of the ASPA record MUST be provided, there MUST be no Provider list, and the PDU Length MUST be 12.¶
Since the data the cache distributed via the RPKI-Router protocol are retrieved from the Global RPKI system at intervals which are only known to the cache, only the cache can really know how frequently it makes sense for the router to poll the cache, or how long the data are likely to remain valid (or, at least, not significantly changed). For this reason, as well as to allow the cache some control over the load placed on it by its client routers, the End Of Data PDU includes three values that allow the cache to communicate timing parameters to the router:¶
This parameter tells the router how long to wait before next attempting to poll the cache and between subsequent attempts, using a Serial Query or Reset Query PDU. The router SHOULD NOT poll the cache sooner than indicated by this parameter. Note that receipt of a Serial Notify PDU overrides this interval and suggests that the router issue an immediate query without waiting for the Refresh Interval to expire. Countdown for this timer starts upon receipt of the containing End Of Data PDU.¶
This parameter tells the router how long to wait before retrying a failed Serial Query or Reset Query. The router SHOULD NOT retry sooner than indicated by this parameter. Note that a protocol version mismatch overrides this interval: if the router needs to downgrade to a lower protocol version number, it MAY send the first Serial Query or Reset Query immediately. Countdown for this timer starts upon failure of the query and restarts after each subsequent failure until a query succeeds.¶
This parameter tells the router how long it can continue to use the current version of the data while unable to perform a successful subsequent query. The router MUST NOT retain the data past the time indicated by this parameter. Countdown for this timer starts upon receipt of the containing End Of Data PDU.¶
If the router has never issued a successful query against a particular cache, it SHOULD retry periodically using the default Retry Interval, above.¶
Caches MUST set Expire Interval to a value larger than both the Refresh Interval and the Retry Interval.¶
Once a router has established a transport connection to a cache, it MUST attempt to open a RPKI-Router 'session' by issuing either a Reset Query Section 5.4) or a Serial Query (Section 5.3) with the highest version of this protocol the router implements in the Protocol Version field. If the cache supports that version, it responds with a Cache Response (Section 5.5) of that version and the session is considered open.¶
If a cache which supports version C receives a query with Protocol Version Q < C, and the cache does not support versions <= Q, the cache MUST send an Error Report (Section 5.11) with Protocol Version C and Error Code 4 ("Unsupported Protocol Version") and disconnect the transport, as negotiation is hopeless.¶
If a cache which supports version C receives a query with Protocol Version Q < C, and the cache can support version Q, the cache MUST establish the session at protocol version Q, [RFC6810] or [RFC8210], and respond with a Cache Response (Section 5.5) of that Protocol Version, Q, and the RPKI-Rtr session is considered open.¶
If the the cache which supports C as its highest verion receives a query of version Q > C, the cache MUST send an Error Report with Protocol Version C and Error Code 4. The router SHOULD send another query with a Protocol Version Q with Q == the version C in the Error Report; unless it has already failed at that version, which indicates a fatal error in programming of the cache which SHOULD result in transport termination.¶
If the router requests Q == 0 and it still fails with the cache responding with an Error Report with Error Code 4, then the router MUST abort the transport connection, as negotiation is hopeless.¶
In any of the downgraded combinations above, the new features of the higher version will not be available, and all PDUs MUST have the negotiated lower version number in their version fields.¶
If either party receives a PDU containing an unrecognized Protocol Version (neither 0, 1, nor 2) during this negotiation, it MUST either downgrade to a known version or terminate the connection, with an Error Report PDU unless the received PDU is itself an Error Report PDU.¶
The router MUST ignore any Serial Notify PDUs it might receive from the cache during this initial startup period, regardless of the Protocol Version field in the Serial Notify PDU. Since Session ID and Serial Number values are specific to a particular protocol version, the values in the notification are not useful to the router. Even if these values were meaningful, the only effect that processing the notification would have would be to trigger exactly the same Reset Query or Serial Query that the router has already sent as part of the not-yet-complete version negotiation process, so there is nothing to be gained by processing Serial Notify PDUs until version negotiation completes.¶
Caches SHOULD NOT send Serial Notify PDUs before version negotiation completes. Routers, however, MUST handle such notifications (by ignoring them) for backwards compatibility with caches serving protocol version 0.¶
Once the cache and router have agreed upon a Protocol Version via the negotiation process above, that version is fixed for the life of the session. See Section 5.1 for a discussion of the interaction between Protocol Version and Session ID.¶
The configured transport security, the negotiated RPKI-Rtr version, etc. MAY NOT be changed once a session has been established. If one side or the other wishes to try a different transport, protocol version, etc. they MUST terminate the transport and restart the entire transport and version negotiation process.¶
If either party receives a PDU for a different Protocol Version once the above negotiation completes, that party MUST drop the session; unless the PDU containing the unexpected Protocol Version was itself an Error Report PDU, the party dropping the session SHOULD send an Error Report with an error code of 8 ("Unexpected Protocol Version").¶
The sequences of PDU transmissions fall into four conversations as follows:¶
Cache Router ~ ~ | <----- Reset Query -------- | R requests data (or Serial Query) | | | ----- Cache Response -----> | C confirms request | ------- Payload PDU ------> | C sends zero or more | ------- Payload PDU ------> | IPv4 Prefix, IPv6 Prefix, | ------- Payload PDU ------> | ASPA, or Router Key PDUs | ------- End of Data ------> | C sends End of Data | | and sends new serial ~ ~¶
When a transport connection is first established, the router MUST send either a Reset Query or a Serial Query. A Serial Query would be appropriate if the router has unexpired data from a broken session with the same cache and remembers the Session ID of that session, in which case a Serial Query containing the Session ID from the previous session will allow the router to bring itself up to date while ensuring that the Serial Numbers are commensurate and that the router and cache are speaking compatible versions of the protocol. In all other cases, the router lacks the necessary data for fast resynchronization and therefore MUST fall back to a Reset Query.¶
The Reset Query sequence is also used when the router receives a Cache Reset, chooses a new cache, or fears that it has otherwise lost its way.¶
See Section 7 for details on version negotiation.¶
To limit the length of time a cache must keep the data necessary to generate incremental updates, a router MUST send either a Serial Query or a Reset Query periodically. This also acts as a keep-alive at the application layer. See Section 6 for details on the required polling frequency.¶
Cache Router ~ ~ | -------- Notify ----------> | (optional) | | | <----- Serial Query ------- | R requests data | | | ----- Cache Response -----> | C confirms request | ------- Payload PDU ------> | C sends zero or more | ------- Payload PDU ------> | IPv4 Prefix, IPv6 Prefix, | ------- Payload PDU ------> | ASPA. or Router Key PDUs | ------- End of Data ------> | C sends End of Data | | containing the new serial ~ ~¶
The cache server SHOULD send a Notify PDU with its current Serial Number when the cache's serial changes, with the expectation that the router MAY then issue a Serial Query earlier than it otherwise might. This is analogous to DNS NOTIFY in [RFC1996]. The cache MUST rate-limit Serial Notifies to no more frequently than one per minute.¶
When the transport layer is up and either a timer has gone off in the router or the cache has sent a Notify PDU, the router queries for new data by sending a Serial Query, and the cache sends all data newer than the serial in the Serial Query.¶
To limit the length of time a cache must keep old withdraws, a router MUST send either a Serial Query or a Reset Query periodically. See Section 6 for details on the required polling frequency.¶
Cache Router ~ ~ | <------ Serial Query ------ | R requests data | ------- Cache Reset ------> | C cannot supply update | | from specified serial | <------ Reset Query ------- | R requests new data | ----- Cache Response -----> | C confirms request | ------- Payload PDU ------> | C sends zero or more | ------- Payload PDU ------> | IPv4 Prefix, IPv6 Prefix, | ------- Payload PDU ------> | ASPA, or Router Key PDUs | ------- End of Data ------> | C sends End of Data | | containing the new serial ~ ~¶
The cache may respond to a Serial Query with a Cache Reset, informing the router that the cache cannot supply an incremental update from the Serial Number specified by the router. This might be because the cache has lost state, or because the router has waited too long between polls and the cache has cleaned up old data that it no longer believes it needed, or because the cache has run out of storage space and had to expire some old data early. Regardless of how this state arose, the cache replies with a Cache Reset to tell the router that it cannot honor the request. When a router receives this, the router SHOULD attempt to connect to any more-preferred caches in its cache list. If there are no more-preferred caches, it MUST issue a Reset Query and get an entire new load from the cache.¶
Cache Router ~ ~ | <------ Serial Query ------ | R requests data | ---- Error Report PDU ----> | C No Data Available ~ ~ Cache Router ~ ~ | <------ Reset Query ------- | R requests data | ---- Error Report PDU ----> | C No Data Available ~ ~¶
The cache may respond to either a Serial Query or a Reset Query informing the router that the cache cannot supply any update at all. The most likely cause is that the cache has lost state, perhaps due to a restart, and has not yet recovered. While it is possible that a cache might go into such a state without dropping any of its active sessions, a router is more likely to see this behavior when it initially connects and issues a Reset Query while the cache is still [re]building its database.¶
When a router receives this kind of error, the router SHOULD attempt to connect to any other caches in its cache list, in preference order. If no other caches are available, the router MUST issue periodic Reset Queries until it gets a new usable load from the cache; maybe once a minute or less frequently so as not to DoS the cache.¶
The transport-layer session between a router and a cache carries the binary PDUs in a persistent reliable session.¶
To prevent cache spoofing and DoS attacks by illegitimate routers, it is highly desirable that the router and the cache be authenticated to each other. Integrity protection for payloads is also desirable to protect against monkey-in-the-middle (MITM) attacks. Unfortunately, there is no protocol to do so on all currently used platforms. Therefore, as of the writing of this document, there is no mandatory-to-implement transport which provides authentication and integrity protection.¶
To reduce exposure to dropped but non-terminated sessions, both caches and routers SHOULD enable keep-alives when available in the chosen transport protocol.¶
Should the cache or the router experience a transport stall (e.g. the peer advertised a TCP RCV.WND [RFC793] [RFC9293] of zero) for longer than three times the Retry Interval (a la BGP's hold timer being three times the keepalive interval), the transport session should be terminated.¶
A cache SHOULD NOT use a separate TCP segment for each PDU, but rather try to pack PDUs efficiently.¶
It is expected that, when the TCP Authentication Option (TCP-AO) [RFC5925] is available on all platforms deployed by operators, it will become the mandatory-to-implement transport.¶
Caches and routers MUST implement unprotected transport over TCP using a port, rpki-rtr (323); see Section 14. Operators SHOULD use procedural means, e.g., access control lists (ACLs), to reduce the exposure to authentication issues.¶
If unprotected TCP is the transport, the cache and routers MUST be on the same trusted and controlled network.¶
If available to the operator, caches and routers MUST use one of the following more protected protocols:¶
Caches and routers SHOULD use TCP-AO transport [RFC5925] over the rpki-rtr port (323).¶
Caches and routers MAY use Secure Shell version 2 (SSHv2) transport [RFC4252] using the normal SSH port (22). For an example, see Section 9.1.¶
Caches and routers MAY use TCP MD5 transport [RFC2385] using the rpki-rtr port (323) if no other protected transport is available. Note that TCP MD5 has been obsoleted by TCP-AO [RFC5925].¶
Caches and routers MAY use TCP over IPsec transport [RFC4301] using the rpki-rtr port (323).¶
Caches and routers MAY use Transport Layer Security (TLS) transport [RFC8446] using port rpki-rtr-tls (324); see Section 14. Conformance to [RFC7525] modern cipher suites is REQUIRED.¶
To run over SSH, the client router first establishes an SSH transport connection using the SSHv2 transport protocol, and the client and server exchange keys for message integrity and encryption. The client then invokes the "ssh-userauth" service to authenticate the application, as described in the SSH authentication protocol [RFC4252]. Once the application has been successfully authenticated, the client invokes the "ssh-connection" service, also known as the SSH connection protocol.¶
After the ssh-connection service is established, the client opens a channel of type "session", which results in an SSH session.¶
Once the SSH session has been established, the application invokes the application transport as an SSH subsystem called "rpki-rtr". Subsystem support is a feature of SSHv2 and is not included in SSHv1. Running this protocol as an SSH subsystem avoids the need for the application to recognize shell prompts or skip over extraneous information, such as a system message that is sent at shell startup.¶
It is assumed that the router and cache have exchanged keys out of band by some reasonably secured means.¶
User authentication "publickey" MUST be supported; host authentication "hostbased" MAY be supported. Implementations MAY support password authentication "password". "None" authentication MUST NOT be used. Client routers SHOULD verify the public key of the cache to avoid MITM attacks.¶
Client routers using TLS transport MUST present client-side certificates to authenticate themselves to the cache in order to allow the cache to manage their load by rejecting connections from unauthorized routers. In principle, any type of certificate and Certification Authority (CA) may be used; however, in general, cache operators will wish to create their own small-scale CA and issue certificates to each authorized router. This simplifies credential rollover; any unrevoked, unexpired certificate from the proper CA may be used.¶
Certificates used to authenticate client routers in this protocol MUST include a subjectAltName extension [RFC5280] containing one or more iPAddress identities; when authenticating the router's certificate, the cache MUST check the IP address of the TLS connection against these iPAddress identities and SHOULD reject the connection if none of the iPAddress identities match the connection.¶
Routers MUST also verify the cache's TLS server certificate, using subjectAltName dNSName identities as described in [RFC6125], to avoid MITM attacks. The rules and guidelines defined in [RFC6125] apply here, with the following considerations:¶
Support for the DNS-ID identifier type (that is, the dNSName identity in the subjectAltName extension) is REQUIRED in rpki-rtr server and client implementations which use TLS. Certification authorities which issue rpki-rtr server certificates MUST support the DNS-ID identifier type, and the DNS-ID identifier type MUST be present in rpki-rtr server certificates.¶
DNS names in rpki-rtr server certificates SHOULD NOT contain the wildcard character "*".¶
rpki-rtr implementations which use TLS MUST NOT use Common Name (CN-ID) identifiers; a CN field may be present in the server certificate's subject name but MUST NOT be used for authentication within the rules described in [RFC6125].¶
The client router MUST set its "reference identifier" (see Section 6.2 of [RFC6125]) to the DNS name of the rpki-rtr cache.¶
If TCP MD5 is used, implementations MUST support key lengths of at least 80 printable ASCII octets, per Section 4.5 of [RFC2385]. Implementations MUST also support hexadecimal sequences of at least 32 characters, i.e., 128 bits.¶
Key rollover with TCP MD5 is problematic. Cache servers SHOULD support [RFC4808].¶
Implementations MUST support key lengths of at least 80 printable ASCII octets. Implementations MUST also support hexadecimal sequences of at least 32 characters, i.e., 128 bits. Message Authentication Code (MAC) lengths of at least 96 bits MUST be supported, per Section 5.1 of [RFC5925].¶
The cryptographic algorithms and associated parameters described in [RFC5926] MUST be supported.¶
A cache has the public authentication data for each router it is configured to support.¶
A router may be configured to peer with a selection of caches, and a cache may be configured to support a selection of routers. Each must have the name of, and authentication data for, each peer. In addition, in a router, this list has a non-unique preference value for each cache. This preference is intended to be based on proximity, a la RTT, not trust, preferred belief, et cetera. The client router attempts to establish a session with each potential serving cache in preference order and then starts to load data from the most preferred cache to which it can connect and authenticate. The router's list of caches has the following elements:¶
Due to the distributed nature of the RPKI, caches simply cannot be rigorously synchronous. A client may hold data from multiple caches but MUST keep the data marked as to source, as later updates MUST affect the correct data.¶
Just as there may be more than one covering ROA from a single cache, there may be multiple covering ROAs from multiple caches. The results are as described in [RFC6811].¶
If data from multiple caches are held, implementations MUST NOT distinguish between data sources when performing validation of BGP announcements.¶
When a more-preferred cache becomes available, if resources allow, it would be prudent for the client to start fetching from that cache.¶
The router SHOULD attempt to maintain at least one set of data, regardless of whether it has chosen a different cache or established a new connection to the previous cache.¶
A client MAY drop the data from a particular cache when it is fully in sync with one or more other caches.¶
See Section 6 for details on what to do when the client is not able to refresh from a particular cache.¶
If a client loses connectivity to a cache it is using or otherwise decides to switch to a new cache, it SHOULD retain the data from the previous cache until it has a full set of data from one or more other caches. Note that this may already be true at the point of connection loss if the client has connections to more than one cache.¶
To keep load on Global RPKI services from unnecessary peaks, it is recommended that caches which fetch from the Global RPKI not do so all at the same times, e.g., on the hour. Choose a random time, perhaps the ISP's AS number modulo 60, and jitter the inter-fetch timing.¶
When a cache is sending ROA (IPv4 or IPv6) PDUs to a router, especially an initial full load in response to a Reset Query PDU, undesirable race conditions are possible:¶
In order to further mitigate such race conditions, a router MAY choose not to make effective the PDUs received in response to a request until the relevant End of Data PDU is received.¶
However, a router MAY choose to apply a time limit for how long it is willing to wait for the End of Data PDU.¶
This section describes the meaning of the error codes. There is an IANA registry where valid error codes are listed; see [iana-err]. Errors which are considered fatal MUST cause the session to be dropped, and the router MUST flush all data learned from that cache.¶
As this document describes a security protocol, many aspects of security interest are described in the relevant sections. This section points out issues which may not be obvious in other sections.¶
This section only discusses updates required in the existing IANA protocol registries to accommodate version 2 of this protocol. See [RFC8210] for IANA considerations of the previous (version 1) protocol.¶
All of the PDU types in the IANA "rpki-rtr-pdu" registry [iana-pdu] in protocol versions 0 and 1 are also allowed in protocol version 2, with the addition of the new ASPA PDU.¶
The "rpki-rtr-error: registry [iana-err] should be updated as follows:¶
Error Code Description ----- ---------------- 0 Corrupt Data 1 Internal Error 2 No Data Available 3 Invalid Request 4 Unsupported Protocol Version 5 Unsupported PDU Type 6 Withdrawal of Unknown Record 7 Duplicate Announcement Received 8 Unexpected Protocol Version 9 ASPA Provider List Error 10-254 Unassigned 255 Reserved¶
The "rpki-rtr-pdu" registry [iana-pdu] has been updated as follows:¶
Protocol PDU Version Type Description -------- ---- --------------- 0-2 0 Serial Notify 0-2 1 Serial Query 0-2 2 Reset Query 0-2 3 Cache Response 0-2 4 IPv4 Prefix 0-2 6 IPv6 Prefix 0-2 7 End of Data 0-2 8 Cache Reset 0 9 Reserved 1-2 9 Router Key 0-2 10 Error Report 0-1 11 Reserved 2 11 ASPA 0-2 255 Reserved¶
The authors wish to thank Nils Bars, Steve Bellovin, Oliver Borchert, Mohamed Boucadair, Tim Bruijnzeels, Roman Danyliw, Rex Fernando, Richard Hansen, Martin Hoffmann, Paul Hoffman, Fabian Holler, Russ Housley, Claudio Jeker, Pradosh Mohapatra, Keyur Patel, David Mandelberg, Sandy Murphy, Robert Raszuk, Andreas Reuter, Thomas Schmidt, John Scudder, Job Snijders, Ruediger Volk, Matthias Waehlisch, and David Ward. Particular thanks go to Hannes Gredler for showing us the dangers of unnecessary fields.¶
No doubt this list is incomplete. We apologize to any contributor whose name we missed.¶