A2 - TCP Trace Analysis
Last updated
Last updated
Packet analysis is a commonly used methodology in computer networks for debugging networked software. Think of it as the debugger for sending data over the network, but instead of breakpoints and stacktraces, we are faced with packets and metadata.
In this assignment, you will use your chat client to track and trace your connection with the server and observe the intricacies of the TCP connection. Because TCP is designed to be reliable, it has several mechanisms to keep track of in-order packet delivery and guaranteed delivery. We want you to explore these features hands-on by taking a look at how the chat client communicates with the server using this transport layer protocol. To this end, you will run your chat client and analyze the TCP traffic using Wireshark, a packet analysis tool. Capture the traffic between your client and the server and answer the questions.
To start capturing packets, you must first select the network interface you want to listen on. Since your client and server will be running locally (i.e., never actually going on the internet), you must select the loopback (lo
) interface.
Once that is done, you might see a lot of data flowing in and out of your network. To avoid clutter, make sure to filter packets based on the port of the connection of interest. In our case, the client and server will communicate over port 5378.
Firstly, make sure you have the conda environment enabled, by checking whether the prefix (computer-networks-lab)
is present in front of your shell prompt. If it is not, please refer to the section to learn how to enable the conda environment.
To start the server, open a new terminal and execute the following command:
The server should remain open while you are performing the analysis. Finally, open up several new terminals to create new clients using your implementation of the . You may open a new client instance using the command:
To complete the assignment, you must answer the following questions in a PDF document, which you will submit in CodeGrade. While performing the analysis, please keep track of the steps you took to record and obtain information about packets.
You must save the trace files obtained as a result of your packet analysis, to be later opened with Wireshark during the TA evaluation. Do not upload these files on CodeGrade nor embed them in your PDF document.
In your submission, include for all questions both the answer and a comprehensive explanation of the procedure used during analysis to obtain the answer. You may include screenshots, steps, difficulties, challenges, and discoveries encountered towards obtaining the answer. Every question must be answered under a clearly separated title in your document.
Which segments perform the TCP connection handshake between client and server? How can you tell?
What are the initial (absolute) sequence numbers of the client and server? Is this expected behavior? Why?
Which bytes in the TCP segments represent the chat message data? How can you find out?
Which flags are used in segments that carry chat messages?
Where in the trace are the segments that carry chat messages acknowledged by the TCP protocol? Where are they acknowledged by the (chat) application?
How do the sequence and acknowledgment numbers change during the trace? Is this expected?
Which segments close the TCP connection? How can you tell?