Welcome to UNIX Communications

Welcome to the varied, powerful, and increasingly friendly world of UNIX communications. This first chapter explains why UNIX and computer communications are a natural combination. It also describes the three areas of UNIX communications that are covered in this book (UNIX Mail, UNIX News, and UNIX File Transfer) and introduces basic concepts common to all of them.

In addition, this chapter gives examples that show how people are using UNIX to meet their communications needs. It also tells where in the book you can find discussions of the various UNIX communications programs.

Why UNIX Communications?

If you work closely with people, you couldn't choose a better system to work with than UNIX. The UNIX operating system was designed to facilitate the sharing of files and information. In addition, UNIX computers are easily linked to form communication networks serving hundreds, or even thousands, of users. The key to accessing this communication power lies in understanding the UNIX communications programs.

Communications programs (such as electronic mail) are among the most often used UNIX programs and are usually among the first programs a new user learns. Although UNIX is extensively documented, some of the most useful information about UNIX communications programs exists only in the minds of UNIX wizards and in highly technical manuals. This book aims to open up the world of UNIX communications to the general user.

With the explosion in growth of the Internet, UNIX communications has become even more important. Even though some computers on the Internet aren't running UNIX and some UNIX systems aren't connected to the Internet, the UNIX communications programs have formed the basis of communications over the Internet. And although efforts are being made to write easy-to-use "front ends" for communications programs, the basic UNIX communications programs are still in use daily on the Internet.

UNIX and Computer Communications

This development and new implementations of UNIX, such as IBM's AIX (running on such machines as RS-6000) and Apple's AUX for the Macintosh, have opened the door for the proliferation of UNIX on PCs. Finally, the release of AT&T System V Release 4 (SVR4) in late 1989 provided a version of UNIX that combines the best features of System V, Xenix, and Berkeley (BSD) UNIX. Versions of SVR4, such as Solaris from Sun Microsystems, have been released for PC systems. In addition, several free versions of UNIX (such Linux and FreeBSD) have recently been released, which makes UNIX affordable by everyone.

Computer communications--the ability to transfer data from one user to another--became the watchword of the computer industry during the 1980s, and it should be even more important in the 1990s. We hear of local-area networks (LANs), AppleTalk, Ethernet, and micro-to-mainframe links, but UNIX is an old pro at networking. UNIX-based computer networks have been around for more than 20 years! From the very beginning communication between users was an essential part of the UNIX operating system. UNIX began as a joint effort of programmers at Bell Laboratories to create an operating system that would facilitate their work together. Because it was designed by programmers and not really marketed as a commercial product until fairly recently, UNIX has been able to remain an "open" system, with roadblocks to information exchange kept to a minimum.

Some Examples of Computer Communications

It's hard to visualize how computer communications works until you've actually done some communicating. Soon we will show you how to use the actual communications programs. In the meantime, the following examples should give you an idea of the possibilities that open up when users and computers are linked.

As we discuss the different scenarios, we introduce some common concepts of computer communications, such as "dumb terminal" and "uploading a file." If you want more details about any of these matters, consult a primer that addresses the issues of data communications and networks.

User-to-User Communication on One Computer

The simplest example of computer communication is shown in Figure 1.1. In this setup, two users on the same computer can send messages to each other via electronic mail, or they can exchange files and programs using basic UNIX commands. No special hardware or software is needed, and there are no compatibility problems.

If this were a computer installation at a university (UNIX is used by approximately 90 percent of U.S. computer science departments), user #1 could send the following message to another student in his computer language class:

Help! I have to write a paper on the C++ programming language by
next week. Do you know of some good books on it?

User #2 would see the message when she checked her mail and would send this message in return:

Relax. I've got an annotated C++ bibliography on one of my disks
here. As soon as I find it, I'll upload it to the system and mail
it to you.
User #2 would then locate the file with the C++ bibliography and include it in a mail message to user #1.

