Experimenting with Application Protocols

Due date

Monday, February 13, 2012

Introduction

In this assignment, you will use the telnet program to experiment with text-based application protocols, including HTTP and SMTP. In the first part, you will use the telnet program to contact a web server and request a page. In the second part, you will contact an SMTP server and send an email. In the third part, you will investigate another text-based application protocol and contact it using telnet. In each case, the server will not know that a human controls one end of the connection; you must follow the application protocol exactly to obtain the desired result.

In the fourth part, you will explore the use of DNS resolution tools.

Goals

Acknowledgments

Parts A, B, and C are based on experiments 3.2 and 3.3 in Hands-On Networking with Internet Technologies by Douglas Comer (2nd edition, 2005). Part D is based on problems in chapter 2 of Computer Networking: A Top-Down Approach by Kurose & Ross (5th edition, 2010). Some discussion questions are taken from Computer Networks: A Systems Approach by Peterson & Davie (3rd edition, 2003).

References

Logistics

Each student should complete this assignment and write it up in his or her lab notebook. However, you may discuss the material with whomever you wish. You may obtain help from anyone you wish, but you should clearly document that help.

You have one week to complete this assignment.

Lab Notebook Issues

For each step in the laboratory assignment, either explain what you saw or answer the question.

Also include your answers to the discussion questions at the bottom.

Assignment

Part A: Use telnet to retrieve a web page

  1. Determine how to run the telnet program on your computer. At a minimum, telnet takes the name or address of a remote computer to connect to. In this assignment, you will also want to specify an integer port number that specifies the application on the remote computer.

  2. Use telnet to connect to www.cs.grinnell.edu. The HTTP server listens for incoming connections on port 80.

  3. Kurose & Ross give the general form of an HTTP message and some examples of request messages. Using this information, request the index page for the host www.cs.grinnell.edu. Verify that the server returns an HTML document, and then closes the connection (i.e., after displaying the text of the page, the telnet program exits.)

  4. What do you expect to happen if you request a web page that does not exist? Why? Try it and find out.

  5. Try using the HEAD operation to request metainformation about the index page for the host www.cs.grinnell.edu. How is the server's reponse similar to its response in task 3? How is the response different? How is the HEAD operation useful?

  6. Try making an HTTP request to delete a page. What happens? 

Part B: Use telnet to send an email

  1. mail.cs.grinnell.edu is running an SMTP server on port 25. Use telnet to contact the SMTP server, using mail as the name of the remote computer. The computer will respond by sending an identification.

  2. Following the example in Kurose & Ross, type appropriate SMTP commands to send yourself an email. Use your own email address for both the sender address and the recipient address. When you are done, close the connection.
  3. Verify that you received the email message.

  4. Not all SMTP servers require the HELO command to authenticate the sender. Does this server?

  5. What do you think will happen if the RCPT TO command names a user that does not exist, such as obamabar@cs.grinnell.edu? Why? Try it and find out.

  6. What do you think will happen if the MAIL FROM command names a user that does not exist? Why? Try it and find out.

  7. What do you think will happen if the MAIL FROM command names a user on another domain, such as president@whitehouse.gov? Why? Try it and find out.

Part C: Investigate and experiment with another text-based protocol

  1. Internet Relay Chat (IRC) is a popular text-based protocol that is not covered by our textbook. Search the web for information about its purpose and history, and write a one-paragraph description with appropriate citations.
  2. Identify an IRC server you can connect to. You will need to know the server's name and port number. You will also want to find the name of an IRC channel that is appropriate for experimentation (i.e., where you won't annoy the other users).

  3. Find the most recent RFC(s) defining the Internet Relay Chat (IRC) protocol. Read about the protocol architecture and messages.

  4. Based on what you read, make yourself a "cheat sheet" listing messages to accomplish the following tasks. Don't just write the name of the message; try to figure out what parameters you will use as well.

  5. Using telnet, connect to the server and port you identified. Send appropriate messages to carry out the above tasks. (Ted Cooper '09 suggests that you type the registration commands in a text editor and copy-paste them into telnet.)

  6. In your own words, explain the purpose of the PING and PONG messages.

Part D: DNS

  1. What is a whois database?

  2. Use various whois databases on the Internet to obtain the names of two DNS servers. Indicate which whois databases you used.

  3. Use nslookup on your local host to send DNS queries to three DNS servers: your local DNS server (the default) and the two DNS servers you found above. Try querying for type A, NS, and MX records. Summarize your findings.

  4. Use the ARIN whois database to determine the IP address range used by Grinnell.
  5. Read the man page for the dig tool. How is it different from nslookup?

  6. Using dig and starting with a root DNS server (from one of the root servers [a-m].root-servers.net), initiate a sequence of queries for the IP address of www.cs.grinnell.edu. Show the list of the names of DNS servers in the delegation chain in answering your query.

  7. Repeat the previous exercise for several popular web domains, including www.google.com and en.wikipedia.org. Report on your observations.

Advice & Hints

Remember that you can use the man program to learn how to use other programs such as telnet.

You can find an index of Internet RFCs at www.rfc-editor.org.

Discussion Questions

  1. Why do you think the HTTP protocol includes the PUT and DELETE commands? How might they be used? Do you think they are often used in practice? Why or why not?

  2. Relate your experiments with SMTP to your experiences with unsolicited or fraudulent email (i.e., spam).
  3. Read about open mail relays on Wikipedia. What is an open mail relay and why is it a problem?

  4. Are the lab workstations open mail relays? Why or why not? If you're not sure, what additional experiments would determine the answer?

  5. How could an attacker use whois databases and nslookup or dig to perform reconnaissance before launching an attack? Should whois databases be publically available?

  6. One feature of the existing DNS .com hierarchy is that it is extremely "wide." Propose a more hierarchical organization of the .com hierarchy. What objections might you foresee to your proposal's adoption? What might be some of the consequences of having most DNS domain names contain four or more levels, versus the two of many existing names?

  7. Suppose we abandon any pretense of DNS hierarchy, and simply move all the .com entries to the root name server: www.cisco.com would become www.cisco, or perhaps just cisco. How would this affect root name server traffic?
  8. How long did you spend on this assignment? What problems, if any, did you run into?

Grading

To earn a B, complete parts A , B, and D of the assignment, along with the discussion questions.

To earn an A, complete parts A, B, C, and D of the assignment, along with the discussion questions.


Janet Davis (davisjan@cs.grinnell.edu) and Mike Erlinger (mike@cs.hmc.edu)

Created Fall, 2009
Last revised February 1, 2012