Anda di halaman 1dari 4

CMPT 371 Homework 1

Kasra Jamshidi 301262973

September 25, 2017


Problem 1.
a. We are given that the first tollbooth is at kilometre 0 and the third is at
kilometre 150. Let the second tollbooth be at some kilometre 0 < k <
150 along the way. Note that the delay at each tollbooth is 2 minutes
(12s/car 10 cars).
Consider the last car in the caravan. It passes the first tollbooth at 2
minutes and reaches the second tollbooth at
60mins 6
kkm = kmins.
100km 10
At this point, the caravan can continue through the second tollbooth,
which takes another 2 minutes. Finally, the last car will spend

60mins 6
(150 k)km = (150 k)mins
100km 10
to make it to the last tollbooth. After another 2 minutes, the entire
caravan finishes their journey.
Summing up we have:

60mins
3 2mins + (k + (150 k))km
100km
6
= 6mins + (150)mins
10
= 96mins

b. The only difference here is the delay at each tollbooth. Where before we
8cars
had 2 minutes, now we have 5cars/min = 1.6mins. Thus the total time is
90 + 3 1.6 = 94.8mins.
Problem 2.
a. 3 Mbps = 3000kbps shared among x users each requiring 150kbps yields
x = 3000kbps
150kbps = 20 users.

b. We are given that each user only spends 10% of their time using the
connection, hence the probability they are transmitting is 0.1.
c. Let X be a random variable modelling the probability that a user will
transmit. Each user transmits with probability 0.1, and there are 120 such
users. Running a trial for each user, X matches the binomial distribution
with n = 120 and p = 0.1. Hence by the binomial probability formula we
have
 
120
P (X = n) = (0.1)n (0.9)120n
n

1
d. Using the same X from part c, we have

P (X 21) = 1 P (X 20)
20  
X n
=1 (0.1)i (0.9)ni
i=0
i

If we take n = 120 as in the previous part, a calculator gives me P (X


21) = 0.00794119224839296.
Problem 3. We have that 1500bytes = (81500)bits = 12000bits. At 4 Mbps =
12000bits 3
4000 kbps = 400000 bps, it will take the data 4000000seconds = 1000 seconds = 3ms
to travel down the link to the router.
Taking into account the propagation delays of 6ms for Host A and 2ms for
Host B, the first packet from Host A arrives at router A at time 3 + 2 = 5ms,
and from Host B at time 3 + 6 = 9ms. Thenceforth each host sends a packet
every 3ms. This means that two packets never arrive at the router at the same
time.
Thus whether or not there is a queueing delay depends on the transmission
delay at router A. Consider the second and third packets to arrive at router A.
Host A sends its second packet which arrives at time 8ms, and Host B sends its
first packet which arrives at time 9ms. If the transmission delay at router A is
greater than 1ms, then the packet from Host B suffers a queueing delay.
This pattern continues in general, as packet i + 1 from Host A arrives at
time 5 + (3i + 3) = 8 + 3ims and packet i from Host B arrives at time 9 + (3i)ms.
Clearly, the difference between these is always 1ms. Hence, there is a queueing
delay for packet i from Host B if router A has a transmission delay greater than
1ms.
Problem 4.
a.
20000km
R dprop = 2Mbps
2.5 108 m/s
= 2000000bps 2 107 m 1s/(2.5 108 m)
2000000bits 2bits
=
25
= 160000bits

b. It takes dprop time for the first bit to reach Host B. In that time, dprop R
bits can be transmitted before the link is saturated. As we saw in part a,
dprop R = 160000bits.
c. It is the maximum number of bits that can be in transit at any time, or
the number of bits it takes to saturate a link.

2
d. This is the number of bits on the wire divided by the distance, giving
160000bits 8bits 1bits
= =
120000km 1km 125m
Thus, the width of a bit is 125m. This is larger than a football field which
is only 100 or 150 yards long, depending which league it belongs to.
e. The textbook tells us that dprop = m/s, so the general formula is
m s
width/bit = =
m/s R R

2.5108 m/s
Plugging into d, we can verify: 2106 bits/s = 125m/bit.
Problem 5. We have F/S packets of size L = S + 80 bits. From the book we
know that dend-end = 3 (0 + L/R + 0) for a packet since we assume no queuing
and propagation delays. Thus, the final (F/S 1th) packet is transmitted at
time [(F/S) 1] L/R + 3 L/R. We can write this as a function g(S), compute
its derivative and solve it at zero. This will give us the value of S for which the
total delay is minimized.
First, simplify g.
S + 80 S + 80
g(S) = [(F/S) 1] +3
R R
F S + 80F S + 80 3S 240
= + +
SR R R R
80F 2S 160
= + +
SR R R
Next, compute its derivative:
dg d 80F d 2S
= +
dS dS SR dS R
80F 2
= +
RS 2 R
Then solve for an extremum, which we know will be its minimum since the
derivative is negative.
80F 2
+ =0
RS 2 R
1 2
=
S2 80F
S 2 = 40F

S = 40F

S = 2 10F
We can reject the negative solution for S, since we know the packet
size must
be positive. Hence the time to send the file is minimized when S = 2 10F .