[SOLVED] COSC328-Lab 2

20.99 $

Category:

Description

Rate this product
  • SSL (and TSL) operates at the application layer. In order to implement it, a developer invokes an SSL (or TSL) library in both the client and server codebases. The client side will take clear text arguments, a password for example, and pass it to the SSL socket. The SSL socket will encrypt the data, send it to the server, then the server will use SSL code to decrypt the message.
  • The TCP requires a socket on the server side to handle the handshake from the client, then all the data received from the client is routed to the connection socket. UDP does not require a handshake between client and server, so the data is sent directly to the server socket from the client socket. For a TCP server with n simultaneous connections, the server will require one handshake or welcome socket plus n connection sockets, so n+1 sockets in total.
  • a) The average time to send an object over the access link is given by

Δ = L/R = 850,000bits/15,000,000 bps = 0.0567 s

This means the average access delay is given by

Δ/(1-Δβ) = 0.0567s/(1-0.0567s * 16 requests/s) = 0.607 s/request

The average time from the router on the internet side of the access link to a given server is 3 s, so the total access delay is given by

0.607 s + 3 s = 3.607 s

  1. b) If 60% of the requests are satisfied by the cache, this means overal traffic intensity is reduced by 60% as well. The average access delay will decrease as such:

Δ/(1-0.4Δβ) + 3 s = 0.0567s/(1-0.4*0.0567s * 16 requests/s) + 3 s = 3.889 s/request

Cached responses happen near instantaneously, at a frequency of 60%. The requests that actually access the internet occur 40% of the time, so the total response time is given by

0.6 * 0 s + 0.4 * 3.889 s = 1.236 s a significant improvement over the 3.607 uncached response time.

4)

Distribution F us di u N D
Client-server 15 Gbits 30 Mbps 2 Mbps 300 Kbps 10 7680s
Client-server 15 Gbits 30 Mbps 2 Mbps 300 Kbps 1000 512,000s
Client-server 15 Gbits 30 Mbps 2 Mbps 2 Mbps 10 7680s
Client-server 15 Gbits 30 Mbps 2 Mbps 2 Mbps 1000 512,000s
P2P 15 Gbits 30 Mbps 2 Mbps 300 Kbps 10 7680s
P2P 15 Gbits 30 Mbps 2 Mbps 300 Kbps 1000 47558.78s
P2P 15 Gbits 30 Mbps 2 Mbps 2 Mbps 10 7680s
P2P 15 Gbits 30 Mbps 2 Mbps 2 Mbps 1000 7680s

For client-server distribution, the time to distribute a file of size F to N clients is given by

Dc-s >= max{NF/us, F/dmin}

So the upload rate of peers u is irrelevant, and as an example, the total time to download for 10 clients is given by

Dc-s >= max{NF/us, F/dmin} = max{10*15Gbit/30Mbps, 15Gbit/2Mbps}

= max{10*15*1024 Mbit/30Mbps, 15 * 1024 Gbit / 2 Mbps} = max{5120s, 7680s}

= 7680s = 2 hr 8 min and similarly for the other three rows. max{512,000s, 7680s}

For peer-to-peer distribution, the time is given by

DP2P >= max{F/us, F/dmin, NF/(us + Σu)}

As an example, the first row in the P2P table is calculated as:

DP2P >= max{F/us, F/dmin, NF/(us + Σu)}

= max{15Gbit/30Mbps, 15Gbit/2Mbps, 10*15Gbit/(30Mbps + 10*300Kbps)}

= max{15*1024Mbit/30Mbps, 15*1024Mbit/2Mbps, 10*15*1024Mbit/(30Mbps +

10*300/1024Mbps)}

= max{512s, 7680s, 4664.48s} = 7680 s = 2 hr 8 min and similarly for the other three rows.

max{512s, 7680s, 47,558.78s}            max{512s, 7680s, 3072s}          max{512s, 7680s, 7566.50}

  • a) TCP b) UDP c) UDP d) UDP e) TCP  f) UDP
  • a) localhost/index.html
  1. b) The browser is requesting a persistent connection; the Connection field of the request header indicates Keep-Alive, meaning keep the connection open until it times out.

