Java Reference
In-Depth Information
If you read the network literature, you're likely to encounter an alter‐
native seven-layer model called the Open Systems Interconnection
(OSI) Reference Model. For network programs in Java, the OSI mod‐
el is overkill. The biggest difference between the OSI model and the
TCP/IP model used in this topic is that the OSI model splits the host-
to-network layer into data link and physical layers and inserts presen‐
tation and session layers in between the application and transport
layers. The OSI model is more general and better suited for non-TCP/
IP networks, although most of the time it's still overly complex. In any
case, Java's network classes only work on TCP/IP networks and al‐
ways in the application or transport layers, so for the purposes of this
topic, absolutely nothing is gained by using the more complicated OSI
model.
To the application layer, it seems as if it is talking directly to the application layer on the
other system; the network creates a logical path between the two application layers. It's
easy to understand the logical path if you think about an IRC chat session. Most par‐
ticipants in an IRC chat would say that they're talking to another person. If you really
push them, they might say that they're talking to their computer (really the application
layer), which is talking to the other person's computer, which is talking to the other
person. Everything more than one layer deep is effectively invisible, and that is exactly
the way it should be. Let's consider each layer in more detail.
The Host-to-Network Layer
As a Java programmer, you're fairly high up in the network food chain. A lot happens
below your radar. In the standard reference model for IP-based Internets (the only kind
of network Java really understands), the hidden parts of the network belong to the host-
to-network layer (also known as the link layer, data link layer, or network interface layer).
The host-to-network layer defines how a particular network interface—such as an
Ethernet card or a WiFi antenna—sends IP datagrams over its physical connection to
the local network and the world.
The part of the host-to-network layer made up of the hardware that connects different
computers (wires, fiber-optic cables, radio waves, or smoke signals) is sometimes called
the physical layer of the network. As a Java programmer, you don't need to worry about
this layer unless something goes wrong—the plug falls out of the back of your computer,
or someone drops a backhoe through the T-1 line between you and the rest of the world.
In other words, Java never sees the physical layer.
The primary reason you'll need to think about the host-to-network layer and the phys‐
ical layer, if you need to think about them at all, is performance. For instance, if your
clients reside on fast, reliable fiber-optic connections, you will design your protocol and
applications differently than if they're on high-latency satellite connections on an oil rig
Search WWH ::




Custom Search