The Resource Public Key Infrastructure (RPKI) to Router Protocol, Version 1
updates
- rfc-6810 — The Resource Public Key Infrastructure (RPKI) to Router Protocol
Extracted elements (30)
The cache is required to merge and simplify the change set before delivering updates to the router. The explicit rationale given is that the entire purpose of the RPKI-Router protocol is to offload work from resource-constrained router platforms to the cache; simplifying the change set is therefore the cache's job.
When a cache cannot provide an incremental update (Cache Reset), the protocol requires the router to explicitly initiate a fallback Reset Query rather than having the cache force it. This is deliberate: the cache cannot know whether the router has other caches that may be able to provide better service, so the decision is left to the router.
Cache servers supporting SSH transport MUST accept RSA authentication and SHOULD accept ECDSA. User authentication MUST be supported; host authentication MAY be supported. Client routers SHOULD verify the cache's public key to avoid MITM attacks. The protocol runs as an SSH subsystem named 'rpki-rtr'.
Caches and routers MUST implement unprotected TCP transport on port rpki-rtr (323). If unprotected TCP is the transport, the cache and routers MUST be on the same trusted and controlled network. When a more protected transport is available, caches and routers MUST use it; TCP-AO SHOULD be preferred.
Caches MUST set the Expire Interval to a value larger than either the Refresh Interval or the Retry Interval. The router MUST NOT retain data past the time indicated by the Expire Interval.
Client routers using TLS transport MUST present client-side certificates containing a subjectAltName with iPAddress identities, and the cache MUST verify the connecting IP address against them. Routers MUST verify the cache's TLS server certificate using dNSName identities per RFC 6125; CN-ID identifiers MUST NOT be used for authentication.
If either party receives a PDU with an unexpected Protocol Version after negotiation completes, that party MUST drop the session and SHOULD send an Error Report with error code 8 (Unexpected Protocol Version), unless the unexpected PDU was itself an Error Report.
If either the router or cache finds that the Session ID value does not match the other's (after protocol version negotiation), the detecting party MUST immediately terminate the session with an Error Report PDU with code 0 (Corrupt Data), and the router MUST flush all data learned from that cache.
Implementations MUST compare Subject Public Key values as well as SKIs when detecting duplicate Router Key PDUs because multiple distinct Subject Public Key values can hash to the same SKI.
TCP-AO implementations MUST support key lengths of at least 80 printable ASCII bytes and hexadecimal sequences of at least 32 characters (128 bits). MAC lengths of at least 96 bits MUST be supported. The cryptographic algorithms specified in RFC 5926 MUST be supported.
The cache MUST rate-limit Serial Notify PDUs to no more than one per minute. Serial Notify is analogous to DNS NOTIFY and is only a hint; the protocol requires the router to poll periodically regardless.
The cache server MUST ensure that the router client holds one and only one IPvX PDU for each unique {Prefix, Len, Max-Len, ASN} tuple at any point in time. If a router receives a duplicate announcement, it SHOULD raise a Duplicate Announcement Received error (code 7).
When a router receives a Cache Reset, it SHOULD attempt to connect to any more-preferred caches. If none are more-preferred, it MUST issue a Reset Query. When a router receives a No Data Available error, it SHOULD try other caches; if none are available it MUST issue periodic Reset Queries.
When holding data from multiple caches, implementations MUST NOT distinguish between data sources when performing BGP announcement validation. Data MUST be kept marked by source so that later updates affect the correct cache's data set.
When replying to a Serial Query, the cache MUST return the minimum set of changes needed to bring the router into sync, merging multiple changes for any prefix or router key into at most one withdrawal followed by at most one announcement; if all changes cancel out, the prefix or key is omitted entirely.
The End of Data PDU conveys three 32-bit timing parameters: Refresh Interval (1–86400 s, default 3600 s), Retry Interval (1–7200 s, default 600 s), and Expire Interval (600–172800 s, default 7200 s). These allow the cache to control polling frequency and data lifetime on the router.
The Serial Number is a 32-bit strictly increasing unsigned integer that wraps from 2^32-1 to 0, denoting the logical version of a cache. A cache increments it upon completing a validated update from a parent cache or the Global RPKI. Serial Numbers are not commensurate between different caches or different protocol versions.
The Session ID is a 16-bit unsigned integer generated by the cache server at startup to uniquely identify the cache instance and bind it to the sequence of Serial Numbers it generates. It allows routers to restart a failed session knowing that their Serial Numbers are commensurate with those of the cache.
The 'rpki-rtr-error' IANA registry maps error codes to descriptions (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). Version 1 adds code 8 (Unexpected Protocol Version).
The 'rpki-rtr-pdu' IANA registry maps PDU Type numbers (0–255) to protocol versions and descriptions. Version 1 adds Router Key (Type 9); Type 9 is reserved and unused in version 0. Addition policy is RFC Required (Standards Track or Experimental). Types 0–4, 6–8, and 10 are valid for both versions 0 and 1.
The cache-to-router link relies on server authentication and transport-level security rather than RPKI object security, creating a fundamentally different and weaker trust model. A compromised transport or forged cache can corrupt the router's routing decisions. Caches SHOULD be topologically close to their routers on DDoS-protected, controlled networks; the cache and router's identity SHOULD be mutually verified before any data exchange.
Protocol version negotiation: a router initiates each transport connection with a Reset Query or Serial Query carrying its version. A v1 cache receiving a v0 query MUST downgrade or terminate with an error. A v1 router receiving a v0 response MUST downgrade or terminate. Once agreed, the version is stable for the life of the session; receipt of a PDU with a different version after negotiation MUST cause the session to be dropped.
End of Data PDU (Type=7, Length=24): Protocol Version (8-bit), PDU Type (8-bit), Session ID (16-bit), Length (32-bit), Serial Number (32-bit), Refresh Interval (32-bit), Retry Interval (32-bit), Expire Interval (32-bit). New in version 1; carries timing parameters the cache expects the router to use for subsequent polling.
Error Report PDU (Type=10, variable Length): Error Code (16-bit), Length of Encapsulated PDU (32-bit), Erroneous PDU (variable), Length of Error Text (32-bit), Diagnostic Message (variable, UTF-8). Error text is optional; if absent, Length of Error Text MUST be zero. An Error Report MUST NOT be sent in response to another Error Report.
IPv4 Prefix PDU (Type=4, Length=20): Flags (8-bit, LSB=1 announce/0 withdraw), Prefix Length (8-bit, 0–32), Max Length (8-bit, 0–32), zero (8-bit), IPv4 Prefix (32-bit), Autonomous System Number (32-bit). Encodes a ROA-derived origin authorization.
IPv6 Prefix PDU (Type=6, Length=32): same structure as IPv4 Prefix PDU but with a 128-bit IPv6 Prefix field and Prefix Length/Max Length range 0–128. Encodes an IPv6 ROA-derived origin authorization.
Reset Query PDU (Type=2, Length=8): Protocol Version (8-bit), PDU Type (8-bit), zero (16-bit), Length (32-bit). Router sends this to request the entire current non-withdrawn database from the cache.
Router Key PDU (Type=9, variable Length): Flags (8-bit, LSB=1 announce/0 withdraw), zero (8-bit), Subject Key Identifier (20 octets), AS Number (32-bit), Subject Public Key Info (variable, full ASN.1 DER encoding including tag and length). New in version 1; Type 9 is reserved/unused in version 0.
Serial Notify PDU (Type=0, Length=12): Protocol Version (8-bit), PDU Type (8-bit), Session ID (16-bit), Length (32-bit), Serial Number (32-bit). Cache-initiated only; the only PDU the cache sends without a prior request from the router.
Serial Query PDU (Type=1, Length=12): Protocol Version (8-bit), PDU Type (8-bit), Session ID (16-bit), Length (32-bit), Serial Number (32-bit). Router sends this to request all announcements and withdrawals since the specified Serial Number.