In this homework, we will learn how to log and analyze network packets.
Learn how to use WireShark to log and view wireless packets.
1. Write a simple Python TCP server (server.py) and a TCP client (client.py). The client sends random data to the server back to back with a inter-packet wait duration (in ms) and message size (in bytes) specified on the command line. The server sends a copy of the received the packet to the client immediately upon receiving the packet from the client. You are welcome to modify your hw1 code for this purpose or feel free to obtain starter code online. If you use starter code from online, please acknowledge the source of the starter code.
python client.pywait 10 length 20 Sending packet 1 packet size 20 Waiting 10ms Sending packet 2 packet size 20 Waiting 10ms ...
python server.pyReceived packet 1 size 20 Sending packet 1 size 20 Received packet 2 size 20 Sending packet 2 size 20 ...
2. Run WireShark on your machine and capture two-minute packet trace packets exchanged between your client and server. Start the server at T=0s. At T=30s, start one client with a wait interval of 20ms and packet size of 20 and 2000 bytes (one experiment per packet size). At T=60s, start the second client with a wait interval of 40ms and same packet size as the first client for each experiment. At T=90s, terminate the first client. At T=110s, terminate the second client.
3. Perform two types of analysis. For the packet trace show some basic statistics about different types of packets captured and their numbers. Then, show the plot of total (cumulative) number of TCP packets as a function of time. Your x-range should be from 0 to 120s. Show with a vertical line T=30s, T=60s, T=90s, and T=110s on the plot.
4. Collect a 2-minute packet on your machine. About 30 seconds into the experiment, you can load a YouTube video and start streaming. Then about 30 seconds before the end of the experiment, you can close the YouTube window.
5. Perform two types of analysis. For the packet trace show some basic statistics about different types of packets captured and their numbers. Then, show the plot of total (cumulative) number of TCP packets as a function of time. Your x-range should be from 0 to 120s. Show with a vertical line when the YouTube video started streamining and when it stopped streaming.
Please upload your code using git invitation for hw2. Include responses to the questions above as a single pdf with the name hw2report.pdf. Please show the exact command you used and a few lines of packet trace in the report and upload the complete packet trace to the repository.