TFTP
The Trivial File Transfer Protocol is a minimal lock-step file transfer protocol over UDP, defined by RFC 1350. DataStream also implements the option-negotiation extension of RFC 2347, which is what makes block sizes above 512 bytes available.
The tftp device receives files only. Read requests are refused.
Binary Layout
| Field | Internal Name | Description | Type / Format | Example / Values |
|---|---|---|---|---|
| Opcode | opcode | Operation type | uint16 | 1 = RRQ, 2 = WRQ, 3 = DATA, 4 = ACK, 5 = ERROR |
| Filename | filename | File path (RRQ/WRQ only) | Null-terminated string | config.txt\0 |
| Mode | mode | Transfer mode (RRQ/WRQ only) | Null-terminated string | octet\0, netascii\0 |
| Block Number | block_num | Data block sequence (DATA/ACK) | uint16 | e.g. 1, 2, 3 |
| Data | data | File content (DATA only) | Binary | 512 bytes by default, up to 65464 when negotiated |
| Error Code | error_code | Error type (ERROR only) | uint16 | 0 = Not defined, 1 = File not found |
| Error Message | error_msg | Error description (ERROR only) | Null-terminated string | File not found\0 |
Opcodes
| Opcode | Name | Purpose |
|---|---|---|
1 | RRQ | Read Request. Not accepted—the tftp device receives files only |
2 | WRQ | Write Request |
3 | DATA | Data packet |
4 | ACK | Acknowledgment |
5 | ERROR | Error packet |
6 | OACK | Option Acknowledgment |
Options
Options are appended to a read or write request as null-terminated name-value pairs, and the server confirms the ones it accepts in an OACK packet.
| Option | Description |
|---|---|
blksize | Data block size, from 512 to 65464 bytes |
tsize | Total transfer size |
Other options are ignored.
Transfer Modes
Only netascii receives special handling, which translates line endings. Every other mode string, including octet, is treated as raw binary and passed through unchanged.