CSE 40771 - Distributed Systems - Spring 2026
In this assignment you will be taking more measurements. This time you will measure the throughput of network communication using different transport methods and packet sizes. This assignment will also be a good refresh/primer on socket programming, which we will be doing more of later on.
We will be testing TCP and UDP which are the two major transport layer protocols. The major distinction between the two is that TCP requires a bi-directional “connection”, where UDP is transmitted in one direction without a guarantee of delivery.
This page and related documentation for the python socket module is worth looking over to start, and may be a useful reference if you run into problems.
To begin, you will need to do the following:
TCPClient.py to the TCPServer.py.
Send 10-20MB of data from the Client to the Server.You can use any variation of send() which includes a buffer length as an argument. Do not use sendall, as we will modify the buffer size later.
Do the same for UDP with UDPClient.py and UDPServer.py. You do not make a “connection” as with TCP, so make sure the server is actually receiving the right amount of data.
For both TCP and UDP, after sending the data the server should respond with an acknowledgement. Have the client wait for this message before continuing.
You will quickly run into the fact that the server does not know how much data it meant to receive in one message. Normally a message contains the length of data to expect. At this point it is ok for you to simply write fixed length buffers in your code or some other “easy” solution.
You may have discovered for UDP that there is a limit to the size of data you can send in a single call to sendto. You will have to send the data in pieces over multiple transmissions. The same is also true for TCP behind the scenes, however the OS is smart enough to chunk your data for you.
Now that you have data moving, we will start to modify the buffer size used in a single call to send for both TCP and UDP. Smaller buffer sizes will result in a greater amount of send calls, and larger buffers result in fewer.
Modify the Client and Server programs so they send the data several times using an array of different buffer sizes in a single invocation. Use a range of buffer sizes from 2^1 to 2^12 (2-4096).
With your Client and Server programs on separate student machines, use the time module to measure the time it takes to transmit the data with each buffer size.
Your Client and Server programs must be able to run on the student machines. They should be invoked only with the following arguments:
(TCP/UDP)Server.py port
(TCP/UDP)Client.py hostname port
When the client connects to the server it will run a test for each buffer size. Printing the test results to standard output.
student01:~$ python Server.py 1234
student12:~$ python Client.py student01 1234
Method: TCP bufsize: b elapsed time: t
Method: UDP bufsize: b elapsed time: t
Method: TCP bufsize: b*2 elapsed time: t
.
.
REPORT. Below your writing print your result data. Each test result should state the method, buffer size, and elapsed time.In your distsys GitHub repository under the a2 directory, commit and push the following files:
Client/Server programs.REPORT file containing your observations and test results.Draft a release titled a2 per the general assignment instructions.
See the general instructions for how to turn in your materials.