CS 725/825 Computer Networks, IT 725 Network Technology
Assignment 3
Due: Wednesday, October 28, 2026, 2:10 pm (start of the class)
Problems:
- (15 points) Analyze a trace of network traffic: a brief outline of the trace or a full decode of the trace (both are produced by command-line utility
tshark). If you have Wireshark installed on your computer, here is the capture file. Answer the following questions: - In a few sentences, describe the content of the trace.
- What is the name of the program that initiated the network traffic captured in the trace?
- What is the hostname of the machine where the command was executed?
- Which HTTP method was used?
- What was the result?
- (15 points) Explore a basic HTTP/1.1 protocol exchange using command-line utility
nc: - Connect to a web server, send a well-formed GET request and capture the server's response. You can see an example of an HTTP request/response in Problem 1. Briefly describe each line in the HTTP response. No need to analyze the document itself.
- Pretend to be a server and capture an HTTP request made by a browser. Briefly describe each line in the request.
- (5 points) Repeat the previous question, this time making the request over HTTPS. For that you either need to find a tool equivalent to
ncthat allows you to open a TLS connection or write a brief program that opens a secure socket and sends the HTTP request. As in the previous assignment, you are expected to type by hand or construct in your program the HTTP request header, so tools and libraries that do that for you (e.g.,curlor Python'srequests) are not allowed. - (5 points)
Calculate MD5 and SHA-512 hashes of the file
a2.html, the HTML description of the previous assignment (download it from https://www.cs.unh.edu/~cs725/assignments/a2.html). Give the commands used to calculate the hashes. - (5 points)
What are the first few bytes of the public key presented in the certificate used by https://www.unh.edu/? Who issued the certificate? Find a command-line utility to verify your answer (hint: use
-servernameoption). - (5 points) Find and test command-line commands that allow you to generate a public/private key pair, a certificate signing request, and a self-signed certificate. Do this for both RSA and Elliptic Curve key pairs. This will prepare you for the programming part of the next assignment where you will use those keys to establish secure connections.
You are expected to look up the meaning of the header lines that were not discussed in class, but there is no need to go beyond one sentence. nc, a.k.a. netcat, is just one example of a utility that can be used. socat is another popular one. telnet can be used for the first part. Any tool/method that allows you to see the entire HTTP request and response is fine.
Programming assignment:
- (50 points) The goal of this assignment is to have you implement a standard protocol from scratch. Study SMTP (the textbook has a good description; you can also look at RFC 5321 or Wikipedia article, which has a good example of a typical SMTP exchange). You are asked to implement a simple SMTP client in two different ways. Unlike in the previous assignment, you are not allowed to use any libraries or tools that would allow you to send a message without actually implementing the SMTP exchange.
- Using
ncandexpect(or an equivalent tool), write write a script that is as short as possible that delivers an email message by (partially) implementing an SMTP conversation. You are not expected to do any extensive error checking. You are not allowed to use any command-line utility for directly sending an email (e.g., themailcommand in Unix/Linux). The Wikipedia article onexpectprovides a few examples to get you started. For this part of the programming assignment, it is fine to hardcode the sender/recipient/subject/body in your program. - Rewrite the solution above using plain socket operations in a programming language of your choice. This time, you are expected to do elementary error checking (detecting an error, printing a message, and aborting the program is fine) and to allow for user-specified sender, recipient, subject, and body of the message that is being sent. The exact user interface is up to you, but you are not allowed to make the user type the SMTP commands. All you need to support is sending plain-text messages; no need to implement sending attachments or any other fancy features.
- Include a brief outline of the approach that you took and a sample run in your assignment submission. You must show representative runs of your programs together with appropriate explanations. Important: by showing an execution of your program, you are making a statement that your program, as submitted, works as shown. An attempt to "fake" a run, for example by writing a program that ignores input and just prints answers regardless of input, will be considered cheating. You may be asked to give a demo of your program. If your program does not fully implement the required functionality or does not work, you have to make it clear in the report.
- Commit the source code to your course Git repository (see instructions). Add brief instructions on how to compile/run the code to the assignment's
README.md. Do not commit data, graphs, documents, etc. into the repository. Don't forget to tag the commit asa3.
Technically, you can communicate with any mail server in this assignment; however, I would like to ask you to use the mail server running at berlioz.cs.unh.edu. This server is accessible only from UNH IP addresses. While there is nothing technically wrong with connecting to any mail server, typo-filled hand-typed sessions tend to trigger various security alarms. I have learned this the hard way when I assigned a similar question in the past and would like to avoid such problems this time around. There are additional constraints that will be described on Teams. Make sure that you read those before testing your code!
Tasks
Deliverables
Submission instructions:
Upload your submission as a single PDF file using myCourses (mycourses.unh.edu). Any source code used in the assignment must be committed to the course Git repository. More details can be found in the standard assignment submission instructions.