Introduction§

In this assignment, you will use the telnet program to experiment with text-based application protocols

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 consider SMTP servers and sending email. In the third part, you will investigate another text-based application protocol with which you might not yet be familiar.

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.

Goals§

Acknowledgments§

This lab is based on experiments 3.2 and 3.3 in Hands-On Networking with Internet Technologies by Douglas Comer (2nd edition, 2005).

References§

Logistics§

Each student should complete this assignment and write it up individually. 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.

Preparation§

To prepare for this assignment, skim the first two references above that describe protocols for the web and email. You may wish to find other resources to fill in details or provide alternative explanations.

You can complete this assignment on any machine with a telnet program installed, which includes any lab machine in CNS. You do not need to obtain any particular files or software.

Lab Report§

Again, pay attention to the Technical Report Guidelines and Suggestions when writing lab reports.

In this lab report: For each step in the laboratory assignment, explain what you saw and/or answer questions given. (If you want to record a transcript of everything you do to look at or copy from later, investigate the script utility.)

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.
    • Under Windows, the built-in telnet command does not "echo" (display) what you type. On Windows, then, I recommend using the telnet program that can be installed in Cygwin or logging in to sun.iwu.edu via SSH and running telnet there (run ssh username@sun.iwu.edu with your IWU username filled in to log in to sun).
  2. Use telnet to connect to www.iwu.edu. The HTTP server listens for incoming connections on port 80.
  3. Using information from the references or other sources, request the index page for the host www.iwu.edu. Notice that you do not receive a document containing IWU's front page. Why not? Why will we not be able to retrieve IWU's web site using telnet? How does a standard web browser handle the response you received?
  4. Using telnet again, connect to an HTTP server at www.example.com, and again request the index page for that host. 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.)
  5. What do you expect to happen if you request a web page that does not exist? Why? Try it with www.example.com and find out.
  6. Try using the HEAD operation to request metainformation about the index page for the host www.example.com. How is the server's reponse similar to its response in task 4? How is the response different? How is the HEAD operation useful?
  7. Try making an HTTP request to delete a page from www.example.com. What happens?

Part B: Use telnet to send an email§

Sadly, this part of the lab is no longer possible. Read through it, and see below.

  1. From a lab computer, use telnet to contact the campus SMTP server, smtp.iwu.edu, using the lab computer's hostname (run hostname in the terminal) as the name of the remote computer. The computer will respond by sending an identification.
  2. Following the example in Peterson & Davie, 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 HELO command names a host different than the one you are using? Why? Try it and find out.
  6. What do you think will happen if the RCPT TO command names a user that does not exist, such as santaclaus@iwu.edu? Why? Try it and find out.
  7. What do you think will happen if the MAIL FROM command names a user that does not exist? Why? Try it and find out.
  8. 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.

This part of the lab is no longer possible. It was great fun, too. The thing is, it wasn't very smart. You could send email from president@whitehouse.gov, or anyone else for that matter. And it's not hard to see how that could be used... improperly. So it's now more secure. Good. But what changed?...

Part B the Second: Investigate IWU's Email Setup§

  1. From a lab computer, use telnet to contact the campus SMTP server, smtp.iwu.edu, using the appropriate port number for the SMTP service. What happens? (Hint: it probably won't go so well. See some of the Discussion Questions below.)

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 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.
  1. Using telnet, connect to the server and port you identified. Send appropriate messages to carry out the above tasks. (It may be easiest to type the registration commands in a text editor and copy-paste them into telnet.)
  2. In your own words, explain the purpose of the PING and PONG messages.

Advice & Hints§

Remember that in a Unix command line (Mac OS, Cygwin, or Linux), you can use the man program to learn how to use other programs such as telnet. E.g., from a command line shell, run man telnet. Press q to quit.

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 the described results of the old Part B 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. So how do we send email from on campus now? What server do we contact, on what port, and with what protocol? See here for help.
  5. Why does this now make it infeasible for us to contact our outgoing mail server via telnet (as humans) and send email, whether fraudulently or not?
  6. Is smtp.iwu.edu an open mail relay? Why or why not? If you're not sure, what additional experiments would determine the answer?
  7. What did you find most surprising or interesting about this assignment?
  8. How long did you spend on this assignment? What problems, if any, did you run into?