Application Layer

2.1 Principles of Network Applications

Home
Introduction
2.1 Principles of Network Applications
2.1.1 Network Application Architectures
2.1.2 Processes Communcating
2.1.3 Application-Layer Protocols
2.1.4 What Services Does an Application Need?
2.1.5 Services Provided by the Internet Transport Protocols
2.2 The Web and HTTP
2.2.1Overview of HTTP
2.2.2 Nonpersistent and Persistent Connections
2.2.3 HTTP Message Format
2.2.4 User-Server Ineraction: Cookies
2.2.5 HTTP Content
2.2.6 Web Caching
2.2.7 The Conditional GET
2.3 File Transfer: FTP
2.3.1 FTP Commands and Replies
2.4 Electronic Mail in the Internet
2.4.1 STMP
2.4.2 Comparison with HTTP
2.4.3 Mail Message Formats and MIME
2.4.4 Mail Access Protocols
2.5 DNS--The Internet's Directory Service
2.5.1 Services Provided by DNS
2.5.2 Overview of How DNS Works
2.5.3 DNS Records and Messages
2.6 P2P File Sharing
2.7 Socket Programming with TCP
2.7.1 Socket Programming with TCP
2.7.2 An Example Client/Server Application in Java
2.8 Socket Programming with UDP

2.1.5 Services Provided by the Internet Transport Protocols

The Internet makes two transport protocols available to applications, UDP and TCP.  When you create a new network application for the Internet, one of the first decisions that you must make is whether to use UDP or TCP.  Each of these protocols offers a different service model to the invoking applications.
 
TCP Services
The TCP service model includes a connection-oriented service and a reliable data transfer service.  When an application invokes TCP for its transport protocol, the application receives both of these services from TCP.
 
  • Connection-oriented service: TCP has the client ans server exchange transport-layer control infornation with each other before the application-level messages begin to flow.  This so-called handshaking procedure alerts the client and server, allowing them to prepare for an onslaught of packets.  After the handshaking phase, a TCP connection is said to exist between the sockets of the two processes.  The connection is a full-duplex connection in that the two processes sna send messages to each other over the connection at the same time.
  • Reliable transport service: The communicating process can rely on TCP to deliver all data sent without error and in the proper order.  When one side of the applicaiton passes a stream of bytes into a socket, it can count on TCP to deliver the same stream of bytes to the receiving socket, with no missing or duplicate bytes.
 
 

kurose_320719_c02f04.gif

TCP also includes a congestion-control mechanism, a service for the general welfare of the Internet rather than for the direct benefit of the communicating process.  The TCP congestion-control mechanism throttles a sending process when the network is congested between sender and receiver.
 
The throttling of the transmission rate can have a very harmful effect on real-time audio and video applications that have a minimum required bandwidth constraint.  Moreover, real-time applications are loss-tolerant and do not need a fully reliable transport service.  For these reasons, developers of real-time applications usually run their applications over UDP rather than TCP.
 
UDP Services
UDP is a no-frills, lightweight transport protocol with a minimalist service model.  UDP is connectionless, so there is no handshaking before the two processes start to communicate.  UDP provides an unreliable data transfer service--that is, when a process sends a message into a UDP socket, UDP provides no guarantee that the message will ever reach the receiving process.

kurose_320719_c02f05.gif