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.
- 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: http://www.madboa.com/geek/dig/ and other online references can be used to learn more about Dig)
- Query the local (default) DNS server for the domain name kernel.org
- What IP address(es) correspond to kernel.org? (Tip: You can copy and paste an IP address into your web browser to confirm it is correct)
- What section of the output was this information contained in?
- Starting from one of many root DNS servers (which have names of the format [a-m].root-servers.net), attempt to find the IP address for this server: ecs-network.serv.pacific.edu. 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:
- The IP address of ecs-network.serv.pacific.edu
- 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.
- 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].root-servers.net), 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
Host: www.pacific.edu\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
\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
\r\n
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r\n
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">\r\n
<head><title>Students to Work with Fastest Computers in the World</title>\r\n
<base href="http://www.pacific.edu/"></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:
- What is the full URL of the document requested by the web browser? (include both the server name and document path)
- What version of HTTP is the browser using for this request? What version of HTTP is the web server using for the response?
- Is this HTTP connection persistent or non-persistent?
- What kind of web browser sent this request? Why does the server (potentially) need to know this information?
- What operating system was the web browser running on?
- What kind of web server answered the request?
- 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 Name | Operations to Document |
---|---|
IMAP | An IMAP client application (1) connects to an IMAP server named imap.example.com, (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 ftp.example.com, (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:
- Provide a one paragraph description of the protocol that answers the following questions:
- What does the protocol allow an application to do?
- What important features does it provide to accomplish that task?
- 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)) - 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 www.somehost.com/path/file.html
To retrieve the file at the URL
http://www.somehost.com/path/file.html
the client first opens a socket to the host www.somehost.com, 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 <html> <body> <h1>Happy New Millennium!</h1> (more file contents) . . . </body> </html>
After sending the response, the server closes the socket.