home *** CD-ROM | disk | FTP | other *** search
/ Internet Core Protocols / Oreilly-InternetCoreProtocols.iso / RFCs / rfc2347.txt < prev    next >
Encoding:
Text File  |  1999-10-14  |  13.1 KB  |  396 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                          G. Malkin
  8. Request for Commments: 2347                                 Bay Networks
  9. Updates: 1350                                                  A. Harkin
  10. Obsoletes: 1782                                      Hewlett Packard Co.
  11. Category: Standards Track                                       May 1998
  12.  
  13.  
  14.                          TFTP Option Extension
  15.  
  16. Status of this Memo
  17.  
  18.    This document specifies an Internet standards track protocol for the
  19.    Internet community, and requests discussion and suggestions for
  20.    improvements.  Please refer to the current edition of the "Internet
  21.    Official Protocol Standards" (STD 1) for the standardization state
  22.    and status of this protocol.  Distribution of this memo is unlimited.
  23.  
  24. Copyright Notice
  25.  
  26.    Copyright (C) The Internet Society (1998).  All Rights Reserved.
  27.  
  28. Abstract
  29.  
  30.    The Trivial File Transfer Protocol [1] is a simple, lock-step, file
  31.    transfer protocol which allows a client to get or put a file onto a
  32.    remote host.  This document describes a simple extension to TFTP to
  33.    allow option negotiation prior to the file transfer.
  34.  
  35. Introduction
  36.  
  37.    The option negotiation mechanism proposed in this document is a
  38.    backward-compatible extension to the TFTP protocol.  It allows file
  39.    transfer options to be negotiated prior to the transfer using a
  40.    mechanism which is consistent with TFTP's Request Packet format.  The
  41.    mechanism is kept simple by enforcing a request-respond-acknowledge
  42.    sequence, similar to the lock-step approach taken by TFTP itself.
  43.  
  44.    While the option negotiation mechanism is general purpose, in that
  45.    many types of options may be negotiated, it was created to support
  46.    the Blocksize option defined in [2].  Additional options are defined
  47.    in [3].
  48.  
  49. Packet Formats
  50.  
  51.    TFTP options are appended to the Read Request and Write Request
  52.    packets.  A new type of TFTP packet, the Option Acknowledgment
  53.    (OACK), is used to acknowledge a client's option negotiation request.
  54.    A new error code, 8, is hereby defined to indicate that a transfer
  55.  
  56.  
  57.  
  58. Malkin & Harkin             Standards Track                     [Page 1]
  59.  
  60. RFC 2347                 TFTP Option Extension                  May 1998
  61.  
  62.  
  63.    should be terminated due to option negotiation.
  64.  
  65.    Options are appended to a TFTP Read Request or Write Request packet
  66.    as follows:
  67.  
  68.       +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+-->
  69.       |  opc  |filename| 0 |  mode  | 0 |  opt1  | 0 | value1 | 0 | <
  70.       +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+-->
  71.  
  72.        >-------+---+---~~---+---+
  73.       <  optN  | 0 | valueN | 0 |
  74.        >-------+---+---~~---+---+
  75.  
  76.       opc
  77.          The opcode field contains either a 1, for Read Requests, or 2,
  78.          for Write Requests, as defined in [1].
  79.  
  80.       filename
  81.          The name of the file to be read or written, as defined in [1].
  82.          This is a NULL-terminated field.
  83.  
  84.       mode
  85.          The mode of the file transfer: "netascii", "octet", or "mail",
  86.          as defined in [1].  This is a NULL-terminated field.
  87.  
  88.       opt1
  89.          The first option, in case-insensitive ASCII (e.g., blksize).
  90.          This is a NULL-terminated field.
  91.  
  92.       value1
  93.          The value associated with the first option, in case-
  94.          insensitive ASCII.  This is a NULL-terminated field.
  95.  
  96.       optN, valueN
  97.          The final option/value pair.  Each NULL-terminated field is
  98.          specified in case-insensitive ASCII.
  99.  
  100.    The options and values are all NULL-terminated, in keeping with the
  101.    original request format.  If multiple options are to be negotiated,
  102.    they are appended to each other.  The order in which options are
  103.    specified is not significant.  The maximum size of a request packet
  104.    is 512 octets.
  105.  
  106.    The OACK packet has the following format:
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Malkin & Harkin             Standards Track                     [Page 2]
  115.  
  116. RFC 2347                 TFTP Option Extension                  May 1998
  117.  
  118.  
  119.       +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
  120.       |  opc  |  opt1  | 0 | value1 | 0 |  optN  | 0 | valueN | 0 |
  121.       +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
  122.  
  123.       opc
  124.          The opcode field contains a 6, for Option Acknowledgment.
  125.  
  126.       opt1
  127.          The first option acknowledgment, copied from the original
  128.          request.
  129.  
  130.       value1
  131.          The acknowledged value associated with the first option.  If
  132.          and how this value may differ from the original request is
  133.          detailed in the specification for the option.
  134.  
  135.       optN, valueN
  136.          The final option/value acknowledgment pair.
  137.  
  138. Negotiation Protocol
  139.  
  140.    The client appends options at the end of the Read Request or Write
  141.    request packet, as shown above.  Any number of options may be
  142.    specified; however, an option may only be specified once.  The order
  143.    of the options is not significant.
  144.  
  145.    If the server supports option negotiation, and it recognizes one or
  146.    more of the options specified in the request packet, the server may
  147.    respond with an Options Acknowledgment (OACK).  Each option the
  148.    server recognizes, and accepts the value for, is included in the
  149.    OACK.  Some options may allow alternate values to be proposed, but
  150.    this is an option specific feature.  The server must not include in
  151.    the OACK any option which had not been specifically requested by the
  152.    client; that is, only the client may initiate option negotiation.
  153.    Options which the server does not support should be omitted from the
  154.    OACK; they should not cause an ERROR packet to be generated.  If the
  155.    value of a supported option is invalid, the specification for that
  156.    option will indicate whether the server should simply omit the option
  157.    from the OACK, respond with an alternate value, or send an ERROR
  158.    packet, with error code 8, to terminate the transfer.
  159.  
  160.    An option not acknowledged by the server must be ignored by the
  161.    client and server as if it were never requested.  If multiple options
  162.    were requested, the client must use those options which were
  163.    acknowledged by the server and must not use those options which were
  164.    not acknowledged by the server.
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Malkin & Harkin             Standards Track                     [Page 3]
  171.  
  172. RFC 2347                 TFTP Option Extension                  May 1998
  173.  
  174.  
  175.    When the client appends options to the end of a Read Request packet,
  176.    three possible responses may be returned by the server:
  177.  
  178.       OACK  - acknowledge of Read Request and the options;
  179.  
  180.       DATA  - acknowledge of Read Request, but not the options;
  181.  
  182.       ERROR - the request has been denied.
  183.  
  184.    When the client appends options to the end of a Write Request packet,
  185.    three possible responses may be returned by the server:
  186.  
  187.       OACK  - acknowledge of Write Request and the options;
  188.  
  189.       ACK   - acknowledge of Write Request, but not the options;
  190.  
  191.       ERROR - the request has been denied.
  192.  
  193.    If a server implementation does not support option negotiation, it
  194.    will likely ignore any options appended to the client's request.  In
  195.    this case, the server will return a DATA packet for a Read Request
  196.    and an ACK packet for a Write Request establishing normal TFTP data
  197.    transfer.  In the event that a server returns an error for a request
  198.    which carries an option, the client may attempt to repeat the request
  199.    without appending any options.  This implementation option would
  200.    handle servers which consider extraneous data in the request packet
  201.    to be erroneous.
  202.  
  203.    Depending on the original transfer request there are two ways for a
  204.    client to confirm acceptance of a server's OACK.  If the transfer was
  205.    initiated with a Read Request, then an ACK (with the data block
  206.    number set to 0) is sent by the client to confirm the values in the
  207.    server's OACK packet.  If the transfer was initiated with a Write
  208.    Request, then the client begins the transfer with the first DATA
  209.    packet, using the negotiated values.  If the client rejects the OACK,
  210.    then it sends an ERROR packet, with error code 8, to the server and
  211.    the transfer is terminated.
  212.  
  213.    Once a client acknowledges an OACK, with an appropriate non-error
  214.    response, that client has agreed to use only the options and values
  215.    returned by the server.  Remember that the server cannot request an
  216.    option; it can only respond to them.  If the client receives an OACK
  217.    containing an unrequested option, it should respond with an ERROR
  218.    packet, with error code 8, and terminate the transfer.
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Malkin & Harkin             Standards Track                     [Page 4]
  227.  
  228. RFC 2347                 TFTP Option Extension                  May 1998
  229.  
  230.  
  231. Examples
  232.  
  233.    Read Request
  234.  
  235.       client                                           server
  236.       -------------------------------------------------------
  237.       |1|foofile|0|octet|0|blksize|0|1432|0|  -->               RRQ
  238.                                     <--  |6|blksize|0|1432|0|   OACK
  239.       |4|0|  -->                                                ACK
  240.                              <--  |3|1| 1432 octets of data |   DATA
  241.       |4|1|  -->                                                ACK
  242.                              <--  |3|2| 1432 octets of data |   DATA
  243.       |4|2|  -->                                                ACK
  244.                              <--  |3|3|<1432 octets of data |   DATA
  245.       |4|3|  -->                                                ACK
  246.  
  247.    Write Request
  248.  
  249.       client                                           server
  250.       -------------------------------------------------------
  251.       |2|barfile|0|octet|0|blksize|0|2048|0|  -->               RRQ
  252.                                     <--  |6|blksize|0|2048|0|   OACK
  253.       |3|1| 2048 octets of data |  -->                          DATA
  254.                                                    <--  |4|1|   ACK
  255.       |3|2| 2048 octets of data |  -->                          DATA
  256.                                                    <--  |4|2|   ACK
  257.       |3|3|<2048 octets of data |  -->                          DATA
  258.                                                       <--  |4|3|   ACK
  259.  
  260. Security Considerations
  261.  
  262.    The basic TFTP protocol has no security mechanism.  This is why it
  263.    has no rename, delete, or file overwrite capabilities.  This document
  264.    does not add any security to TFTP; however, the specified extensions
  265.    do not add any additional security risks.
  266.  
  267. References
  268.  
  269.    [1] Sollins, K., "The TFTP Protocol (Revision 2)", STD 33, RFC 1350,
  270.        October 1992.
  271.  
  272.    [2] Malkin, G., and A. Harkin, "TFTP Blocksize Option", RFC 2348,
  273.        May 1998.
  274.  
  275.    [3] Malkin, G., and A. Harkin, "TFTP Timeout Interval and Transfer
  276.        Size Options", RFC 2349, May 1998.
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Malkin & Harkin             Standards Track                     [Page 5]
  283.  
  284. RFC 2347                 TFTP Option Extension                  May 1998
  285.  
  286.  
  287. Authors' Addresses
  288.  
  289.    Gary Scott Malkin
  290.    Bay Networks
  291.    8 Federal Street
  292.    Billerica, MA  01821
  293.  
  294.    Phone:  (978) 916-4237
  295.    EMail:  gmalkin@baynetworks.com
  296.  
  297.  
  298.    Art Harkin
  299.    Internet Services Project
  300.    Information Networks Division
  301.    19420 Homestead Road MS 43LN
  302.    Cupertino, CA  95014
  303.  
  304.    Phone: (408) 447-3755
  305.    EMail: ash@cup.hp.com
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. Malkin & Harkin             Standards Track                     [Page 6]
  339.  
  340. RFC 2347                 TFTP Option Extension                  May 1998
  341.  
  342.  
  343. Full Copyright Statement
  344.  
  345.    Copyright (C) The Internet Society (1998).  All Rights Reserved.
  346.  
  347.    This document and translations of it may be copied and furnished to
  348.    others, and derivative works that comment on or otherwise explain it
  349.    or assist in its implementation may be prepared, copied, published
  350.    and distributed, in whole or in part, without restriction of any
  351.    kind, provided that the above copyright notice and this paragraph are
  352.    included on all such copies and derivative works.  However, this
  353.    document itself may not be modified in any way, such as by removing
  354.    the copyright notice or references to the Internet Society or other
  355.    Internet organizations, except as needed for the purpose of
  356.    developing Internet standards in which case the procedures for
  357.    copyrights defined in the Internet Standards process must be
  358.    followed, or as required to translate it into languages other than
  359.    English.
  360.  
  361.    The limited permissions granted above are perpetual and will not be
  362.    revoked by the Internet Society or its successors or assigns.
  363.  
  364.    This document and the information contained herein is provided on an
  365.    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  366.    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  367.    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  368.    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  369.    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Malkin & Harkin             Standards Track                     [Page 7]
  395.  
  396.