MCQ-HTTP Non-Persistent & Persistent Connection

1. If an HTTP non-persistent connection requires 3 RTTs per request and there are 5 objects on a page, what is the total time required if each RTT is 50 ms?

a) 500 ms
b) 750 ms
c) 1000 ms
d) 1250 ms

Answer: d) 1250 ms

2. In a persistent connection, if the initial connection setup requires 2 RTTs and each of the 8 objects requires 1 RTT, what is the total time if RTT is 60 ms?

a) 480 ms
b) 520 ms
c) 600 ms
d) 680 ms

Answer: d) 680 ms

3. A browser needs to download 15 objects from a server. In a non-persistent connection, each request-response takes 2 RTTs, and in a persistent connection, the first request takes 2 RTTs and the rest take 1 RTT each. If RTT is 80 ms, how much time is saved using a persistent connection?

a) 560 ms
b) 640 ms
c) 720 ms
d) 800 ms

Answer: c) 720 ms

Conclusion

Non-persistent and persistent connections are two fundamental approaches in HTTP communication. Non-persistent connections, while simpler, result in increased latency due to frequent connection establishment. In contrast, persistent connections enhance efficiency by keeping a single connection open for multiple requests. Modern web applications prefer persistent connections to optimize performance and reduce network congestion.

Theoretical MCQ

1. In Non-Persistent HTTP:

a) A single TCP connection is used for all requests and responses.

b) A new TCP connection is established for each request/response pair.

c) TCP connections are kept alive for multiple requests, but the client waits for each response before sending the next request.

d) TCP connections are kept alive, and the client can send multiple requests without waiting for responses.

2. The primary advantage of Persistent HTTP over Non-Persistent HTTP is:

a) Reduced server load.

b) Faster retrieval of multiple files from the same server.

c) Improved security of data transmission.

d) Simpler server implementation.

3. HTTP Pipelining is a technique used with:

a) Non-Persistent HTTP. b) Persistent HTTP. c) Both Persistent and Non-Persistent HTTP. d) Neither Persistent nor Non-Persistent HTTP.

4. Which of the following is NOT a characteristic of Persistent HTTP?

a) TCP connection reuse.

b) Reduced latency for multiple requests.

c) Establishing a new TCP connection for each file transfer.

d) Potential for improved performance compared to Non-Persistent HTTP.

5. In a scenario where a web page has multiple embedded images, which HTTP connection method would generally result in the fastest page load time (assuming other factors like network congestion are constant)?

a) Non-Persistent HTTP. b) Persistent HTTP without pipelining. c) Persistent HTTP with pipelining. d) It depends on the server’s capabilities.

6. The major overhead in Non-Persistent HTTP is due to:

a) The time taken to transmit the data. b) The round-trip time (RTT) for establishing and closing TCP connections for each request. c) Server processing time. d) DNS lookups.

7. Which statement is TRUE about HTTP pipelining?

a) It eliminates the need for TCP connections.

b) It allows the client to send multiple HTTP requests without waiting for the server’s responses.

c) It guarantees that server responses will arrive in the same order as the requests.

d) It is only supported by older versions of HTTP.

8. If the Round Trip Time (RTT) is significantly larger than the data transmission time for each file, which HTTP method will see the most significant performance gain from pipelining?

a) Non-Persistent HTTP

b) Persistent HTTP

c) Neither method will see significant gain.

d) Both methods will see the same amount of gain.

Answers:

  1. b)
  2. b)
  3. b)
  4. c)
  5. c)
  6. b)
  7. b)
  8. b)

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *