home *** CD-ROM | disk | FTP | other *** search
/ DEFCON 12 / DEFCON_12_CD-ROM_2004.iso / Arcieri / draft-arcieri-peer-distributed-transfer-protocol.xml < prev    next >
Text File  |  2004-07-08  |  53KB  |  1,541 lines

  1. <?rfc toc="yes" ?>
  2. <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
  3. <rfc ipr="full2026" docName="draft-arcieri-peer-distributed-transfer-protocol">
  4.   <front>
  5.     <title abbrev="PDTP Protocol Specification">Peer Distributed Transfer Protocol</title>
  6.     <author initials="A." surname="Arcieri" fullname="Anthony Arcieri" role="editor">
  7.       <organization>PDTP.org</organization>
  8.     </author>
  9.     <date day="6" month="July" year="2004" />
  10.     <area>Internet</area>
  11.     <keyword>I-D</keyword>
  12.     <keyword>Internet-Draft</keyword>
  13.     <keyword>PDTP</keyword>
  14.     <abstract>
  15.         <t>The Peer Distributed Transfer Protocol (PDTP) provides a method of transferring files using peers to aid in distribution of content, similar to <eref target="http://www.bitconjurer.org/BitTorrent/">BitTorrent</eref>. PDTP servers export a dynamically changing directory heirarchy, making it somewhat more like HTTP or FTP, and support a number of other features such as metadata rich directory listings and support for file integrity validation through the use of DSS signatures, and large networks designed to replace FTP mirroring.</t>
  16.     </abstract>
  17.   </front>
  18.  
  19.   <middle>
  20.     <section title="Introduction">
  21.       <section title="Overview">
  22.     <t>
  23. This document describes version 1 of PDTP.  Version 1 currently only allows 
  24. for operation on IPv4 networks.  IPv6 support has been planned from the
  25. start, and may or may not make it into version 1 depending on the
  26. additional design complexity of facilitating transfers between
  27. IPv4 and IPv6 hosts.
  28. </t>
  29.     <t>
  30. PDTP is actually a suite of four different protocol formats used by different components of the system:
  31.  
  32.     <list style="symbols">
  33.     <t><xref target="client-server-protocol">The client/server protocol</xref>, which is used by clients to query the contents of a file repository and manages the file transfer process.  No file data is transferred using this protocol directly.  The PDTP client/server protocol's standard port number is XXXX (pending IANA assignment).</t>
  34.     <t><xref target="hub-protocol">The hub protocol</xref>, used by PDTP servers to talk to PDTP hubs in order to query file repository contents, network mappings, and various transfer regulation functions.  The PDTP hub protocol's standard port number is XXXX (pending IANA assignment).</t>
  35.     <t><xref target="piece-transfer-protocol">The piece transfer protocol</xref>, or "peer protocol", used by  clients
  36. to transfer pieces to/from each other or from PDTP hubs.  The PDTP piece transfer protocol's standard port number is XXXX (pending IANA assignment).</t>
  37.     <t><xref target="proxy-protocol">The proxy protocol</xref>, used by clients behind firewalls to access PDTP servers.  The PDTP proxy protocol's standard port number is XXXX (pending IANA assignment).</t>
  38.     </list>
  39. </t>
  40.       </section>
  41.  
  42.       <section title="Integer abbreviations">
  43.     <figure>
  44.       <preamble>The following abbreviations will be used to describe various integers:</preamble>
  45.       <artwork>
  46. uint8    Big-endian 8-bit unsigned integer
  47. uint16    Big-endian 16-bit unsigned integer
  48. uint32    Big-endian 32-bit unsigned integer
  49. uint64    Big-endian 64-bit unsigned integer
  50.       </artwork>
  51.     </figure>
  52.       </section>
  53.  
  54.       <section title="Handshaking">
  55.     <figure>
  56.       <preamble>Handshaking occurs when a PDTP client connects to a PDTP server:</preamble>
  57.       <artwork>
  58. Client sends:
  59. uint32    Magic number (0x50445450, "PDTP")
  60.  
  61. Server responds:
  62. uint32    Magic number (0x50445450, "PDTP")
  63. uint16  Number of available protocol versions
  64. uint16    Minimum protocol version
  65. uint16    Next available protocol version [Optional]
  66. ...
  67. uint16  Maximum available protocol version [Optional]
  68. </artwork>
  69.     </figure>
  70.     <figure>
  71.       <preamble>- OR -</preamble>
  72.       <artwork>
  73. Server rebonds:
  74. uint16    Magic number (0x5244526E, "REDR");
  75. uint16    String length
  76. string    Name of destination host
  77. uint16    Host port
  78. </artwork>
  79.     </figure>
  80.     <figure>
  81.       <preamble>- OR -</preamble>
  82.       <artwork>
  83. Server responds:
  84. uint16    Magic number (0x41555448, "AUTH")
  85. ...    Authorization process (See Appendix C)
  86. uint32  Magic number (0x50445450, "PDTP")
  87. uint16  Minimum protocol version
  88. uint16  Maximum protocol version
  89. </artwork>
  90.     </figure>
  91.     <t>
  92. The 'PDTP' response indicates the server has accepted the connection.  An
  93. 'AUTH' response may be issued prior to a 'PDTP' response if the server
  94. requires authorization to login.
  95. </t>
  96.     <t>
  97. If the server wishes to redirect the client to a different named server,
  98. it can send a REDR response, followed by the hostname, IPv4 address in
  99. dotted quad format, or IPv6 address of the remote server, and the port 
  100. number to redirect to.
  101. </t>
  102.     <t>
  103. The server and client arbitrate which protocol version to use by having
  104. the client pick a version number from an ordered list.  The list consists
  105. of a 16-bit value indicating how many protocol versions are supported,
  106. and an ordered list of 16-bit integers comprising the specific protocol
  107. revisions supported.
  108. </t>
  109.     <t>
  110. Currently the only available protocol version is 1.  Therefore this list
  111. should consist only of two 16-bit integers, each set to 1, the first
  112. to indicate that only one protocol version is available and the
  113. second to indicate that version 1 is the only supported version.
  114. </t>
  115.     <figure>
  116.       <artwork>
  117. Client responds:
  118. uint16    Protocol version
  119. </artwork>
  120.     </figure>
  121.     <t>
  122. The client then selects which protocol version it would like to use.  If
  123. the client selects a protocol version which wasn't in the list, the
  124. client has violated the protocol and the server should terminate the
  125. connection.
  126. </t>
  127.       </section>
  128.  
  129.       <section title="Transaction format">
  130.     <t>
  131. All communication following the handshake takes the form of transactions.
  132. Transactions may originate from the server as well, in which case the
  133. serial number of the response should be set to zero.  All outstanding
  134. transactions from a client should have a unique serial number so the
  135. client can determine which transaction a particular response is
  136. associated with.
  137. </t>
  138.     <figure>
  139.       <artwork>
  140. Client or server sends: [Required]
  141. uint32  Transaction length
  142. uint32  Transaction serial number
  143. uint16    Transaction ID
  144. uint16  Object count
  145. </artwork>
  146.     </figure>
  147.     <t>
  148. Each transaction begins with a length field, which is the length of the entire
  149. remainder of the transaction in bytes (i.e. the 4 bytes for the transaction
  150. length value itself are not included)  Thus the smallest possible value for 
  151. the transaction length is 8 bytes: 4 bytes for the serial number, 2 for the 
  152. transaction ID, and two for the object count.  The entire transaction would
  153. be 12 bytes, counting 4 extra bytes for the transaction length value.
  154. </t>
  155.     <t>
  156. Every transaction has a type, which is specified in the "Transaction ID" field.
  157. This transaction ID actually consists of a 1-bit boolean value which indicates
  158. whether the transaction is 0: a command or 1: a reply.  The remaining 15 bits
  159. in the field comprise a big endian integer identifier for the transaction.
  160. Specific types of transactions will be enumerated below.  This value is set to
  161. zero to indicate an error when responding to a client's transaction.  Otherwise,
  162. all server responses will have the same ID and serial number as the original
  163. client's transaction.
  164. </t>
  165.     <figure>
  166.       <preamble>
  167. Transactions may or may not have a number of parameters known as "objects".
  168. The number of objects contained within a transaction are stored in the
  169. "Object count" field of the transaction header.  The length of all the objects
  170. and the object headers is counted in the "Transaction length" value.
  171. Objects take the following format:
  172. </preamble>
  173.       <artwork>
  174. uint32  Object length
  175. uint16    Object ID
  176. string    Object payload of specified length
  177. </artwork>
  178.     </figure>
  179.     <t>
  180. What follows is a description of all transactions and associated objects used
  181. by the various protocols in the PDTP suite.  All objects are mandatory unless
  182. stated otherwise.  Objects should be arranged in order of their respective
  183. numerical object identifiers from least to greatest.  This document arranges
  184. its object lists in such a manner; transactions should be constructed in the
  185. same order presented in this document in order to be valid.
  186.     </t>
  187.       </section>
  188.     </section>
  189.     <section anchor="client-server-protocol" title="Client/Server Protocol">
  190.       <section title="Control transactions">
  191.  
  192.     <section title="Command 0x1: Download File">
  193.       <figure>
  194.         <artwork>
  195. [Objects:]
  196.  
  197. Object ID:      0x2 (Path) [See Appendix A for format]
  198. Payload:        string  Path to file
  199.  
  200. Object ID:    0x6 (Piece List) [Optional]
  201. Payload:    string    Piece list
  202. </artwork>
  203.       </figure>
  204.       <t>
  205. This transaction requests a download from the server.  The piece list consists
  206. of a list of uint32 pairs, which are the start and end of ranges of piece
  207. indices we still need.  So, for example, if we are beginning a new download
  208. of a file with 2000 pieces, piece list would be 8 bytes long and contain two
  209. uint32 values, 0 and 1999.  If we are getting the same file but have pieces
  210. 1000-1500, we would send 16 bytes which contain 4 uint32 values, 0, 999,
  211. 1501, and 1999.  If we have everything but the first piece, we would send
  212. 8 bytes which contain two uint32 values, 0 and 0.
  213. </t>
  214.       <t>
  215. The piece list object may be optionally omitted, which indicates that
  216. the client does not possess any pieces of the given file.
  217. </t>
  218.       <figure>
  219.         <preamble>
  220. If the file handle and piece list are valid, the server will respond with:
  221. </preamble>
  222.         <artwork>
  223. Object ID:      0x1 (File Handle)
  224. Payload:        uint32  File handle ID
  225. </artwork>
  226.       </figure>
  227.       <t>
  228. File transfers are stateful and server regulated.  The server will 
  229. asynchronously send transfer management transactions for the given
  230. file handle until the client sends the 0x2: End Download transaction
  231. or the server sends the 0x17: End Transfer transaction.
  232. </t>
  233.       <figure>
  234.         <preamble>
  235. In the event of an error, the server will respond with the following:
  236. </preamble>
  237.         <artwork>
  238. Object ID:      0x500 (Error message)
  239. Payload:        string  Error message
  240. </artwork>
  241.       </figure>
  242.     </section>
  243.  
  244.     <section title="Command 0x2: End Download">
  245.       <figure>
  246.         <artwork>
  247. [Objects:]
  248.  
  249. Object ID:    0x1 (File Handle)
  250. Payload:    uint32    File handle ID
  251. </artwork>
  252.       </figure>
  253.       <t>
  254. This transaction is sent by clients to terminate a transfer.  It should not
  255. be confused with transaction 0x16 (Terminate Transfer) which is used by
  256. the server to inform clients that a download has been terminated.  This
  257. transaction should be sent by clients when they are satisfied with the
  258. set of pieces they have received.  Otherwise, even after a client has
  259. successfully transferred all the pieces of a file, the server will
  260. continue to include this file in the piece selection process for uploaders,
  261. and if the client attempts to download another file they can upload
  262. pieces from a file they've already received successfully in order to
  263. earn the right to transfer more pieces from a different file.
  264. </t>
  265.       <figure>
  266.         <preamble>
  267. On success the server will respond with a transaction with no objects, or on
  268. error it should respond with the following:
  269. </preamble>
  270.         <artwork>
  271. Object ID:      0x500 (Error message)
  272. Payload:        string  Error message
  273. </artwork>
  274.       </figure>
  275.     </section>
  276.  
  277.     <section title="Command 0x3: Retrieve Server Certificate">
  278.       <figure>
  279.         <preamble>
  280. This transaction takes no objects from the client.  The server responds with:
  281. </preamble>
  282.         <artwork>
  283. Object ID:    0x40 (X.509 Certificate)
  284. Payload:    uint32    Server certificate containing DSA key
  285. </artwork>
  286.       </figure>
  287.       <t>
  288. Administrators of PDTP servers may elect to allow the authenticity of certain
  289. files to be verified using a DSS cryptographic signature.  This transaction
  290. allows retrieval of an X.509 certificate containing the DSA key used to
  291. sign files on the server.
  292. </t>
  293.       <t>
  294. More information on X.509 can be found in <xref target="RFC2459">RFC2459</xref>.
  295. </t>
  296.     </section>
  297.  
  298.     <section title="Command 0x4: Change Listener Port">
  299.       <figure>
  300.         <artwork>
  301. [Objects:]
  302.  
  303. Object ID:    0x12 (Port Number) [Optional]
  304. Payload:    uint16    New listener port number
  305. </artwork>
  306.       </figure>
  307.       <t>
  308. This transaction allows a client to dynamically reassign their listener
  309. port.  By default, the PDTP server will assume the client is capable of
  310. receiving connections on port 4045 unless specified otherwise by this
  311. transaction.  If a 0x12 (Port Number) object is not passed in this
  312. transaction, then the client is set to passive mode.
  313. </t>
  314.       <figure>
  315.         <preamble>
  316. If the port number is valid, the server will respond with a transaction without
  317. any objects.  In the event of an error, the server will respond with the 
  318. following:
  319. </preamble>
  320.         <artwork>
  321. Object ID:      0x500 (Error Message)
  322. Payload:        string  Error message
  323. </artwork>
  324.       </figure>
  325.     </section>
  326.  
  327.     <section title="Command 0x5: Set Maximum Download Concurrency">
  328.       <figure>
  329.         <artwork>
  330. [Objects:]
  331.  
  332. Object ID:    0x7 (Concurrency Value)
  333. Payload:    uint16    New maximum concurrent connections
  334. </artwork>
  335.       </figure>
  336.       <t>
  337. By default clients will be assigned a server side default for the maximum
  338. number of concurrent piece downloads they wish to perform.  Clients may
  339. specify this value explicitly using this transaction.  A value of zero
  340. is not allowed, and servers may elect to set a ceiling for this value.
  341. </t>
  342.       <figure>
  343.         <preamble>
  344. If the concurrency value is valid, the server will respond with a transaction
  345. without any objects.  In the event of an error, the server will respond with
  346. the following:
  347. </preamble>
  348.         <artwork>
  349. Object ID:      0x500 (Error Message)
  350. Payload:        string  Error message
  351. </artwork>
  352.       </figure>
  353.     </section>
  354.  
  355.     <section title="Command 0x6: Set Maximum Upload Concurrency">
  356.       <figure>
  357.         <artwork>
  358. [Objects:]
  359.  
  360. Object ID:      0x7 (Concurrency Value)
  361. Payload:        uint16  New maximum concurrent connections
  362. </artwork>
  363.       </figure>
  364.       <t>
  365. By default clients will be assigned a server side default for the maximum
  366. number of concurrent piece uploads they wish to perform.  Clients may
  367. specify this value explicity using this transaction.  A value of zero
  368. is not allowed, and servers may elect to set a ceiling for this value.
  369. </t>
  370.       <figure>
  371.         <preamble>
  372. If the concurrency value is valid, the server will respond with a transaction
  373. without any objects.  In the event of an error, the server will respond with
  374. the following:
  375. </preamble>
  376.         <artwork>
  377. Object ID:      0x500 (Error Message)
  378. Payload:        string  Error message 
  379. </artwork>
  380.       </figure>
  381.     </section>
  382.  
  383.     <section title="Command 0x100: Directory Status">
  384.       <figure>
  385.         <artwork>
  386. [Objects:]
  387.  
  388. Object ID:      0x2 (Path) [See Appendix A for format]
  389. Payload:        string  Path to directory
  390. </artwork>
  391.       </figure>
  392.       <figure>
  393.         <preamble>
  394. This transaction requests the status of the specified directory.  The server
  395. returns a transaction with the following object:
  396. </preamble>
  397.         <artwork>
  398. Object ID:      0x102 (Entry Timestamp)
  399. Payload:        string  48-bit timestamp value
  400. </artwork>
  401.       </figure>
  402.       <figure>
  403.         <preamble>
  404. The timestamp is a 48-bit string which can be broken down as follows:
  405. </preamble>
  406.         <artwork>
  407. uint16          Year
  408. uint32          Year seconds
  409. </artwork>
  410.       </figure>
  411.       <t>
  412. The timestamp format consists of an 16-bit integer year and a 32-bit value
  413. representing the number of seconds since the beginning of that year.
  414. </t>
  415.       <figure>
  416.         <preamble>
  417. In the event of an error, the server will return the following:
  418. </preamble>
  419.         <artwork>
  420. Object ID:      0x500 (Error Message)
  421. Payload:        string  Error message
  422. </artwork>
  423.       </figure>
  424.     </section>
  425.  
  426.     <section title="Command 0x101: File Status">
  427.       <figure>
  428.         <artwork>
  429. [Objects:]
  430.  
  431. Object ID:      0x2 (Path) [See Appendix A for format]
  432. Payload:        string  Path to file
  433. </artwork>
  434.       </figure>
  435.       <figure>
  436.         <preamble>
  437. This transaction requests the status of the specified file.  The server
  438. returns a transaction with the following object:
  439. </preamble>
  440.         <artwork>
  441. Object ID:      0x102 (Entry Timestamp)
  442. Payload:        string  48-bit timestamp value
  443. </artwork>
  444.       </figure>
  445.       <figure>
  446.         <preamble>
  447. The timestamp is a 48-bit string which can be broken down as follows:
  448. </preamble>
  449.         <artwork>
  450. uint16          Year
  451. uint32          Year seconds
  452. </artwork>
  453.       </figure>
  454.       <t>
  455. The timestamp format consists of an 16-bit integer year and a 32-bit value
  456. representing the number of seconds since the beginning of that year.
  457. </t>
  458.       <figure>
  459.         <preamble>
  460. In the event of an error, the server will return the following:
  461. </preamble>
  462.         <artwork>
  463. Object ID:      0x500 (Error Message)
  464. Payload:        string  Error message
  465. </artwork>
  466.       </figure>
  467.     </section>
  468.  
  469.     <section title="Command 0x102: Directory Listing">
  470.       <figure>
  471.         <artwork>
  472. [Objects:]
  473.  
  474. Object ID:      0x2 (Path) [See Appendix A for format]
  475. Payload:        string  Path to directory
  476. </artwork>
  477.       </figure>
  478.       <figure>
  479.         <preamble>
  480. The transaction requests a listing of the specified directory.  The server
  481. returns an arbitrary number of the following objects:
  482. </preamble>
  483.         <artwork>
  484. Object ID:      0x100 (Subdirectory Entry)
  485. Payload:        string  Subdirectory information
  486.  
  487. Object ID:    0x101 (File Entry)
  488. Payload:    string    File information
  489. </artwork>
  490.       </figure>
  491.       <figure>
  492.         <preamble>
  493. The subdirectory information string (0x100) should consist of the following:
  494. </preamble>
  495.         <artwork>
  496. uint16          Modification timestamp: year
  497. uint32          Modification timestamp: year seconds
  498. uint16          Length of directory name
  499. string          Directory name
  500. </artwork>
  501.       </figure>
  502.       <figure>
  503.         <preamble>
  504. The file information string (0x101) should consist of the following:
  505. </preamble>
  506.         <artwork>
  507. uint16        Modification timestamp: year
  508. uint32        Modification timestamp: year seconds
  509. uint64        File length in bytes
  510. uint16        Length of filename
  511. string        Filename
  512. </artwork>
  513.       </figure>
  514.       <t>
  515. The timestamp format consists of an 16-bit integer year and a 32-bit value 
  516. representing the number of seconds since the beginning of that year.
  517. </t>
  518.       <t>
  519. In the event of an error, the server will return the following:
  520. </t>
  521.       <t>
  522.         <list style="hanging" hangIndent="16">
  523.           <t hangText="Object ID:">0x500 (Error Message)</t>
  524.           <t hangText="Payload:">string  Error message</t>
  525.         </list>
  526.       </t>
  527.     </section>
  528.  
  529.     <section title="Command 0x103: File Information">
  530.       <figure>
  531.         <artwork>
  532. [Objects:] 
  533.  
  534. Object ID:      0x2 (Path) [See Appendix A for format]
  535. Payload:        string  Path to file
  536. </artwork>
  537.       </figure>
  538.       <figure>
  539.         <preamble>
  540. This transaction requests the information required to complete the download
  541. process.  The server responds with the following objects:
  542. </preamble>
  543.         <artwork>
  544. Object ID:      0x3 (File Length)
  545. Payload:        uint64  File length
  546.  
  547. Object ID:      0x4 (Piece Length)
  548. Payload:        uint32  Piece length
  549. </artwork>
  550.       </figure>
  551.       <figure>
  552.         <preamble>
  553. And either of the following objects:
  554. </preamble>
  555.         <artwork>
  556. Object ID:      0x20 (MD5 Hashes)
  557. Payload:        string  Buffer of MD5 hashes for all pieces in file
  558. </artwork>
  559.       </figure>
  560.       <t>- OR - </t>
  561.       <figure>
  562.         <artwork>
  563. Object ID:      0x21 (SHA1 Hashes)
  564. Payload:        string  Buffer of SHA1 hashes for all pieces in file
  565. </artwork>
  566.       </figure>
  567.       <figure>
  568.         <preamble>
  569. If a cryptographic signature is available for a given file it should
  570. be included in the transaction as well:
  571. </preamble>
  572.         <artwork>
  573. Object ID:    0x41 (DSS Signature) [Optional]
  574. Payload:    string  DSS signature of file
  575. </artwork>
  576.       </figure>
  577.       <figure>
  578.         <preamble>
  579. Or in the event of an error, the server responds with an error transaction
  580. containing only the following object:
  581. </preamble>
  582.         <artwork>
  583. Object ID:      0x500 (Error Message)
  584. Payload:        string  Error message
  585. </artwork>
  586.       </figure>
  587.       <t>
  588. The 0x20 or 0x21 object is a list of hashes for each piece in the file.
  589. The number of bytes in the 0x20 or 0x21 object will be the number of
  590. bytes in a single hash digest * ceiling(file length / piece length).
  591. So, for 0x20 (MD5) with a piece length of 8 and a file length of 17
  592. the length of the 0x20 object will be 48 bytes, which is the length
  593. of a single MD5 hash (16 bytes) * 3.
  594. </t>
  595.       <t>
  596. Currently MD5 and SHA1 are the only supported hash ciphers, but the protocol
  597. is designed so objects 0x22, 0x23, etc. are reserved for future hash ciphers.
  598. </t>
  599.       <t>
  600. After receiving a list of hashes, the client should then compute hashes
  601. for each piece in any pre-existing copy of the file and compare them
  602. to the server-provided list to determine what pieces of the file remain
  603. to be transferred.  This list should be passed as the 0x6 (Piece List) object
  604. of the 0x1 (Download File) transaction.
  605. </t>
  606.       <t>
  607. The optional 0x41 (DSS Signature) object is the SHA1 hash of the file encrypted
  608. with the DSA key contained within the server's certificate, which may be
  609. retrieved with the 0x3 (Retrieve Server Certificate) transaction.  This
  610. is used to ensure that files on the server have not been tampered with
  611. prior to downloading.
  612. </t>
  613.       <t>
  614. For detailed information about the MD5 cipher, please see <xref target="RFC1321">RFC1321</xref>.
  615. For detailed information about the SHA1 cipher, please see <xref target="RFC3174">RFC3174</xref>.
  616. For more information on the DSS, please see <xref target="FIPS.186-1.1998">FIPS186</xref> and <xref target="RFC2802">RFC2802</xref>.
  617. </t>
  618.     </section>
  619.  
  620.     <section title="Command 0x104: RDL Directory Listing">
  621.       <figure>
  622.         <artwork>
  623. [Objects:]
  624.  
  625. Object ID:      0x2 (Path) [See Appendix A for format]
  626. Payload:        string  Path to directory
  627. </artwork>
  628.       </figure>
  629.       <figure>
  630.         <preamble>
  631. This transaction requests a Rich Directory Listing.  The server responds:
  632. </preamble>
  633.         <artwork>
  634. Object ID:    0x104 (RDL response)
  635. Payload:    string    XML document containing RDL response
  636. </artwork>
  637.       </figure>
  638.       <figure>
  639.         <preamble>
  640. Or in the event of an error, the server responds with the following:
  641. </preamble>
  642.         <artwork>
  643. Object ID:      0x500 (Error Message)
  644. Payload:        string  Error message
  645. </artwork>
  646.       </figure>
  647.       <t>
  648. RDL is an XML directory listing format which may be used secondarily to the
  649. 0x102 (Directory Listing) transaction in order to obtain a metadata rich
  650. directory listing with extended file attributes.  The format of these
  651. results is not specified in this document, but may be found at:
  652. </t>
  653.       <t>
  654. <eref target="http://pdtp.org/rdl.php">http://pdtp.org/rdl.php</eref>
  655. </t>
  656.     </section>
  657.  
  658.     <section title="Command 0x105: RDL File Information">
  659.       <figure>
  660.         <artwork>
  661. [Objects:]
  662.  
  663. Object ID:      0x2 (Path) [See Appendix A for format]
  664. Payload:        string  Path to file
  665. </artwork>
  666.       </figure>
  667.       <figure>
  668.         <preamble>
  669. This transaction requests RDL attributes for a file.  The server responds:
  670. </preamble>
  671.         <artwork>
  672. Object ID:      0x104 (RDL response)
  673. Payload:        string  XML document containing RDL response
  674. </artwork>
  675.       </figure>
  676.       <figure>
  677.         <preamble>
  678. Or in the event of an error, the server responds with the following:
  679. </preamble>
  680.         <artwork>
  681. Object ID:      0x500 (Error Message)
  682. Payload:        string  Error message
  683. </artwork>
  684.       </figure>
  685.       <t>
  686. This is a counterpart to transaction 0x103 (File Information) only also
  687. returning extended file attributes from the 0x104 (RDL Directory Listing)
  688. transaction.
  689. </t>
  690.     </section>
  691.       </section>
  692.  
  693.       <section title="Transfer management">
  694.     <section title="Transfer management transactions (originating from server)">
  695.       <section title="Command 0x10: Send Piece to Peer">
  696.         <figure>
  697.           <artwork>
  698. [Objects:]
  699.  
  700. Object ID:    0x1 (File Handle)
  701. Payload:    uint32    File handle ID
  702.  
  703. Object ID:    0x6 (Piece ID)
  704. Payload:    uint32    Piece number
  705.  
  706. Object ID:    0x10 (IPv4 Address)
  707. Payload:    uint32    Address of remote peer
  708.  
  709. Object ID:    0x12 (Port Number)
  710. Payload:    uint16    Port number of remote peer
  711. </artwork>
  712.         </figure>
  713.         <t>
  714. This transaction instructs one peer to connect to another and send the
  715. specified piece from the specified file.
  716. </t>
  717.       </section>
  718.  
  719.       <section title="Command 0x11: Receive Piece from Peer">
  720.         <figure>
  721.           <artwork>
  722. [Objects:]
  723.  
  724. Object ID:      0x1 (File Handle)
  725. Payload:        uint32  File handle ID
  726.  
  727. Object ID:      0x6 (Piece ID)
  728. Payload:        uint32  Piece number
  729.  
  730. Object ID:      0x10 (IPv4 Address)
  731. Payload:        uint32  Address of remote peer
  732.  
  733. Object ID:      0x12 (Port Number)
  734. Payload:        uint16  Port number of remote peer
  735. </artwork>
  736.         </figure>
  737.         <t>
  738. This transaction instructs one peer to connect to another and
  739. receive the specified piece from the specified file.
  740. </t>
  741.       </section>
  742.  
  743.       <section title="Command 0x16: Terminate Piece Transfer">
  744.         <figure>
  745.           <artwork>
  746. [Objects:]
  747.  
  748. Object ID:    0x1 (File Handle)
  749. Payload:    uint32    File handle ID
  750.  
  751. Object ID:    0x6 (Piece ID)
  752. Payload:    uint32    Piece number
  753.  
  754. Object ID:    0x10 (IPv4 Address)
  755. Payload:    uint32    Address of remote peer
  756. </artwork>
  757.         </figure>
  758.         <t>
  759. This transaction instructs a client which is uploading a piece to one of its
  760. peers to terminate its upload.  No response from the client doing the uploading
  761. is expected.  Instead, the server should wait for a 0x15 (Report failed piece 
  762. transfer) transaction originating from the client which is downloading the
  763. piece.  This command should not be sent to the client which is downloading
  764. a piece; this is a protocol violation and should be ignored (or noted in
  765. a log as a protocol violation)
  766. </t>
  767.       </section>
  768.  
  769.       <section title="Command 0x17: Terminate File Transfer">
  770.         <figure>
  771.           <artwork>
  772. [Objects:]
  773.  
  774. Object ID:    0x1 (File Handle)
  775. Payload:    uint32    File handle ID
  776. </artwork>
  777.         </figure>
  778.         <t>
  779. This transaction informs a client that the file associated with the given
  780. handle is no longer being offered by the server, and that the client should
  781. terminate all attempts to receive that particular file.
  782. </t>
  783.       </section>
  784.     </section>
  785.  
  786.     <section title="Transfer management transactions (originating from client)">
  787.       <section title="Command 0x12: Authorize Piece Upload Attempt">
  788.         <figure>
  789.           <artwork>
  790. [Objects:]
  791.  
  792. Object ID:    0x1 (File Handle)
  793. Payload:    uint32    File handle ID
  794.  
  795. Object ID:    0x6 (Piece ID)
  796. Payload:    uint32    Piece number
  797.  
  798. Object ID:    0x10 (IPv4 Address)
  799. Payload:    uint32    Address of remote peer
  800. </artwork>
  801.         </figure>
  802.         <t>
  803. This transaction informs the server that a peer has connected and is requesting
  804. to upload the specified piece (using an opcode of 0x10).  The listening peer
  805. then and asks for server authorization for the transfer to continue.  The
  806. server will always respond with a transaction without any objects.  If the
  807. connection attempt is authorized the response transaction will have its
  808. transaction ID set to 0x12, or if the connection is unauthorized the server
  809. will send an error response, that is that the transaction ID will be set to 0.
  810. </t>
  811.       </section>
  812.  
  813.       <section title="Command 0x13: Authorize Piece Download Attempt">
  814.         <figure>
  815.           <artwork>
  816. [Objects:]
  817.  
  818. Object ID:      0x1 (File Handle)
  819. Payload:        uint32  File handle ID
  820.  
  821. Object ID:      0x6 (Piece ID)
  822. Payload:        uint32  Piece number
  823.  
  824. Object ID:      0x10 (IPv4 Address)
  825. Payload:        uint32  Address of remote peer
  826. </artwork>
  827.         </figure>
  828.         <t>
  829. This transaction is identical to the one above (0x12) except it is used
  830. when the remote peer requests a piece download (using opcode 0x11)
  831. </t>
  832.       </section>
  833.  
  834.       <section title="Command 0x14: Report Successful Piece Transfer">
  835.         <figure>
  836.           <artwork>
  837. [Objects:]
  838.  
  839. Object ID:    0x1 (File Handle)
  840. Payload:    uint32    File handle ID
  841.  
  842. Object ID:    0x6 (Piece ID)
  843. Payload:    uint32    Piece number
  844.  
  845. Object ID:    0x10 (IPv4 Address)
  846. Payload:    uint32    Address of remote peer
  847. </artwork>
  848.         </figure>
  849.         <t>
  850. This transaction informs the server that a piece transfer has completed
  851. successfully.  It should be sent by both peers involved in a transfer
  852. every time a piece transfer completes successfully.  The server does
  853. not send a response to this transaction; it is used only for the
  854. server's internal bookkeeping.
  855. </t>
  856.       </section>
  857.  
  858.       <section title="Command 0x15: Report Failed Piece Transfer">
  859.         <figure>
  860.           <artwork>
  861. [Objects:]
  862.  
  863. Object ID:    0x1 (File Handle)
  864. Payload:    uint32    File handle ID
  865.  
  866. Object ID:    0x6 (Piece ID)
  867. Payload:    uint32    Piece number
  868.  
  869. Object ID:    0x10 (IPv4 Address)
  870. Payload:    uint32    Address of remote peer
  871. </artwork>
  872.         </figure>
  873.         <t>
  874. This transaction is functionally equivalent to the one above (0x14) except
  875. it is used to report a failed piece transfer.  The server sends no response.
  876. </t>
  877.       </section>
  878.     </section>
  879.       </section>
  880.     </section>
  881.  
  882.     <section anchor="piece-transfer-protocol" title="Piece Transfer Protocol">
  883.       <t>
  884. In PDTP, pieces are transferred between a peer listening on a TCP
  885. port, which we will hereafter refer to as the 'listener', and a peer
  886. connecting to this TCP port, which we will hereafter refer to as the
  887. 'connecting peer'.
  888. </t>
  889.       <figure>
  890.     <preamble>
  891. The piece transfer protocol is very simple by design.  The connecting peer 
  892. begins the exchange by sending the following:
  893. </preamble>
  894.     <artwork>
  895. Connecting peer sends:
  896. uint32    Magic number    (0x50545050, "PTPP")
  897.  
  898. Listener responds:
  899. uint32    Magic number    (0x50545050, "PTPP")
  900. uint16    Minimum protocol version
  901. uint16    Maximum protocol version
  902. </artwork>
  903.       </figure>
  904.       <t>
  905. Both the minimum and maximum protocol version should currently be 1.  In the
  906. future these values will be the lowest and highest protocol versions supported
  907. by the server.
  908. </t>
  909.       <figure>
  910.     <preamble>
  911. In the future, the response from the connecting peer will vary depending
  912. on the protocol versions supported by the listener and the underlying
  913. transport protocol.  However, at the current time the connecting
  914. peer will always respond with the following:
  915. </preamble>
  916.     <artwork>
  917. uint16  Protocol version
  918. uint16    Operation code
  919. </artwork>
  920.       </figure>
  921.       <t>
  922. The connecting peer selects which protocol version it would like to use.  This
  923. value must be greater than or equal to the lowest version supported and less
  924. than or equal to the highest protocol version supported by the server.  Any
  925. values which don't meet this criteria are a protocol violation, and the
  926. connection should be terminated by the server.  At this point in time, this
  927. value should always be 1.
  928. </t>
  929.       <figure>
  930.     <preamble>
  931. The operation code will be one of the following values (note that these 
  932. correspond directly to the transaction IDs from the server originated
  933. transactions to begin a piece transfer):
  934. </preamble>
  935.     <artwork>
  936. 0x10:    Piece upload request (connecting peer => listener)
  937. 0x11:    Piece download request (listener => connecting peer)
  938. </artwork>
  939.       </figure>
  940.       <figure>
  941.     <preamble>
  942. After the protocol version and operation code, the connecting peer will send
  943. the following values which describe exactly what piece from what server is
  944. to be transferred:
  945. </preamble>
  946.     <artwork>
  947. uint32  IPv4 address of coordinating server in network byte order
  948. uint16    Port of coordinating server
  949. uint32  File handle ID
  950. uint32  Piece ID
  951. </artwork>
  952.       </figure>
  953.       <t>
  954. The listener should then report the connecting peer's request to the 
  955. coordinating server using the proper transaction from the 
  956. "Transfer Management Transactions" section above: either 0x12 for a
  957. piece upload request or 0x13 for a piece download request.
  958. </t>
  959.       <figure>
  960.     <preamble>
  961. If the connecting peer requests a piece upload, then then listener should
  962. first authorize the connection with the server.  If the server does not
  963. give authorization for this transfer the listener should close the connection.
  964. Otherwise if authorization is received it should send the following:
  965. </preamble>
  966.     <artwork>
  967. uint32    Piece offset
  968. uint32  Bytes to transfer
  969. </artwork>
  970.       </figure>
  971.       <t>
  972. This allows the listener, which is downloading the piece, to resume the
  973. transfer of a piece which has already been partially received by specifying
  974. an offset (in bytes) from the beginning of the piece from which to begin
  975. the transfer.  If this value is equal to or greater than the piece size,
  976. or if the offset plus the bytes to transfer exceeds the piece size,
  977. then the connecting peer should disconnect and report a failed transfer
  978. due to a protocol violation.  Otherwise it should begin sending the piece
  979. from the specified offset.  The bytes to transfer field allows clients
  980. to grab the beginning portion of a piece if they believe that portion
  981. to have been "tainted" by a malicious client.
  982. </t>
  983.       <figure>
  984.     <preamble>
  985. If the connecting peer is requesting a piece download, then in addition
  986. to the header already enumerated above it should send:
  987. </preamble>
  988.     <artwork>
  989. uint32    Piece offset
  990. uint32    Bytes to transfer
  991. </artwork>
  992.       </figure>
  993.       <t>
  994. The listener should then request authorization from the server, and if the
  995. server does not authorize the transfer the listener should close the connection.
  996. Otherwise the listener should begin sending the piece from the specified offset.
  997. </t>
  998.       <t>
  999. If the connection is lost before the piece transfer completes, this
  1000. should be reported to the server using the appropriate transaction from the
  1001. "Transfer Management Transactions" section, 0x15 (Report failed transfer).
  1002. </t>
  1003.       <t>
  1004. If the piece transfer succeeds, both the connecting peer and listener
  1005. should report so to the server using the appropriate transaction from the
  1006. "Transfer Management Transactions" section, 0x14 (Report successful transfer).
  1007. </t>
  1008.       <figure>
  1009.     <preamble>
  1010. After a successful piece transfer, both the connecting peer and listener
  1011. have the option of closing the connection.  Otherwise, the listener can
  1012. wait for the following:
  1013. </preamble>
  1014.     <artwork>
  1015. uint16    Operation code
  1016. </artwork>
  1017.     <postamble>
  1018. and the two peers can then begin another piece transfer if so desired.
  1019. </postamble>
  1020.       </figure>
  1021.     </section>
  1022.  
  1023.     <section anchor="hub-protocol" title="Hub Protocol">
  1024.       <t>
  1025. Unlike the client/server protocol, communication between servers and
  1026. hubs allows fully synchronous, bidirectional communication.  Consequently,
  1027. both the server and hub will use serial numbers to keep track of
  1028. outstanding transactions.  Serial numbers used by the server and hub
  1029. are distinct, and the server and hub distinguish requests from replies
  1030. by transaction types alone.
  1031. </t>
  1032.  
  1033.       <section title="Handshaking">
  1034.     <t>
  1035. PDTP hubs provide directory structure information to a PDTP server
  1036. or cluster of PDTP servers.  In order to function, a PDTP server must be
  1037. connected to a hub.  A PDTP server should connect to one and only one
  1038. PDTP hub at a single time.  The connection is made via TCP.
  1039. </t>
  1040.     <t>
  1041. After connecting the server initiates the handshaking process.
  1042. </t>
  1043.     <figure>
  1044.       <artwork>
  1045. Server sends:
  1046. uint32  Magic number    (0x50445350, "PDSP")
  1047.  
  1048. Hub responds:
  1049. uint32  Magic number (0x50445450, "PDSP")
  1050. uint16  Minimum protocol version
  1051. uint16  Maximum protocol version
  1052. </artwork>
  1053.     </figure>
  1054.     <t>- OR -</t>
  1055.     <figure>
  1056.       <artwork>
  1057. Hub responds:
  1058. uint16  Magic number (0x41555448, "AUTH")
  1059. ...     Authorization process (See Appendix C)
  1060. uint32  Magic number (0x50445450, "PDSP")
  1061. uint16  Minimum protocol version
  1062. uint16  Maximum protocol version
  1063. </artwork>
  1064.     </figure>
  1065.     <t>
  1066. The 'PDSP' response indicates the hub has accepted the connection.  An
  1067. 'AUTH' response may be issued prior to a 'PDSP' response if the hub
  1068. requires authorization to allow a server to connect.
  1069. </t>
  1070.     <t>
  1071. Both the minimum and maximum protocol version should currently be 1.  In the
  1072. future these values will be the lowest and highest protocol versions supported
  1073. by the hub.
  1074. </t>
  1075.     <figure>
  1076.       <preamble>
  1077. The server should respond with the following:
  1078. </preamble>
  1079.       <artwork>
  1080. uint16  Protocol version
  1081. </artwork>
  1082.     </figure>
  1083.     <t>
  1084. The server selects which protocol version it would like to use.  This value
  1085. must be greater than or equal to the lowest version supported and less than or
  1086. equal to the highest protocol version supported by the server.  Any values
  1087. which don't meet this criteria are a protocol violation, and the connection
  1088. should be terminated by the hub.  At this point in time, this value should
  1089. always be 1.
  1090. </t>
  1091.     <t>
  1092. After handshaking, the hub and server communicate using the standard
  1093. transaction format.  The following transactions are supported:
  1094. </t>
  1095.       </section>
  1096.  
  1097.       <section title="Transactions originating from hub">
  1098.     <section title="Command 0x4: Change Listener Port">
  1099.       <t>
  1100. This transaction is documented in section 2.1.  It is used to inform the server 
  1101. that the hub's piece server is listening on a port other than the one
  1102. to which the server connected.
  1103. </t>
  1104.     </section>
  1105.  
  1106.     <section title="Command 0x13: Authorize Piece Download Attempt">
  1107.       <t>
  1108. This transaction is documented in section 2.2.2.  It is used when a client
  1109. connects to the hub's piece server and is requesting a particular piece.
  1110. The hub requests authorization from the server, and the server can either
  1111. grant or deny the connecting client's request for a particular piece.
  1112. </t>
  1113.     </section>
  1114.  
  1115.     <section title="Command 0x200: Add Handle">
  1116.       <figure>
  1117.         <artwork>
  1118. [Objects:]
  1119.  
  1120. Object ID:    0x1 (File Handle)
  1121. Payload:    uint32    File handle ID
  1122.  
  1123. Object ID:      0x2 (Path) [See Appendix A for format]
  1124. Payload:        string  Path to file
  1125.  
  1126. Object ID:    0x6 (Piece ID)
  1127. Payload:    uint16    Number of pieces in file
  1128. </artwork>
  1129.       </figure>
  1130.       <t>
  1131. This transaction informs the server that the given handle is now valid
  1132. and consists of the given number of pieces.  This transaction should
  1133. be sent with a serial number of zero, and no response is returned.
  1134. </t>
  1135.     </section>
  1136.  
  1137.     <section title="Command 0x201: Remove Handle">
  1138.       <figure>
  1139.         <artwork>
  1140. [Objects:] 
  1141.  
  1142. Object ID:      0x1 (File Handle)
  1143. Payload:        uint32  File handle ID
  1144. </artwork>
  1145.       </figure>
  1146.       <t>
  1147. This transaction informs the server that the given handle is no longer valid.
  1148. The server should terminate all transfers associated with the given handle.
  1149. This transaction should be sent with a serial number of zero, and no response
  1150. is returned.
  1151. </t>
  1152.     </section>
  1153.       </section>
  1154.  
  1155.       <section title="Transactions originating from server">
  1156.     <t>
  1157. PDTP hubs also implement all directory listing transactions implemented
  1158. by servers and used by clients for querying directories.  The expected behavior
  1159. of a PDTP server is that requests for directory or file information sent
  1160. to the server are redirected to the hub, but that the 0x100 and 0x101 status
  1161. queries can be used to implement a caching behavior within the server, to
  1162. mitigate the amount of bandwidth used by the hub for handling these
  1163. queries.  Hubs should therefore be able to answer the following queries
  1164. authoritatively for the files and directory maps they are serving:
  1165. </t>
  1166.     <figure>
  1167.       <artwork>
  1168. Command 0x100:  Directory Status
  1169. Command 0x101:  File Status
  1170. Command 0x102:  Directory Listing
  1171. Command 0x103:  File Information
  1172. Command 0x104:  RDL Directory Listing
  1173. Command 0x105:    RDL File Information
  1174. </artwork>
  1175.     </figure>
  1176.      </section>
  1177.     </section>
  1178.  
  1179.     <section anchor="proxy-protocol" title="Proxy Protocol">
  1180.       <t>
  1181. PDTP supports making outgoing server and peer connections as well as redirection
  1182. of incoming peer connections through a proxy server.  This is accomplished
  1183. partially through dynamic protocol translation within the proxy server
  1184. and partially through special protocol constructions for making outgoing
  1185. connections.  The PDTP proxy server also listens on port 4045.
  1186. </t>
  1187.       <figure>
  1188.     <preamble>
  1189. Requesting a connection through a proxy server is accomplished as follows:</preamble>
  1190.     <artwork>
  1191. Client sends:
  1192. uint32  Magic number    (0x50786350, "PXCP")
  1193.  
  1194. Proxy server responds:
  1195. uint32  Magic number    (0x50786350, "PXCP")
  1196. uint16  Minimum protocol version
  1197. uint16  Maximum protocol version
  1198. </artwork>
  1199.       </figure>
  1200.       <t>
  1201. Both the minimum and maximum protocol version should currently be 1.  In the
  1202. future these values will be the lowest and highest protocol versions supported
  1203. by the server.
  1204. </t>
  1205.       <figure>
  1206.     <artwork>
  1207. Client responds:
  1208. uint16  Protocol version
  1209. </artwork>
  1210.       </figure>
  1211.       <t>
  1212. The client then selects which protocol version it would like to use.  This
  1213. value must be greater than or equal to the lowest version supported and less
  1214. than or equal to the highest protocol version supported by the server.  Any
  1215. values which don't meet this criteria are a protocol violation, and the
  1216. connection should be terminated by the server.
  1217. </t>
  1218.       <figure>
  1219.     <preamble>
  1220. After selecting the protocol version it would like to use, the client sends
  1221. the address and port of the remote system to connect to:
  1222. </preamble>
  1223.     <artwork>
  1224. uint32  Host IP address in network byte order
  1225. uint16  Host port
  1226. </artwork>
  1227.       </figure>
  1228.       <t>
  1229. The client may then issue a PDTP or PTPP connection request.  If the connection
  1230. to the remote system fails the proxy should simply terminate the connection.
  1231. Otherwise it should connect to the requested system and repeat the PDTP or
  1232. PTPP connection requests made by the client.
  1233. </t>
  1234.     </section>
  1235.  
  1236.     <section title="Acknowledgments">
  1237.       <t>Thanks to Marshall Rose for his conversion tools from the 
  1238.       <xref target="RFC2629">RFC-2629</xref> XML format to HTML and RFC.</t>
  1239.     </section>
  1240.   </middle>
  1241.  
  1242.   <back>
  1243.     <references title="References">
  1244.       <reference anchor='RFC1321'>
  1245.       <front>
  1246.       <title abbrev='MD5 Message-Digest Algorithm'>The MD5 Message-Digest Algorithm</title>
  1247.       <author initials='R.' surname='Rivest' fullname='Ronald L. Rivest'>
  1248.       <organization>Massachusetts Institute of Technology, (MIT) Laboratory for Computer Science</organization>
  1249.       <address>
  1250.       <postal>
  1251.       <street>545 Technology Square</street>
  1252.       <street>NE43-324</street>
  1253.       <city>Cambridge</city>
  1254.       <region>MA</region>
  1255.       <code>02139-1986</code>
  1256.       <country>US</country></postal>
  1257.       <phone>+1 617 253 5880</phone>
  1258.       <email>rivest@theory.lcs.mit.edu</email></address></author>
  1259.       <date year='1992' month='April' /></front>
  1260.       <seriesInfo name='RFC' value='1321' />
  1261.       <format type='TXT' octets='35222' target='ftp://ftp.isi.edu/in-notes/rfc1321.txt' />
  1262.       </reference>
  1263.  
  1264. <reference anchor='RFC2104'>
  1265. <front>
  1266. <title abbrev='HMAC'>HMAC: Keyed-Hashing for Message Authentication</title>
  1267. <author initials='H.' surname='Krawczyk' fullname='Hugo Krawczyk'>
  1268. <organization>IBM, T.J. Watson Research Center</organization>
  1269. <address>
  1270. <postal>
  1271. <street>P.O.Box 704</street>
  1272. <city>Yorktown Heights</city>
  1273. <region>NY</region>
  1274. <code>10598</code>
  1275. <country>US</country></postal>
  1276. <email>hugo@watson.ibm.com</email></address></author>
  1277. <author initials='M.' surname='Bellare' fullname='Mihir Bellare'>
  1278. <organization>University of California at San Diego, Dept of Computer Science and Engineering</organization>
  1279. <address>
  1280. <postal>
  1281. <street>9500 Gilman Drive</street>
  1282. <street>Mail Code 0114</street>
  1283. <city>La Jolla</city>
  1284. <region>CA</region>
  1285. <code>92093</code>
  1286. <country>US</country></postal>
  1287. <email>mihir@cs.ucsd.edu</email></address></author>
  1288. <author initials='R.' surname='Canetti' fullname='Ran Canetti'>
  1289. <organization>IBM T.J. Watson Research Center</organization>
  1290. <address>
  1291. <postal>
  1292. <street>P.O.Box 704</street>
  1293. <city>Yorktown Heights</city>
  1294. <region>NY</region>
  1295. <code>10598</code>
  1296. <country>US</country></postal>
  1297. <email>canetti@watson.ibm.com</email></address></author>
  1298. <date year='1997' month='February' />
  1299. <abstract>
  1300. <t>This document describes HMAC, a mechanism for message authentication using cryptographic hash functions. HMAC can be used with any iterative cryptographic hash function, e.g., MD5, SHA-1, in combination with a secret shared key.  The cryptographic strength of HMAC depends on the properties of the underlying hash function.</t></abstract></front>
  1301. <seriesInfo name='RFC' value='2104' />
  1302. <format type='TXT' octets='22297' target='ftp://ftp.isi.edu/in-notes/rfc2104.txt' />
  1303. </reference>
  1304.  
  1305. <reference anchor='RFC2279'>
  1306. <front>
  1307. <title abbrev='UTF-8'>UTF-8, a transformation format of ISO 10646</title>
  1308. <author initials='F.' surname='Yergeau' fullname='Francois Yergeau'>
  1309. <organization>Alis Technologies</organization>
  1310. <address>
  1311. <postal>
  1312. <street>100, boul. Alexis-Nihon</street>
  1313. <street>Suite 600</street>
  1314. <city>Montreal</city>
  1315. <region>Quebec</region>
  1316. <code>H4M 2P2</code>
  1317. <country>CA</country></postal>
  1318. <phone>+1 514 747 2547</phone>
  1319. <facsimile>+1 514 747 2561</facsimile>
  1320. <email>fyergeau@alis.com</email></address></author>
  1321. <date year='1998' month='January' />
  1322. <abstract>
  1323. <t>ISO/IEC 10646-1 defines a multi-octet character set called the Universal Character Set (UCS) which encompasses most of the world's writing systems. Multi-octet characters, however, are not compatible with many current applications and protocols, and this has led to the development of a few so-called UCS transformation formats (UTF), each with different characteristics.  UTF-8, the object of this memo, has the characteristic of preserving the full US-ASCII range, providing compatibility with file systems, parsers and other software that rely on US-ASCII values but are transparent to other values. This memo updates and replaces RFC 2044, in particular addressing the question of versions of the relevant standards.</t></abstract></front>
  1324. <seriesInfo name='RFC' value='2279' />
  1325. <format type='TXT' octets='21634' target='ftp://ftp.isi.edu/in-notes/rfc2279.txt' />
  1326. </reference>
  1327.  
  1328. <reference anchor='RFC2459'>
  1329.  
  1330. <front>
  1331. <title abbrev='Internet X.509 Public Key Infrastructure'>Internet X.509 Public Key Infrastructure Certificate and CRL Profile</title>
  1332. <author initials='R.' surname='Housley' fullname='Russell Housley'>
  1333. <organization>SPYRUS</organization>
  1334. <address>
  1335. <postal>
  1336. <street>381 Elden Street</street>
  1337. <street>Suite 1120</street>
  1338. <city>Herndon</city>
  1339. <region>VA</region>
  1340. <code>20170</code>
  1341. <country>US</country></postal>
  1342. <email>housley@spyrus.com</email></address></author>
  1343. <author initials='W.' surname='Ford' fullname='Warwick Ford'>
  1344. <organization>VeriSign, Inc.</organization>
  1345. <address>
  1346. <postal>
  1347. <street>One Alewife Center</street>
  1348. <city>Cambridge</city>
  1349. <region>MA</region>
  1350. <code>02140</code>
  1351. <country>US</country></postal>
  1352. <email>wford@verisign.com</email></address></author>
  1353. <author initials='T.' surname='Polk' fullname='Tim Polk'>
  1354. <organization>NIST</organization>
  1355. <address>
  1356. <postal>
  1357. <street />
  1358. <city>Gaithersburg</city>
  1359. <region>MD</region>
  1360. <code>20899</code>
  1361. <country>US</country></postal>
  1362. <email>wpolk@nist.gov</email></address></author>
  1363. <author initials='D.' surname='Solo' fullname='David Solo'>
  1364. <organization>Citicorp</organization>
  1365. <address>
  1366. <postal>
  1367. <street>666 Fifth Ave</street>
  1368. <street>3rd Floor</street>
  1369. <city>New York</city>
  1370. <region>NY</region>
  1371. <code>10103</code>
  1372. <country>US</country></postal>
  1373. <email>david.solo@citicorp.com</email></address></author>
  1374. <date year='1999' month='January' />
  1375. <abstract>
  1376. <t>This memo profiles the X.509 v3 certificate and  X.509 v2 CRL for use in the Internet.  An overview of the approach and model are provided  as an introduction.  The .509 v3 certificate format is described in detail, with additional information regarding the format and semantics of Internet name forms (e.g., IP addresses).  Standard certificate extensions are described and one new Internet-specific extension is defined.  A required set of certificate extensions is specified.  The X.509 v2 CRL format is described and a required extension set is defined as well.  An algorithm for X.509 certificate path validation is described. Supplemental information is provided describing the format of public keys and digital signatures in X.509 certificates for common Internet public key encryption algorithms (i.e., RSA, DSA, and Diffie-Hellman).  ASN.1 modules and examples are provided in the appendices.</t>
  1377. <t>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.</t>
  1378. <t>Please send comments on this document to the ietf-pkix@imc.org mail list.</t></abstract></front>
  1379.  
  1380. <seriesInfo name='RFC' value='2459' />
  1381. <format type='TXT' octets='278438' target='ftp://ftp.isi.edu/in-notes/rfc2459.txt' />
  1382. </reference>
  1383.  
  1384.       <reference anchor="RFC2629">
  1385.         <front>
  1386.           <title>Writing I-Ds and RFCs using XML</title>
  1387.           <author initials="M.T." surname="Rose" fullname="Marshall T. Rose">
  1388.             <organization>Invisible Worlds, Inc.</organization>
  1389.             <address>
  1390.               <postal>
  1391.                 <street>660 York Street</street>
  1392.                 <city>San Francisco</city>
  1393.                 <region>CA</region>
  1394.                 <code>94110</code>
  1395.                 <country>US</country>
  1396.               </postal>
  1397.               <phone>+1 415 695 3975</phone>
  1398.               <email>mrose@not.invisible.net</email>
  1399.               <uri>http://invisible.net/</uri>
  1400.             </address>
  1401.           </author>
  1402.         <date month="June" year="1999"/>
  1403.         </front>
  1404.         <seriesInfo name="RFC" value="2629"/>
  1405.       </reference>
  1406.  
  1407. <reference anchor='RFC2802'>
  1408.  
  1409. <front>
  1410. <title>Digital Signatures for the v1.0 Internet Open Trading Protocol (IOTP)</title>
  1411. <author initials='K.' surname='Davidson' fullname='K. Davidson'>
  1412. <organization /></author>
  1413. <author initials='Y.' surname='Kawatsura' fullname='Y. Kawatsura'>
  1414. <organization /></author>
  1415. <date year='2000' month='April' /></front>
  1416.  
  1417. <seriesInfo name='RFC' value='2802' />
  1418. <format type='TXT' octets='52756' target='ftp://ftp.isi.edu/in-notes/rfc2802.txt' />
  1419. </reference>
  1420.  
  1421. <reference anchor='RFC3174'>
  1422. <front>
  1423. <title>US Secure Hash Algorithm 1 (SHA1)</title>
  1424. <author initials='D.' surname='Eastlake' fullname='D. Eastlake'>
  1425. <organization /></author>
  1426. <author initials='P.' surname='Jones' fullname='P. Jones'>
  1427. <organization /></author>
  1428. <date year='2001' month='September' /></front>
  1429. <seriesInfo name='RFC' value='3174' />
  1430. <format type='TXT' octets='35525' target='ftp://ftp.isi.edu/in-notes/rfc3174.txt' />
  1431. </reference>
  1432.  
  1433.       <reference anchor="FIPS.186-1.1998" target="http://csrc.nist.gov/fips/fips1861.pdf">
  1434.         <front>
  1435.           <title>Digital Signature Standard</title>
  1436.           <author>
  1437.             <organization>National Institute of Standards and Technology</organization>
  1438.           </author>
  1439.           <date month="December" year="1998" />
  1440.         </front>
  1441.         <seriesInfo name="FIPS" value="PUB 186-1" />
  1442.       </reference>
  1443.  
  1444.     </references>
  1445.  
  1446.     <section title="Path format">
  1447.       <t>
  1448. All paths used by PDTP are canonical Unix format absolute paths, given in the
  1449. UTF-8 character set (see <xref target="RFC2279">RFC2279</xref>).  
  1450. </t>
  1451.       <t>
  1452. Entities in a path are either directories are files.  Every directory name
  1453. should be postfixed with a '/' character, with a degenerate form of "/" for the
  1454. root directory.  Therefore, all paths should begin with a '/' character, and
  1455. when the last entity in a path is a directory, the entire path should also end
  1456. with a '/' character.
  1457. </t>
  1458.       <t>
  1459. (Note: The traditional symbolic directory names '.' for the current directory
  1460.  and '..' for the current directory's parent are not allowed)
  1461. </t>
  1462.       <t>
  1463. Files always come at the end of a list of directories.  This directory list
  1464. must contain at least one element, the root directory '/'.  So, in order
  1465. to reference a file named 'foo' in the root directory, a client would
  1466. pass a path of '/foo'.
  1467. </t>
  1468.       <t>
  1469. The maximum length of a path is 1024 bytes.  Paths longer than this limit
  1470. are a protocol violation and an appropriate error should be returned.
  1471. </t>
  1472.     </section>
  1473.  
  1474.     <section title="Authorization mechanisms">
  1475.       <figure>
  1476.     <preamble>
  1477. The authorization process by the server sending the authorization magic number:
  1478. </preamble>
  1479.     <artwork>
  1480. uint32    Magic number    (0x41555448, "AUTH")
  1481. </artwork>
  1482.       </figure>
  1483.       <t>
  1484. The client then sends a 16-bit integer indicating the authorization mechanism
  1485. index to utilize.
  1486. </t>
  1487.       <figure>
  1488.     <artwork>
  1489. uint16    Authorization mechanism
  1490.  
  1491. The server responds:
  1492.  
  1493. uint8    ACK (0x1) or NACK (0x0)
  1494. </artwork>
  1495.       </figure>
  1496.       <t>
  1497. A response of ACK indicates the use of this mechanism is allowed, and NACK
  1498. rejects it.  If the server responds NACK, the client may either issue another 
  1499. authorization mechanism to try, or disconnect.
  1500. </t>
  1501.       <t>
  1502. If the server responds ACK, the specified authorization process is performed.
  1503. At the end of the process, the server responds ACK (0x1) if the authorization
  1504. succeeded or NACK (0x0) if it failed.  If an authorization attempt fails,
  1505. the client may send another authorization mechanism index to attempt, or
  1506. disconnect if it has exhausted the mechanisms it wishes to use.
  1507. </t>
  1508.       <t>
  1509. * Authorization mechanism 0x0: HMAC-SHA1
  1510. </t>
  1511.       <figure>
  1512.     <preamble>
  1513. This mechanism utilizes <xref target="RFC2104">RFC2104</xref> HMAC hashing, 
  1514. using SHA1 (<xref target="RFC3174">RFC3174</xref>) as the underlying hash 
  1515. cipher.  The authentication proceeds as follows:
  1516. </preamble>
  1517.     <artwork>
  1518. Server sends:
  1519. string    160-bits (20 bytes) of random challenge data
  1520. </artwork>
  1521.       </figure>
  1522.       <figure>
  1523.     <preamble>
  1524. The message to be encrypted is 20 bytes of random challenge data which is
  1525. sent to the client by the server.  An HMAC-style hash should be applied
  1526. to this message with an arbitrary length key common to both parties.
  1527. The authentication proceeds as follows:
  1528. </preamble>
  1529.     <artwork>
  1530. Client responds:
  1531. string    160-bits of SHA1 digest resulting from HMAC hashing
  1532. </artwork>
  1533.       </figure>
  1534.       <t>
  1535. The server should then check the hash and send ACK or NACK accordingly
  1536. depending on if the digest matches or not.
  1537. </t>
  1538.     </section>
  1539.   </back>
  1540. </rfc>
  1541.