Untitled

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Faculty of Computer & Instructor: Dr.

Islam Hegazy
Information Sciences Academic year: 2021-2022
Ain Shams University Assignment: 1 (17/08/2022)
Course Name: Computer Networks Duration: 3 days
Year: (Summer term) 3rd undergraduate Total Grade: 50

Answer the following questions


1. Two hosts are directly connected by a 100 KM fiber optics cable so there is neither
queuing nor processing delay. What is the expected RTT if a bit moves on the cable
with speed of 2 * 108 m/s? (2 marks)
Sol:
RTT = 2 * (dproc + dqueue + dprop) = 2 * (d/s) = 2 * (100*103 / (2 *108)) = 1 ms
2. Two hosts are connected by a 5 Mbps link of length 100 km. A bit moves with a speed
of 2.8 * 108 m/s on the link. Host A converts the data to a 128 kbps bit stream and
groups them into 32-byte packets. How long does it take a bit generated at Host A to
reach Host B? (2 marks)
Sol:
Time to form a packet = (32 * 8) / (128 * 103) = 0.002 sec = 2 msec
Transmission delay = L / R = (32 * 8) / (5 * 106) = 0.0000512 sec = 51.2 sec
Propagation delay = d / s = (100 * 103) / (2.8 * 108) = 0.000357 sec = 357 sec
Total delay = 0.002 + 0.0000512 + 0.000357 = 0.0024082 sec = 2.4082 msec
3. Suppose users share a 5 Mbps link. Also suppose each user transmits continuously at 1
Mbps when transmitting, but each user transmits only 25 percent of the time. Suppose
that packet switching is used.


i. How many users can be supported if circuit switching is used? (1 mark)
ii. Find the probability that a given user is transmitting. 
 (1 mark)
iii. Suppose now there are 30 users. Find the probability that at any given time
at most three users are active. (2 marks)
Sol:
i. 5 users only
ii. Probability that a given user is transmitting = 𝒑(𝟏 − 𝒑)𝒏−𝟏 = 0.25*(0.75)4=
0.079
iii. Probability that three users are transmitting simultaneously =
𝑛 𝒎 𝟑𝟎 𝟑𝟎
∑𝑖≤𝑚
𝑖=0 (𝑚 ) 𝒑 (𝟏 − 𝒑)
𝒏−𝒎
= ( ) 𝒑𝟎 (𝟏 − 𝒑)𝟑𝟎 + ( ) 𝒑𝟏 (𝟏 − 𝒑)𝟑𝟎−𝟏 +
𝟎 𝟏
𝟑𝟎 𝟐 𝟑𝟎−𝟐 𝟑𝟎 𝟑 𝟑𝟎−𝟑
( ) 𝒑 (𝟏 − 𝒑) + ( ) 𝒑 (𝟏 − 𝒑) = 0.037
𝟐 𝟑
4. A 10 MB file takes 400 sec to reach 10 clients using the client-server architecture. Each
client has an upload rate 512 Kbps and download rate 512 Kbps. (4 marks)
i. What is the upload rate of the server?
ii. How long does it take to distribute the same file on a P2P network?
Sol:
𝑁𝐹 𝐹 10∗10∗106 ∗8 10∗106 ∗8
i. 𝐷𝑐𝑠 = max { 𝑢 , } = max { , } = 400 𝑠𝑒𝑐
𝑠 𝑑𝑚𝑖𝑛 𝑢𝑠 512∗103

1
10 ∗ 10 ∗ 106 ∗ 8
= max { , 156.25} = 400 𝑠𝑒𝑐
𝑢𝑠
10∗10∗106 ∗8
us = = 2 Mbps
400
𝐹 𝐹 𝑁𝐹 10∗106 ∗8 10∗106 ∗8 10∗10∗106 ∗8
ii. 𝐷𝑝2𝑝 = max {𝑢 , ,𝑢 𝑁 } = max { , , 2∗106 +10∗512∗103}
𝑠 𝑑𝑚𝑖𝑛 𝑠 +∑𝑖=1 𝑢𝑖 2∗106 512∗103
= max {40, 156.25, 112.36} = 156.25 sec

5. An institutional network is connected to the Internet with an access link of capacity


1.54 Mbps and the capacity of the institution’s LAN is 10 Mbps. Suppose that clients
on the LAN requests objects with average size 100 Kbits and that the average request
rate from the clients to the servers on the Internet is 15 requests per second. Also,
suppose that the Internet delay is 2 seconds on average. (4 marks)
i. Find the total average response time.
ii. Now suppose a cache is installed in the institutional LAN. Suppose the miss
rate is 0.4. Find the total response time.
Sol:
L = 100 Kbits/request = 100 * 103 bits/request
Ra = 1.54 Mbps = 1.54 * 106 bps
Rl = 10 Mbps = 10 * 106 bps
a = 15 req/sec
miss = 0.4
i. Access link intensity = aL/Ra = 15 * 100 * 103 / 1.54 * 106 = 0.97
Access link delay = (L/Ra) / (1 – access link intensity) = 2.16 sec
LAN intensity = aL/Rl = 0.15
LAN delay = (L/Rl) / (1 – LAN intensity) = 0.012 sec
Total response time = Internet delay + Link delay + LAN delay
= 2 + 2.16 + 0.012 = 4.172 sec
ii. Access link delay = (L/Ra) / (1 – miss * access link intensity) = 0.106
Total response time = miss * (Internet delay + Link delay + LAN delay) + hit
* LAN delay = 0.85 sec

