Internet Engineering Task Force (IETF)                        P. Masotta
Request for Comments: 7440                                         Serva
Category: Standards Track                                   January 2015
ISSN: 2070-1721
        
Internet Engineering Task Force (IETF)                        P. Masotta
Request for Comments: 7440                                         Serva
Category: Standards Track                                   January 2015
ISSN: 2070-1721
        

TFTP Windowsize Option

TFTP窗口大小选项

Abstract

摘要

The "Trivial File Transfer Protocol" (RFC 1350) is a simple, lockstep, file transfer protocol that allows a client to get or put a file onto a remote host. One of its primary uses is in the early stages of nodes booting from a Local Area Network (LAN). TFTP has been used for this application because it is very simple to implement. The employment of a lockstep scheme limits throughput when used on a LAN.

“普通文件传输协议”(RFC1350)是一种简单、锁定步骤的文件传输协议,允许客户端将文件获取或放置到远程主机上。它的主要用途之一是在从局域网(LAN)引导节点的早期阶段。TFTP已用于此应用程序,因为它的实现非常简单。当在局域网上使用时,采用锁步方案限制了吞吐量。

This document describes a TFTP option that allows the client and server to negotiate a window size of consecutive blocks to send as an alternative for replacing the single-block lockstep schema. The TFTP option mechanism employed is described in "TFTP Option Extension" (RFC 2347).

本文档描述了一个TFTP选项,该选项允许客户端和服务器协商要发送的连续块的窗口大小,作为替换单块锁步模式的替代方案。所采用的TFTP选项机制在“TFTP选项扩展”(RFC 2347)中描述。

Status of This Memo

关于下段备忘

This is an Internet Standards Track document.

这是一份互联网标准跟踪文件。

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.

本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 5741第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc7440.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc7440.

Copyright Notice

版权公告

Copyright (c) 2015 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2015 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。

Table of Contents

目录

   1. Introduction ....................................................2
   2. Conventions Used in This Document ...............................3
   3. Windowsize Option Specification .................................3
   4. Traffic Flow and Error Handling .................................4
   5. Proof of Concept and Windowsize Evaluation ......................6
   6. Congestion and Error Control ....................................7
   7. Security Considerations .........................................8
   8. References ......................................................9
      8.1. Normative References .......................................9
   Author's Address ...................................................9
        
   1. Introduction ....................................................2
   2. Conventions Used in This Document ...............................3
   3. Windowsize Option Specification .................................3
   4. Traffic Flow and Error Handling .................................4
   5. Proof of Concept and Windowsize Evaluation ......................6
   6. Congestion and Error Control ....................................7
   7. Security Considerations .........................................8
   8. References ......................................................9
      8.1. Normative References .......................................9
   Author's Address ...................................................9
        
1. Introduction
1. 介绍

TFTP is virtually unused for Internet transfers today, TFTP is still massively used in network boot/installation scenarios including EFI (Extensible Firmware Interface). TFTP's inherently low transfer rate has been, so far, partially mitigated by the use of the blocksize negotiated extension [RFC2348]. Using this method, the original limitation of 512-byte blocks are, in practice, replaced in Ethernet environments by blocks no larger than 1468 Bytes to avoid IP block fragmentation. This strategy produces insufficient results when transferring big files, for example, the initial ramdisk of Linux distributions or the PE images used in network installations by Microsoft WDS/MDT/SCCM. Considering TFTP looks far from extinction today, this document presents a negotiated extension, under the terms of the "TFTP Option Extension" [RFC2347], that produces TFTP transfer rates comparable to those achieved by modern file transfer protocols.

TFTP目前几乎不用于Internet传输,TFTP仍然大量用于网络引导/安装场景,包括EFI(可扩展固件接口)。到目前为止,TFTP固有的低传输速率已通过使用块大小协商扩展[RFC2348]得到部分缓解。使用此方法,在以太网环境中,512字节块的原始限制实际上被不大于1468字节的块所取代,以避免IP块碎片。此策略在传输大文件时产生的结果不足,例如,Linux发行版的初始ramdisk或Microsoft WDS/MDT/SCCM在网络安装中使用的PE映像。考虑到TFTP在今天看来远未消亡,本文件根据“TFTP选项扩展”[RFC2347]的条款提出了一种协商扩展,该扩展产生的TFTP传输速率可与现代文件传输协议实现的传输速率相媲美。

2. Conventions Used in This Document
2. 本文件中使用的公约

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“建议”、“不建议”、“可”和“可选”应按照[RFC2119]中的说明进行解释。

