STFTP (Simplified Trivial File Transfer Protocol) MODULE #1
STFTP Usage and Design Transfer files between processes. Minimal overhead (no security). Designed for UDP, although could be used with many transport protocols.
STFTP Usage and Design (cont.) Easy to implement Small - possible to include in firmware Used to bootstrap workstations and network devices.
Diskless Workstation Booting 1 The call for help Diskless Workstation Help! I don't know who I am! My Ethernet address is: 4C:23:17:77:A6:03 RARP
The answer from the all-knowing Diskless Workstation I know all! You are to be know as: RARP REPLY RARP Server
Diskless Workstation I need the file named boot STFTP Request (Broadcast) The request for instructions
The dialog Diskless Workstation STFTP File Transfer STFTP Server here is part 1 I got part 1 here is part 2 boot file
STFTP Protocol 5 message types: –Read request –Write request –Data –ACK (acknowledgment) [ Not required in module#1 but would be required in the later modules ] –Error
Messages Each is an independent UDP Datagram Each has a 2 byte opcode Each packet has null terminated Source IP, Destination IP, Source port and destination port. The structure of the rest of the datagram depends on the opcode.
Message Formats 2 bytes FILENAMEOPCODE 0 SOURCE IP 0 DEST IP 0 SOURCE Port 0 DEST Port 0 OPCODEDATA SOURCE IP 0 DEST IP 0 SOURCE Port 0 DEST Port 0BLOCK #OPCODE SOURCE IP 0 DEST IP 0 SOURCE Port 0 DEST Port 0BLOCK #ERROR MESSAGE0OPCODE SOURCE IP 0 DEST IP 0 SOURCE Port 0 DEST Port 0BLOCK #
2 byte opcode network byte order null terminated ascii string containing name of file Read Request 01filename0 SOURCE IP 0 DEST IP 0 SOURCE Port 0 DEST Port 0 null terminated strings
2 byte opcode network byte order null terminated ascii string containing name of file Write Request 02filename0 SOURCE IP 0 DEST IP 0 SOURCE Port 0 DEST Port 0 null terminated strings
all data packets have 512 bytes except the last one. 2 byte opcode network byte order STFTP Data Packet data 0 to 512 bytes 03 block # SOURCE IP 0 DEST IP 0 SOURCE Port 0 DEST Port 0 null terminated string
STFTP Acknowledgment 2 byte opcode network byte order 2 byte block number network byte order 04 block # SOURCE IP 0 DEST IP 0 SOURCE Port 0 DEST Port 0 null terminated string
STFTP Error Packet 05 errcodeerrstring 2 byte opcode network byte order 2 byte error code network byte order null terminated ascii error string ascii error string 0 SOURCE IP 0 DEST IP 0 SOURCE Port 0 DEST Port 0 null terminated string
STFTP Error Codes (16 bit int) 0 - not defined 1 - File not found 2 - Access violation 3 - Disk full 4 - Illegal (STFTP) operation 5 - Unknown port 6 - File already exists 7 - No such user
When is it over? There is no length of file field sent! All data messages except the last one contain 512 bytes of data. The last data message might contain 0 bytes of data!
Deliverables at the end of Module #1: A STFTP Client A STFTP Server A Proxy Server
References: