Network Working Group G. Malkin Request for Commments: 2348 Bay Networks Updates: 1350 A. Harkin Obsoletes: 1783 Hewlett Packard Co. Category: Standards Track May 1998
Network Working Group G. Malkin Request for Commments: 2348 Bay Networks Updates: 1350 A. Harkin Obsoletes: 1783 Hewlett Packard Co. Category: Standards Track May 1998
TFTP Blocksize Option
TFTP块大小选项
Status of this Memo
本备忘录的状况
This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.
本文件规定了互联网社区的互联网标准跟踪协议,并要求进行讨论和提出改进建议。有关本协议的标准化状态和状态,请参考当前版本的“互联网官方协议标准”(STD 1)。本备忘录的分发不受限制。
Copyright Notice
版权公告
Copyright (C) The Internet Society (1998). All Rights Reserved.
版权所有(C)互联网协会(1998年)。版权所有。
Abstract
摘要
The Trivial File Transfer Protocol [1] is a simple, lock-step, file transfer protocol which allows a client to get or put a file onto a remote host. One of its primary uses is the booting of diskless nodes on a Local Area Network. TFTP is used because it is very simple to implement in a small node's limited ROM space. However, the choice of a 512-octet blocksize is not the most efficient for use on a LAN whose MTU may 1500 octets or greater.
琐碎文件传输协议[1]是一个简单的、锁定步骤的文件传输协议,它允许客户端获取文件或将文件放到远程主机上。它的主要用途之一是在局域网上引导无盘节点。之所以使用TFTP,是因为它很容易在一个小节点的有限ROM空间中实现。但是,对于MTU可能为1500个八位字节或更大的LAN,选择512个八位字节的块大小并不是最有效的。
This document describes a TFTP option which allows the client and server to negotiate a blocksize more applicable to the network medium. The TFTP Option Extension mechanism is described in [2].
本文档描述了TFTP选项,该选项允许客户端和服务器协商更适用于网络介质的块大小。TFTP选项扩展机制如[2]所述。
Blocksize Option Specification
块大小选项规范
The TFTP Read Request or Write Request packet is modified to include the blocksize option as follows. Note that all fields except "opc" are NULL-terminated.
TFTP读请求或写请求数据包被修改为包括blocksize选项,如下所示。请注意,除“opc”之外的所有字段均以空结尾。
+-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+ | opc |filename| 0 | mode | 0 | blksize| 0 | #octets| 0 | +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
+-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+ | opc |filename| 0 | mode | 0 | blksize| 0 | #octets| 0 | +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
opc The opcode field contains either a 1, for Read Requests, or 2, for Write Requests, as defined in [1].
opc操作码字段包含1(用于读取请求)或2(用于写入请求),如[1]中所定义。
filename The name of the file to be read or written, as defined in [1].
filename要读取或写入的文件名,如[1]中所定义。
mode The mode of the file transfer: "netascii", "octet", or "mail", as defined in [1].
模式文件传输模式:“netascii”、“八位字节”或“邮件”,如[1]中所定义。
blksize The Blocksize option, "blksize" (case in-sensitive).
blksize块大小选项,“blksize”(区分大小写)。
#octets The number of octets in a block, specified in ASCII. Valid values range between "8" and "65464" octets, inclusive. The blocksize refers to the number of data octets; it does not include the four octets of TFTP header.
#八位字节块中的八位字节数,用ASCII指定。有效值范围在“8”和“65464”八位字节之间(含)。块大小是指数据八位字节的数量;它不包括TFTP头的四个八位字节。
For example:
例如:
+-------+--------+---+--------+---+--------+---+--------+---+ | 1 | foobar | 0 | octet | 0 | blksize| 0 | 1428 | 0 | +-------+--------+---+--------+---+--------+---+--------+---+
+-------+--------+---+--------+---+--------+---+--------+---+ | 1 | foobar | 0 | octet | 0 | blksize| 0 | 1428 | 0 | +-------+--------+---+--------+---+--------+---+--------+---+
is a Read Request, for the file named "foobar", in octet (binary) transfer mode, with a block size of 1428 octets (Ethernet MTU, less the TFTP, UDP and IP header lengths).
是对名为“foobar”的文件的读取请求,采用八位字节(二进制)传输模式,块大小为1428个八位字节(以太网MTU,小于TFTP、UDP和IP头长度)。
If the server is willing to accept the blocksize option, it sends an Option Acknowledgment (OACK) to the client. The specified value must be less than or equal to the value specified by the client. The client must then either use the size specified in the OACK, or send an ERROR packet, with error code 8, to terminate the transfer.
如果服务器愿意接受blocksize选项,它将向客户端发送选项确认(OACK)。指定的值必须小于或等于客户端指定的值。然后,客户端必须使用OACK中指定的大小,或者发送错误数据包(错误代码为8)以终止传输。
The rules for determining the final packet are unchanged from [1]. The reception of a data packet with a data length less than the negotiated blocksize is the final packet. If the blocksize is greater than the amount of data to be transfered, the first packet is the final packet. If the amount of data to be transfered is an integral multiple of the blocksize, an extra data packet containing no data is sent to end the transfer.
确定最终数据包的规则从[1]起保持不变。数据长度小于协商块大小的数据分组的接收是最终分组。如果块大小大于要传输的数据量,则第一个数据包为最终数据包。如果要传输的数据量是块大小的整数倍,则发送不包含任何数据的额外数据包以结束传输。
Proof of Concept
概念证明
Performance tests were run on the prototype implementation using a variety of block sizes. The tests were run on a lightly loaded Ethernet, between two HP-UX 9000, in "octet" mode, on 2.25MB files. The average (5x) transfer times for paths with (g-time) and without (n-time) a intermediate gateway are graphed as follows:
使用各种块大小在原型实现上运行性能测试。测试在两个HP-UX 9000之间的轻负载以太网上以“八位字节”模式在2.25MB文件上运行。具有(g-time)和不具有(n-time)中间网关的路径的平均(5x)传输时间如下图所示:
| 37 + g | 35 + | 33 + | 31 + | 29 + | 27 + | g blocksize n-time g-time 25 + --------- ------ ------ s | n 512 23.85 37.05 e 23 + g 1024 16.15 25.65 c | 1428 13.70 23.10 o 21 + 2048 10.90 16.90 n | 4096 6.85 9.65 d 19 + 8192 4.90 6.15 s | 17 + g | n 15 + | n 13 + | 11 + n | g 9 + | 7 + n | g 5 + n " 0 +------+------+--+---+------+------+--- 512 1K | 2K 4K 8K 1428 blocksize (octets)
| 37 + g | 35 + | 33 + | 31 + | 29 + | 27 + | g blocksize n-time g-time 25 + --------- ------ ------ s | n 512 23.85 37.05 e 23 + g 1024 16.15 25.65 c | 1428 13.70 23.10 o 21 + 2048 10.90 16.90 n | 4096 6.85 9.65 d 19 + 8192 4.90 6.15 s | 17 + g | n 15 + | n 13 + | 11 + n | g 9 + | 7 + n | g 5 + n " 0 +------+------+--+---+------+------+--- 512 1K | 2K 4K 8K 1428 blocksize (octets)
The comparisons between transfer times (without a gateway) between the standard 512-octet blocksize and the negotiated blocksizes are:
标准512八位字节块大小和协商块大小之间的传输时间(无网关)比较如下:
1024 2x -32% 1428 2.8x -42% 2048 4x -54% 4096 8x -71% 8192 16x -80%
1024 2x-32%1428 2.8x-42%2048 4x-54%4096 8x-71%8192 16x-80%
As was anticipated, the transfer time decreases with an increase in blocksize. The reason for the reduction in time is the reduction in the number of packets sent. For example, by increasing the blocksize from 512 octets to 1024 octets, not only are the number of data packets halved, but the number of acknowledgement packets is also halved (along with the number of times the data transmitter must wait for an ACK). A secondary effect is the efficiency gained by reducing the per-packet framing and processing overhead.
正如预期的那样,传输时间随着块大小的增加而减少。时间缩短的原因是发送的数据包数量减少。例如,通过将块大小从512个八位字节增加到1024个八位字节,不仅数据包的数量减少了一半,而且确认包的数量也减少了一半(以及数据发送器必须等待ACK的次数)。第二个影响是通过减少每个数据包的帧和处理开销而获得的效率。
Of course, if the blocksize exceeds the path MTU, IP fragmentation and reassembly will begin to add more overhead. This will be more noticable the greater the number of gateways in the path.
当然,如果块大小超过路径MTU,IP碎片和重组将开始增加更多开销。路径中网关的数量越多,这一点就越明显。
Security Considerations
安全考虑
The basic TFTP protocol has no security mechanism. This is why it has no rename, delete, or file overwrite capabilities. This document does not add any security to TFTP; however, the specified extensions do not add any additional security risks.
基本TFTP协议没有安全机制。这就是为什么它没有重命名、删除或文件覆盖功能。本文件不向TFTP添加任何安全性;但是,指定的扩展不会增加任何额外的安全风险。
References
工具书类
[1] Sollins, K., "The TFTP Protocol (Revision 2)", STD 33, RFC 1350, October 1992.
[1] Sollins,K.,“TFTP协议(第2版)”,STD 33,RFC 1350,1992年10月。
[2] Malkin, G., and A. Harkin, "TFTP Option Extension", RFC 2347, May 1998.
[2] Malkin,G.和A.Harkin,“TFTP期权扩展”,RFC 2347,1998年5月。
Authors' Addresses
作者地址
Gary Scott Malkin Bay Networks 8 Federal Street Billerica, MA 10821
加里·斯科特·马尔金湾网络美国马萨诸塞州比尔里卡联邦街8号10821
Phone: (978) 916-4237 EMail: gmalkin@baynetworks.com
电话:(978)916-4237电子邮件:gmalkin@baynetworks.com
Art Harkin Networked Computing Division Hewlett-Packard Company 19420 Homestead Road MS 43LN Cupertino, CA 95014
Art Harkin网络计算部门惠普公司19420 Homestead路MS 43LN库珀蒂诺,加利福尼亚州95014
Phone: (408) 447-3755 EMail: ash@cup.hp.com
电话:(408)447-3755电子邮件:ash@cup.hp.com
Full Copyright Statement
完整版权声明
Copyright (C) The Internet Society (1998). All Rights Reserved.
版权所有(C)互联网协会(1998年)。版权所有。
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.
本文件和其中包含的信息是按“原样”提供的,互联网协会和互联网工程任务组否认所有明示或暗示的保证,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。