Application Layer

2.2 The Web and HTTP

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.2.2 Nonpersistent and Persistent Connections

HTTP can use both nonpersistent connections and persistent connections.  Although HTTP uses persistent connections in its default node, HTTP clients and servers can also be configured to use non-persistent connections instead.
 
Nonpersistent Connections
As the browser receives the Web page, it displays the page to the user.  Two different browsers may interpret a Web page in somewhat different ways.  HTTP has nothbing to do with how a Web page is interpreted by a client.  The HTTP specifications define only the communication protocol between the client HTTP program ans the server HTTP program.
 
We define the round-trip time (RTT), which is the time it takes for a small packet to travel from one client to server and then back to the client.  The  RTT includes packet-propagation delays, packet-queuing delays in intermediate routers and switches, and packet-processing delays. 
 
Persistent Connections
Nonpersistent connections have some shortcomings.  First, a brand-new connection must be established and maintained for each requested object.  For jeach of these connections, TCP buffers must be allocated and TCP variables must be kept in both the client and server.  This can place a serious burden on the Web server, which may be serving request from hundreds of different clients simultaneously.  Second, each object suffers a delivery delay of two RTTs--one RTT to establish the TCP connection and one RTT to request and receive an object.
 

kurose_320719_c02f07.gif

With persistent connections, the server leaves the TCP connection open after sending a response.  Subsequent requests and responses between the same client and server can be snet over the same connection.  In particualr, an entire Web page can be sent over a simgle persistent  TCP connection.  MOreover, multiple Web pagesresiding on the same server an be sent from the server to the same client over a single lpersistent TCP connection.
 
There are two versions fo persistent connections: without pipelinging and with pipelinging.  For the version without pipelinging, the client issuse a new request only when the previous response has been received.  In this case, the client experiences one RTT in order to request and receive each of the refered objects.  Although this is an improvement over nonpersistent's two RTT's per object, the RTT delay can be further reduced with pipelining.  Another disadvantage of no piplining is that after the server sends an oblject over the persistent TCP connection, the connection idles--does nothing--while it waits for another request to arrive.  This idling wastes server resources.
 
The default mode of HTTP uses persistent connections with pipelining.  With pipelining, the HTTP client issues a request as soon as it encounters a reference.  Thus the HTTP client can mak back-to-back requests for the refered objects; that is, it can make a new request before receiving a response to a previous request.When the server receives the back-to-back requests, it sends the objects back-to-back,  With pipelining, it is possible for only one RTT to be expended for all the referenced objects.  Futhermore, the pipedlined TCP connection remains idle for a smaller fraction of time.