3.1. Communications Software for Modem Links
There are a number of communications
packages available for Linux. Many of these packages are
terminal programs, which
allow a user to dial in to another computer as if she were sitting in
front of a simple terminal. The traditional terminal program for
Unix-like environments is kermit. It
is, however, ancient now, and would probably be considered difficult
to use. There are more comfortable programs available that support
features such as telephone-dialing dictionaries, script languages to
automate dialing and logging in to remote computer systems, and a
variety of file exchange protocols. One of these programs is
minicom, which was modeled after
some of the most popular DOS terminal programs. X11 users are
accommodated, too. seyon is a fully
featured X11-based communications program.
Terminal programs
aren't the only type of serial communication
programs available. Other programs let you connect to a host and
download email in a single bundle, to read and reply to later at your
leisure. This can save a lot of time and is especially useful if you
are unfortunate enough to live in an area where your connectivity is
time charged. All of the reading and replying time can be spent
offline, and when you are ready, you can reconnect and upload your
responses in a single bundle.
PPP is in-between, allowing both
interactive and noninteractive use. Many people use PPP to dial in to
their campus network or other Internet Service Provider to access the
Internet. PPP (in the form of PPPoE) is also, however, commonly used
over permanent or semipermanent connections like cable or DSL modems.
We'll discuss PPPoE in Chapter 7.
3.1.1. Introduction to Serial Devices
The Unix kernel provides devices for
accessing serial hardware, typically called tty
devices (pronounced as it is spelled: T-T-Y).This is an abbreviation for
Teletype device, which used
to be one of the major manufacturers of terminal devices in the early
days of Unix. The term is used now for any character-based data
terminal. Throughout this chapter, we use the term to refer
exclusively to the Linux device files rather than the physical
terminal.
Linux provides three
classes of tty devices: serial devices, virtual terminals (all of
which you can access by pressing Alt-F1 through
Alt-Fnn on the local console), and
pseudo-terminals (similar to a two-way pipe, used by applications
such as X11). The former were called tty devices because the original
character-based terminals were connected to the Unix machine by a
serial cable or telephone line and modem. The latter two were named
after the tty device because they were created to behave in a similar
fashion from the programmer's perspective. PPP
is most commonly implemented in the kernel. The kernel
doesn't really treat the tty device as a network
device that you can manipulate like an Ethernet device, using
commands such as ifconfig. However, it does
treat tty devices as places where network devices can be bound. To do
this, the kernel changes what is called the "line
discipline" of the tty device. PPP is a line
discipline that may be enabled on tty devices. The general idea is
that the serial driver handles data given to it differently,
depending on the line discipline it is configured for. In its default
line discipline, the driver simply transmits each character it is
given in turn. When the PPP line discipline is selected, the driver
instead reads a block of data, wraps a special header around it that
allows the remote end to identify that block of data in a stream, and
transmits the new data block. It isn't too important
to understand this yet; we'll cover PPP in a later
chapter, and it all happens automatically anyway.