In this document, these words will appear with that interpretation only when in ALL CAPS. Lowercase uses of these words are not to be interpreted as carrying the significance given in RFC 2119.

在本文件中,只有在所有大写字母中,这些单词才会以该解释出现。这些词语的小写用法不得解释为具有RFC 2119中给出的含义。

3. Windowsize Option Specification
3. WindowsSize选项规范

The TFTP Read Request or Write Request packet is modified to include the windowsize option as follows. Note that all fields except "opc" MUST be ASCII strings followed by a single-byte NULL character.

TFTP读取请求或写入请求数据包被修改为包含WindowsSize选项,如下所示。请注意,除“opc”之外的所有字段都必须是ASCII字符串,后跟单字节空字符。

      2B     string   1B   string   1B     string     1B   string   1B
   +-------+---~~---+----+---~~---+----+-----~~-----+----+---~~---+----+
   |  opc  |filename|  0 |  mode  |  0 | windowsize |  0 | #blocks|  0 |
   +-------+---~~---+----+---~~---+----+-----~~-----+----+---~~---+----+
        
      2B     string   1B   string   1B     string     1B   string   1B
   +-------+---~~---+----+---~~---+----+-----~~-----+----+---~~---+----+
   |  opc  |filename|  0 |  mode  |  0 | windowsize |  0 | #blocks|  0 |
   +-------+---~~---+----+---~~---+----+-----~~-----+----+---~~---+----+
        

opc The opcode field contains either a 1 for Read Requests or a 2 for Write Requests, as defined in [RFC1350].

opc根据[RFC1350]中的定义,操作码字段包含读取请求的1或写入请求的2。

filename The name of the file to be read or written, as defined in [RFC1350].

filename要读取或写入的文件名,如[RFC1350]中所定义。

mode The mode of the file transfer: "netascii", "octet", or "mail", as defined in [RFC1350].

模式文件传输模式:[RFC1350]中定义的:“netascii”、“八位字节”或“邮件”。

windowsize The windowsize option, "windowsize" (case insensitive).

WindowsSize窗口大小选项“WindowsSize”(不区分大小写)。

#blocks The base-10 ASCII string representation of the number of blocks in a window. The valid values range MUST be between 1 and 65535 blocks, inclusive. The windowsize refers to the number of consecutive blocks transmitted before stopping and waiting for the reception of the acknowledgment of the last block transmitted.

#blocks以10为基数的ASCII字符串表示窗口中的块数。有效值范围必须介于1和65535块之间(包括1和65535块)。窗口大小是指在停止并等待接收最后发送的块的确认之前发送的连续块数。

For example:

例如:

   +------+--------+----+-------+----+------------+----+----+----+
   |0x0001| foobar |0x00| octet |0x00| windowsize |0x00| 16 |0x00|
   +------+--------+----+-------+----+------------+----+----+----+
        
   +------+--------+----+-------+----+------------+----+----+----+
   |0x0001| foobar |0x00| octet |0x00| windowsize |0x00| 16 |0x00|
   +------+--------+----+-------+----+------------+----+----+----+
        

is a Read Request for the file named "foobar" in octet transfer mode with a windowsize of 16 blocks (option blocksize is not negotiated in this example, the default of 512 Bytes per block applies).

是在八位字节传输模式下对名为“foobar”的文件的读取请求,窗口大小为16个块(本例中不协商选项blocksize,默认为每个块512字节)。

If the server is willing to accept the windowsize 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.

如果服务器愿意接受WindowsSize选项,则会向客户端发送选项确认(OACK)。指定的值必须小于或等于客户端指定的值。然后,客户端必须使用OACK中指定的大小,或者发送错误数据包(错误代码为8)来终止传输。

The rules for determining the final packet are unchanged from [RFC1350] and [RFC2348].

确定最终数据包的规则在[RFC1350]和[RFC2348]中保持不变。

The reception of a data window with a number of blocks less than the negotiated windowsize is the final window. If the windowsize is greater than the amount of data to be transferred, the first window is the final window.

接收块数小于协商窗口大小的数据窗口是最终窗口。如果窗口大小大于要传输的数据量,则第一个窗口为最终窗口。

4. Traffic Flow and Error Handling
4. 流量和错误处理

The next diagram depicts a section of the traffic flow between the Data Sender (DSND) and the Data Receiver (DRCV) parties on a generic windowsize TFTP file transfer.

