Check the course calendar for the due date.
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.
This lab is based on experiments 3.2 and 3.3 in Hands-On Networking with Internet Technologies by Douglas Comer (2nd edition, 2005).
Each student should complete this assignment and write it up individually (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.
To prepare for this assignment, skim appropriate sections Peterson & Davie. These sections describe protocols for email and web protocols.
You can complete this assignment on any HMC CS workstation. You do not need to obtain any particular files or software.
Use the script program to capture your shell session as you complete the following tasks.
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.
Use telnet to connect to www.cs.hmc.edu. The HTTP server listens for incoming connections on port 80.
Peterson & Davie 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.hmc.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.)
What do you expect to happen if you request a web page that does not exist? Why? Try it and find out.
Try using the HEAD operation to request metainformation about the index page for the host www.cs.hmc.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?
Try making an HTTP request to delete a page. What happens?
cs.hmc.edu is running an SMTP server on port 25. Use telnet to contact the SMTP server, using localhost as the name of the remote computer. The computer will respond by sending an identification.
Verify that you received the email message.
What happens if you make a typing error while entering the SMTP commands and have to use backspace to correct it? Which approach do you think makes more sense: the HTTP server's approach or the SMTP server's approach? Why?
Not all SMTP servers require the HELO command to authenticate the sender. Does this server?
What do you think will happen if the RCPT TO command names a user that does not exist, such as bushgeo@cs.hmc.edu? Why? Try it and find out.
What do you think will happen if the MAIL FROM command names a user that does not exist? Why? Try it and find out.
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.
Identify an IRC server you can connect to. You will need to know the server's name and port number. You may 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).
Find the most recent RFC(s) defining the Internet Relay Chat (IRC) protocol. Read about the protocol architecture and messages.
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.
Using telnet, connect to the server and port you identified. Send appropriate messages to carry out the above tasks.
The basic format of lab reports is left to you. Each lab should have its own page, be clear about what parts of the assignment you did, clearly specify any issues, and be readable.
For example:
Include your answers to the questions in the assignment and your answers to the discussion questions.
Below this, paste the contents of the session log you captured using the script command. Insert annotations describing what is happening in each part of the script. Make these annotations stand out, e.g., by making them boldface or a different color.
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?
Read about open mail relays on Wikipedia. What is an open mail relay and why is it a problem?
Are the CS workstations open mail relays? Why or why not? If you're not sure, what additional experiments would determine the answer?
What did you find most surprising or interesting about this assignment?
How long did you spend on this assignment?
How long did you spend on the writeup for this assignment?
To earn a B, complete parts A and B of the assignment, along with the discussion questions.
To earn an A, complete parts A, B, and C of the assignment, along with the discussion questions.