TFTP Blocksize Option
Extracted elements (13)
A blocksize of 1432 bytes is suggested as an example matching Ethernet MTU minus UDP and IP header lengths, achieving a 42% reduction in transfer time versus the default 512-byte blocksize on an unimpeded LAN path.
Increasing blocksize yields diminishing returns and added overhead when the blocksize exceeds the path MTU, because IP fragmentation and reassembly overhead increases, especially across multiple gateways.
Performance tests showed transfer time reductions of 32% (1024 B), 42% (1432 B), 54% (2048 B), 71% (4096 B), and 80% (8192 B) compared to the 512-byte default, primarily due to reducing the number of data and acknowledgment packets.
The default 512-byte blocksize in TFTP is inefficient on LANs whose MTU may be 1500 bytes or greater. Negotiating a larger blocksize reduces the number of data and acknowledgment packets, decreasing total transfer time significantly.
If the negotiated blocksize is greater than the size of the data to be transferred, the first packet is also the final packet.
The rules for determining the final packet are unchanged from RFC 1350. A data packet with a data length less than the negotiated blocksize signals the final packet; if the total data is an integral multiple of the blocksize, an extra zero-data packet ends the transfer.
If the server is willing to accept the blocksize option, it sends an Option Acknowledgment (OACK) to the client. The value specified in the OACK must be less than or equal to the value specified by the client.
Upon receiving an OACK, the client must either use the block size specified in the OACK or send an ERROR packet with error code 8 to terminate the transfer.
Valid values for the blocksize option range between 8 and 65464 octets, inclusive. The value is expressed in ASCII.
ERROR code 8 is used by the client to reject a server's OACK and terminate the transfer when the client is unwilling to accept the negotiated blocksize.
The 'blksize' option name is case-insensitive and NULL-terminated. The associated value '#octets' specifies the negotiated block size in ASCII, as a NULL-terminated field, and is carried in RRQ or WRQ packets.
Security issues are not discussed in this memo.
The TFTP Read Request or Write Request packet is extended to include the blocksize option: |opc|filename|0|mode|0|blksize|0|#octets|0|. The 'blksize' option name and the '#octets' value are both NULL-terminated ASCII strings appended after the mode field.