You are on page 1of 10

Extra Problems On Chapter 2 (HTTP and FTP)

Question 1:

Part I - Among the words in brackets, underline (or circle) the correct one to

complete the text, only one word is correct.

- HTTP request is usually referred to as a (message, segment, packet) that will

be sent to a (DNS, SMTP, WEB) server on the port (25, 80, 53). Before sending

this request, a (TCP, UDP, HTTP) connection should be first established, and

this connection is usually initiated by the (server, client).

- P2P is pointed to as a (centralized, decentralized) communication system, in

which each end-host is called a (client, client/server, peer). These hosts

typically run the program process of (client, server, client/server), and they

(can, cannot) enter and leave the network so often, using (static, dynamic) IP

addresses.

Part II – Complete the following table.

- Fill in the names of the layers, a protocol that corresponds to each layer and the
name of the data unit in each one. Then, place the appropriate letter in the blank
associated with the layer for the proper description of its services below as
illustrated in the solved examples.
Name of the Protocols Name of data Proper
layer unit description
application HTTP,smtp, message d
Layer 5
dns,
transport UDP, TCP segment c
Layer 4
Netowork or IP Packet or b
Layer 3
internet datagram
Data link Ethernet frame e
Layer 2
Physical layer Analog/digital bit a
Layer 1

a) Provides a definition of mechanical and electrical standards for


communication system
b) Concerned with routing packets across a communication network
c) Provides end-to-end logical communication between application processes.
d) Format and transfer files between communication paradigm and the user’s
software
e) Frames of data are transferred across a single link
Question 2:

An HTTP file ceng415.html with size L is located at server1, this file references 4

images: Image1.jpg (size L1), Image2.jpg (size L2), Image3.jpg (size L3) and Image4.jpg

(size L4). The first 2 images are stored in server1, but Image3 and Image4 are stored in

another server: server2. Server1 is located at a distance d1, while server2 is at distance

d2 far away from the client.

Assume that we have a constant bit rate R, and a line speed S over all the links.

In terms of L, L1, L2, L3, L4, d1, d2, R and S, answer the following questions.

CENG415.html
Image1.jpg
Image2.jpg

Image3.jpg
Image4.jpg
d1
Server1

d2
Server2 Client

a. Find the Round Trip Times RTT1 between the client and server1 and RTT2 between
the client and server2.
RTT1= 2 * d1/s1 RTT2= 2 * d2/s2

b. If we are using a non-persistent http protocol, compute the total time that it would
take the browser on the client to retrieve the entire document.
Delay = RTT1 (connection with server1) + RTT1 (request and response for
ceng415.html) + L/R
+ RTT1 (connection with server1) + RTT1 (request and response for Image1.jpg) + L1/R
+ RTT1 (connection with server1)+ RTT1 + (request and response for Image2.jpg)
+L2/R
+ RTT2 (connection with server2) + RTT2 (request and response for Image3.jpg) +L3/R
+ RTT2 (connection with server2) + RTT2 (request and response for Image4.jpg)+L4/R
c. Re-calculate the total time to retrieve the entire document, if the client
browser now is using persistent http protocol without piplining.
Delay = RTT1(connection with server1) + RTT1 (request and response for

ceng415.html)+L/R

+ RTT1 (request and response for Image1.jpg) + L1/R

+ RTT1 (request and response for Image2.jpg) +L2/R

+ RTT2 (connection with server2) + RTT2 (request and response for


Image3.jpg) +/L3/R
+ RTT2 (request and response for Image4.jpg) +L4/R

d. Recalculate the total time to retrieve the entire document. If the browser
this time supports persistent with pipelining http protocol. (Assuming
same distance and same image length).

Server2 Client Server 1

RTT

2RTT + dtr

dtr

html

dtr
dtr
image 1
image 2

dtr
dtr
image 3 2RTT + 2 dtr
image 4

Delay = 2RTT + dtr + 2 RTT + 2dtr


Question 3:

Alice is shopping online via internet with a connection of 0.5 Mbps. The web page

of size 20 Kbytes contains 20 images of 15 Kbytes each. Assume that the one way

propagation delay is 2.5 ms.

a. How long does it take for the page (including images) to appear on
Alice’s screen, assuming non-persistent HTTP using a single
connection at a time? Show your calculation in details.
RTT= 2* one way propagation delay = 5 ms= 0.005 sec
Time to download the web page with non-persistent HTTP = 42 RTT + time
transmission of the base file (20 Kbytes) + time transmission of the 20 images (15
Kbytes each) = 42*0.005 + (8*20*103/0.5*106) + (20*8*15.103/0.5*106) = 0.21 +
0.32 + 4.8 = 5.33 sec

