TFTP Blocksize Option
Extracted elements (9)
A blocksize of 1428 octets is used as the Ethernet MTU example (1500 octets minus TFTP, UDP, and IP header lengths), demonstrating how clients should select a blocksize that avoids IP fragmentation on a given network path.
The default 512-octet TFTP blocksize is inefficient on LANs with MTUs of 1500 octets or greater. Increasing blocksize reduces the number of data and acknowledgment packets, lowering round-trip wait overhead and per-packet framing costs. Performance tests showed up to 80% reduction in transfer time at 8192-octet blocks versus 512-octet blocks.
If the negotiated blocksize exceeds the path MTU, IP fragmentation and reassembly will add overhead, increasingly noticeable with more intermediate gateways. Implementations should choose a blocksize that fits within the path MTU to avoid fragmentation penalties.
If the server accepts the blocksize option, it sends an Option Acknowledgment (OACK) to the client. The value in the OACK must be less than or equal to the value requested by the client.
Upon receiving an OACK, the client must either use the blocksize specified in the OACK or send an ERROR packet with error code 8 to terminate the transfer.
The 'blksize' option value ('#octets') specifies the number of data octets per block in ASCII decimal. Valid values range from 8 to 65464 octets inclusive. This count excludes the 4-octet TFTP header.
The final packet rules from RFC 1350 remain unchanged: a data packet with a data length less than the negotiated blocksize is the final packet. If the total data is an exact multiple of the blocksize, an extra zero-length data packet ends the transfer.
The basic TFTP protocol has no security mechanism, which is why it lacks rename, delete, or file overwrite capabilities. This document does not add any security to TFTP, but the blocksize option extensions do not introduce any additional security risks.
The TFTP Read Request or Write Request packet is extended with the blocksize option: fields are 'opc' (opcode 1 or 2), 'filename' (NULL-terminated), 'mode' (NULL-terminated), 'blksize' (NULL-terminated literal string), and '#octets' (ASCII decimal value, NULL-terminated). All fields except 'opc' are NULL-terminated.