CS 107: Using Telnet

Assigned on Wednesday, 10/2.
Due on Friday, 10/4, at 5 PM.
Assignment updated at noon on Thursday, 10/2.

Telnet is a protocol that is usually used by people to log in to computer systems that have a command-line interface. A command-line interface presents you with a prompt, after which you are expected to type a command. This exercise will show you how to use telnet to communicate directly with web servers.

Print out this assignment first by clicking on the "Print" button in Mozilla. This assignment is easier to do if you read the directions from paper than by flipping back and forth between windows.

Exercises

Complete the following exercises to learn how telnet works. There is nothing to submit until you reach the "Questions" section below.

Step 1: Connect to the department's HTTP server.

Step 2: Request a file from the server.

You should see a completely black window, with no prompt.


	GET /faculty/dmusican/cs107f02/index.html HTTP/1.1
	Host: www.mathcs.carleton.edu

followed by a blank line. This is a request for our course home page. You should now get a bunch of information about the file (this information is called the "header"), followed by the file itself in raw HTML form.

If you wait a few seconds, the HTTP server will close the TCP connection.

Step 3: Cause an error message.

Step 4: Get a file's header information without getting the file itself.

Questions

Copy the following questions into a file named "telnet.txt" and insert your answers. Do all your work in your K drive folder, and only use the S drive when you are ready to submit your answers. When you are ready to submit, copy telnet.txt into the folder S:\Students\homework\cs107\yourusername. If you make a mistake and want to resubmit your homework, change the name of the file to telnet2.txt and drag it into the same folder. The grader will grade the latest-numbered file.

  1. When you requested the file index.html, what header information did you receive? Explain as well as you can what each line of the header means.

  2. When you requested a non-existent file, what error number and message did the server send back?

  3. Single click on the icon that looks like two networking computers at the very top left of the Putty window, and choose "Event Log". You should see within it something like "Connecting to 137.22.4.90 port 80". This IP address, 137.22.4.90, uniquely identifies www.mathcs.carleton.edu among all the computers on the Internet. Close the event log, and try the following.

  4. Try giving the web server on www.mathcs.carleton.edu gibberish. What error number and message do you receive?