Yes, I know I'm layering 4 protocols into one picture. That's not the point when you're implementing just TFTP.
| Offset | Length | Description |
|---|---|---|
| 0 | 6 | Ethernet destination |
| 6 | 6 | Ethernet source |
| 12 | 2 | Ethernet protocol (0x08, 0x00) |
| 14 | 1 | IP version, Internet Header Length (0x45) |
| 15 | 1 | IP Type Of Service |
| 16 | 2 | Total IP packet length (in bytes) |
| 18 | 2 | IP ID |
| 20 | 2 | 3 bits flags, Fragment Offset (bytes) |
| 22 | 1 | IP Time To Live (hops) |
| 23 | 1 | IP protocol (17==UDP) |
| 24 | 2 | IP header checksum |
| 26 | 4 | IP sender |
| 30 | 4 | IP destination |
| 34 | 2 | UDP source port |
| 36 | 2 | UDP destination port |
| 38 | 2 | UDP segment length |
| 40 | 2 | UDP checksum |
| 42 | 2 | TFTP opcode |
| TFTP RRQ/WRQ packet | ||
| 44 | .. | TFTP Filename |
| .. | 1 | '0' |
| .. | .. | TFTP Mode |
| .. | 1 | '0' |
| TFTP DATA/ACK packet | ||
| 44 | 2 | TFTP block # |
| 46 | .. | TFTP data (leave out for ACK) |
| TFTP ERROR packet | ||
| 44 | 2 | TFTP ErrorCode |
| 46 | .. | TFTP ErrMsg |
| .. | .. | '0' |