ECE/CS 372–Introduction to Computer Networks Solution

advertisement
1
ECE/CS 372–Introduction to Computer Networks
Solution–Assignment # 1
Stephen Redfield, School of EECS, Oregon State University
Credit to Bechir Hamdaoui and Kurose & Ross
P6, Page 72
a) dprop = m/s seconds
b) dtrans = L/R seconds
c)
d)
e)
f)
dend to end = (m/s + L/R) seconds
The bit is just leaving Host A
The first bit is in the link and has not reached Host B
The first bit has reached Host B
g) Want
km.
P7, Page 72
Consider the first bit in a packet. Before this bit can be transmitted, all of the bits in the packet must be generated.
This requires 56 × 8/(64 × 103) seconds = 7 milliseconds.
The time required to transmit the packet is 56 × 8/(2 × 106) seconds = 224 microseconds.
Propagation delay = 10 milliseconds.
The delay until decoding is 7 milliseconds + 224 microseconds + 10 milliseconds = 17.224 milliseconds
P8, Page 72
a) 3 × 1000kbps/150kbps = 20 users can be supported because each user requires one tenth of the bandwidth b) p
= 0.1
c) (120n )pn(1 − p)120−n
d)
.
P10, Page 73
The first end system requires L/R1 to transmit the packet onto the first link; the packet propagates over the first link
in d1/s1; the first packet switch adds a processing delay of dproc; after receiving the entire packet, the first packet
switch requires L/R2 to transmit the packet onto the second link; the packet propagates over the second link in d2/s2;
the second packet switch adds a processing delay of dproc; after receiving the entire packet, the second packet switch
requires L/R3 to transmit the packet onto the third link; the packet propagates over the third link in d3/s3. Adding all
these delays gives
dend−end = L/R1 + L/R2 + L/R3 + d1/s1 + d2/s2 + d3/s3 + 2 × dproc
To answer the second question, we simply plug the values into the equation to get
6 + 6 + 6 + 20 + 16 + 4 + 3 + 3 = 64 msec
P11, Page 73
Because bits are immediately transmitted, the packet switch does not introduce any delay; in particular, it does not
introduce a transmission delay. Thus,
dend−end = L/R + d1/s1 + d2/s2 + d3/s3
2
For the values in the previous problem (P10), we get 6 + 20 + 16 + 4 = 46 msec.
P12, Page 73
Given that one packet is already been transmitted, and n packets are in the queue waiting their turns, the queuing delay
of the (n+1)th packet is
[nL + (L − x)]/R
P13, Page 73
a)
(or P12 version 5) The queuing delay is 0 for the first transmitted packet, L/R for the second transmitted
packet,and generally, (N-1)L/R for the Nth transmitted packet. Thus, the average delay for the N packets is
(L/R + 2L/R + ....... + (N − 1)L/R)/N
which is equal to
L/(RN) ∗ (1 + 2 + ..... + (N − 1)) = L/(RN) ∗ N(N − 1)/2 = LN(N − 1)/(2RN) = (N − 1)L/(2R)
Note that here we used the well-known fact that 1 + 2 + ....... + N = N(N + 1)/2
b)
(or P13 version 5) It takes LN/R seconds to transmit the N packets. Thus, the buffer is empty when a batch
of N packets arrive. The first of the N packets has no queuing delay. The 2nd packet has a queuing delay of L/R
seconds. The Nth packet has a delay of (N − 1)L/R seconds. Note that the Nth packet has already been transmitted when
the second batch of N packets arrives. Hence, the next N packets arrive at an empty queue; that is, the (N + 1)th packet
has no queueing delay; the (N + 2)th packet has a queueing delay of L/R, etc. Therefore, it suffices to average over a
batch of N packets to determine the average over all packets.
The average queueing delay is then
P14, Page 74
a) The transmission delay is L/R. Hence, the total (queueing + transmission) delay is
b) Let x = L/R. Thus, the total delay is
. Note that 1 − ax > 0 or x < 1/a must hold.
a = 10
100
80
60
40
20
0
0.09
Fig. 1.
Total delay as a function of L/R for a=10
0.092
0.094
0.096
x or L/R
0.098
0.1
3
P15, Page 74
First, note that µ = R/L packets per second. From previous problem (P14), we derived the total (queueing +
transmission) delay as
Replacing I by aL/R and R/L by µ implies that the total delay is
P23, Page 75
Let us call the first packet A and the second packet B.
a)
If the bottleneck link is the first link (that is, Rs < Rc), then, packet B is queued at the first link waiting for the
transmission of packet A. So, the packet inter-arrival time at the destination is simply L/Rs.
b)
If the second link is the bottleneck link (i.e., Rc < Rs) and since both packets are sent back to back, it must be
true that the second packet arrives at the input queue of the second link before the second link finishes the transmission
of the first packet. That is, since Rc < Rs,
L/Rs + L/Rs + dprop < L/Rs + dprop + L/Rc
The left hand side of the above inequality represents the time needed by the second packet to arrive at the input queue
of the second link (the second link has not started transmitting the second packet yet). The right hand side represents
the time needed by the first packet to finish its transmission onto the second link (which is the minimum time needed
for the second packet to start its transmission onto the second link).
The inequality above clearly shows that the second packet must have queuing delay at the input queue of the second
link. Now if we send the second packet T seconds later, then we can ensure the there is no queueing delay for the
second packet at the second link if we have:
L/Rs + L/Rs + dprop + T ≥ L/Rs + dprop + L/Rc
Thus, T must be equal to or greater than L/Rc−L/Rs in order to ensure no queueing delay before the second link.
P25, Page 76
a) bandwidth x propagation delay = R × d/s = 2.106× 20000 × 103/(2.5 × 108) = 160,000 bits
b) It takes 1/R second for each bit to be transmitted (to be pushed onto the link). Thus, at any time, there will be as
many bits as the propagation delay allows to push. That is, dprop/(1/R), which is 160,000 bits
c) The bandwidth-delay product of a link is the maximum number of bits that can be in the link at any time
d) The width is the distance divided by the total number of bits in the link. That is, 20,000×103/160,000 = 125 meters
long, which is longer than a football field
e) The width is then (d/number of bits) (from d) above) which is equal to (d/bandwidth − delay product) (from c)
above) which is equal to d/(R × dprop) (from a) above) which is equal to d/(R × d/s) or s/R
P29, Page 76
Recall geostationary satellite is 36,000 kilometers away from earth surface. a)
propagation delay is dprop = d/s = 36 × 106/(2.4 × 108) = 0.15 sec
b) bandwidth-delay product is R × dprop = 10 × 106× 0.15 = 1,500,000 bits
c) The transmission of x bits should take full minute. That is, x should be large enough so that the last bitcompletes
its transmission exactly after 1 minute. Hence, x should be at least 60/(1/R) = 600,000,000 bits
4
P33, Page 78
Time at which the first packet is received at the destination = S+80R ×3 seconds. After this, one packet is received at
destination every
seconds. Thus delay in sending the whole file is
To calculate the value of S which leads to the minimum delay,
Download