The Web & HTTP (M1.5)

 The Web was the first Internet application 

The HyperText Transfer Protocol (HTTP) 

  • The Web’s application-layer protocol,is at the heart of the Web. 
  • HTTP is implemented in two programs: a client program and a server program. 
  • The client program and server program, executing on different end systems, talk to each other by exchanging HTTP messages. 
  • HTTP defines the structure of these messages and how the client and server exchange the messages.
  • HTTP defines how Web clients request Web pages from Web servers and how servers transfer Web pages to clients.    
HTTP Protocol | InnovationM Blog
  • When a user requests a Web page (for example, clicks on a hyperlink), the browser sends HTTP request messages to the server. 
  • The server receives the requests and responds with HTTP response messages that contain the objects.  
  • HTTP uses TCP as its underlying transport protocol (rather than running on top of UDP). 
  • The HTTP client first initiates a TCP connection with the server. Once the connection is established, the browser and the server processes access TCP through their socket interfaces.   
It is important to note that the server sends requested files to clients without storing any state information about the client. If a particular client asks for the same object twice in a period of a few seconds, the server does not respond by saying that it just served the object to the client; instead, the server resends the object, as it has completely forgotten what it did earlier. Because an HTTP server maintains no information about the clients, HTTP is said to be a stateless protocol. 
 
Round-trip time(RTT), which is the time it takes for a small packet to travel from 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.  

HTTP can use both nonpersistent connections and persistent connections. 

A nonpersistent connection is the one that is closed after the server sends the requested object to the client. In other words, the connection is used exactly for one request and one response.

Non-persistent connections have some shortcomings. First, a brand-new connection must be established and maintained for each requested object. For each of these connections, TCP buffers must be allocated and TCP variables must be kept in both the client and server. This can place a significant burden on the Web server,which may be serving requests from hundreds of different clients simultaneously. Second, as we just described, 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.
 
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 sent over the same connection.
 
 
Cookies, allow sites to keep track of users. Most major commercial Web sites use cookies today. 

No comments:

Post a Comment

Monk and Inversions

using System; public class Solution { public static void Main () { int T = Convert . ToInt32 ( Console . ReadLine...