下一个图表描述了通用WindowsSize TFTP文件传输中数据发送方(DSND)和数据接收方(DRCV)之间的流量部分。

The DSND MUST cyclically send to the DRCV the agreed windowsize consecutive data blocks before normally stopping and waiting for the ACK of the transferred window. The DRCV MUST send to the DSND the ACK of the last data block of the window in order to confirm a successful data block window reception.

DSND必须在正常停止并等待传输窗口的ACK之前,周期性地向DRCV发送商定的窗口大小连续数据块。DRCV必须向DSND发送窗口最后一个数据块的ACK,以确认数据块窗口接收成功。

In the case of an expected ACK not timely reaching the DSND (timeout), the last received ACK SHALL set the beginning of the next windowsize data block window to be sent.

如果预期ACK未及时到达DSND(超时),则最后收到的ACK应设置要发送的下一个窗口大小数据块窗口的开始。

In the case of a data block sequence error, the DRCV SHOULD notify the DSND by sending an ACK corresponding to the last data block correctly received. The notified DSND SHOULD send a new data block window whose beginning MUST be set based on the ACK received out of sequence.

在数据块序列错误的情况下,DRCV应通过发送与正确接收的最后一个数据块对应的ACK来通知DSND。通知的DSND应发送一个新的数据块窗口,该窗口的开头必须根据无序接收的ACK进行设置。

Traffic with windowsize = 1 MUST be equivalent to traffic specified by [RFC1350].

WindowsSize=1的流量必须等于[RFC1350]指定的流量。

For normative traffic not specifically addressed in this section, please refer to [RFC1350] and its updates.

对于本节中未具体说明的标准流量,请参考[RFC1350]及其更新。

         [ DRCV ]      <---traffic--->      [ DSND ]
           ACK#      ->               <-   Data Block#   window block#
                              ...
                              <-           |DB n+01|          1
                              <-           |DB n+02|          2
                              <-           |DB n+03|          3
                              <-           |DB n+04|          4
         |ACK n+04|           ->
                              <-           |DB n+05|          1
                       Error |<-           |DB n+06|          2
                              <-           |DB n+07|          3
         |ACK n+05|           ->
                              <-           |DB n+06|          1
                              <-           |DB n+07|          2
                              <-           |DB n+08|          3
                              <-           |DB n+09|          4
         |ACK n+09|           ->
                              <-           |DB n+10|          1
                       Error |<-           |DB n+11|          2
                              <-           |DB n+12|          3
         |ACK n+10|           ->| Error
                              <-           |DB n+13|          4
                                          - timeout -
                              <-           |DB n+10|          1
                              <-           |DB n+11|          2
                              <-           |DB n+12|          3
                              <-           |DB n+13|          4
         |ACK n+13|           ->
                              ...
        
         [ DRCV ]      <---traffic--->      [ DSND ]
           ACK#      ->               <-   Data Block#   window block#
                              ...
                              <-           |DB n+01|          1
                              <-           |DB n+02|          2
                              <-           |DB n+03|          3
                              <-           |DB n+04|          4
         |ACK n+04|           ->
                              <-           |DB n+05|          1
                       Error |<-           |DB n+06|          2
                              <-           |DB n+07|          3
         |ACK n+05|           ->
                              <-           |DB n+06|          1
                              <-           |DB n+07|          2
                              <-           |DB n+08|          3
                              <-           |DB n+09|          4
         |ACK n+09|           ->
                              <-           |DB n+10|          1
                       Error |<-           |DB n+11|          2
                              <-           |DB n+12|          3
         |ACK n+10|           ->| Error
                              <-           |DB n+13|          4
                                          - timeout -
                              <-           |DB n+10|          1
                              <-           |DB n+11|          2
                              <-           |DB n+12|          3
                              <-           |DB n+13|          4
         |ACK n+13|           ->
                              ...
        

Section of a Windowsize = 4 TFTP Transfer Including Errors and Error Recovery

WindowsSize=4 TFTP传输的一部分,包括错误和错误恢复

5. Proof of Concept and Windowsize Evaluation
5. 概念验证和窗口大小评估

Performance tests were run on the prototype implementation using a variety of windowsizes and a fixed blocksize of 1456 bytes. The tests were run on a lightly loaded Gigabit Ethernet, between two Toshiba Tecra Core 2 Duo 2.2 Ghz laptops, in "octet" mode, transferring a 180 MByte file.

