Java Reference
In-Depth Information
port layer breaks the request into TCP segments, adds some sequence numbers and
checksums to the data, and then passes the request to the local internet layer. The internet
layer fragments the segments into IP datagrams of the necessary size for the local net‐
work and passes them to the host-to-network layer for transmission onto the wire. The
host-to-network layer encodes the digital data as analog signals appropriate for the
particular physical medium and sends the request out the wire where it will be read by
the host-to-network layer of the remote system to which it's addressed.
The host-to-network layer on the remote system decodes the analog signals into digital
data, then passes the resulting IP datagrams to the server's internet layer. The internet
layer does some simple checks to see that the IP datagrams aren't corrupt, reassembles
them if they've been fragmented, and passes them to the server's transport layer. The
server's transport layer checks to see that all the data arrived and requests retransmission
of any missing or corrupt pieces. (This request actually goes back down through the
server's internet layer, through the server's host-to-network layer, and back to the client
system, where it bubbles back up to the client's transport layer, which retransmits the
missing data back down through the layers. This is all transparent to the application
layer.) Once the server's transport layer has received enough contiguous, sequential
datagrams, it reassembles them and writes them onto a stream read by the web server
running in the server application layer. The server responds to the request and sends
its response back down through the layers on the server system for transmission back
across the Internet and delivery to the web client.
As you can guess, the real process is much more elaborate. The host-to-network layer
is by far the most complex, and a lot has been deliberately hidden. For example, it's
entirely possible that data sent across the Internet will pass through several routers and
their layers before reaching its final destination. It may need to be converted from radio
waves in the air to electrical signals in copper wire to light pulses in fiber-optic cables
and back again, possibly more than once. However, 90% of the time your Java code will
work in the application layer and only need to talk to the transport layer. The other 10%
of the time, you'll be in the transport layer and talking to the application layer or the
internet layer. The complexity of the host-to-network layer is hidden from you; that's
the point of the layer model.
Search WWH ::




Custom Search