idnits 2.17.1 draft-ietf-ppsp-peer-protocol-12.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 6 instances of lines with non-RFC2606-compliant FQDNs in the document. == There are 5 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (November 28, 2014) is 3430 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS180-4' -- Possible downref: Non-RFC (?) normative reference: ref. 'IANADNSSECALGNUM' ** Downref: Normative reference to an Experimental RFC: RFC 6817 == Outdated reference: A later version (-12) exists of draft-ietf-ppsp-base-tracker-protocol-06 -- Obsolete informational reference (is this intentional?): RFC 4960 (Obsoleted by RFC 9260) -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) -- Obsolete informational reference (is this intentional?): RFC 5389 (Obsoleted by RFC 8489) -- Obsolete informational reference (is this intentional?): RFC 6347 (Obsoleted by RFC 9147) Summary: 1 error (**), 0 flaws (~~), 4 warnings (==), 7 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 PPSP A. Bakker 3 Internet-Draft Vrije Universiteit Amsterdam 4 Intended status: Standards Track R. Petrocco 5 Expires: June 1, 2015 V. Grishchenko 6 Technische Universiteit Delft 7 November 28, 2014 9 Peer-to-Peer Streaming Peer Protocol (PPSPP) 10 draft-ietf-ppsp-peer-protocol-12 12 Abstract 14 The Peer-to-Peer Streaming Peer Protocol (PPSPP) is a protocol for 15 disseminating the same content to a group of interested parties in a 16 streaming fashion. PPSPP supports streaming of both pre-recorded 17 (on-demand) and live audio/video content. It is based on the peer- 18 to-peer paradigm, where clients consuming the content are put on 19 equal footing with the servers initially providing the content, to 20 create a system where everyone can potentially provide upload 21 bandwidth. It has been designed to provide short time-till-playback 22 for the end user, and to prevent disruption of the streams by 23 malicious peers. PPSPP has also been designed to be flexible and 24 extensible. It can use different mechanisms to optimize peer 25 uploading, prevent freeriding, and work with different peer discovery 26 schemes (centralized trackers or Distributed Hash Tables). It 27 supports multiple methods for content integrity protection and chunk 28 addressing. Designed as a generic protocol that can run on top of 29 various transport protocols, it currently runs on top of UDP using 30 LEDBAT for congestion control. 32 Status of This Memo 34 This Internet-Draft is submitted in full conformance with the 35 provisions of BCP 78 and BCP 79. 37 Internet-Drafts are working documents of the Internet Engineering 38 Task Force (IETF). Note that other groups may also distribute 39 working documents as Internet-Drafts. The list of current Internet- 40 Drafts is at http://datatracker.ietf.org/drafts/current/. 42 Internet-Drafts are draft documents valid for a maximum of six months 43 and may be updated, replaced, or obsoleted by other documents at any 44 time. It is inappropriate to use Internet-Drafts as reference 45 material or to cite them other than as "work in progress." 47 This Internet-Draft will expire on June 1, 2015. 49 Copyright Notice 51 Copyright (c) 2014 IETF Trust and the persons identified as the 52 document authors. All rights reserved. 54 This document is subject to BCP 78 and the IETF Trust's Legal 55 Provisions Relating to IETF Documents 56 (http://trustee.ietf.org/license-info) in effect on the date of 57 publication of this document. Please review these documents 58 carefully, as they describe your rights and restrictions with respect 59 to this document. Code Components extracted from this document must 60 include Simplified BSD License text as described in Section 4.e of 61 the Trust Legal Provisions and are provided without warranty as 62 described in the Simplified BSD License. 64 Table of Contents 66 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5 67 1.1. Purpose . . . . . . . . . . . . . . . . . . . . . . . . . 5 68 1.2. Requirements Language . . . . . . . . . . . . . . . . . . 6 69 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 6 70 2. Overall Operation . . . . . . . . . . . . . . . . . . . . . . 9 71 2.1. Example: Joining a Swarm . . . . . . . . . . . . . . . . 9 72 2.2. Example: Exchanging Chunks . . . . . . . . . . . . . . . 10 73 2.3. Example: Leaving a Swarm . . . . . . . . . . . . . . . . 10 74 3. Messages . . . . . . . . . . . . . . . . . . . . . . . . . . 11 75 3.1. HANDSHAKE . . . . . . . . . . . . . . . . . . . . . . . . 11 76 3.1.1. Handshake Procedure . . . . . . . . . . . . . . . . . 12 77 3.2. HAVE . . . . . . . . . . . . . . . . . . . . . . . . . . 14 78 3.3. DATA . . . . . . . . . . . . . . . . . . . . . . . . . . 15 79 3.4. ACK . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 80 3.5. INTEGRITY . . . . . . . . . . . . . . . . . . . . . . . . 15 81 3.6. SIGNED_INTEGRITY . . . . . . . . . . . . . . . . . . . . 16 82 3.7. REQUEST . . . . . . . . . . . . . . . . . . . . . . . . . 16 83 3.8. CANCEL . . . . . . . . . . . . . . . . . . . . . . . . . 16 84 3.9. CHOKE and UNCHOKE . . . . . . . . . . . . . . . . . . . . 17 85 3.10. Peer Address Exchange . . . . . . . . . . . . . . . . . . 17 86 3.10.1. PEX_REQ and PEX_RES Messages . . . . . . . . . . . . 17 87 3.11. Channels . . . . . . . . . . . . . . . . . . . . . . . . 18 88 3.12. Keep Alive Signalling . . . . . . . . . . . . . . . . . . 19 89 4. Chunk Addressing Schemes . . . . . . . . . . . . . . . . . . 20 90 4.1. Start-End Ranges . . . . . . . . . . . . . . . . . . . . 20 91 4.1.1. Chunk Ranges . . . . . . . . . . . . . . . . . . . . 20 92 4.1.2. Byte Ranges . . . . . . . . . . . . . . . . . . . . . 21 93 4.2. Bin Numbers . . . . . . . . . . . . . . . . . . . . . . . 21 94 4.3. In Messages . . . . . . . . . . . . . . . . . . . . . . . 23 95 4.3.1. In HAVE Messages . . . . . . . . . . . . . . . . . . 23 96 4.3.2. In ACK Messages . . . . . . . . . . . . . . . . . . . 23 98 5. Content Integrity Protection . . . . . . . . . . . . . . . . 23 99 5.1. Merkle Hash Tree Scheme . . . . . . . . . . . . . . . . . 24 100 5.2. Content Integrity Verification . . . . . . . . . . . . . 25 101 5.3. The Atomic Datagram Principle . . . . . . . . . . . . . . 26 102 5.4. INTEGRITY Messages . . . . . . . . . . . . . . . . . . . 27 103 5.5. Discussion and Overhead . . . . . . . . . . . . . . . . . 27 104 5.6. Automatic Detection of Content Size . . . . . . . . . . . 28 105 5.6.1. Peak Hashes . . . . . . . . . . . . . . . . . . . . . 28 106 5.6.2. Procedure . . . . . . . . . . . . . . . . . . . . . . 30 107 6. Live Streaming . . . . . . . . . . . . . . . . . . . . . . . 31 108 6.1. Content Authentication . . . . . . . . . . . . . . . . . 31 109 6.1.1. Sign All . . . . . . . . . . . . . . . . . . . . . . 32 110 6.1.2. Unified Merkle Tree . . . . . . . . . . . . . . . . . 32 111 6.1.2.1. Signed Munro Hashes . . . . . . . . . . . . . . . 33 112 6.1.2.2. Munro Signature Calculation . . . . . . . . . . . 35 113 6.1.2.3. Procedure . . . . . . . . . . . . . . . . . . . . 36 114 6.1.2.4. Secure Tune In . . . . . . . . . . . . . . . . . 36 115 6.2. Forgetting Chunks . . . . . . . . . . . . . . . . . . . . 37 116 7. Protocol Options . . . . . . . . . . . . . . . . . . . . . . 37 117 7.1. End Option . . . . . . . . . . . . . . . . . . . . . . . 38 118 7.2. Version . . . . . . . . . . . . . . . . . . . . . . . . . 38 119 7.3. Minimum Version . . . . . . . . . . . . . . . . . . . . . 39 120 7.4. Swarm Identifier . . . . . . . . . . . . . . . . . . . . 39 121 7.5. Content Integrity Protection Method . . . . . . . . . . . 40 122 7.6. Merkle Tree Hash Function . . . . . . . . . . . . . . . . 40 123 7.7. Live Signature Algorithm . . . . . . . . . . . . . . . . 41 124 7.8. Chunk Addressing Method . . . . . . . . . . . . . . . . . 41 125 7.9. Live Discard Window . . . . . . . . . . . . . . . . . . . 42 126 7.10. Supported Messages . . . . . . . . . . . . . . . . . . . 43 127 7.11. Chunk Size . . . . . . . . . . . . . . . . . . . . . . . 43 128 8. UDP Encapsulation . . . . . . . . . . . . . . . . . . . . . . 44 129 8.1. Chunk Size . . . . . . . . . . . . . . . . . . . . . . . 44 130 8.2. Datagrams and Messages . . . . . . . . . . . . . . . . . 45 131 8.3. Channels . . . . . . . . . . . . . . . . . . . . . . . . 46 132 8.4. HANDSHAKE . . . . . . . . . . . . . . . . . . . . . . . . 46 133 8.5. HAVE . . . . . . . . . . . . . . . . . . . . . . . . . . 47 134 8.6. DATA . . . . . . . . . . . . . . . . . . . . . . . . . . 47 135 8.7. ACK . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 136 8.8. INTEGRITY . . . . . . . . . . . . . . . . . . . . . . . . 49 137 8.9. SIGNED_INTEGRITY . . . . . . . . . . . . . . . . . . . . 50 138 8.10. REQUEST . . . . . . . . . . . . . . . . . . . . . . . . . 51 139 8.11. CANCEL . . . . . . . . . . . . . . . . . . . . . . . . . 51 140 8.12. CHOKE and UNCHOKE . . . . . . . . . . . . . . . . . . . . 52 141 8.13. PEX_REQ, PEX_RESv4, PEX_RESv6 and PEX_REScert . . . . . . 52 142 8.14. KEEPALIVE . . . . . . . . . . . . . . . . . . . . . . . . 54 143 8.15. Flow and Congestion Control . . . . . . . . . . . . . . . 54 144 8.16. Example of Operation . . . . . . . . . . . . . . . . . . 56 145 9. Extensibility . . . . . . . . . . . . . . . . . . . . . . . . 60 146 9.1. Chunk Picking Algorithms . . . . . . . . . . . . . . . . 60 147 9.2. Reciprocity Algorithms . . . . . . . . . . . . . . . . . 60 148 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 60 149 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 61 150 11.1. PPSP Peer Protocol Message Type Registry . . . . . . . . 61 151 11.2. PPSP Peer Protocol Option Registry . . . . . . . . . . . 61 152 11.3. PPSP Peer Protocol Version Number Registry . . . . . . . 61 153 11.4. PPSP Peer Protocol Content Integrity Protection Method 154 Registry . . . . . . . . . . . . . . . . . . . . . . . . 61 155 11.5. PPSP Peer Protocol Merkle Hash Tree Function Registry . 61 156 11.6. PPSP Peer Protocol Chunk Addressing Method Registry . . 62 157 12. Manageability Considerations . . . . . . . . . . . . . . . . 62 158 12.1. Operations . . . . . . . . . . . . . . . . . . . . . . . 62 159 12.1.1. Installation and Initial Setup . . . . . . . . . . . 62 160 12.1.2. Requirements on Other Protocols and Functional 161 Components . . . . . . . . . . . . . . . . . . . . . 63 162 12.1.3. Migration Path . . . . . . . . . . . . . . . . . . . 63 163 12.1.4. Impact on Network Operation . . . . . . . . . . . . 63 164 12.1.5. Verifying Correct Operation . . . . . . . . . . . . 63 165 12.1.6. Configuration . . . . . . . . . . . . . . . . . . . 64 166 12.2. Management Considerations . . . . . . . . . . . . . . . 64 167 12.2.1. Management Interoperability and Information . . . . 65 168 12.2.2. Fault Management . . . . . . . . . . . . . . . . . . 65 169 12.2.3. Configuration Management . . . . . . . . . . . . . . 65 170 12.2.4. Accounting Management . . . . . . . . . . . . . . . 66 171 12.2.5. Performance Management . . . . . . . . . . . . . . . 66 172 12.2.6. Security Management . . . . . . . . . . . . . . . . 66 173 13. Security Considerations . . . . . . . . . . . . . . . . . . . 66 174 13.1. Security of the Handshake Procedure . . . . . . . . . . 66 175 13.1.1. Protection Against Attack 1 . . . . . . . . . . . . 67 176 13.1.2. Protection Against Attack 2 . . . . . . . . . . . . 68 177 13.1.3. Protection Against Attack 3 . . . . . . . . . . . . 68 178 13.2. Secure Peer Address Exchange . . . . . . . . . . . . . . 69 179 13.2.1. Protection against the Amplification Attack . . . . 69 180 13.2.2. Example: Tracker as Certification Authority . . . . 70 181 13.2.3. Protection Against Eclipse Attacks . . . . . . . . . 71 182 13.3. Support for Closed Swarms ([RFC6972] PPSP.SEC.REQ-1) . . 71 183 13.4. Confidentiality of Streamed Content ([RFC6972] 184 PPSP.SEC.REQ-1) . . . . . . . . . . . . . . . . . . . . 71 185 13.5. Strength of the Hash Function for Merkle Hash Trees . . 72 186 13.6. Limit Potential Damage and Resource Exhaustion by Bad or 187 Broken Peers ([RFC6972] PPSP.SEC.REQ-2) . . . . . . . . 72 188 13.6.1. HANDSHAKE . . . . . . . . . . . . . . . . . . . . . 72 189 13.6.2. HAVE . . . . . . . . . . . . . . . . . . . . . . . . 73 190 13.6.3. DATA . . . . . . . . . . . . . . . . . . . . . . . . 73 191 13.6.4. ACK . . . . . . . . . . . . . . . . . . . . . . . . 73 192 13.6.5. INTEGRITY and SIGNED_INTEGRITY . . . . . . . . . . . 74 193 13.6.6. REQUEST . . . . . . . . . . . . . . . . . . . . . . 74 194 13.6.7. CANCEL . . . . . . . . . . . . . . . . . . . . . . . 74 195 13.6.8. CHOKE . . . . . . . . . . . . . . . . . . . . . . . 74 196 13.6.9. UNCHOKE . . . . . . . . . . . . . . . . . . . . . . 75 197 13.6.10. PEX_RES . . . . . . . . . . . . . . . . . . . . . . 75 198 13.6.11. Unsolicited Messages in General . . . . . . . . . . 75 199 13.7. Exclude Bad or Broken Peers ([RFC6972] PPSP.SEC.REQ-2) . 75 200 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 75 201 14.1. Normative References . . . . . . . . . . . . . . . . . . 75 202 14.2. Informative References . . . . . . . . . . . . . . . . . 77 203 Appendix A. Revision History . . . . . . . . . . . . . . . . . . 81 204 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 111 206 1. Introduction 208 1.1. Purpose 210 This document describes the Peer-to-Peer Streaming Peer Protocol 211 (PPSPP), designed for disseminating the same content to a group of 212 interested parties in a streaming fashion. PPSPP supports streaming 213 of both pre-recorded (on-demand) and live audio/video content. It is 214 based on the peer-to-peer paradigm where clients consuming the 215 content are put on equal footing with the servers initially providing 216 the content, to create a system where everyone can potentially 217 provide upload bandwidth. 219 PPSPP has been designed to provide short time-till-playback for the 220 end user, and to prevent disruption of the streams by malicious 221 peers. Central in this design is a simple method of identifying 222 content based on self-certification. In particular, content in PPSPP 223 is identified by a single cryptographic hash that is the root hash in 224 a Merkle hash tree calculated recursively from the content 225 [MERKLE][ABMRKL]. This self-certifying hash tree allows every peer 226 to directly detect when a malicious peer tries to distribute fake 227 content. The tree can be used for both static and live content. 228 Moreover, it ensures only a small amount of information is needed to 229 start a download and to verify incoming chunks of content, thus 230 ensuring short start-up times. 232 PPSPP has also been designed to be extensible for different 233 transports and use cases. Hence, PPSPP is a generic protocol which 234 can run directly on top of UDP, TCP, or other protocols. As such, 235 PPSPP defines a common set of messages that make up the protocol, 236 which can have different representations on the wire depending on the 237 lower-level protocol used. When the lower-level transport allows, 238 PPSPP can also use different congestion control algorithms. 240 At present, PPSPP is set to run on top of UDP using LEDBAT for 241 congestion control [RFC6817]. Using LEDBAT enables PPSPP to serve 242 the content after playback (seeding) without disrupting the user who 243 may have moved to different tasks that use its network connection. 245 PPSPP is also flexible and extensible in the mechanisms it uses to 246 promote client contribution and prevent freeriding, that is, how to 247 deal with peers that only download content but never upload to 248 others. It also allows different schemes for chunk addressing and 249 content integrity protection, if the defaults are not fit for a 250 particular use case. In addition, it can work with different peer 251 discovery schemes, such as centralized trackers or fast Distributed 252 Hash Tables [JIM11]. Finally, in this default setup, PPSPP maintains 253 only a small amount of state per peer. A reference implementation of 254 PPSPP over UDP is available [SWIFTIMPL]. 256 The protocol defined in this document assumes that a peer has already 257 discovered a list of (initial) peers using, for example, a 258 centralized tracker [I-D.ietf-ppsp-base-tracker-protocol]. Once a 259 peer has this list of peers, PPSPP allows the peer to connect to 260 other peers, request chunks of content, and discover other peers 261 disseminating the same content. 263 The design of PPSPP is based on our research into making BitTorrent 264 [BITTORRENT] suitable for streaming content [P2PWIKI]. Most PPSPP 265 messages have corresponding BitTorrent messages and vice versa. 266 However, PPSPP is specifically targeted towards streaming audio/video 267 content and optimizes time-till-playback. It was also designed to be 268 more flexible and extensible. 270 1.2. Requirements Language 272 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 273 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 274 document are to be interpreted as described in RFC 2119 [RFC2119]. 276 1.3. Terminology 278 message 279 The basic unit of PPSPP communication. A message will have 280 different representations on the wire depending on the transport 281 protocol used. Messages are typically multiplexed into a 282 datagram for transmission. 284 datagram 285 A sequence of messages that is offered as a unit to the 286 underlying transport protocol (UDP, etc.). The datagram is 287 PPSPP's Protocol Data Unit (PDU). 289 content 290 Either a live transmission or a pre-recorded multimedia file. 292 chunk 293 The basic unit in which the content is divided. E.g. a block of 294 N kilobyte. A chunk may be of variable size. 296 chunk ID 297 Unique identifier for a chunk of content (e.g. an integer). Its 298 type depends on the chunk addressing scheme used. 300 chunk specification 301 An expression that denotes one or more chunk IDs. 303 chunk addressing scheme 304 Scheme for identifying chunks and expressing the chunk 305 availability map of a peer in a compact fashion. 307 chunk availability map 308 The set of chunks a peer has successfully downloaded and checked 309 the integrity of. 311 bin 312 A number denoting a specific binary interval of the content 313 (i.e., one or more consecutive chunks) in the bin numbers chunk 314 addressing scheme (see Section 4). 316 content integrity protection scheme 317 Scheme for protecting the integrity of the content while it is 318 being distributed via the peer-to-peer network. That is, methods 319 for receiving peers to detect whether a requested chunk has been 320 modified, either maliciously by the sending peer or accidentally 321 in transit. 323 hash 324 The result of applying a cryptographic hash function, more 325 specifically a modification detection code (MDC) [HAC01], such as 326 SHA-256 [FIPS180-4], to a piece of data. 328 Merkle hash tree 329 A tree of hashes whose base is formed by the hashes of the chunks 330 of content, and its higher nodes are calculated by recursively 331 computing the hash of the concatenation of the two child hashes 332 (see Section 5.1). 334 root hash 335 The root in a Merkle hash tree calculated recursively from the 336 content (see Section 5.1). 338 munro hash 339 The hash of a subtree that is the unit of signing in the Unified 340 Merkle Tree content authentication scheme for live streaming (see 341 Section 6.1.2.1). 343 swarm 344 A group of peers participating in the distribution of the same 345 content. 347 swarm ID 348 Unique identifier for a swarm of peers, in PPSPP a sequence of 349 bytes. For video-on-demand with content integrity protection 350 enabled, the identifier is the so-called root hash of a Merkle 351 hash tree over the content. For live streaming, the swarm ID is 352 a public key. 354 tracker 355 An entity that records the addresses of peers participating in a 356 swarm, usually for a set of swarms, and makes this membership 357 information available to other peers on request. 359 choking 360 When a peer A is choking peer B it means that A is currently not 361 willing to accept requests for content from B. 363 seeding 364 Peer A is said to be seeding when A has downloaded a static 365 content file completely and is now offering it for others to 366 download. 368 leeching 369 Peer A is said to be leeching when A has not completely 370 downloaded a static content file yet or is not offering to upload 371 it to others. 373 channel 374 A logical connection between two peers. The channel concept 375 allows peers to use the same transport address for communicating 376 with different peers. 378 channel ID 379 Unique, randomly chosen identifier for a channel, local to each 380 peer. So the two peers logically connected by a channel each 381 have a different channel ID for the channel. 383 heavy payload 384 A datagram has a heavy payload when it contains DATA messages, 385 SIGNED_INTEGRITY messages, or a large number of smaller messages. 387 In this document the prefixes kilo, mega, etc. denote base 1024. 389 2. Overall Operation 391 The basic unit of communication in PPSPP is the message. Multiple 392 messages are multiplexed into a single datagram for transmission. A 393 datagram (and hence the messages it contains) will have different 394 representations on the wire depending on the transport protocol used 395 (see Section 8). 397 The overall operation of PPSPP is illustrated in the following 398 examples. The examples assume that the content distributed is 399 static, UDP is used for transport, the Merkle Hash Tree scheme is 400 used for content integrity protection, and that a specific policy is 401 used for selecting which chunks to download. 403 2.1. Example: Joining a Swarm 405 Consider a user who wants to watch a video. To play the video, the 406 user clicks on the play button of a HTML5