使用各种窗口大小和1456字节的固定块大小在原型实现上运行性能测试。测试在两台东芝Tecra Core 2 Duo 2.2 Ghz笔记本电脑之间的轻负载千兆以太网上运行,以“八位字节”模式传输180 MByte文件。

              ^
              |
          300 +
      Seconds |                           windowsize | time (s)
              |                           ----------   ------
              |     x                         1         257
          250 +                               2         131
              |                               4          76
              |                               8          54
              |                              16          42
          200 +                              32          38
              |                              64          35
              |
              |
          150 +
              |
              |           x
              |
          100 +
              |
              |                 x
              |
           50 +                       x
              |                             x
              |                                   x     x
              |
            0 +-//--+-----+-----+-----+-----+-----+-----+-->
                    1     2     4     8    16    32    64
        
              ^
              |
          300 +
      Seconds |                           windowsize | time (s)
              |                           ----------   ------
              |     x                         1         257
          250 +                               2         131
              |                               4          76
              |                               8          54
              |                              16          42
          200 +                              32          38
              |                              64          35
              |
              |
          150 +
              |
              |           x
              |
          100 +
              |
              |                 x
              |
           50 +                       x
              |                             x
              |                                   x     x
              |
            0 +-//--+-----+-----+-----+-----+-----+-----+-->
                    1     2     4     8    16    32    64
        

Windowsize (in Blocks of 1456 Bytes)

窗口大小(以1456字节的块为单位)

Comparatively, the same 180 MB transfer performed over a drive mapped on Server Message Block (SMB) / Common Internet File System (CIFS) on the same scenario took 23 seconds.

相比之下,在同一场景中,在映射到服务器消息块(SMB)/通用Internet文件系统(CIFS)的驱动器上执行相同的180 MB传输需要23秒。

The comparison of transfer times (without a gateway) between the standard lockstep schema and the negotiated windowsizes are:

标准锁步模式和协商窗口之间的传输时间(无网关)比较如下:

               Windowsize  |  Time Reduction (%)
               ----------     -----------------
                    1              -0%
                    2             -49%
                    4             -70%
                    8             -79%
                   16             -84%
                   32             -85%
                   64             -86%
        
               Windowsize  |  Time Reduction (%)
               ----------     -----------------
                    1              -0%
                    2             -49%
                    4             -70%
                    8             -79%
                   16             -84%
                   32             -85%
                   64             -86%
        

The transfer time decreases with the use of a windowed schema. The reason for the reduction in time is the reduction in the number of the required synchronous acknowledgements exchanged.

使用窗口模式可以缩短传输时间。时间减少的原因是交换的所需同步确认的数量减少。

The choice of appropriate windowsize values on a particular scenario depends on the underlying networking technology and topology, and likely other factors as well. Operators SHOULD test various values and SHOULD be conservative when selecting a windowsize value because as the former table and chart shows, there is a point where the benefit of continuing to increase the windowsize is subject to diminishing returns.

在特定场景中选择合适的WindowsSize值取决于底层网络技术和拓扑以及可能的其他因素。操作员应测试各种值,并且在选择窗口大小值时应保守,因为如前一个表和图表所示,继续增加窗口大小的好处会受到收益递减的影响。

6. Congestion and Error Control
6. 拥塞与差错控制

From a congestion control (CC) standpoint, the number of blocks in a window does not pose an intrinsic threat to the ability of intermediate devices to signal congestion through drops. The rate at which TFTP UDP datagrams are sent SHOULD follow the CC guidelines in Section 3.1 of [RFC5405].

从拥塞控制(CC)的角度来看,窗口中的块数不会对中间设备通过丢包发出拥塞信号的能力构成内在威胁。TFTP UDP数据报的发送速率应遵循[RFC5405]第3.1节中的CC指南。

From an error control standpoint, while [RFC1350] and subsequent updates do not specify a circuit breaker (CB), existing implementations have always chosen to fail under certain circumstances. Implementations SHOULD always set a maximum number of retries for datagram retransmissions, imposing an appropriate threshold on error recovery attempts, after which a transfer SHOULD always be aborted to prevent pathological retransmission conditions.

从错误控制的角度来看,虽然[RFC1350]和后续更新没有指定断路器(CB),但现有的实现总是选择在某些情况下失败。实现应始终为数据报重传设置最大重试次数,对错误恢复尝试施加适当的阈值,之后应始终中止传输以防止出现病态重传情况。

An implementation example scaled for an Ethernet environment (1 Gbit/s, MTU=1500) would be to set:

以太网环境(1 Gbit/s,MTU=1500)的一个实施示例是:

