rfc-2348

TFTP Blocksize Option

G. Malkin, A. Harkin
date1998-05 streamLegacy statusDRAFT STANDARD pages5 canonicalhttps://www.rfc-editor.org/rfc/rfc2348 doi10.17487/RFC2348
The Trivial File Transfer Protocol is a simple, lock-step, file transfer protocol which allows a client to get or put a file onto a remote host. This document describes a TFTP option which allows the client and server to negotiate a blocksize more applicable to the network medium. [STANDARDS-TRACK]

obsoletes

updates

Extracted elements (9)

design-rationale §Blocksize Option Specification

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.

design-rationale §Proof of Concept

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.

interoperability-note §Proof of Concept

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.

normative-requirement §Blocksize Option Specification MUST

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.

normative-requirement §Blocksize Option Specification MUST

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.

protocol-element §Blocksize Option Specification

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.

protocol-element §Blocksize Option Specification

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.

security-consideration §Security Considerations

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.

security

wire-format §Blocksize Option Specification

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.