Using Telnet
Telnet is a telecommunications software utility which allows you to become a user on a remote computer. Once you access the remote terminal, you can use it for its intended purposes. Unlike FTP, the telnet utility does not allow you to transfer and save files to your own computer. (A general WARNING: Telnet is very insecure and should only be used when there are no other alternatives. )
In this lab you will learn how to use telnet as a basic tool to experiment with application layer protocols. (These experiments have been adapted from Hands-On Networking with Internet Technologies, 2nd Ed. by Douglas Comer, Prentice Hall, 2004.)
Fortune Cookies
The first step will be to use telnet to contact a fortune cookie server. Keep in mind that the server does not know that you -- a human -- are accessing it, as opposed to a computer program, so you must follow the protocol in this and subsequent sections precisely.
First, figure out how to run the telnet program on your computer. telnet usually takes two command-line arguments: the host computer name or ip address, and an integer port number (corresponding to an application on the remote computer). You will learn lots more about host names, addresses, and port numbers as the course progresses.
Run telnet and contact port 8445 on the computer cookie.update.uu.se. On most computers you will type
telnet cookie.update.uu.se 8445
You should see telnet displaying status messages of 'Trying...', 'Connected...', etc.
Enter two numbers: 1 10 on a single line and press enter. The server should return a fortune cookie to you and then close the connection.
Visit the page http://cookie.update.uu.se/cookie.html to learn more about this fortune cookie database.
Contacting a Web Server
Next, use telnet to contact a web server and request a web page.
Connect to the host www.google.com on port 80.
Enter the following command:
GET http://www.google.com HTTP/1.1
(leave a blank line by pressing Enter twice)The server should return an HTML document to you and then close the connection. (The telnet program will display the raw HTML code of the main Google website.)
Sending an Email Message
Now, use telnet to connect to the Berry College email server and send a message.
Telnet to port 25 on the host
mail.berry.edu
.The server should respond, once connected, with an identification message, starting with the numeric code "220".
Next, enter the following set of commands (the server will respond each time you enter a line):
HELO cs.berry.edu MAIL FROM: your email login RCPT TO: target email address (e.g. use your own complete Berry email address) DATA fill in a test message here... The body of the message may span multiple lines of text. When you are done, type a period on a line all by itself to indicate the end of the message body. . QUIT
The server should indicate that the message is queued for delivery and then close the telnet connection.
Check your email after a minute or so to verify that the email was successfully sent.
Using ping
The ping utility (built into most OS'es) is used to determine the reachability of a host.
Find the help page on your system that describes and explains the command-line flags and arguments to the ping program.
Choose a well-known site such as www.google.com, and use ping to determine if the site is reachable.
Use a search engine to find the domain name of a computer in another country and ping that computer. What is the largest round-trip time you can find?