728x90
2.2.1 Overview of HTTP
- 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
- A Web page (also called a document) consists of objects. An object is simply a file—such as an HTML file, a JPEG image, a Java applet, or a video clip—that is addressable by a single URL
- The base HTML file references the other objects in the page with the objects’ URLs. Each URL has two components: the hostname of the server that houses the object and the object’s path name

- The URL has www.someSchool.edu for a hostname and /someDepartment/picture.gif for a path name.
- HTTP defines how Web clients request Web pages from Web servers and how servers transfer Web pages to clients
- HTTP uses TCP as its underlying transport protocol (rather than running on top of UDP).
- 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.
2.2.2 Non-Persistent and Persistent Connections
- When this client-server interaction is taking place over TCP, the application developer needs to make an important decision—should each request/response pair be sent over a separate TCP connection, or should all of the requests and their corresponding responses be sent over the same TCP connection?
- In the former approach, the application is said to use non-persistent connections; and in the latter approach, persistent connections.
HTTP with Non-Persistent Connections
- Let’s suppose the page consists of a base HTML file and 10 JPEG images, and that all 11 of these objects reside on the same server. Further suppose the URL for the base HTML file is

- The steps above illustrate the use of non-persistent connections, where each TCP connection is closed after the server sends the object—the connection does not persist for other objects.
- Note that each TCP connection transports exactly one request message and one response message
- Before continuing, let’s do a back-of-the-envelope calculation to estimate the amount of time that elapses from when a client requests the base HTML file until the entire file is received by the client.
- we define the 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.
- this causes the browser to initiate a TCP connection between the browser and the Web server; this involves a “three-way handshake”—the client sends a small TCP segment to the server, the server acknowledges and responds with a small TCP segment, and, finally, the client acknowledges back to the server.
- The first two parts of the three-way handshake take one RTT
- After completing the first two parts of the handshake, the client sends the HTTP request message combined with the third part of the three-way handshake (the acknowledgment) into the TCP connection.
- Once the request message arrives at the server, the server sends the HTML file into the TCP connection.
- This HTTP request/response eats up another RTT. Thus, roughly, the total response time is two RTTs plus the transmission time at the server of the HTML file.
HTTP with Persistent Connections
- Non-persistent connections have some shortcomings.
- First, a brand-new connection must be established and maintained for each requested object.
- 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 HTTP 1.1 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.
In particular, an entire Web page (in the example above, the base HTML file and the 10 images) can be sent over a single persistent TCP connection.
- These requests for objects can be made back-to-back, without waiting for replies to pending requests (pipelining)
- Typically, the HTTP server closes a connection when it isn’t used for a certain time (a configurable timeout interval).
- The default mode of HTTP uses persistent connections with pipelining.
728x90
'네트워크' 카테고리의 다른 글
http프로토콜의 특징, 장점과 단점 (0) | 2023.12.19 |
---|---|
네트워크란? ip란? 서브넷마스크란? (2) | 2023.10.15 |
2.1.3 Transport Services Available to Applications (0) | 2023.07.18 |
Chapter 2 Application Layer (0) | 2023.07.15 |
1.6 Networks Under Attack (0) | 2023.07.13 |
댓글