in Computer Networks retagged by
15,185 views
17 votes
17 votes
Assume that you have made a request for a web page through your web browser to a web server. Initially the browser cache is empty. Further, the browser is configured to send $\textsf{HTTP}$ requests in non-persistent mode. The web page contains text and five very small images.The minimum number of $\textsf{TCP}$ connections required to display the web page completely in your browser is__________.
in Computer Networks retagged by
by
15.2k views

4 Comments

What should be the answer if persistent-mode is used?
0
0

then it will be 1 only.

1
1
In persistence connection all the things you can access in only one time TCP connection i.e. after DNS reply because before searching anything on HTTP apply for DNS to get IP address of that web browser.
0
0
Minimum no of  $\textsf{TCP}$ required = $1$ for text $+$ $5$ for images = $6$
0
0

3 Answers

35 votes
35 votes
Best answer

In $\textsf{HTTP}$ non-persistent connection, each time a request is served by the server, the connection is automatically closed by the server.

So we need $1$ connection for web page and $5$ for images. Thus, in total we need $6$ $\textsf{TCP}$ connections to fetch web page completely.

Answer: 6

selected by

4 Comments

@Vishal The 5E edition is correct. Here is a snippet from Ross, reinforcing n+1 connections, +1 for the base HTML file.

5
5

@Vishalkumar98

So , what’s the conclusion? for N files it will take N times connections or N+1  times connections?

and one more question!

here for text we are not considering any extra connection right? it will be included in the connection to fetch the webpage? or it's vice versa?

3
3

 for N files it will take N times connections or N+1  times connections?

@Pranavpurkar

A web server will consist of different files, a file will contain different objects. When we open a new connection, we can access one of the files, but to fetch the objects inside the file we need new connections.

eg 1 file in a server has 10 objects, so we need one connection to establish a connection through port 80 and fetch that file, and then we need 10 extra connections to fetch the objects in the file. So a total of 11 connections are required.

For N files, it depends on the number of objects inside each file.

here for text we are not considering any extra connection right? it will be included in the connection to fetch the webpage? or it's vice versa?

Yes, we are not considering an extra connection for text because, if you have ever done web development you will see the text is contained inside the HTML file, but the images are actually stored inside the local directory or server, we just reference it in our HTML. That’s why we need a separate connection to fetch them.

8
8
12 votes
12 votes
Since, Browser cache is empty, first of all DNS will complete its DNS translation, but that would be a UDP connection, so you don't need to worry about it!

After that, first TCP connection will be established which will be used to request the BASE HTML FILE. After the client extracts the base html file, it will Request for the five referenced objects of the pagr using five different TCP connections.

Hence, total 6 TCP connections would be required.
4 votes
4 votes
6

In non-persistent HTTP for every object there is a TCP connection required. Hence 1 TCP connection for text and 5 TCP connections for images required. So, total of 6 TCP connections are required.
Answer:

Related questions