In Figure 1.1, the UNIX setup on the left is a "dumb" terminal, consisting of only a keyboard and a monitor. A dumb terminal has no intelligence (computing power) of its own: It only enables you to type information into the main computer, and it only displays information presented by that computer.

figure
Figure 1.1 People on the same computer communicate with each other.

The setup on the right is an "intelligent" terminal. An intelligent terminal (one with its own computing power such as a desktop PC) offers big advantages over a dumb terminal. If the main computer is heavily loaded with users, you can download your files (transfer them from the main computer to your personal computer and continue to work on them using the computing power of your PC. With the PC, you can compose letters and documents locally with one of the word processors available for PCs (word processors that enable you to work graphically, instead of being the text based versions you may have to use if you are working remotely). Later, you can upload the text files (transfer them to the remote main computer. After the files are stored on the main computer, you can send them to other users with one of the UNIX mail programs.

As computer systems have become more powerful and less expensive, it's possible that the computer system on your desktop is almost as powerful as the computer you are connecting to! Affordable workstations running UNIX are available to many people, so that you can perform almost all of your communications tasks on your desktop system and only connect to the main system when you need to transmit information.

In Figure 1.1 both setups are directly connected with a wire or cable to the UNIX computer. This hard-wired connection, as it is also called, is simple and provides high-speed response. When a user presses a key, the computer seems to respond instantaneously, although actually the data is being sent at a rate of perhaps 19,200 baud (bits per second). The problem with directly connected terminals is that they generally must be located in the same vicinity as the computer, unless special hardware is used to allow them to be placed further away.

Talking to the Computer from Far Away

To access the computer from farther away than a few hundred feet, you usually use a modem (modulator-demodulator), as shown in Figure 1.2.

figure
Figure 1.2 With a modem you can access a computer from a distance.

For example, suppose that a traveling sales representative has set up a portable computer in a hotel room in Boston and is using a modem to call the company's UNIX computer in Los Angeles. Using the telephone network, the sales representative can check her electronic mailbox to see if anyone has sent her messages. If so, she can fire off replies in a fraction of the time it would take with paper mail. It's a simple matter for her to upload a report to the main computer or to download a file with the latest competitive information into her PC.

A Central UNIX Computer Talks to Many Remote Users

The previous example showed only one remote user calling into a UNIX system. Figure 1.3 shows how many users in different locations can communicate with each other through a central UNIX computer. Users with modems call in over the public telephone network or through special packet-switched networks such as Telenet (the packet-switched network sometimes offers less expensive long distance telephone rates).

figure
Figure 1.3 A central UNIX computer connects remote users calling on modems.

On a conferencing system, such as the Whole Earth `Lectronic Link (The WELL) in Sausalito, California, users can send messages to one another with the UNIX mail programs, or they can participate in ongoing electronic conferences on such topics as "One-Person Businesses," "Spirituality," "Politics," and "UNIX." They can also read news articles from around the world by using the Netnews software. This system serves as an intellectual forum for the discussion of new ideas and as a meeting place for people of similar interests.

Other Internet providers enable you to connect to your home UNIX system by calling a local telephone number and using such UNIX programs as telnet and ftp. Because many of these providers have local access numbers in cities across the country, you can use local numbers to connect to your home computer when you are traveling.

The Limitations of Modem Speed

Users calling a UNIX computer often (but not always) have access to the same UNIX utility programs that are available to a directly connected user. Aside from any restrictions imposed by the system administrator, the only limitation on the use of the programs is the speed of the modem. For example, a modem passing data at 1,200 baud (1,200 bits per second, or about 120 characters per second) can take several seconds to redraw a normal screen of text. Thus, a session with vi (the UNIX screen-oriented editor) can be slow enough to be frustrating as it updates the screen. Electronic mail also can be too slow at 1,200 baud. Of course, the availability of inexpensive 9,600-baud modems is rapidly overcoming this problem for most applications, and faster (but more expensive) 14,400- and even 28,800-baud modems are now available.

New High-Speed Modems

As recently as a few years ago, a 9,600-baud modem would cost more than $1,000, which was too expensive for most individual users. Now, a modem that will transfer data many times as fast (28,800 baud, for example) costs well under that figure. Although individuals may not need this fast transfer rate, for corporate use, however, where telephone communication between UNIX computers is necessary, they can be a godsend.

Figure 1.4 shows a setup for transferring files between computers by using UUCP programs. (UUCP programs are explained shortly.) When UNIX computers call one another, they often transfer megabytes of data and may tie up a phone line for hours. High-speed modems cut that time dramatically. For example, to send the text of the novel Moby Dick at 300 baud would take 23 hours. At 1,200 baud, it would still take about 6 hours. With the new 9,600-baud modems, it would take only 43 minutes! Of course, it does no good to have a 9,600-baud modem if the host system has only 1,200- or 2,400-baud dial-up lines--the connection can only be as fast as the slower of the two modems. Fortunately, most service providers now offer high-speed modems, although frequently at a premium charge.

If you know the speed of your modem, you can get a rough idea of how long it will take to transfer information. If, for example, you have a fast 14,400-baud modem, you can transfer about 1,440 bytes of information per second. To transfer a megabyte of information, then, would take about 700 seconds, or around 11 minutes. Many modern modems offer features such as automatic data compression, which makes their effective baud rate even higher than their advertised rate.

figure
Figure 1.4 UUCP programs transfer files between UNIX computers

Two UNIX Computers Communicating Directly

The two UNIX computers in Figure 1.4 are shown connected by modems and the public telephone network. They can also be directly connected by cable, or they can be connected by leased lines (a private telephone connection). For higher speeds, they can be connected by a local area network (LAN).

The programs that permit two UNIX machines to pass files to each other are known as the UUCP group of programs (UUCP stands for UNIX to UNIX copy. Part IV of this book is devoted to these programs. UUCP operations underlie the operation of many other UNIX communications programs.

You can also use the UUCP programs directly. For example, in Figure 1.4, the system administrators for two different UNIX systems could use the UUCP programs to transfer many megabytes of programs and data files from one system to another.

A Nationwide Network of UNIX Computers

Imagine that the UUCP programs mentioned in the previous example have been automated. One UNIX computer calls another at a specified time (for example, at night, when telephone rates are low) and transfers messages destined for users of that computer. Hundreds of UNIX computers are similarly connected to one another in a nationwide network, such as the one shown in Figure 1.5. Thousands of users send messages to one another; messages hop from one computer to another until they reach their destination.

Such a network does in fact exist--it is the UUCP network. Unbelievable as it may seem, this complex network functions on a cooperative basis, relying on volunteer administrators and on the goodwill of the institutions, companies, and research labs who own the computers.

figure
Figure 1.5 A network of UNIX computers links thousands of users.

The UUCP network does more than just move mail. A group of programs called Netnews runs continuously as USENET on the UUCP network. Hundreds of special "conferences" (called newsgroups) are organized on USENET, and users share ideas on this giant electronic bulletin board. (You will learn how to use USENET in Part III of this book.)

For example, when the infamous Internet "worm" program nearly brought some major UNIX networks to a halt in November 1988, UNIX experts used electronic mail to keep in touch as they struggled to understand and disarm the intruding program. In ensuing weeks, both technical and ethical discussions in USENET newsgroups explored ways to make UNIX systems more secure and discussed the sanctions that could be used against intruders. A little later, in 1989, the democracy movement in China used USENET, as well as fax transmissions, to tell the world about their struggle and to ask for messages of protest and support from the world community. Finally, during that same busy year, information and debate about "cold fusion" spread across the networks. It is increasingly evident that USENET and other networks are likely to supplement--if not supplant--the traditionally methodical process of publication in scientific journals.

More recently, the USENET system was critical in keeping communications going during the Los Angeles earthquake. Even though many regular telephone lines were jammed, the dedicated lines that carry network traffic were able to convey reports of the problems (and enabled people to find out whether friends and relatives were alive). In fact, in providing emergency communications, USENET and the other computer communications systems are beginning to take the place of the amateur radio network.

In addition to the UUCP network of UNIX computers, the world-wide network called the Internet also connects many thousands of UNIX systems together. Using the Internet allows UNIX systems to communicate at speeds much faster than that allowed by modems. The Internet will be described in more detail in Chapter 2, "Introduction to the Internet."

Some UNIX Conventions

Before beginning our discussion of the communications programs, we will explain some of the conventions used in this book.

Commands
Special command keys are shown with an initial capital letter, such as Escape and Delete. The carriage return is indicated by Enter.

Commands using control characters are shown as Control+D, Control+N, and so on. In some UNIX programs, the prompts and help screens represent such commands as ^D and ^N, using the ^ symbol as a shorthand way of representing the Control key. This is the same as Control+D and Control+N in our notation. In either case, you press the Control key and the letter simultaneously. You don't have to press Shift to capitalize the letter.

Typeface

For text representing computer input and output and the names of files, directories, and variables, we use a typeface that resembles the monospace characters you see on the screen. It looks like this:

Welcome to UNIX Communications
Please enter your first command.
Format Statements
Format statements show the proper syntax, or format, for using a particular command. For example,

cp filename directory_name
shows the format for using the copy command (cp) to copy a file into a different directory. The words filename and directory_name are placeholders for the names of the real file and directory. To use this command, you would have to enter the actual names of the file and the directory.

Variations Between Systems
UNIX is remarkably standard for an operating system that has several different versions and runs on many different computers, from micros to mainframes. However, don't be surprised if some of the commands and options listed in this book don't work exactly as described--small differences in syntax and operation are inevitable. For example, we start the electronic mail program on our system by typing either mail or Mail.

You'll be able to overcome minor inconsistencies by experimenting and looking in a UNIX primer. You can also use the man command followed by a program name to read the online manual entry for that program. For more difficult problems ("How do I send a message to my cousin who's on a UNIX system at UCLA?"), you might have to turn to an experienced user or to your system administrator.

Bourne Shell and C Shell
There are several popular shells, or command processors, available for UNIX. The shells differ in how they handle certain commands and special characters. (We discuss shells in Chapter 2.) When we give program examples, we usually give them for the Bourne Shell (the $ prompt). However, most of the examples work as-is for the C Shell (% prompt), although you may have to "escape" certain characters, particularly in the chapters dealing with UUCP commands. For example, in the C Shell, when you are using an exclamation point to indicate a remote company (tortoise!), you need to precede it with a backslash (\), like this:

% uucp alice.txt tortoise\!/uucp/alice.txt
Note that we always show the escape character (the backslash) when applicable. The Bourne Shell ignores the escape character if it is not needed. Most of the examples will also work in shells such as the Korn shell (ksh).

Many of the examples in this book are taken from our home system, a 4.3BSD (Berkeley)-derived system. However, we've been careful to make examples and explanation accurate for System V as well.

Where to Find More Information About UNIX

If you are beginning UNIX user, you'll be able to learn many of the basic UNIX commands from the overview in Chapter 2. We also recommend that you read an introductory guide to UNIX, such as UNIX Primer Plus by Waite, Martin, and Prata (Indianapolis: SAMS, 1990), if you have Berkeley UNIX; or, if you have System V, UNIX System V Primer, Second Edition by the same authors (Indianapolis: Howard W. Sams, 1987). Keep a UNIX text at your terminal as you work through this book and read about the UNIX commands as you encounter them. Soon you will have mastered the communications programs, and you will have a head start on UNIX as well.

Summary

Mastering the communications programs is essential to getting the most from a UNIX system. We have shown you several examples of computer communications on UNIX systems. In the next chapter, we cover the bare minimum of UNIX lore so that you can start sending and receiving electronic mail and explore and the other UNIX communications facilities.