b. What would become the time for the page (including images) to appear
on Alice’s screen if she used persistent HTTP without pipelining
instead of non-persistent HTTP? Show your calculation in details.

Time to download the web page with persistent HTTP without pipelining = 22 RTT +
time transmission of the base file (20 Kbytes) + time transmission of the 20 images (15
Kbytes each) = 22*0.005 + (8*20*103/0.5*106) + (20*8*15.103/0.5*106) = 0.11 + 0.32 +
4.8 = 5.23 sec

c. Repeat part b) if persistent HTTP with pipelining is used. Again, show


your calculation in details.

Time to download the web page with persistent HTTP with pipelining = 3 RTT + time
transmission of the base file (20 Kbytes) + time transmission of the one image (15
Kbytes) = 3*0.005 + (8*20*103/0.5*106) + (8*15.103/0.5*106) = 0.015 + 0.32 + 0.24
= 0.575 sec

Question 4:

Choose the correct answer. Only one answer is correct in each question. HTTP with
persistent connections
a. requires 2 RTTs per object
b. requires the server to open a new TCP connection to send a response
c. provides higher security
d. none of the above

2. Cookies enable a Web server to


a. infect a user’s machine with malware
b. track a user’s activity at its own Web site
c. know all previous Web pages visited by the user
d. learn your full name, e-mail address and credit card information
3. FTP
a. uses TCP as transport layer protocol
b. provides a reliable, connection-oriented service for transferring files
c. uses port numbers 20 and 21
d. all of the above
4. The method POST of HTTP is used by a browser to:
a. request an object with empty entity body
b. request an object with a fill out form
c. upload an object to a given path
d. delete an object in a given path

5. To get an IP address for a given web page, local DNS server communicates first with
the:
a. Authoritative DNS server
b. TLD DNS server
c. Web server
d. Root DNS server

6. The response time of a web page with N objects for non persistent HTTP is equal to:
a. N. RTT + ∑
b. (2N). RTT + ∑
c. 2. RTT + transmission time of the largest object
d. (N+1). RTT + ∑

7. The response time of a web page with N objects for persistent HTTP without
pipelining is equal to:
a. N. RTT + ∑
b. (2N). RTT + ∑
c. 2. RTT + transmission time of the largest object
d. (N+1). RTT + ∑

8. The response time of a web page with N objects for persistent HTTP with pipelining
is equal to:
a. N. RTT + ∑
b. (2N). RTT + ∑
c. 3. RTT + ∑
d. (N+1). RTT + ∑

Question 5:

1. List two advantages of deploying a Web cache (i.e. a proxy server) in an institutional
network.

Low latency, outbound traffic, low connection cost etc.


2. Determine what transport layer protocol (TCP or UDP) you would use for each of the
following applications and justify your choice. (5 points)
a. File Transfer:
b. Live video streaming:
c. DNS server:
d. Web browser:
e. VoIP:

TCP for a and d (these applications require reliable transmission), UDP for b,c,e (these
applications require quick transmission)
3. A user in Beirut, connected to the internet via a 2 Mbps connection retrieves a 25 Kbytes
web page from a web server in Paris, where the page references 3 images of 200 Kbytes
each. Assume that the one way propagation delay is 20 ms.
a. How long does it take for the page (including images) to appear on the user’s screen,
assuming non-persistent HTTP using a single connection at a time?

RTT= 2* one way propagation delay = 40 ms


Time to download the web page with non-persistent HTTP = 8 RTT + time transmission of
the basefile (25 Kbytes) + time transmission of the 3 images (200 Kbytes each) = 8*40 ms +
(8*25.103/2.106) + (3*8*200.103/2.106) = 322.5 ms

b. What would become the time for the page (including images) to appear on the user’s
screen if he used persistent HTTP without pipelining in place of non-persistent
HTTP?

Time to download the web page with persistent HTTP without pipelining = 5RTT + time
transmission of the base file (25 Kbytes) + time transmission of the 3 images (200 Kbytes
each) = 5*40 ms + (8*25.103/2.106) + (3*8*200.103/2.106) = 222.5 ms

Question 6:

1) Name two well-known data transport protocols provided by the Internet


