The upload is also simple, requiring only four packets for tiny files.
The client begins by sending a write request using TFTP opcode 2,
telling the server it wants to upload R3.cfg.
This is similar to a read request, except the opcode is 2 instead of 1.
Notice that the UDP layer 4 port allocation works the
same for uploads and downloads.
The client sends this control message on UDP port 69 with a
random source port towards the server.
The second packet is an acknowledgement from the server back to the client.
By acknowledging block 0,
the server tells the client it is clear to upload the file.
I'm drilling into the data transfer from client to server.
Notice the UDP port selection.
The source port used by the client is the same one used for the control session,
namely 33183.
The destination port of 35670 was the dynamic source port allocated by
the server when the previous acknowledgement was sent.
As expected, we can see the file contents at the bottom of the screen,
which is proof that the file is being transferred.
Finally,
the server acknowledges that the upload operation was complete and sends a message back, indicating success.