Filetransfer is a project mainly written in Java, it's free.
filetransfer was a project written for a networking course to reliably transfer a file between two computers using UDP packets.
Before running sendfile and recvfile, ensure that sendfile.jar and recvfile.jar are in the same directory. The source files are located in src/filetransfer.
The syntax for running both programs are as follows:
./sendfile -r
All of the packets from the sender to the receiver use the following format:
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | Data Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | F | L | Flags | +-+-+-+-+-+-+-+-++ | Data | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
To initiate the transfer, a packet is sent from the sender with the name of the file and the listening port to return ACKs to.
All packets after that contain chunks of the file, identified by the sequence number.
To signify the end of a transfer, an empty packet is set with the Last Packet flag set in the header.