Skip to main content
Version: 1.2.0

TFTP

Trivial File Transfer Protocol for simple file transfers:

Binary Layout

FieldInternal NameDescriptionType / FormatExample / Values
OpcodeopcodeOperation typeuint161 = RRQ, 2 = WRQ, 3 = DATA, 4 = ACK, 5 = ERROR
FilenamefilenameFile path (RRQ/WRQ only)Null-terminated stringconfig.txt\0
ModemodeTransfer mode (RRQ/WRQ only)Null-terminated stringoctet\0, netascii\0
Block Numberblock_numData block sequence (DATA/ACK)uint16e.g. 1, 2, 3
DatadataFile content (DATA only)BinaryUp to 512 bytes
Error Codeerror_codeError type (ERROR only)uint160 = Not defined, 1 = File not found
Error Messageerror_msgError description (ERROR only)Null-terminated stringFile not found\0

Opcodes

OpcodeNamePurpose
1RRQRead Request
2WRQWrite Request
3DATAData packet
4ACKAcknowledgment
5ERRORError packet