The TFTP WRQ (Write Request) message type is used by the client to establish a connection for writing a file from the server. Following image shows the structure of TFTP WRQ (Write Request) packet format.
Following are the fields of TFTP WRQ packet.
- Opcode : Opcode field of TFTP WRQ (Write Request) packet is 16-bits (2-bytes) in length. TFTP WRQ packets have an opcode of "2".
- Filename : The TFTP WRQ (Write Request) packet has a file name, which is name of the file requested. File name is string of variable size. File name is a sequence of ASCII (American Standard Code for Information Interchange) bytes.
- All 0s : Filename is terminated by a byte of all zeros. Since the filename field is variable in length, a byte of all 0s indicates the end of filename.
- Mode : Mode is another variable length field in TFTP WRQ packet. Mode field contains information about the data transfer mode. Three modes of data transfer are netascii (file is transferred as lines of characters for an ASCII file, each terminated by a carriage return), octet (raw 8-bits) and mail (for sending files to an email address).
- All 0s : The end of TFTP WRQ packets is with a byte length field of all 0s.
Following image shows a Wireshark packet capture screeshot of TFTP WRQ packet.