You are here: Home / Past Courses / Fall 2012 - ECPE 177 / Homework / Homework 1 - Application Layer

Homework 1 - Application Layer

There are three main problems in this homework assignment.  All answers can be found online with a little searching, so warm up your Google skills!

Submission information: This homework assignment is due at the start of class on the due date.  You must turn it in electronically via the companion Sakai website. Simply upload a document in PDF format, or type your solution directly into the Assignment submission box.


Problem 1 - Digging into DNS with Dig

Dig is a simple command line utility that allows you to query DNS servers for address information.  For this problem, we will be exploring the hierarchy of DNS servers.  Recall that DNS functions by referring requests from higher levels of the hierarchy to lower levels of the hierarchy that contain more specific information about a more limited subset of addresses.  To answer questions, use either the command line version of Dig (available on nearly all Linux or Unix systems), or use one of many free web interfaces that provide similar functionality.

  1. The Dig program often gets several different types of information from the DNS server, which are divided into three sections: (a) Answer, (b) Authority, and (c) Additional.  What do these section titles mean? What type of information goes there?   (Tip: and other online references can be used to learn more about Dig)
  2. Query the local (default) DNS server for the domain name
    1. What IP address(es) correspond to  (Tip: You can copy and paste an IP address into your web browser to confirm it is correct)
    2. What section of the output was this information contained in?
  3. Starting from one of many root DNS servers (which have names of the format [a-m], attempt to find the IP address for this server:  You will need to do several iterative queries, starting at one of the root DNS servers, and then moving lower in the hierarchy.  For your answer, you should show:
    1. The IP address of
    2. The hierarchy of DNS servers that you queried to find the IP address, numbered so that it is clear which server you queried first and last.
  4. Wait!  If I need to contact a root DNS server in order to start a query, and I only know root DNS servers by their domain names ([a-m], not IP addresses, don't I have a circular dependency problem?  How is this resolved in real systems?


    Problem 2 - HTTP Trace Decode

    The following sequence of ASCII characters was captured by Wireshark when a web browser sent a request to a web server. Both the request and response are shown. The characters \r and \n represent the carriage return and newline characters, respectively. Line breaks have been added after the newline to improve readability, but as originally captured, this was simply a continuous stream of characters!

    Request from web browser to web server:

    GET /About-Pacific/Newsroom/2012/April-2012/Students-to-Work-with-Fastest-Computers-in-the-World.html HTTP/1.1\r\n
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0.1) Gecko/20100101 Firefox/9.0.1\r\n
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
    Accept-Language: en-us,en;q=0.5\r\n
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n
    Connection: keep-alive\r\n
    Cookie: <omitted...>\r\n

    Response from web server to web browser:

    HTTP/1.1 200 OK\r\n
    Content-Length: 16036\r\n
    Content-Type: text/html\r\n
    Server: Microsoft-IIS/7.5\r\n
    X-Powered-By: ASP.NET\r\n
    Date: Sun, 26 Aug 2012 20:06:51 GMT\r\n
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">\r\n
    <html xmlns="" xmlns:fb="">\r\n
    <head><title>Students to Work with Fastest Computers in the World</title>\r\n
    <base href=""></base>\r\n
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />HTTP/1.1 200 OK\r\n
    <More characters followed - not shown in this output...>ƒƒ‚‚ƒ‚‚

    From both traces above, answer the following questions:

    1. What is the full URL of the document requested by the web browser? (include both the server name and document path)
    2. What version of HTTP is the browser using for this request? What version of HTTP is the web server using for the response?
    3. Is this HTTP connection persistent or non-persistent?
    4. What kind of web browser sent this request? Why does the server (potentially) need to know this information?
    5. What operating system was the web browser running on?
    6. What kind of web server answered the request?
    7. Did the server successfully produce the requested document? What type of document did the server say it is?


    Problem 3 - Protocol Documentation

    For this problem, you must chooseƒƒ‚‚ƒ‚‚ one protocol from the list below. ƒ‚‚ We have not discussed these protocols in class (in detail).

    Protocol NameOperations to Document
    IMAP An IMAP client application (1) connects to an IMAP server named, (2) provides the username myuser and password mypassword, (3) obtains a list of all mail folders available, (4) downloads the full text of message number 15 from the folder with the name Inbox, and (5) disconnects from the server.
    FTP An FTP client application (1) connects to an FTP server namedƒƒ‚‚ƒ‚‚, (2) provides the usernameƒƒ‚‚ƒ‚‚ myuser and passwordƒƒ‚‚ƒ‚‚ mypassword,ƒƒ‚‚ƒ‚‚ (3) changes to the directory /my/test/data/ on the server, (4) obtains a list of files in that directory, (5) downloads the file datasamples.txt using the normal active ASCII mode, and (6) disconnects from the server.

    After picking one protocol, you should complete the following tasks:

    1. Provide a one paragraph description of the protocol that answers the following questions:
      1. What does the protocol allow an application to do?
      2. What important features does it provide to accomplish that task?
      3. What makes this protocol better or worse compared to its competitors?
        (The competition in this case is other email protocols (e.g., POP) or file transfer protocols (e.g., SFTP))
    2. Provide a step-by-step trace of the protocol that shows, in detail, how the protocol accomplishes the operations specified above. Your trace should be clearly labeled so that the grader can easily tell which computer is sending out which message (e.g. which are messages are sent by the client, and which are sent by the server), and the order in which messages are sent. ƒƒ‚‚ƒ‚‚  When needed, use reasonable fictional data for your trace. Note that real protocols are complex! For this problem, just focus on the essential parts of the protocol necessary to complete the desired operations. You can ignore optional features and still receive full credit.


    Warning! This problem focuses on the protocol, **not** the application. For example, don't tell me how to use Microsoft Outlook to check my email!  Instead, tell me how the IMAP protocol enables Microsoft Outlook and other email programs to contact a server and obtain a list of email messages.

    Here is an example of an acceptable answer for the HTTP protocol, which we have already discussed in class.

      Operation to document: Download the file

      To retrieve the file at the URL

      the client first opens a socket to the hostƒ‚‚, port 80 (use the default port of 80 because none is specified in the URL). Then, the client sends the following data through the socket:

      GET /path/file.html HTTP/1.0
      [blank line here]

      The server should respond with the following header and data, sent back through the same socket:

      HTTP/1.0 200 OK
      Date: Fri, 31 Dec 1999 23:59:59 GMT
      Content-Type: text/html
      Content-Length: 1354
      <h1>Happy New Millennium!</h1>
      (more file contents)

      After sending the response, the server closes the socket.