Search for question
Question

Computer Networking Coursework Assignment Birkbeck, University of London Academic Year 2023/24 Deadline: 17/03/2024, 23:55 UTC General information • The coursework assignments for Computer Networking will be graded with a mark between 0 and 100; the coursework mark counts for 50% of the total grade for this module. The remaining 50% will result from the mark of a written examination. ⚫ The coursework is to be completed in four parts and must be submitted during term time by the 17th of March, 2024. The following table shows the marks awarded as well as a suggested completion date for each part. Part no. Topic Suggested date Marks 1 Querying the DNS with nslookup 22/02/2023 20 2 TCP segment analysis 29/02/2023 20 3 UDP packet analysis 07/03/2023 20 4 Socket programming 14/03/2023 40 • You should follow carefully the instructions regarding each part, including those regarding the formatting (which are not difficult to follow). • • The coursework report (for all four parts) must be submitted in a single PDF file (no Microsoft Word or other formats), plus two Python files for Part 4. You must upload all the code and documentation (two source files for client and server, plus one PDF file for the report) in a Zip file named according to the following template: surname_name_id.zip. All late submissions will be capped according to the regulations, unless a Mitigating Circumstances claim is approved. You are strongly encouraged not to submit at the very last minute, so as to avoid technical problems which may cause a late submission. 1 1 Querying the DNS with nslookup You need to use the program nslookup and perform the following tasks. 1. Consider the domain name cs.nyu.edu and query with nslookup your local server, asking for the address associated to said name. What type of query do you need to send? Report the obtained answer and the IP address associated to the name you chose. State whether the an- swer is authoritative, and briefly explain what an authoritative answer is. (2 marks) 2. What DNS server returned the answer at the previous task? Give its IP address as shown in the answer. Is the DNS server in question the router (also acting as DNS server) of the LAN you are connected to? Justify your (2 marks) answer. 3. Determine the IP address of cs.nyu.edu with an authoritative answer. Hint: you first need to determine the DNS server that has authority on the relevant zone. (4 marks) 4. Determine again the IP address of cs.nyu.edu with nslookup, but by- passing your local DNS server and running an iterative query as a DNS server would, until you get an authoritative answer. Hint: Having to work without your local DNS server, in this exercise you need to start from one of the root servers. If a server returns no answer to the default Type A query, ask the same server for a relevant DNS server by means of a NS-Type query. (12 marks) All outputs from the execution of nslookup are to be included either as screenshots or as text that is copy-pasted from the shell window - in the latter case, use a fixed-width (a.k.a. monospaced) font such as Courier. Do not rely solely on the screenshots (or pasted text) for your answers; instead, give the answers alongside a brief justification for them. • This assignment awards up to 20 marks. • The suggested completion date for this part is the 22nd of February, 2024. 2 2 TCP segment analysis Download the text file at the link below while capturing TCP segments with Wireshark; store the packets in a trace. Alternatively, download the relevant trace from the Moodle page of the module and analyse that with Wireshark. https://www.gutenberg.org/files/25791/25791-0.txt 1. By analysing the segments with Wireshark, identify the IP ad- dress and TCP port number of both your client computer and of www.gutenberg.org. (4 marks) 2. What is the sequence number of the TCP SYN segment that is used to initiate the TCP connection between the client computer and www.gutenberg.org? What part of the segment identifies it as a SYN (8 marks) segment? 3. What is the sequence number of the SYNACK segment sent by www.gutenberg.org to your client computer in reply to the SYN? What is the value of the ACKnowledgement field in the SYNACK segment? How did www.gutenberg.org determine that value? What is it in the segment that identifies the segment as a SYNACK segment? (8 marks) For this part you need to include at least one screenshot per question (at least three in total), showing all the information you used to answer the question. Do not rely solely on the screenshots for your answers; instead, give the answers alongside a brief justification for them. • This assignment awards up to 20 marks. • The suggested completion date for this part is the 29th of February, 2024. 3 3 UDP packet analysis Run a DNS query with nslookup while capturing UDP packets with Wireshark; store the packets in a trace. Alternatively, download the relevant trace from the Moodle page of the module and analyse that with Wireshark. 1. Select one UDP packet from your trace. From the packet you chose, determine and state how many fields there are in the UDP header. Do not look at the textbook - instead, answer by looking at the trace through Wireshark. Give the name of said fields. (5 marks) 2. From the information displayed in Wireshark's packet content field for the chosen packet, determine the length (in bytes) of each of the UDP header fields. (5 marks) 3. By looking at Length field (see question 2 above), state the maximum length (in bytes) of the payload of a UDP packet. (3 marks) 4. Examine a pair of UDP packets in which the first packet is sent by your host and the second packet is a reply to the first packet. Describe the relationship between the port numbers in the two packets. (7 marks) For this part you need to include at least one screenshot per question (at least three in total), showing all the information you used to answer the question. The screenshot need to demonstrate that you derive your answers from running Wireshark rather than from other sources. Do not rely solely on the screenshots for your answers; instead, give the answers alongside a brief justification for them. . This assignment awards up to 20 marks. • The suggested completion date for this part is the 7th of March, 2024. 4 Socket programming To complete this assignment you are required to write two programs (client and server) in Python, that implement the game' described below. The game is between two instances of the client who play against each other using the server2. Each player sends an integer between 0 and 9; if the two numbers differ by 3 or less, the player who sent the higher number wins; instead, if the two numbers differ by 4 or more, the player who sent the lower number wins. If the two numbers are equal, there is a draw. All messages have to be sent/received using the TCP protocol. Client The client has to be coded according to the following specification. • At startup, the client prompts for an integer number I between 0 and 9 from the user. • The client connects to the server (via TCP) and sends I; then it listens for an integer N which can be 0, 1 or 2. • Upon receiving N, the client prints "You win!" if N = 1, "You lose!" if N = 0, or "Draw!" if N = 2. • Finally, the client disconnects from the server. Server The server has to be coded according to the following specification. • The server waits for connections. • Once two connections are established upon request of the clients (say Client 1 and Client 2), the server waits for integer numbers I₁ and I2 from Client 1 and Client 2, respectively. • The server receives I₁ and 12 from Client 1 and Client 2, respectively, in any order. • • • The server determines the winner as follows. If the two numbers are equal, there is a draw. If the two numbers differ by 3 or less, the player who sent the higher number wins; instead, if the two numbers differ by 4 or more, the player who sent the lower number wins. If there is a draw, the server sends the integer 2 to both clients; otherwise it sends the integer 1 to the winner client and 0 to the loser client. 'The game is not intended to be interesting or entertaining; it serves mainly for this coding exercise. However you can try and play it. 2In principle the server could allow several games in parallel, each played by a pair of client instances, but for the purpose of this assignment the server is only required to manage one game at a time. 5