Lecture 4: Applications #1: Telnet
RFCs and Internet Documentation
In this subject, we concentrate fairly heavily on the protocols and
architectures used in the global Internet.
Every aspect of the Internet is documented in a series of documents
called "RFCs" (Request For Comment). RFCs are the means by which new
technologies are introduced in the Internet: after suitable research
work has been done, the new proposals are published as an RFC. On the
other hand, some RFCs document standard Internet protocols. RFCs are
usually in plain text form.
Once an RFC is published, it is not changed. However, it may be
"obsoleted" by later work. Unfortunately, there is no easy way to
"browse" RFCs to discover which RFC is the latest on a particular
topic, although there are various Web Indexes which can be useful.
All RFCs are available on-line on the Internet. In Australia, they
are available at several sites: in particular your lecturer's
favourite archives are at:
http://mirror.aarnet.edu.au/rfc/
ftp://munnari.oz.au/rfc
ftp://ftp.monash.edu.au/pub/internet-standards/
You will probably (later) need to learn how to download RFCs to answer some
of the assignment questions.
Application Protocols
Application protocols define the way in the TCP reliable service can
be used to achieve network-based computing. Because applications can
assume reliability, their protocols can be relatively simple.
Most Internet application protocols use commands (and, in some cases,
responses) in a human-readable form. They normally also use plain
ASCII text (see later) where possible. This makes debugging the
protocols quite straightfoward in most cases.
Some application protocols include:
- Telnet
- provides remote login allowing a user to log into a remote
computer as though it was local. We examine Telnet in this lecture.
- SMTP
- (Simple Mail Transfer Protocol) is the Internet
electronic mail delivery protocol. We
look at electronic mail in the next lecture.
- FTP
- (File Transfer Protocol) is used to copy files from one system
to another.
- HTTP
- (HyperText Transfer Protocol) is the protocol basis of the World
Wide Web.
Remote Login
Remote login means to "log in" to a remote computer (or, to use the
historical term, a "host") as though it were local.
- The idea of "remote login", as opposed to "local login" is
significant in the history of computing -- originally, a user "logged
in" at a basic display terminal which was directly connected to a
hardware port on a multi-user host computer.
- If the host was connected
to a network, remote login allowed users to log in to other networked
hosts over the network as though their terminal was directly
connected. Either way, the idea of "logging in" is still based on
getting a command line shell on the target system. On our
Unix systems, we nowadays talk about a shell window, which
performs this function.
- Some systems do not (even now) support remote login, in most cases
because they don't support a decent "command-line" interface.
- Different operating systems have (or used to have... ) quite
different procedures for handling local logins, making the problem of
providing a generic remote login facility (potentially) quite
complicated.
Telnet
Telnet is the basic remote login protocol, and is supported on virtually all
time-shared operating systems.
Basic Telnet operation:
- The user invokes the telnet client process, usually by name from
the command line, eg:
telnet ironbark
Once running, the client process then establishes a TCP connection to
the desired telnet server, which is "waiting for connections" at the
well-known port 23 -- note that we are again ignoring the question of
how the name "ironbark" gets translated to a network address, see
later.
- In the case of Unix, the telnet server connects the incoming
connection to a variation of the standard "login" process on the
server host. This may work differently on other systems.
- The user's keystrokes are transmitted to the remote server, and
output is displayed on the user's screen. Thus, initially the user can
"log in", and once authenticated (using a username/password pair)
has a normal shell, or command line interface, on the remote host.
Digression: ASCII Text
Fundamental idea: the most basic unit of data is the byte
-- virtually all computers (and network systems) handle data one byte
at a time. Recall that a byte can take any value between zero and 255.
US-ASCII (or, just "ASCII") was the first widely accepted data
representation system, and is universally recognised. In its traditional
form, it's a 7-bit code, meaning that if an ASCII message is stored or
carried in a modern byte-oriented system, the Most Significant
Bit (MSB) of every byte will always be zero. For this reason,
ASCII messages are sometimes called "7-bit data". An ASCII-valued byte
has traditionally been called a "character", and obviously takes any
value between zero and 127.
Within the ASCII "character set" there is a further subdivision:
- Printable ASCII
- characters with values between
32 (the ASCII "space" character) and 127 (the "DEL"
character). This includes all of the uppercase and lowercase letters,
the digits and the punctuation characters.
- Control Characters
- character values between zero
and 31. These were originally designed for a range of "official
functions", most of which are now irrelevant.
Telnet NVT
The telnet protocol defines a "Network Virtual Terminal"
(NVT) that provides a standard interface to remote systems, regardless
of their particular approach to terminal login. A telnet implementation
(client or server) maps the semantics of local terminal operation to
the NVT before sending data over the connection. Some aspects of the NVT
include:
- The basic unit of transmission is the "line of text" -- ideal for
command-line interfaces.
- An NVT text line contains only standard printable US-ASCII characters,
terminated by an NVT "newline" indicator.
- The NVT "newline" or "line ending" indicator is the two-character
sequence: carriage return, decimal 13 followed by
linefeed, decimal 10. Traditionally this has been
written as <CR><LF>[1].
A telnet implementation "maps"
the "enter" or "return" key to this sequence before sending the
line of text over the TCP connection.
- The telnet NVT has a few other interesting characterictics: it
defines the meaning of a few other ASCII control codes, permits
certain "out of band" commands to be sent to the remote host, and
has faciliites for "Option Negotiation".
[1] The "angle brackets" here (ie, < and
>) were traditionally used to indicate an ASCII control character.
They are now so commonly used in HTML markup (see later) that this
older usage is disappearing.
Other Aspects of Remote Login
Programs which implement the telnet protocol are widely (and freely)
available, and telnet is much used.
The BSD version of Unix introduced (in the mid 1980s) a remote login
utility with enhanced characteristics called "rlogin." Some
of its features are:
- It supports the idea of "trusted" hosts, whereby a remote login
request from a trusted host (providing the usernames match) is not
re-authenticated. This can be administered on a per-host basis
(/etc/hosts.equiv) or a per-user basis (~/.rhosts).
- rlogin exports the user's local "login environment" to the remote
host, so that an rlogin session can look almost identical to a local
login.
Nowadays, computer users who wish to use remote login facilities commonly use a
"secure" software package such as "ssh" (for "Secure SHell"). This
software encrypts (for security, see later) and compresses the data (for
efficiency) before sending it to the remote host.
Telnet as a "Debugging Weapon"
A telnet program can be used to connect to other services than the standard
telnet (ie, login) server at port 23. Most telnet implementations allow the
user to specify a port number on the command line, and will open a TCP
connection to that port. This can be very useful in debugging communications
protocols.
The reason this works is that virtually all "traditional" Internet application
protocols are based on the telnet idea of exchanging lines of
text[2]. In fact, as we shall see, they
usually use the telnet NVT specification.
In this subject, we will use telnet to demonstrate the operation of various
Internet application protocols. For example, to investigate the Internet
"email delivery" protocol SMTP (see
next lecture) we could do:
telnet ironbark 25
A final comment: telnet is a valuable tool to learn about network applications.
In fact, it's so powerful that in some educational institutions, possession of
a copy of telnet is regarded as prima facie evidence of intending to
"hack into" computer systems... Be careful!
[2] In some cases this is only true
for "commands" and "responses" -- so-called "8-bit data" can
subsequently be transferred.
This lecture is also available in
PostScript format.
The tutorial for this lecture is
Tutorial #03.
[Previous Lecture]
[Lecture Index]
[Next Lecture]
Copyright © 2000 by
Philip Scott,
La Trobe University.