What is the octet mode in TFTP?

In octet mode, data is transferred and stored exactly as-is. In netascii mode, line endings are converted (if needed) on the receiving end to its preferred line-ending (i.e. Newline on Unixes). There is no default as the mode string is always included in the ReadReQuest or WriteReQuest packet.

[edit] Every packet (except the last) sent must contain exactly 512 bytes of data. If a packet contains less (0..511) it signals the end of the file.
The protocol was designed to able to be implemented with a minimum amount of code, so using a fixed-size buffer was anticipated. You could probably come up with a more complicated scheme, but why?

RFC 1350* defines the protocol.


The “Sorcerer’s Apprentice Syndrome” is protected against by only sending the next block upon timeout or the receipt of the first acknowledgment for a block (any further acknowledgments are silently ignored).

The RFC (see section 7) requires an ERROR packet upon error (including malformed request).

*RFC = “Request for Comments”. RFC 1350 is the latest and official description and standard for the TFTP protocol.

Leave a Comment