7) a) Using non-persistent connections, the order of connections is as such: i) Client initiates TCP connection ii) Server acknowledges connection iii) Client requests HTML document

  1. iv) Server acknowledges requests and begins sending HTML document v) Client receives HTML document vi) Server closes connection
  • Client unpacks HTML document, sees reference to four image files
  • Client repeats above for all four images

This means each object will involve two TCP connections and the file transfer time, so the total time is given by: ttot = 0.1 s * 2 * 5 + 10,000bit / 10 * 10242 bps + 4 * 50,000bit / 10 * 10242 bps = 1.02 s

  1. If the browser is able to open any number of parallel connections, the first step to obtain the HTML remains the same, but then all four images can be obtained concurrently. Hence ttot = 0.1 s * 2 * 2 + 10,000bit / 10 * 10242 bps + 50,000bit / 10 * 10242 bps = 0.406 s
  2. In a persistent connection with no pipelining and parallel connections, the client will require two RTT to initiate the TCP handshake with server 1, then transfer the HTML document, see the references to the images, begin the transfer of the three images from server 1 while concurrently setting up a TCP handshake with server 2 and transferring the image file from there. In other words, four RTT times will be necessary plus the HTML file transfer and one image transfer time, or ttot = 0.1 s * 2 * 2 + 10,000bit / 10 * 10242 bps + 50,000bit / 10 * 10242 bps = 0.406 s

This is effectively the same result as a non-persistent connection with concurrency. However, with pipelining, the client will request the images as it encounters a reference to them in the HTML document. Unless the image on server 2 is at the very end of the HTML document, this means the TCP handshake will occur some time during the HTML document transfer. Assuming the image on server 2 is referenced at the very beginning of the HTML file, it will effectively negate the transfer time of the html file, or

ttot = 0.1 s * 2 * 2 + 50,000bit / 10 * 10242 bps = 0.405 s which is the fastest of the four options (although only by one ms).

8) a)

Time (ms) Request type Details
0 HTTP GET m1.a.com performs a HTTP GET for the file at www.b.com. Message sent to local HTTP cache (based on question assumptions, no time taken)
~0 DNS

REQUEST

m1.a.com performs a DNS REQUEST to obtain the IP for www.b.com from its local DNS server, since the local cache did not have the address.

No time based on assumptions.

~0 DNS

REQUEST

Local DNS server does not have the entry cached, requests from rootlevel DNS
50 DNS

RESPONSE

DNS REQUEST arrives at root-level server, sends back DNS RESPONSE with top level domain (TLD)
100 DNS

REQUEST

Local DNS receives the root-level DNS response, sends a DNS

REQUEST to the TLD DNS

150 DNS

RESPONSE

TLD DNS receives the request and send a response containing the authoritative DNS
200 DNS

REQUEST

The local DNS receives the reply with the authoritative DNS, sends DNS REQUEST to authoritative DNS (25 ms to get to www.b.com servers)
225 DNS

RESPONSE

Authoritative DNS in www.b.com domain receives the request and sends a DNS RESPONSE with the A record for www.b.com
250 DNS

RESPONSE

DNS RESPONSE received by local DNS and forwarded to HTTP cache
~250 HTTP GET (TCP handshake init) Local HTTP cache initiates TCP handshake with www.b.com for the file, requiring one RTT before the request can be sent
300 HTTP GET (SENT) Local HTTP performs HTTP GET to www.b.com for the file
350 HTTP

RESPONSE

www.b.com responds with the document, begins transmitting. t = 10 ms (b LAN) + 1000 ms (on 1 Mbps link) + 100 ms (a LAN) = 1110 ms
1460 HTTP

RESPONSE

Local HTTP cache sends HTTP RESPONSE to m1.a.com, taking 100 ms to transmit
1560 None File has arrived in full to m1.a.com

b)

Time (ms) Request type Details
0 HTTP GET m2.a.com performs a HTTP GET for the file at www.b.com. Message sent to local HTTP cache (based on question assumptions, no time taken)
~0 HTTP GET Local HTTP cache has a copy of the file and the IP address for www.b.com Sends HTTP conditional GET to www.b.com
75 HTTP

RESPONSE

www.b.com receives the request and responds that the file is unchanged, and that it will not be transmitted.
100 HTTP

RESPONSE

Local cache receives the message that the file from www.b.com is unchanged, sends HTTP RESPONSE with the file to m2.a.com t = 100 ms
200 None File has arrived in full to m2.a.com