Java Reference
In-Depth Information
that packets are delivered in the correct order (or at all). However, UDP is often much
faster than TCP. TCP is called a reliable protocol; UDP is an unreliable protocol. Later,
you'll see that unreliable protocols are much more useful than they sound.
The Application Layer
The layer that delivers data to the user is called the application layer . The three lower
layers all work together to define how data is transferred from one computer to another.
The application layer decides what to do with the data after it's transferred. For example,
an application protocol like HTTP (for the World Wide Web) makes sure that your web
browser displays a graphic image as a picture, not a long stream of numbers. The ap‐
plication layer is where most of the network parts of your programs spend their time.
There is an entire alphabet soup of application layer protocols: in addition to HTTP for
the Web, there are SMTP, POP, and IMAP for email; FTP, FSP, and TFTP for file transfer;
NFS for file access; Gnutella and BitTorrent for file sharing; the Session Initiation Pro‐
tocol (SIP) and Skype for voice communication; and many, many more. In addition,
your programs can define their own application layer protocols as necessary.
IP, TCP, and UDP
IP, the Internet protocol, was developed with military sponsorship during the Cold War,
and ended up with a lot of features that the military was interested in. First, it had to be
robust. The entire network couldn't stop functioning if the Soviets nuked a router in
Cleveland; all messages still had to get through to their intended destinations (except
those going to Cleveland, of course). Therefore, IP was designed to allow multiple routes
between any two points and to route packets of data around damaged routers.
Second, the military had many different kinds of computers, and all of them had to be
able to talk to one another. Therefore, IP had to be open and platform-independent; it
wasn't good enough to have one protocol for IBM mainframes and another for PDP-11s.
The IBM mainframes needed to talk to the PDP-11s and any other strange computers
that might be lying around.
Because there are multiple routes between two points, and because the quickest path
between two points may change over time as a function of network traffic and other
factors (such as the existence of Cleveland), the packets that make up a particular data
stream may not all take the same route. Furthermore, they may not arrive in the order
they were sent, if they even arrive at all. To improve on the basic scheme, TCP was
layered on top of IP to give each end of a connection the ability to acknowledge receipt
of IP packets and request retransmission of lost or corrupted packets. Furthermore,
TCP allows the packets to be put back together on the receiving end in the same order
they were sent.
Search WWH ::




Custom Search