Reliable Files Transfer
The source code and some specifications will be omitted per UCSC’s policy.
During the Winter 2025, I had a chance to take a network programming class of CSE156. One of my favorite’s class assignments was to create a program transferring files over UDP socket. The goal was to learn the importance and the reason why each TCP field exists, since the assignment forced me to basically reimplement a reliable protocol over unreliable transport link from scratch. The result was a packet structure that is similar to TCP packets, and control flows that assembled TCP.
Challenges
🔗- Make a reliable transferring over unreliable transfer protocol (UDP).
- Each UDP packet size must be lower than a specific number.
- Can handle dropped packets, duplicate packets, unordered packets.
- Can handle multiple transfers at once, so multiplexing.
- Must be relatively fast for large files, so keeping an entire 1GB file buffer inside memory is out of the equation.
Stack
🔗C++ with standard library only. Writing on UDP must be done on socket-level only.
Additional notes
🔗Not only did I learn more on socket programming and TCP, I also learned how to handle buffers. With many layers of abstraction and fragmentation from limited packet size, constructing partially complete buffer with interactiveness is a must.