Java Reference
In-Depth Information
typing “ping localhost” in a command window. This address is unique to your
system and can be reached by any point on the Internet. Some
IP
addresses are
static; some are issued dynamically. A
DNS
takes a friendly name and translates
it to a valid
IP
address, which allows us to type (and remember) names like
IP
routing is handled hop-to-hop. A node delivering an
IP
message does
not need to know how to get to the ultimate destination. It only needs to
know the address of the next hop. A message being delivered from bruce.bit-
terjava.com to braden.austin.oberon.com might be delivered to bitter-
java.com, then oberon.com, then austin.oberon.com, and finally
braden.austin.oberon.com. The
IP
message has a timeout built in that pre-
vents infinite looping in the delivery process. If a message eventually times
out, it is discarded and the source is notified so that the message can be
retransmitted. Each node has a routing table, which contains the rules for
individual message dispatch.
Given these standards, we have the primitives necessary to create distrib-
uted applications. Since we can now assume that other Internet servers also
adhere to these standards, we can build additional application layers that
will enable increasing levels of cooperation. Following are some applica-
tion-level standards.
2.2.5
HTTP provides application-level transport
TCP
and
IP
are basically at the network and transport layers.
HTTP,
the proto-
col that browsers use to transfer web pages, moves up to the application layer.
It does not specify a connection, instead it uses
TCP
/
IP
for networking services.
In its simplest form,
HTTP
is a client
/
server protocol. In reality,
HTTP
has
matured to a library-level transport given its popular use for tunneling all
sorts of application-specific protocols. For example,
HTTPS
can be used to
send secure messages. The base
HTTP
protocol shields the application devel-
oper from the complexities of basic client
/
server communication. The client
specifies a resource in the form of a
URL
. The
URL
specifies the protocol, a
domain name, and a path. Once the
URL
is specified, a
TCP
session is estab-
lished, and the client can issue commands. The most common commands are
GET
and
POST
.
A
GET
request is used to request server documents. When the client issues
a
GET
, the server then sends back a content message consisting of status,
header, and data. The Multipurpose Internet Mail Extension (
MIME
), the
type standard, determines how the browser will display the data. Common
types are text
/
html for formatted text, text
/
plain for plain text, and image
/