Due: Thursday, March 27, 2014, 8:10 am (start of the class)

Problems:

  1. (15 points) Textbook (6th ed.), Chapter 2. Problems P4, P5, and P6 (pages 171-173).
  2. (20 points) The following trace contains a capture of two DNS queries (pcap file download: cs725-s14-a2.pcap, CloudShark: https://www.cloudshark.org/captures/8acd4a24c8b4) Describe broadly the content of queries and responses. What are the time to live (TTL) values for the hostname responses (not for the name servers)? Why such a big difference?
  3. (20 points) Write a short Python script that measures the time it takes to do DNS name resolution. It takes less than 10 lines of straightforward code so it should be easy even if you have never touched Python. Methods socket.gethostbyname('example.com') and time.time() are your friends and so is Google. Use the script to test the DNS response time for the website hostnames of a mix organizations. Try major brands vs small ones, large research universities vs regional community colleges, US versus foreign organizations. Write a bries discussion of your findings.

    Important: Don't forget that DNS queries are cached so you have just one shot at each place unless you want to wait for the cached entry to expire which can take a day or more for some sites. If you see sub-millisecond resolution time, you are talking to a cache. Also think of all other network traffic that originates from the host. Having www.unh.edu open in a browser most likely means that an IP address for it is in the cache. Use different hostnames for testing and for the final experiment. The more obscure place you pick the less likely it is cached.

  4. (5 points) Can you find an IPv6 address of Facebook? This should not be an exercise in Googling the answer. Show the command that you used.
  5. (40 points) Study SMTP (the textbook has a good description, you can also look at RFC 5321 or Wikpedia article, which has a good example of a typical SMTP exchange). The goal of this part of the assignment is try to directly communicate with an MTA pretending to be another MTA sending a message.

    All students: From a computer with a UNH IP address (this is important), connect to the mail server running at berlioz.cs.unh.edu on port 25 using nc (or a telnet client, note that telnet is not installed on agate to discourage people from using it for remote access) and pretend to be an MTA delivering a message addressed to cs725 AT cs.unh.edu. Use subject "SMTP test" and make sure that you are identified in the body of the message. Capture the session and turn it in as a part of the assignment paper. Technically, you can use any mail server for the assignment, however, I would like to ask you to use the one specified above. While there is nothing technically wrong with connecting to any mail server, typos-filled hand-typed sessions tend to trigger various security alarms. I have learned this the hard way when the course was offered in the past and would like to avoid such problems this time around.

    All students: using berlioz.cs.unh.edu as the mail server, send an email with a fake "From" address to yourself and analyze its full header. Point out all the information that may indicate that the message did not originate from a legitimate source.

    CS students: write as-short-as-possible program that delivers an email message by (partially) implementing the SMTP conversation. You are not allowed to use any library for sending email (e.g., javax.mail). Take a look at the quick intro to Python network programming in the textbook - that might be the quickest way to get this part done.

    IT students: write as-short-as-possible script that delivers an email message by (partially) implementing the SMTP conversation. You are not allowed to use any command or utility for direct sending of email (e.g., the mail command in Unix/Linux). Basic shell, nc and expect are probably good starting points in your search for the right tools.

    Other majors: you can pick either the CS or the IT option.

Submission instructions:

Follow the standard assignment submission instructions.

Make sure that you read, understand, and follow the instructions. If you have any doubts, ask. Scans of handwritten submissions will no longer be accepted.