Java Reference
In-Depth Information
Chapter 13
Java networking basics
13.1 Introduction
Java arrived on the scene just as computer networking was expanding from iso-
lated local area networks outward to the whole world via the Internet. The devel-
opers of Java quickly realized that exploiting the vast potential of networks would
become a major activity for programmers in this new interconnected world, so
they built a wide array of networking capabilities into the language. This capa-
bility grew with each new version of Java and became one of the primary reasons
for its popularity.
In this chapter we review the basics of TCP/IP (Internet) networking and some
of the tools that Java provides to exploit it [1,2]. In the rest of Part II we examine
many of the more sophisticated networking capabilities of Java with an emphasis
on how they could benefit scientific and engineering applications.
13.2 Internet basics
As shown in Figure 13.1, networking architecture is based on the concept of layers
of protocols. (The more formal OSI - Open System Interconnection - model has
seven layers but this one shows the essential layer definitions.) Each layer has its
own standardized protocol and standardized application programming interface
(API), which allows the next higher layer to communicate with it. Internally,
the layers can be implemented in different ways as long as they provide the
standard API. For example, the Network layer does not know if the physical layer
is Ethernet or a wireless system because the software device drivers respond to
the function calls the same way.
The term “Internet” refers primarily to the Network layer protocol known as the
Internet Protocol (IP) and the Transport layer protocol known as the Transmission
Control Protocol (TCP) forming the familiar TCP/IP acronym. The application
layer includes various web protocols, such as the Hypertext Transfer Protocol
(HTTP), which rely on the Internet sub-layers. Most users never see below the
application layer.
When you send an email or a file over the Internet, the TCP and IP protocols
split the message into groups of bytes called packets. Each packet holds a header
413
Search WWH ::




Custom Search