RFC 2349

TFTP Timeout Interval and Transfer Size Options

πŸ“… published May 1998, from ietf

TFTP Timeout Interval and Transfer Size Options πŸŽ€

Okay bestie, this is RFC 2349 ✨ and it's giving standards track πŸ”₯. It's from May 1998 and it's written by G. Malkin (Bay Networks) and A. Harkin (Hewlett Packard Co.). It updates RFC 1350 and obsoletes RFC 1784. (The header says "Request for Commments," typo and all πŸ’€.) So basically it adds two new TFTP options on top of the Option Extension mechanism. Let's go πŸ’…

Status of this Memo

Okay so this doc is an Internet standards track protocol for the Internet community 🌸. It's basically asking everyone to talk about it and suggest improvements 🫢. If you want the official standardization state, check the current "Internet Official Protocol Standards" (STD 1) πŸ“œ. And distribution is unlimited, so share away πŸ’–.

Copyright Notice

Copyright (C) The Internet Society (1998). All Rights Reserved. 🌈

Abstract

So TFTP [1] is a simple, lock-step file transfer protocol that lets a client get or put a file onto a remote host πŸ¦‹. This doc describes two TFTP options πŸ‘‘. The first lets the client and server negotiate the Timeout Interval ⏱️. The second lets the side receiving the file figure out the ultimate size of the transfer before it even starts 🧚. The TFTP Option Extension mechanism is described in [2] πŸ’œ.

Timeout Interval Option Specification

Okay so the TFTP Read Request or Write Request packet gets a timeout option tacked on, and it looks like this πŸ“:

   +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
   |  opc  |filename| 0 |  mode  | 0 | timeout| 0 |  #secs | 0 |
   +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
  • opc: The opcode field is either a 1 (Read Request) or a 2 (Write Request), as defined in [1] ✨.
  • filename: The name of the file to be read or written, as defined in [1]. It's NULL-terminated πŸŽ€.
  • mode: The file transfer mode, which is "netascii", "octet", or "mail", as defined in [1]. Also NULL-terminated 🫢.
  • timeout: The Timeout Interval option, spelled "timeout" (case in-sensitive) πŸ¦‹. NULL-terminated too πŸ’….
  • #secs: How many seconds to wait before retransmitting, written in ASCII. Valid values are "1" through "255" seconds, inclusive 🌸. NULL-terminated 🌈.

For example, this is giving πŸ’–:

   +-------+--------+---+--------+---+--------+---+-------+---+
   |   1   | foobar | 0 | octet  | 0 | timeout| 0 |   1   | 0 |
   +-------+--------+---+--------+---+--------+---+-------+---+

That's a Read Request for the file named "foobar" in octet (binary) mode, with a 1 second timeout interval 🧚.

If the server is cool with the timeout option, it sends an Option Acknowledgment (OACK) back to the client 🫢. The timeout value in the OACK has to match the one the client asked for πŸ”₯.

Transfer Size Option Specification

Same vibe for the transfer size option πŸ’…. The TFTP Read Request or Write Request packet gets a tsize option added like this:

   +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
   |  opc  |filename| 0 |  mode  | 0 | tsize  | 0 |  size  | 0 |
   +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
  • opc: The opcode field is either a 1 (Read Request) or a 2 (Write Request), as defined in [1] ✨.
  • filename: The name of the file to be read or written, as defined in [1]. NULL-terminated πŸŽ€.
  • mode: The file transfer mode, "netascii", "octet", or "mail", as defined in [1]. NULL-terminated 🌸.
  • tsize: The Transfer Size option, spelled "tsize" (case in-sensitive). It's a NULL-terminated field πŸ¦‹.
  • size: The size of the file being transfered. NULL-terminated 🌈.

Example time 🧚:

   +-------+--------+---+--------+---+--------+---+--------+---+
   |   2   | foobar | 0 | octet  | 0 | tsize  | 0 | 673312 | 0 |
   +-------+--------+---+--------+---+--------+---+--------+---+

That's a Write Request for the 673312-octet file named "foobar", in octet (binary) mode πŸ’–.

Okay so for Read Requests, the request has a size of "0", and the server sends back the file's size in octets in the OACK πŸ‘‘. If the file is too big for the client, it may abort the transfer with an Error packet (error code 3) πŸ’€. For Write Requests, the file size in octets is in the request and gets echoed back in the OACK 🫢. If the file is too big for the server, it may abort with an Error packet (error code 3) too πŸ™ˆ.

Security Considerations

Okay real talk bestie 😭: the basic TFTP protocol has no security mechanism at all. That's literally why it has no rename, delete, or file overwrite capabilities πŸ’€. This doc doesn't add any security to TFTP πŸ”₯. BUT the extensions specified here don't add any extra security risks either 🫢.

References

[1] Sollins, K., "The TFTP Protocol (Revision 2)", STD 33, RFC 1350, October 92.

[2] Malkin, G., and A. Harkin, "TFTP Option Extension", RFC 2347, May 1998.

Authors' Addresses

Gary Scott Malkin 🌸 Bay Networks 8 Federal Street Billerica, MA 01821

Phone: (978) 916-4237 EMail: gmalkin@baynetworks.com

Art Harkin πŸ¦‹ Internet Services Project Information Networks Division 19420 Homestead Road MS 43LN Cupertino, CA 95014

Phone: (408) 447-3755 EMail: ash@cup.hp.com

Full Copyright Statement

Copyright (C) The Internet Society (1998). All Rights Reserved.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. πŸ’…βœ¨

πŸ“¦ where this page comes from