CS 725/825 Computer Networks, IT 725 Network Technology

Assignment 4

Due: Wednesday, November 14, 2018, 2:10 pm (start of the class)


  1. (5 points) Calculate MD5, SHA-1, SHA-256, and SHA-512 hashes of a3.html, the HTML description of the previous assignment (download it from http://www.cs.unh.edu/~cs725/assignments/a3.html). Describe the commands used.
  2. (5 points) What are the first few bytes of the public key presented in the certificate used by https://www.cs.unh.edu/? Who issued the certificate? Use command line commands to verify your answer.
  3. (40 points) Consider the trace https://www.cloudshark.org/captures/edfcc6f32285. The trace is based on the same packet capture as the trace in the previous assignment, only with more packets included. This time focus on the TCP layer:
    1. Show the absolute starting sequence numbers in each direction. It is fine to give a hex value.
    2. For the first 10 packets, give their main purpose (e.g., SYN-ACK, DATA, ACK, etc.) and sequence and acknowledgment numbers (it is OK to give values relative to the start of the connection).
    3. Can you see the connection being closed in the trace?
    4. On both client and server sides, indicate the TCP states (label the time axis of the time-space diagram with the state names).
    5. What was the total number of bytes sent from client to server?
    6. What was the total number of bytes sent from server to client?
    7. How long did the SMTP transaction take, including the TCP connection open?
    8. Identify few pairs of packets that could be used to estimate the round-trip time (RTT) both by the client and the server. List the observed RTTs and try to estimate the network latency.

Programming assignment:

  1. (50 points) The goal of this assignment is to re-implement the programming part of Assignment 2 as a simple web-based solution that allows you to measure the offset between the clock on the system that runs a browser and a web server. The idea for this problem was inspired by website http://time.is/ that among other information shows how much ahead or behind the clock on your computer with respect to the clock on the time.is server (which is presumably synchronized with UTC). An example run could be as follows, the server-side code is started on agate on port 25001; then a browser is opened on a computer and http://agate.cs.unh.edu:25001/time.html typed in the address box. As a result, a page with a button is displayed. When a user clicks on the button, a script embedded in the page sends (and times) a request sent back to the server and displays the result:

    screen shot

    More specifically, after the button is clicked, the page takes note of the current time t1, sends a request back to the server, the server notes the time the request arrived t2, prepares the response, gets the time the response is ready to leave t3, and sends both t2 and t3 back to the browser as a JSON-encoded object. The browser notes the arrival time of the response t4 and calculates the round trip time (RTT) as (t4 - t1) - (t3 - t2), and the clock offset as (t1 + RTT/2) - t2:

    timing diagram

    In this assignment, you are required to create your own webserver. You are not allowed to use any existing web server, such as Apache, however, you are free to use libraries, frameworks, etc. JavaScript-based node.js or Python Flask are examples of tools that you should consider using.

    This is one of the assignments where the solution is much shorter than the description. My own solutions in JavaScript or Python, that could be further shortened, are each less than 30 lines. Some of the code was shown in class as an example. If your code grows significantly beyond this, you are on a wrong track. Make sure that you read and understand instructions before writing code.

    At the most basic level, you are writing a web server that on receiving request for /time.html serves the page that you will find in folder a4 of your repository (you must pull updates from the upstream first). If it receives request for /servertime, it responds with JSON-encoded timestamps (given as integers in milliseconds) taken by the server (e.g., {"t2":1540383416014,"t3":1540383416014} was sent in the screenshot above) labeled in the HTTP header as Content-Type': 'application/json. Finally, it must return the HTTP 404 error code for any other request.

    The source code for the programming part of the assignment must be committed to your course Git repostory.

Submission instructions:

Upload your submission as a single PDF file using Canvas (mycourses.unh.edu). More details can be found in the standard assignment submission instructions.