Transport Layer Provide a brief description of each service and indicate
what type of application might use that service
TCP and UDP
TCP is a connection oriented data service that provides a reliable loss free
end to end connection Peer to peer communication between applications is
often managed using TCP
UDP is an unreliable datagram service which provides end to end packet
delivery without recovery and retransmission for applications that might
wish to implement their own packet management and error recovery
protocols such as streaming applications.

2) Briefly describe how web caching can reduce the delay in receiving a
requested object. Will Web caching reduce the delay for all objects requested
by a user or for only some of the objects? Why?

Web caching can bring the desired content “closer” to the user.
If an object is present in the cache server we will not need more delays to bring it
from the original server. So web caching can reduce the delay for all objects, even
objects that are not cached, since caching reduces the traffic on links.

3) An HTTP file liu.html with size 1 KB is located at server1, this file


references 3 images: ImageA.jpg (stored on the same server server1),
ImageB.jpg (stored on a server 2), and ImageC.jpg (stored on server 3).
Assume the size of control packets is negligible. Server1 is located at a
distance 10 KM, while server2 and server 3 are at distance 20 KM far
away from the client. Assume that we have a constant bit rate 100 Kb/s,
and a line speed 2.5 108 m/over all the links.

a. Find the Round Trip Times RTT1, RTT2 and RTT3 between the client and
the 3 servers Server1, Server2 and Server 3.
RTT1= 2 * propagation time to server 1 = (2*10000m)/(2.5 108 m/s) = 0.8 ms
RTT2= (2*20000m)/(2.5 108 m/s) = 1.6 ms
RTT3= (2*20000m)/(2.5 108 m/s) = 1.6 ms

b. If we are using a non-persistent http protocol, compute the total time


that it would take the browser on the client to retrieve the entire
document
RTT1 (connection to server 1)
+RTT1 + 1KB/100kbps (request and response of .html)
+RTT1 (connection to server 1)
+ RTT1 + LA/100kbps (request and response of ImageA)
+ RTT2 (connection to server 2)
+ RTT2 + LB/100kbps (request and response of ImageB)
+ RTT3 (connection to server 3)
+ RTT3 + LC/100kbps (request and response of ImageC)

c. Re-calculate the total time to retrieve the entire document, if the client
browser now is using persistent http protocol without pipelining

RTT1 (connection to server 1)


+RTT1 + 1KB/100kbps (request and response of .html)
+ RTT1 + LA/100kbps (request and response of ImageA)
+ RTT2 (connection to server 2)
+ RTT2 + LB/100kbps (request and response of ImageB)
+ RTT3 (connection to server 3)
+ RTT3 + LC/100kbps (request and response of ImageC)
d. Recalculate the total time to retrieve the entire document. If the browser
this time supports a parallel (with pipelining) persistent http protocol

RTT1 (connection to server 1)


+RTT1 + 1KB/100kbps (request and response of .html)
+ max[
RTT1 + LA/10kbps (request and response of ImageA),
RTT2 (connection to server 2) + RTT2 + LB/10kbps (request and response
of ImageB) ,
RTT3 (connection to server 3) + RTT3 + LC/10kbps (request and response
of ImageC) ]

Question 7:

1. Consider the following FTP traces:

Source Destination Protocol Info


74.205.116.197 192.168.1.68 FTP Response : 220
192.168.1.68 74.205.116.197 FTP Request: USER Ali
74.205.116.197 192.168.1.68 FTP Response: 331
________________
192.168.1.68 74.205.116.197 FTP Request: PASS 12AB005#415
74.205.116.197 192.168.1.68 FTP Response: User Ali logged in
192.168.1.68 74.205.116.197 FTP Request: STOR
CENG415_quiz1.doc
74.205.116.197 192.168.1.68 FTP Response: 452 ___________
a) What is response 331?
Accept user request password

b) What is the IP address of FTP server?


74.205.116.197
c) Do you see that the connection is secured?
NO I see the password

d) Was the user able to store the file? How did you know?

No. Since code 452 means an error is occured

2. Why is it said that FTP sends control information "out-of-band"?

FTP uses two parallel TCP connections, one connection for sending control
information (such as a request to transfer a file) and another connection for actually
transferring the file. Because the control information is not sent over the same
connection that the file is sent over, FTP sends control information out of band.

Question 7:

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
2RTTo  RTT1  RTT2    RTTn
a)
RTT1   RTTn  2RTTo  8  2RTTo
 18RTTo  RTT1    RTTn .
b)
RTT1   RTTn  2RTTo  2  2RTTo
 6RTTo  RTT1    RTTn
c) RTT1    RTTn  2RTTo  RTTo
 3RTTo  RTT1    RTTn .

You might also like