This preview shows page 1. Sign up to view the full content.
Unformatted text preview: skless system, the first request is a read request
(RRQ). Figure 15.1 shows the format of the five TFTP messages. (Opcodes 1 and 2 share the same format.) file:///D|/Documents%20and%20Settings/bigini/Documenti/homenet2run/tcpip/tcp-ip-illustrated/tftp_tri.htm (1 of 4) [12/09/2001 14.47.07] Chapter 15. TFTP: Trivial File Transfer Protocol Figure 15.1 Format of the five TFTP messages.
The first 2 bytes of the TFTP message are an opcode. For a read request (RRQ) and write request (WRQ) the
filename specifies the file on the server that the client wants to read from. or write to. We specifically show that this
filename is terminated by a byte of 0 in Figure 15.1. The mode is one of the ASCII strings netascii or octet (in
any combination of uppercase or lowercase), again terminated by a byte of 0. netascii means the data are lines of
ASCII text with each line terminated by the 2-character sequence of a carriage return followed by a linefeed (called
CR/LF). Both ends must convert between this format and whatever the local host uses as a line delimiter. An octet
transfer treats the data as 8-bit bytes with no interpretation.
Each data packet contains a block number that is later used in an acknowledgment packet. As an example, when
reading a file the client sends a read request (RRQ) specifying the filename and mode. If the file can be read by the
client, the server responds with a data packet with a block number of 1. The client sends an ACK of block number 1.
The server responds with the next data packet, with a block number of 2. The client sends an ACK of block number
2. This continues until the file is transferred. Each data packet contains 512 bytes of data, except for the final packet,
which contains 0-511 bytes of data. When the client receives a data packet with less than 512 bytes of data, it knows
it has received the final packet.
In the case of a write request (WRQ), the client sends the WRQ specifying the filename and mode. If the file can be
written by the client, the server responds with an ACK of block number 0. The client...
View Full Document
- Spring '12