windowsize = 8 blksize = 1456 maximum retransmission attempts per block/window = 6 timeout between retransmissions = 1 S minimum inter-packet delay = 80 uS

windowsize=8 blksize=1456每个块的最大重传尝试次数/window=6重传之间的超时时间=1 S最小数据包间延迟=80 uS

Implementations might well choose other values based on expected and/or tested operating conditions.

实现可能会根据预期和/或测试的操作条件选择其他值。

7. Security Considerations
7. 安全考虑

TFTP includes no login or access control mechanisms. Care must be taken when using TFTP for file transfers where authentication, access control, confidentiality, or integrity checking are needed. Note that those security services could be supplied above or below the layer at which TFTP runs. Care must also be taken in the rights granted to a TFTP server process so as not to violate the security of the server's file system. TFTP is often installed with controls such that only files that have public read access are available via TFTP. Also listing, deleting, renaming, and writing files via TFTP are typically disallowed. TFTP file transfers are NOT RECOMMENDED where the inherent protocol limitations could raise insurmountable liability concerns.

TFTP不包括登录或访问控制机制。在需要身份验证、访问控制、机密性或完整性检查的文件传输中使用TFTP时,必须小心。请注意,这些安全服务可以在TFTP运行的层之上或之下提供。还必须注意授予TFTP服务器进程的权限,以免侵犯服务器文件系统的安全性。TFTP通常安装有控件,这样只有具有公共读取访问权限的文件才能通过TFTP访问。此外,通常不允许通过TFTP列出、删除、重命名和写入文件。如果固有的协议限制可能引起无法克服的责任问题,则不建议使用TFTP文件传输。

TFTP includes no protection against an on-path attacker; care must be taken in controlling windowsize values according to data sender, data receiver, and network environment capabilities. TFTP service is frequently associated with bootstrap and initial provisioning activities; servers in such an environment are in a position to impose device or network specific throughput limitations as appropriate.

TFTP不包括针对路径上攻击者的保护;在根据数据发送方、数据接收方和网络环境功能控制WindowsSize值时必须小心。TFTP服务经常与引导和初始供应活动相关联;在这样的环境中,服务器可以适当地施加特定于设备或网络的吞吐量限制。

This document does not add any security controls to TFTP; however, the specified extension does not pose additional security risks either.

本文件未向TFTP添加任何安全控制;但是,指定的扩展也不会带来额外的安全风险。

8. References
8. 工具书类
8.1. Normative References
8.1. 规范性引用文件

[RFC1350] Sollins, K., "The TFTP Protocol (Revision 2)", STD 33, RFC 1350, July 1992, <http://www.rfc-editor.org/info/rfc1350>.

[RFC1350]Sollins,K.,“TFTP协议(修订版2)”,STD 33,RFC 1350,1992年7月<http://www.rfc-editor.org/info/rfc1350>.

[RFC2347] Malkin, G. and A. Harkin, "TFTP Option Extension", RFC 2347, May 1998, <http://www.rfc-editor.org/info/rfc2347>.

[RFC2347]Malkin,G.和A.Harkin,“TFTP期权扩展”,RFC 2347,1998年5月<http://www.rfc-editor.org/info/rfc2347>.

[RFC2348] Malkin, G. and A. Harkin, "TFTP Blocksize Option", RFC 2348, May 1998, <http://www.rfc-editor.org/info/rfc2348>.

[RFC2348]Malkin,G.和A.Harkin,“TFTP块大小选项”,RFC 2348,1998年5月<http://www.rfc-editor.org/info/rfc2348>.

[RFC5405] Eggert, L. and G. Fairhurst, "Unicast UDP Usage Guidelines for Application Designers", BCP 145, RFC 5405, November 2008, <http://www.rfc-editor.org/info/rfc5405>.

[RFC5405]Eggert,L.和G.Fairhurst,“应用程序设计者的单播UDP使用指南”,BCP 145,RFC 5405,2008年11月<http://www.rfc-editor.org/info/rfc5405>.

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997, <http://www.rfc-editor.org/info/rfc2119>.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月<http://www.rfc-editor.org/info/rfc2119>.

Author's Address

作者地址

Patrick Masotta Serva

帕特里克·马索塔·塞瓦

   EMail: patrick.masotta.ietf@vercot.com
   URI:   http://www.vercot.com/~serva/
        
   EMail: patrick.masotta.ietf@vercot.com
   URI:   http://www.vercot.com/~serva/