Network Working Group R. Bush Internet-Draft Internet Initiative Japan, Inc. Intended status: Standards Track March 3, 2009 Expires: September 4, 2009 The RPKI/Router Protocol draft-ymbk-rpki-rtr-protocol-00 Status of this Memo This Internet-Draft is submitted to IETF in full conformance with the provisions of BCP 78 and BCP 79. This document may not be modified, and derivative works of it may not be created, and it may not be published except as an Internet-Draft. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. 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." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on September 4, 2009. Copyright Notice Copyright (c) 2009 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 in effect on the date of publication of this document (http://trustee.ietf.org/license-info). Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Abstract In order to formally validate the origin ASes of BGP announcements, Bush Expires September 4, 2009 [Page 1] Internet-Draft The RPKI/Router Protocol March 2009 routers need a simple but reliable mechanism to receive RPKI [I-D.ietf-sidr-arch] or analogous prefix origin data from a trusted cache. This document describes a protocol to deliver validated prefix origin data to routers over ssh. Requirements Language The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. Table of Contents 1. Items that Need Work . . . . . . . . . . . . . . . . . . . . . 3 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. Deployment Structure . . . . . . . . . . . . . . . . . . . . . 3 4. Operational Overview . . . . . . . . . . . . . . . . . . . . . 4 5. Protocol Data Units (PDUs) . . . . . . . . . . . . . . . . . . 4 5.1. Serial Notify . . . . . . . . . . . . . . . . . . . . . . 4 5.2. Serial Query . . . . . . . . . . . . . . . . . . . . . . . 5 5.3. Reset Query . . . . . . . . . . . . . . . . . . . . . . . 5 5.4. Cache Response . . . . . . . . . . . . . . . . . . . . . . 5 5.5. IPv4 Prefix . . . . . . . . . . . . . . . . . . . . . . . 6 5.6. IPv6 Prefix . . . . . . . . . . . . . . . . . . . . . . . 6 5.7. End of Data . . . . . . . . . . . . . . . . . . . . . . . 7 5.8. Cache Reset . . . . . . . . . . . . . . . . . . . . . . . 7 5.9. Fields of a PDU . . . . . . . . . . . . . . . . . . . . . 7 6. Protocol Sequences . . . . . . . . . . . . . . . . . . . . . . 8 6.1. Start or Restart . . . . . . . . . . . . . . . . . . . . . 8 6.2. Typical Exchange . . . . . . . . . . . . . . . . . . . . . 9 6.3. Cache has Reset . . . . . . . . . . . . . . . . . . . . . 9 7. SSH Transport . . . . . . . . . . . . . . . . . . . . . . . . 10 8. Router-Cache Setup . . . . . . . . . . . . . . . . . . . . . . 10 9. Deployment Scenarios . . . . . . . . . . . . . . . . . . . . . 11 10. Security Considerations . . . . . . . . . . . . . . . . . . . 12 11. Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 13. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 13 14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 14 14.1. Normative References . . . . . . . . . . . . . . . . . . . 14 14.2. Informative References . . . . . . . . . . . . . . . . . . 14 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 14 Bush Expires September 4, 2009 [Page 2] Internet-Draft The RPKI/Router Protocol March 2009 1. Items that Need Work Errors - Need to figure out what kinds of errors there might be and then how to report and handle them. 2. Introduction In order to formally validate the origin ASes of BGP announcements, routers need a simple but reliable mechanism to receive RPKI [I-D.ietf-sidr-arch] or analogous formally validated prefix origin data from a trusted cache. This document describes a protocol to deliver validated prefix origin data to routers over ssh. 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 PDU sequences are described in Section 6. And the transport protocol is described in Section 7. Section 8 details how routers and caches are configured to connect and authenticate. Section 9 describes likely deployment scenarios. The traditional security and IANA considerations end the document. 3. Deployment Structure Deployment of the RPKI to reach routers has a three level structure as follows: Global RPKI: The authoritative data of the RPKI are published in a distributed set of servers, RPKI publication repositories, e.g. the IANA, RIRs, NIRs, and ISPs, see [I-D.ietf-sidr-repos-struct]. Local Caches: A local set of one or more collected and verified non- authoritative caches. A relying party, e.g. router or other client, MUST have a formally authenticated trust relationship with, and a secure transport channel to, any non-authoritative cache(s) it uses. Routers: A router fetches data from a local cache using the protocol described in this document. It is said to be a client of the cache. There are mechanisms for the router to assure itself of the authenticity of the cache and to authenticate itself to the cache. Bush Expires September 4, 2009 [Page 3] Internet-Draft The RPKI/Router Protocol March 2009 4. Operational Overview A router establishes and keeps open an authenticated connection to a cache with which it has an client/server relationship. It is configured with a semi-ordered list of caches, and establishes a connection to the highest preference cache that accepts one. Periodically, the router sends to the cache the serial number of the highest numbered data record it has received from that cache, i.e. the router's current serial number. When a router establishes a new connection to a cache, or wishes to reset a current relationship, it sends a Reset Query. The Cache responds with all data records which have serial numbers greater than that in the router's query. This may be the null set, in which case the End of Data PDU is still sent. Note that 'greater' must take wrap-around into account, see [RFC1982]. When the router has received all data records from the cache, it sets its current serial number to that of the serial number in the End of Data PDU. 5. Protocol Data Units (PDUs) The exchanges between the cache and the router are sequences of exchanges of the following PDUs according to the rules described in Section 6. 5.1. Serial Notify The cache notifies the router that the cache has new data. 0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | reserved = zero | | 0 | 0 | | +-------------------------------------------+ | | | Serial Number | | | `-------------------------------------------' Bush Expires September 4, 2009 [Page 4] Internet-Draft The RPKI/Router Protocol March 2009 5.2. Serial Query Serial Query: The router sends Serial Query to ask the cache for all payload PDUs which have serial numbers higher than the serial number in the Serial Query. 0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | reserved = zero | | 0 | 1 | | +-------------------------------------------+ | | | Serial Number | | | `-------------------------------------------' 5.3. Reset Query Reset Query: The router tells the cache that it wants to receive the total active, current, non-withdrawn, database. 0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | reserved = zero | | 0 | 2 | | `-------------------------------------------' 5.4. Cache Response The cache responds with zero or more payload PDUs, the set of all data records it has with serial numbers greater than that sent by the client router, or all data records if the cache received a Reset Query. 0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | reserved = zero | | 0 | 3 | | `-------------------------------------------' Bush Expires September 4, 2009 [Page 5] Internet-Draft The RPKI/Router Protocol March 2009 5.5. IPv4 Prefix 0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | Color | | 0 | 4 | | +-------------------------------------------+ | Announce | Prefix | Max | Data | | Withdraw | Length | Length | Source | | 0/1 | 0..32 | 0..32 | RPKI/IRR | +-------------------------------------------+ | | | IPv4 prefix | | | +-------------------------------------------+ | | | Autonomous System Number | | | `-------------------------------------------' 5.6. IPv6 Prefix 0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | Color | | 0 | 6 | | +-------------------------------------------+ | Announce | Prefix | Max | Data | | Withdraw | Length | Length | Source | | 0/1 | 0..128 | 0..128 | RPKI/IRR | +-------------------------------------------+ | | +--- ---+ | | +--- IPv6 prefix ---+ | | +--- ---+ | | +-------------------------------------------+ | | | Autonomous System Number | | | `-------------------------------------------' Bush Expires September 4, 2009 [Page 6] Internet-Draft The RPKI/Router Protocol March 2009 5.7. End of Data End of Data: Cache tells router it has no more data for the request. 0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | reserved = zero | | 0 | 9 | | +-------------------------------------------+ | | | Serial Number | | | `-------------------------------------------' 5.8. Cache Reset The cache may respond to a Serial Query informing the router that the cache's serial number is no longer commensurate with that of the router. 0 8 16 24 31 .-------------------------------------------. | Protocol | PDU | | | Version | Type | reserved = zero | | 0 | 10 | | `-------------------------------------------' 5.9. Fields of a PDU PDUs contain the following data elements: Protocol Version: A cardinal, currently 0, denoting the version of this protocol. Serial Number: The serial number of the RPKI Cache when this ROA was received from the cache's up-stream cache server or gathered from the global RPKI. A cache increments its serial number when completing an rcynic from a parent cache. See [RFC1982] on DNS Serial Number Arithmetic for too much detail on serial number arithmetic. Color: An arbitrary 16 bit field that might be used in some way. Announce/Withdraw: Whether this PDU announces a new right to announce the prefix or withdraws a previously announced right. The allowed values are 0 for withdraw and 1 for announce. A withdraw effectively deletes all previously announced IPvX Prefix Bush Expires September 4, 2009 [Page 7] Internet-Draft The RPKI/Router Protocol March 2009 PDUs with the exact same Prefix, Length, Max-Len, ASN, Data Source, and Color. Prefix Length: A cardinal denoting the shortest prefix allowed for the prefix. Max Length: A cardinal denoting the longest prefix allowed by the prefix. This MUST NOT be less than the Prefix Length element. Data Source: A cardinal denoting the source of the data, e.g. for RPKI data, it is 0, for IRR data it is 1. Prefix: The IPv4 or IPv6 prefix of the ROA. Autonomous System Number: ASN allowed to announce this prefix, a 32 bit cardinal. 6. Protocol Sequences The sequences of PDU transmissions fall into three conversations as follows: 6.1. Start or Restart Cache Router ~ ~ | <----- Reset Query -------- | R requests data | | | ----- Cache Response -----> | C tells R C's serial | ------- IPvX Prefix ------> | C sends zero or more | ------- IPvX Prefix ------> | IPv4 and IPv6 Prefix | ------- IPvX Prefix ------> | Payload PDUs | ------ End of Data ------> | C sends End of Data ~ ~ When a transport session is first established, the router sends a Reset Query and the cache responds with a data sequence of all data it contains. This Reset Query sequence is also used in response to the cache sending a Cache Reset, the router choosing a new cache, or the router fearing it has otherwise lost its way. To limit the length of time a cache must keep withdraws, a router MUST send either a Serial Query or a Reset Query no less frequently than once an hour. This also acts as a keep alive at the application layer. Bush Expires September 4, 2009 [Page 8] Internet-Draft The RPKI/Router Protocol March 2009 6.2. Typical Exchange Cache Router ~ ~ | -------- Notify ----------> | (optional) | | | <----- Serial Query ------- | R requests data | | | ----- Cache Response -----> | C tells R C's serial | ------- IPvX Prefix ------> | C sends zero or more | ------- IPvX Prefix ------> | IPv4 and IPv6 Prefix | ------- IPvX Prefix ------> | Payload PDUs | ------ End of Data ------> | C sends End of Data 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 SHOULD 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, the router queries for new data by sending a Serial Query, and the router 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 no less frequently than once an hour. 6.3. Cache has Reset Cache Router ~ ~ | <----- Serial Query ------ | R requests data | ------- Cache Reset ------> | C has lost serial | | | <------ Reset Query ------- | R requests new data | | | ----- Cache Response -----> | C tells R C's serial | ------- IPvX Prefix ------> | C sends zero or more | ------- IPvX Prefix ------> | IPv4 and IPv6 Prefix | ------- IPvX Prefix ------> | Payload PDUs | ------ End of Data ------> | C sends End of Data ~ ~ The cache may respond to a Serial Query informing the router that the cache's serial number is no longer commensurate with that of the router. The most likely cause is that the cache was completely Bush Expires September 4, 2009 [Page 9] Internet-Draft The RPKI/Router Protocol March 2009 restarted when or since the transport session to the router was down. 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 7. SSH Transport The transport layer session between a router and a cache carries the binary Protocol Data Units (PDUs) in a persistent SSH session. To run over SSH, the client router first establishes an SSH transport connection using the SSH 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 RFC 4252 [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 SSH version 2 (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 start-up. It is assumed that the router and cache have exchanged keys out of band by some reasonably secured means. 8. Router-Cache Setup A cache has the public authentication data for each router it is configured to support. When a router or cache peers with multiple serving caches, it must have the name of each server and authentication data for each. In addition, the list has a non-unique preference value for each server in order of preference. The client router or cache attempts to establish a session with each potential serving cache in priority order, and then starts to load data from the highest preference cache to which it can connect and authenticate. The router's list of Bush Expires September 4, 2009 [Page 10] Internet-Draft The RPKI/Router Protocol March 2009 caches has the following elements: Preference: A cardinal denoting the router's preference to use that cache, the lower the value the more preferred. Name: The IP Address or fully qualified domain name of the cache. Key: The public ssh key of the cache. MyKey: The private ssh key of this client. As caches can not be rigorously synchronous, a client which changes servers can not combine data from different parent caches. Therefore, when a lower preference cache becomes available, if resources allow, it would be prudent for the client to start a new buffer for that cache's data, and only switch to those data when that buffer is fully up to date. 9. Deployment Scenarios For illustration, we present three likely deployment scenarios. Small End Site: The small multi-homed end site may wish to outsource the RPKI cache to one or more of their upstream ISPs. They would exchange authentication material with the ISP using some out of band mechanism, and their router(s) would connect to one or more up-streams' caches. The ISPs would likely deploy caches intended for customer use separately from the caches with which their own BGP speakers peer. Large End Site: A larger multi-homed end site might run one or more caches, arranging them in a hierarchy of client caches, each fetching from a serving cache which is closer to the global RPKI. They might configure fall-back peerings to up-stream ISP caches. ISP Backbone: A large ISP would likely have one or more redundant caches in each major PoP, and these caches would fetch from each other in an ISP-dependent topology so as not to place undue load on the global RPKI publication infrastructure. Experience with large DNS cache deployments has shown that complex topologies are ill-advised as it is easy to make errors in the graph, e.g. not maintaining a loop-free condition. Of course, these are illustrations and there are other possible deployment strategies. It is expected that minimizing load on the global RPKI servers will be a major consideration. Bush Expires September 4, 2009 [Page 11] Internet-Draft The RPKI/Router Protocol March 2009 To keep load on global RPKI services from unnecessary peaks, it is recommended that primary caches which load from the distributed 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. 10. Security Considerations 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. Cache Validation: In order for a collection of caches as described in Section 9 to guarantee a consistent view, they need to be given consistent trust anchors to use in their internal validation process. Distribution of a consistent trust anchor is assumed to be out of band. Cache Peer Identification: As the router initiates an ssh transport session to a cache which it identifies by either IP address or fully qualified domain name, a DNS or address spoofing attack could make the correct cache unreachable. No session would be established, as the authorization keys would not match. Transport Security: The RPKI relies on object, not server or transport, trust. I.e. the IANA root trust anchor is distributed to all caches through some out of band means, and can then be used by each cache to validate certificates and ROAs all the way down the tree. The inter-cache relationships are based on this object security model, hence the inter-cache transport can be lightly protected. But this protocol document assumes that the routers can not do the validation cryptography. Hence the last link, from cache to router, is secured by server authentication and transport level security. This is dangerous, as server authentication and transport have very different threat models than object security. So the strength of the trust relationship and the transport between the router(s) and the cache(s) are critical. You're betting your routing on this. While we can not say the cache must be on the same LAN, if only due to the issue of an enterprise wanting to off-load the cache task to their upstream ISP(s), locality, trust, and control are very critical issues here. The cache(s) really SHOULD be as close, in the sense of controlled and protected (against DDoS, Bush Expires September 4, 2009 [Page 12] Internet-Draft The RPKI/Router Protocol March 2009 MITM) transport, to the router(s) as possible. It also SHOULD be topologically close so that a minimum of validated routing data are needed to bootstrap a router's access to a cache. 11. Glossary The following terms are used with special meaning: Global RPKI: The authoritative data of the RPKI are published in a distributed set of servers at the IANA, RIRs, NIRs, and ISPs, see [I-D.ietf-sidr-repos-struct]. Non-authorative Cache: A coalesced copy of the RPKI which is periodically fetched/refreshed directly or indirectly from the global RPKI using the [rcynic] protocol/tools Cache: The rcynic system is used to gather the distributed data of the RPKI into a validated cache. Trusting this cache further is a matter between the provider of the cache and a relying party. Serial Number: A 32-bit monotonically increasing, cardinal which wraps from 2^32-1 to 0. It denotes the logical version of a cache. A cache increments the value by one when it successfully updates its data from a parent cache or from primary RPKI data. As a cache is rcynicing, new incoming data, and implicit deletes, are marked with the new serial but MUST not be sent until the fetch is complete. A serial number is not commensurate between caches, nor need it be maintained across resets of the cache server. See [RFC1982] on DNS Serial Number Arithmetic for too much detail on serial number arithmetic. 12. IANA Considerations This document request the IANA to create a registry for PDU types. In addition, a registry for Version Numbers would be needed if new Version Number is defined in a new RFC. Note to RFC Editor: this section may be replaced on publication as an RFC. 13. Acknowledgments The author wishes to thank Rob Austein, Steve Bellovin, Rex Fernando, Russ Housley, Pradosh Mohapatra. Megumi Ninomiya, Robert Raszuk, Bush Expires September 4, 2009 [Page 13] Internet-Draft The RPKI/Router Protocol March 2009 John Scudder, Ruediger Volk, David Ward, and Bert Wijnen. 14. References 14.1. Normative References [RFC1982] Elz, R. and R. Bush, "Serial Number Arithmetic", RFC 1982, August 1996. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC4252] Ylonen, T. and C. Lonvick, "The Secure Shell (SSH) Authentication Protocol", RFC 4252, January 2006. [rcynic] Austein, R., "rcynic protocol", . 14.2. Informative References [I-D.ietf-sidr-arch] Lepinski, M. and S. Kent, "An Infrastructure to Support Secure Internet Routing", draft-ietf-sidr-arch-04 (work in progress), November 2008. [I-D.ietf-sidr-repos-struct] Huston, G., Loomans, R., and G. Michaelson, "A Profile for Resource Certificate Repository Structure", draft-ietf-sidr-repos-struct-01 (work in progress), October 2008. [RFC1996] Vixie, P., "A Mechanism for Prompt Notification of Zone Changes (DNS NOTIFY)", RFC 1996, August 1996. Author's Address Randy Bush Internet Initiative Japan, Inc. 5147 Crystal Springs Bainbridge Island, Washington 98110 US Phone: +1 206 780 0431 x1 Email: randy@psg.com Bush Expires September 4, 2009 [Page 14]