The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+6 votes

Consider Amit lives in Delhi, connected to the internet via a 100 Mbps connection retrieve a 250 KB webpage from server in Bangalore, where page contain 3  images of 500 KB each. Assume one way propagation delay is 75 ms and Amit’s access link is the bandwidth bottleneck for this connection. If T1 is the time taken for the page with images to appear on Amit’s screen using nonpersistent HTTP and T2 is time using persistent connection, then T = T1 – T2 will be ________  msec.

asked in Computer Networks by (141 points) | 422 views

2 Answers

+14 votes
Best answer

For non persistent we have to make the connection request after every object while in Persistent we can view all object in one go.
Here the total transmission time is nothing but the transmission time of page with all three images. 

answered by Active (1.5k points)
selected by

Rally wonder explanation ..thanks @sumit

but their is small doubt in nonpersistent what for third transimission is ?
Third transmission is requesting for the first object.
for first object or for base file..?
For first object, as it already connected with the basefile. Let's take example of internet banking, there you have to first connect with the base account by entering the login credentials. Once you are connected you have to enter the transition password for every transition (money transfer).
so response for base file comes in second RTT itself..isn't it?
superb explanation thakur sahab
Shukriya bhai
I have one doubt in persistent connection.

After connection establishment the base file comes in second reply and and for 3 image files client has to request again and those 3 image files comes in third reply. So, total 2 RTT here.

But isn't it possible that client request base webpage and and 3 image files in one single request and server sends them in one single reply? That is only 1 RTT.
from where 140 ms comes
awesome explaination .

In non  persistent connection we have to close the connection also after receiving the object . Why we are not considering here that time . Also for connection establishment 3 way handshake is done which requires time of 1.5 RTT .
I also think that this solution is not correct , for connection establishment it should take 1.5 RTT.

Also in diagram for non persistent connection , for better clarity all four connection establishment should be drawn beside one other and not after one other , if you are drawing after one other where does connection closure time goes?

so it should be like

connection 1 establishment

webpage transfer

connection 1 closure                    connection 2 establishment

                                                     image 1 transfer

                                                     connection 2 closure                     connection 2 establishment

                                                                                                          image 2 transfer

                                                                                                           connection 2 closure     

similarly for image 3
+3 votes

Given data rate $= 100\space Mbps$

One way propagation delay  $= 75\space ms$
Round Trip Time $RTT = 2$ x One way propagation delay  $= 2$ x $75 ms\space = 150\space ms$


In $non-persistent\space HTTP$, we need one TCP connection each for $each\space object$ sent. Here, we have to send $4$ objects $\rightarrow\space$ $1\space$ base file (web page) and $3$ images. 

Client Action Server Action Time requred
Request Connection Accept Connection 1 RTT
Request Webpage

Accept Request

Send Web page


Receive Webpage

(Finds 3 objects)

Close connection Transmission Time
Request Connection Accept Connection 1 RTT
Request Image 1

Accept Request

Send Image1

Receive Image 1 Close connection Transmission Time
Request Connection Accept Connection 1 RTT
Request Image 2

Accept Request

Send Image 2

Receive Image 2 Close connection Transmission Time
Request Connection

Accept Connection

Request Image 3

Accept Request

Send Image 3

Receive Image 3 Close Connection Transmission Time

Thus, the total time is $T1 = 4* 2 RTT +$ Total Data Transmission time

Transmission time $= \frac{Amount\space of\space data}{Data\space Rate} = \frac{250 KB + 3 * 500 KB}{100\space Mbps }= \frac{(250*8 + 3*500*8) Kb}{100\space Mbps}$
    $=  \frac{(2000 + 12000) . 10^3 }{ 100 * 10^6} \space s = 140\space ms$

Now $T_1 = 4*2*150\space  ms+ 140\space ms = 1340\space ms$


$Persistent\space HTTP$ is the idea of using a single TCP connection to send and receive multiple HTTP requests/responses. All objects will be sent with a single request here. 

Client Action Server Action Time Required
Request Connection Accept Connection 1 RTT
Request Web page

Accept Request

Send Web page


Receive Web page

(Finds 3 objects)

Close connection Transmission Time
Request all objects

Accept Request

Send all objects

Receive all objects Close connection Transmission Time

So, total time here is $T_2 = 3* RTT +$ Total Data Transmission Time
        $= 3* 150\space ms + 140\space ms = 590\space ms$


Therefore $T_1 - T_2 = 1340\space ms - 590\space ms = 750\space ms$.

answered by Active (1.3k points)
in the persistent http , after establishing the tcp connection why can't we get the webpage as well as all the 3 images over this single connection so that t2=2*rtt + transmission time for the entire data ?
The base file (web page - html/txt) always has to be loaded first to allow some more exchanges between the client and the server before the needed resources are sent. for example

i) Cookies : Cookies are files containing user specific data like selections in a form, shopping cart contents, or authentication data stored in the $client\space  computer$. If the cookies are not already set, it is set by the cookie information the server sent along with the base file. The client sends this information also in the later requests. This is needed because otherwise the server has to keep different sets of web pages for different users.

ii) Web Cache : Web cache is a storage nearer to the client than the server. It is to load resources fast. Only after reading the base file the client know what resources are needed, and hence can make use of the web cache. If an updated cached version is found, client sends this information also along with the later request so that the server responds with blank. So if all the resources are sent by the server upfront, it simply increases the overhead, or the web cache will be useless.
nice explanation @ arungate

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
47,894 questions
52,260 answers
67,679 users