Search code examples
network-programmingtcpdns

how much time elapses from when the client clicks on the link until the client receives the object?


Question

Suppose within your Web browser you click on a link to obtain a Web page. The IP address for the associated URL is not cached in your local host, so a DNS lookup is necessary to obtain the IP address. Suppose that n DNS servers are visited before your host receives the IP address from DNS; the successive visits incur an RTT of RTT1, . . ., RTTn. Further suppose that the Web page associated with the link contains exactly one object, consisting of a small amount of HTML text. Let RTT0 denote the RTT between the local host and the server containing the object. Assuming zero transmission time of the object, how much time elapses from when the client clicks on the link until the client receives the object?

My Attempt

When Client requests for Any HTTP service from Server the following Scenario takes place

  1. DNS request from DNS client to DNS server for requested server's IP address.
  2. After Recieving an IP address,A TCP Connection is initiated
  3. After Initiation of TCP connection,Cient will Request HTTP CLient request to HTTP Server using the IP address Obtained after DNS reply.

I will calculate time based on the above scenario.

In order to reach DNS Server to get IP Address we will require RTT1 + RTT2 +....+ RTTn . .

Calculate time taken for TCP connection

RTT0+RTT0=2RTT0

calculate time taken for Requesting object and recieving reply-:

RTT0+RTT0=2RTT0

Total time elapsed must be

RTT1 + RTT2 +....+ RTTn +2RTT0+2RTT0=RTT1 + RTT2 +....+ RTTn . +4RTT0

But answer is given as -:

The total amount of time to get the IP address is RTT1 + RTT2 +....+ RTTn . Once the IP address is known, RTTO elapses to set up the TCP connection and another RTTO elapses to request and receive the small object. The total response time is 2RTT0 + RTT1 + RTT2 +... RTTn

Where Am i Wrong?

Please help !


Solution

  • You only need 1 RTT to set up the TCP connection. and then One more RTT to get that object.