Due: Tuesday, April 6, 2021, 11:59 pm

Tasks

Problem Set:

  1. Analyze this trace and answer the questions. Make sure that you point to a specific piece of information in the trace that you used to answer the questions.
    1. Describe the application-layer activity captured in the trace.
    2. What version of HTTP is being proposed for the session by the client?
    3. Does the server agree with the version? How?
    4. What is the client requesting?
    5. How long does it take for the server to respond?
    6. Describe the client application.
    7. What is the purpose of the DNT: 1 directive?
    8. Is the client requesting a persistent connection? How?
    9. Is the server granting a persistent connection?
    10. Describe the server software. What is the common name of this server software?
    11. Does the server permit caching of the document?
    12. What is the MIME type of the returned document. Does it match the filename extension?
    13. Is the returned document in proper HTML format?
    14. What are the first few characters of the returned document?
    15. Does the server have the correct wall time? Assume the trace timestamps are correct.
  2. Finish the following questions in Chapter 2 and Chapter 8 of the textbook
    • Chapter 2, Problems - P2
    • Chapter 8, Homework Problems and Questions - R1

    You can also find the above questions here (Colby IP needed)

  3. Calculate MD5 and SHA-1 digest of p2.html, the HTML description of the previous assignment (download it from https://cs.colby.edu/courses/S21/cs331/projects/p2.html). Note: you are expected to use tools to finish this task. You don't need to implement the algorithms.
  4. What are the first few bytes of the public key in the certificate used by https://colby.edu/? Who issued the certificate?

Programming assignment:

In this question you are asked to implement a web-based prefix calculator similar in functionality to the one that you implemented for Project 1. Since this is not an exercise in web page development, the HTML for the solution is provided and should not be modified. A static (the AJAX request in the page results in a fixed response regardless of its parameters) example of the page can be found here. The page served in the trace can be downloaded from p3/formnjs.html. Using curl or wget is the easiest way to get the file to your account on gloin. Node.js has been installed on gloin. If you have node.js installed on your machine, you can work on your machine.

Write a node.js server that: serves the provide page formnjs.html, responds to the AJAX GET /prefcalc request from the page by returning JSON-encoded results of the prefix calculation, and returns HTTP 404 Page Not Found status code for any other request. You can reuse the Python or Javascript IP calculator you implemented in project 1 by letting the node.js server trigger the script when needed. As with any servers, it is very likely that your implementation contains significant security holes that can be easily exploited. For that reason, do not leave your code running longer than it is necessary for testing. This is also the reason why the example page uses no active components on the server side.

Extensions

  1. Modify the HTML file so that the functionality is provided by a client-side script embedded in the page. For that you need to remove the AJAX call to the server and replace it with a JavaScript version of the code that you wrote for Assignment 1.
  2. Implement the server in the programming assignment using a different lagnague (e.g., Python).
  3. The provided HTML file in the programming assignment can check errors such as values out of range. How does the HTML implement this error checking?
  4. Any interesting extensions you have not tried before.

Submission

Please follow the submission instructions to turn in your work. You may have difficulty submitting this project due to the JS code. If so, please upload your code archive to Google Drive and share it with me.

© 2021 Ying Li. Page last modified: .