Microsoft Word – CSE 3461 Au 21 Programming Lab.docx
CSE 3461
Computer Networking and Internet Technologies
Programming Lab– Autumn 2021
CSE 3461 – Autumn 2021 Page 1
Write a file transfer application using TCP sockets in Python (you may use another programming language but
please get my permission first). The file-transfer protocol includes a server called ftps.py and a client called
ftpc.py. ftpc.py runs on one computer system denoted System-1; ftps.py runs on a different system denoted
System-2. You may use the sample code I passed out early in the semester as a starting point.
To ease the lab description, assume that the client program is running on System-1 (arbitrary name for the sake
of this description) and the server program is running on System-2 (another arbitrary name for the sake of this
description). First, start the server on System-2 using the command:1
% python3 ftps.py
Then, start ftpc.py on System-1 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 (if
you use machines in the CSE labs they usually have your root directory mounted).
The file-transfer application will use a simple protocol. The first 4 bytes (in network byte order2) 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
stream-oriented, not packet-oriented.
Submit a README.txt file with your program and a copy of this lab description signed below, in a zip file on
Carmen. Your code should be well documented.
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. You should use a utility like diff or md5sum commands at the terminal to ensure that the
transferred file is the same as the original one.
In accordance with The Ohio State University Code of Student Conduct, I certify:
• that I have neither received nor given aid on this programming assignment; and
• that I shall not discuss the contents of this programming assignment with anyone in CSE 3461 until after
grades have been posted;
Name: ____________________________ Signature: ____________________________
1 Throughout this lab description, “%” indicates the shell prompt; do not type the % character
2 Please look up what this means as part of the assignment