#Why is the Opcode for a TFTP packet 2 whole bytes?
The latest revision of the TFTP Standard, on the bottom of page 3, says that
The TFTP header consists of a 2 byte opcode field which indicates the packet's type (e.g., DATA, ERROR, etc.)
It later specifies that the Opcodes are 1-5:
TFTP supports five types of packets, all of which have been mentioned above:
opcode operation
1 Read request (RRQ)
2 Write request (WRQ)
3 Data (DATA)
4 Acknowledgment (ACK)
5 Error (ERROR)
Here's an example of a read request packet:
2 bytes string 1 byte string 1 byte
--------------------------------------------------
| Opcode | Filename | 0 | Mode | 0 |
--------------------------------------------------
Why is the Opcode 2 whole bytes? If my math is right, that means that you can put any number from 0 to 65536 65535 (2^16
) in that slot, but there are only 5 Opcodes. 1 byte can get you 256 (2^8
) slots. What is the point of all that space? Is there a more universal standard that specifies that they're following along with?
If I'm reading the standard correctly, the second byte will always be 0'd out?