Question: Write a file transfer application using TCP sockets in Python. The file-transfer protocol will include a server called ftps.py and a client called ftpc.py. In
Write a file transfer application using TCP sockets in Python. The file-transfer protocol will include a server called ftps.py and a client called ftpc.py. In the following, we assume the client is running on beta.cse.ohio-state.edu and the server is running on gamma.cse.ohio-state.edu.1 First, start the server on gamma.cse.ohio-state.edu using the command:
python3 ftps.py Then, start ftpc.py on beta.cse.ohio-state.edu with the command:
python3 ftpc.py
The ftpc.py client will send all bytes of that local file. The ftps.py server should receive the file and then store it. Make sure that the new file created by ftps.py is in a different directory to avoid overwriting the original file since all CSE machines have your root directory mounted.
The file-transfer application will use a simple protocol. The first 4 bytes (in network byte order) will contain the number of bytes in the file to follow. The next 20 bytes will contain the name of the file (assume the name fits in 20 bytes). The rest of the bytes in the TCP stream to follow will contain the data in the file. Note that TCP is not packet-oriented, but it is stream-oriented. Submit well-documented code using the following command:
submit cl_c3461ac lab2
Your program should work for binary files (images, etc.) of arbitrary size. Chunk the file into pieces, each of which is at most 1,000 bytes. Submit a README.txt file with your lab. The client and server should be running on different machines on stdlinux (see the footnote). You can use the sample images on the course webpage to test your program. Use diff or md5sum to ensure
that the transferred file is the same as the original one.
1In your lab, you can substitute any machine on stdlinux (e.g., zeta.cse.ohio-state.edu or epsilon.cse.ohio-state.edu) for beta.cse.ohio-state.edu and gamma.cse.ohio-state.edu, respectively. You should do so to avoid overloading these machines.
FYI: stdlinux.cse.ohio_state is the server of linux environment in ohio state. The program may not necessary run on that machine. Just need the general answer of TCP implementation. I don't know how to use python to implement TCP. Thanks!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