6. Calculate the TimeoutInterval if the SampleRTT is 100 ms with  = 0.25 and  = 0.25.
Assume that the EstimatedRTT was 190 ms and DevRTT was 50 ms before the given
SampleRTT. (2 marks)

Sol:
EstimatedRTT = (1 - ) * EstimatedRTT +  * SampleRTT
= 0.75 * 190 * 10-3 + 0.25 * 100 * 10-3 = 0.1675 sec
DevRTT = (1 - ) * DevRTT +  * | SampleRTT – EstimatedRTT |
= 0.75 * 50 * 10-3 + 0.25 * | 100 * 10-3 – 0.1675| = 0.054375 sec
TimeoutInterval = EstimatedRTT + 4 * DevRTT
= 0.1675 + 4 * 0.054375 = 0.385 sec

7. If TCP throughout is 1 Gbps, the segment size is 1250 bytes, and RTT is 100 ms. What
would be the loss probability? (2 marks)

2
Sol:
1.22∗𝑀𝑆𝑆
TCP throughput = 𝑅𝑇𝑇∗√𝐿
1.22 ∗ 1250∗8
1 * 109 = 100∗ 10−3 ∗√𝐿
1.22 ∗ 1250 ∗ 8
L = (100 ∗ 10−3∗ 1∗ 109)2
= 1.49 * 10-8

8. Consider the circuit-switched network shown in the figure below, with circuit switches
A, B, C, and D. Suppose there are 13 circuits between A and B, 14 circuits between B
and C, 13 circuits between C and D, and 16 circuits between D and A. (2 marks)
i. What is the maximum number of connections that can be ongoing in the
network at any one time?
ii. Suppose that these maximum number of connections are all ongoing. What
happens when another call connection request arrives to the network, will it be
accepted?
iii. Suppose that every connection requires 2 consecutive hops, and calls are
connected clockwise. For example, a connection can go from A to C, from B to
D, from C to A, and from D to B. With these constraints, what is the maximum
number of connections that can be ongoing in the network at any one time?
iv. Suppose that 13 connections are needed from A to C, and 10 connections are
needed from B to D. Can we route these calls through the four links to
accommodate all 23 connections?

Sol:

i. 56
ii. No
iii. 26
iv. Yes

9. Suppose the client-to-server HTTP GET message is the following: (2 marks)


GET /kurose_ross_sandbox/interactive/quotation5.htm HTTP/1.1
Host: gaia.cs.umass.edu
Accept: text/plain, text/html, text/xml, image/jpeg, image/png, audio/vnf.wave,
3
audio/mpeg, video/mpeg, video/wmv,
Accept-Language: en-us, en-gb;q=0.6, en;q=0.9, fr, fr-ch, ar
If-Modified-Since: Mon, 15 Aug 2022 14:17:04 -0700
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1)
Gecko/20100101 Firefox/9.0.1

i. What is the name of the file that is being retrieved in this GET message?
ii. What version of HTTP is the client running?
iii. Will the client accept jpeg images?
iv. Does the client already has a cached copy of the file?

Sol:

i. quotation5.htm
ii. HTTP/1.1
iii. Yes
iv. Yes

10. Look at the scenario below, where Alice sends an email to Bob. For the questions
below, assume that Alice and Bob user agents use POP3 protocol. (3 marks)

i. At point 4 in the diagram, what protocol is being used?


ii. At point 6 in the diagram, what protocol is being used?
iii. Does SMTP use TCP or UDP?
iv. Is SMTP a 'push' or 'pull' protocol?
v. Is POP3 a 'push' or 'pull' protocol?
vi. What port does SMTP use?
vii. What port does POP3 use?

Sol:

i. SMTP
ii. POP3
iii. TCP
iv. Push
v. Pull
vi. 25
vii. 110

4
11. Assume a constant transmission rate of R = 1400000 bps, a constant packet-length L =
6000 bits, and a is the average rate of packets/second. Traffic intensity I = La/R, and
the queuing delay is calculated as I(L/R)(1 - I) for I < 1. (3 marks)
i. Assuming that a = 20, what is the queuing delay?
ii. Assuming the router's buffer is infinite, the queuing delay is 0.7523 ms, and
898 packets arrive. How many packets will be in the buffer 1 second later?
iii. If the buffer has a maximum size of 877 packets, how many of the 898 packets
would be dropped upon arrival from the previous question?

Sol:

i. Queuing Delay = I(L/R)(1 - I) * 1000 = 0.0857*(6000/1400000)*(1-0.0857) *


1000 = 0.3358 ms.
ii. Packets left in buffer = a - floor(1000/delay) = 898 - floor(1000/0.7523) = 0
packets.
iii. Packets dropped = packets - buffer size = 898 - 877 = 21 dropped packets.

With My Best Regards,


Islam Hegazy

You might also like