Section 1.7
The Internet and the World-Wide Web
COMPUTERS CAN BE CONNECTED together on networks. A computer on a network can communicate with other computers on the same network by exchanging data and files or by sending and receiving messages. Computers on a network can even work together on a large computation.
Today, millions of computers throughout the world are connected to a single huge network called the Internet. New computers are being connected to the Internet every day. In fact, a computer can join the Internet temporarily by using a modem to establish a connection through telephone lines.
There are elaborate protocols for communication over the Internet. A protocol is simply a detailed specification of how communication is to proceed. For two computers to communicate at all, they must both be using the same protocols. The most basic protocols are the Internet Protocol (IP), which specifies how data is to be physically transmitted from one computer to another, and the Transmission Control Protocol (TCP), which ensures that data sent using IP is received in its entirety and without error. These two protocols, which are generally referred to collectively as TCP/IP, provide a foundation for communication. Other protocols use TCP/IP to send specific types of information such as files and electronic mail.
All communication over the Internet is in the form of packets. A packet consists of some data, along with addressing information that indicates where on the Internet that data is supposed to go. Think of a packet as an envelope with an address on the outside and a message on the inside. The packet also includes a "return address," that is, the address of the sender. A packet can hold only a limited amount of data; longer messages must be divided among several packets, which are then sent individually over the net and reassembled at their destination.
Every computer on the Internet has an IP address, a number that identifies it uniquely among all the computers on the net. The IP address is used for addressing packets, so one computer can only send data to another over the Internet if it knows that computer's IP address. Since people prefer to use names rather than numbers, many computers are also identified by names, called domain names. For example, the main computer at Hobart and William Smith Colleges has the domain name hws3.hws.edu. (Domain names are just for convenience; your computer still needs to know IP addresses before it can communicate. There are computers on the Internet whose job it is to translate domain names to IP addresses. When you use a domain name, your computer sends a message to a domain name server to find out the corresponding IP address. Then, your computer uses the IP address, rather than the domain name, to communicate with the other computer.)
The Internet provides a number of services to the computers connected to it (and, of course, to the users of those computers). These services use TCP/IP to send various types of data over the net. Among the most popular services are Telnet, electronic mail, FTP, gopher, and the World-Wide Web.
Telnet allows a person using one computer to log on to another computer. (Of course, that person needs to know a user name and password for an account on the other computer.) Essentially, the first computer acts as a terminal for the second. Telnet is often used by people who are away from home to access their computer accounts back home -- and they can do so from any computer on the Internet, anywhere in the world.
Electronic mail, or email, provides person-to-person communication over the Internet. An email message is sent by a particular user of one computer to a particular user of another computer. Each person is identified by a unique email address, which consists of the domain name of the computer where they receive their mail together with their user name or personal name. The email address has the form "username@domain.name". For example, my own email address is: eck@hws.edu. Email is actually transferred from one computer to another using a protocol called SMTP (Simple Mail Transfer Protocol). Email is still the most common and important use of the Internet.
FTP (File Transport Protocol) is designed to copy files from one computer to another. As with Telnet, an FTP user needs a user name and password to get access to a computer. However, many computers have been set up with special accounts that can be accessed through FTP with the user name "anonymous" and any password. This so-called anonymous FTP can be used to make files on one computer publically available to anyone with Internet access.
Gopher was invented as a kind of simplified FTP, with a much easier user interface. A computer that wants to publish information using Gopher runs a program called a "Gopher server." A person elsewhere on the Internet can connect to the server using another program called a "Gopher client." When the client connects to the server, the server sends back a list of items, which the client displays to the user. Each item represents either a file or another list of items on the same computer or on another computer. If the user selects a file, that file is "downloaded" from the server and is either saved or is displayed directly on the user's screen. When the user selects an item representing another list, the client retrieves the new list and displays it, and the user can make another selection. The exciting part is that the new list might come from a Gopher server on a completely different computer anywhere on the Internet. A Gopher user can hop from machine to machine, retrieving information from all over the world, without ever worrying about IP addresses, domain names, user names, passwords, or the arcane commands that are used in older protocols like FTP and Telnet.
The World-Wide Web (WWW) is sort of like Gopher carried to an extreme. Although Gopher made the Internet easy to use and even fun, it could deal only with individual files and lists. The WWW is based on pages which can contain information of many different kinds as well as links to other pages. The setup is much like Gopher: To publish information on the WWW, a computer runs a server program, generally called a Web server. Users access the Web using a client program, generally called a Web browser. The browser contacts a server to retrieve a page of information. If the user selects a link on that page, the browser "follows the link" to retrieve and display a new page of information. The idea is simple, but the result is profound: The user has access to a huge sea of interlinked information that can be navigated with no special computer expertise. The Web is the most exciting part of the Internet and is driving the Internet to a truly phenomenal rate of growth. If it fulfills its promise, the Web might become a universal and fundamental part of everyday life.
I should note that FTP and Gopher have not gone away. But they have been largely subsumed into the World-Wide Web. The protocol used by Web servers is called HTTP (HyperText Transfer Protocol), and Web browsers communicate with Web servers using this protocol. However, Web browsers understand several protocols, including FTP and Gopher. This means that a Web browser can communicate with anonymous FTP sites and with Gopher servers, as well as with Web servers. The idea is that you should only need one program, with one interface, to access all the information available on the Internet. When you use a Web browser, you might not even know whether it is using FTP, Gopher, or HTTP. That's the way it should be: You just want the information; the browser should know how to get it.
Now just what, you might be thinking, does all this have to do with Java? In fact, Java is intimately associated with the Internet and the World-Wide Web. As you have seen in the previous section, special Java programs called applets are meant to be transmitted over the Internet and displayed on Web pages. A Web server transmits a Java applet just as it would transmit any other type of information. A Web browser that understands Java -- that is, that includes an interpreter for the Java virtual machine -- can then run the applet right on the Web page. Since applets are programs, they can do almost anything, including complex interaction with the user. With Java, a Web page becomes more than just a passive display of information. It becomes anything that programmers can imagine and implement.
Its association with the Web is not Java's only advantage. But many good programming languages have been invented only to be soon forgotten. Java has had the good luck to ride on the coattails of the Web's immense and increasing popularity.
End of Chapter 1
[ Next Chapter | Previous Section | Chapter Index | Main Index ]