hw4 Soln
hw4 Soln
1
B. Each super peer might store the meta-data for all of the files its children are sharing.
A super-duper peer might store all of the meta-data that its super-peer children store.
An ordinary node would first send a query to its super peer. The super peer would
respond with matches and then possibly forward the message to its super-duper peer.
The super-duper peer would respond (through the overlay network) with its matches.
The super-duper peer may further forward the query to other super-duper peers.
(b) Kurose & Ross, Chapter 6, pp. 581-582:
i. P8, parts (a), (b), (c), and (e).
(a) Messages from C to A need to be relayed by B, since A can’t hear C. This means that
one slot is spent transferring a message from C to B, and another from B to A, so the
answer is 1 message per 2 slots.
(b) The transmissions do not interfere with one another since only B can hear A and only
C can hear D, so the answer is 2 messages per slot.
(c) Since B can hear both A and C, only one of them can transmit during any given slot, so
the answer is 1 message per slot.
(e)A. It takes two slots to get a message from C to A and another two to return the ACK
from A to C, so 1 message per 4 slots.
B. A can send to B concurrent with D sending to C, but the acknowledgments in the
other direction will interfere.
So we have:
slot 1 Messages from A → B, D → C
slot 2 ACK from B → A
slot 3 ACK from C → D
(clearly the last two slots could come in the other order)
This gives us 2 messages per 3 slots.
C. We have:
slot 1 Message from C → D
slot 2 ACK from D → C, message from A → B
slot 3 ACK from B → A
This again gives us 2 messages per 3 slots.
(c) Kurose & Ross, Chapter 7, pp. 672-673:
i. P23.
Time Slot Packets in the queue Number of tokens in bucket
0 1, 2, 3 2
1 3, 4 1
2 4, 5 1
3 5, 6 1
A.
4 6 1
5 – 1
6 7, 8 2
7 9, 10 1
8 10 1
2
Time Slot Packets in output bucket
0 1, 2
1 3
2 4
3 5
B.
4 6
5 –
6 7, 8
7 9
8 10
(d) Kurose & Ross, Chapter 8, p. 751:
i. P9.
The idea behind this sort of third-party setup (which by the way is how the fairly popular
“Kerberos” system works) is that the KDC mediates communication between Alice and
Bob because both Alice and Bob trust the KDC (to the extent of sharing their keys with it).
A corresponding exchange could look like:
A. Alice sends a request to the KDC stating her identity, A, and that she wishes to commu-
nicate with Bob. She encrypts this using KA−KDC , which keeps the message private
between Alice and the KDC, and authenticates Alice to the KDC.
B. The KDC generates a random session key KS and encrypts it twice, as follows.
First, the KDC encrypts both A and KS using KB−KDC , resulting in:
a glob of bits that Alice can’t read, but from which Bob will be able to extract both the
session key and the fact that the KDC issued the key to Alice.
Second, the KDC encrypts both this ciphertext and KS (again) but this time using
KA−KDC , i.e., generating:
2. Sizing Header Fields. You are designing a reliable, sliding window, byte-stream protocol similar
to TCP. It will be used for communication with a geosynchronous satellite network, for which the
bandwidth is 1 Gbps and the RTT is 275 ms. Assume the maximum segment lifetime is 30 seconds.
(a) How many bits wide should you make the AdvertisedWindow and SequenceNum fields?
Answer. To fully utilize the network, AdvertisedWindow needs to be larger than (Delay ×
Bandwidth).
3
(AdvertisedWindow) ≥ (Delay) × (Bandwidth)
= 275ms × 1Gbps
= 275Mbit
= 34.375MB
(AdvertisedWindow)
(Effective Bandwidth) =
RTT
216 B
=
275ms
= 238.31KB/s
(c) If it turns out that 0.5% of the packets sent over the path are lost, what throughput would you
expect a long-running TCP connection to achieve?
Assume a value of AdvertisedWindow large enough to not impede performance.
4
Answer. The average long-term performance achieved by a TCP sender is governed by the TCP
Throughput Equation:
√
1.5B
(Throughput) = √
RTT p
√
1.5B
= √
275ms 0.005
= (62.98 × B) bytes/s
3. QoS.
(a) Suppose the capacity C of a link is 18. Assume that 4 sources—S1, S2, S3, and S4—are trying
to send over the link at rates of r1 = 2, r2 = 4, r3 = 5, and r4 = 8, respectively. What is the
max-min fairness allocation?
Answer. In the first round, we have N = 4 sources needing allocations, so the fair share is
18/4 = 4.5. This suffices for sources 1 and 2 (giving them their full requested allocation of 2
and 4, respectively), so we remove them and repeat the process.
For the second round, N 0 = 2 and we have already given out 2 + 4 = 6 of the total capacity
of 18. Therefore, 12 remains, and the fair share is 12/2 = 6. This suffices for source 3, so
it gets its full requested allocation of 5. This leaves us with a remaining capacity of 7, with
N 00 = 1. The fair share is 7. All remaining sources (just source 4) want more than that, so each
is allocated the remaining fair share.
Thus, the allocations are: A1=2, A2=4, A3=5, A4=7.
(b) For each of the following statements, indicate whether it applies to Integrated Services (IntServ),
Differentiated Services (DiffServ), and/or Best Effort. (A given statement can apply to more than
just one type of service.)
i. The service is provided end-to-end.
Answer. IntServ and Best Effort. DiffServ operates only between domains and not end-to-
end, while IntServ and Best Effort both are provided as end-to-end services.
Note: it’s easy to not think of Best Effort as providing any actual sort of service, and
therefore not considering that it provides a service end-to-end.
ii. Among the three, requires the most state in routers.
Answer. IntServ. IntServ requires the most state, since it needs to track individual flows or
connections. DiffServ only needs to maintain per-class state, of which there are not many
classes. Best Effort doesn’t maintain any state.
5
iii. Is widely available in the Internet today.
Answer. Best Effort (with DiffServ also being allowed in addition).
Best Effort is the only end-to-end service widely available today. We discussed how Diff-
Serv is frequently available within individual domains, though usually not between do-
mains. Because the question wasn’t clear on just what constitutes “widely available,” an-
swers that included DiffServ too were allowed.
iv. Provides isolation and guarantees among aggregated flows but not individual connections.
Answer. DiffServ. DiffServ operates on large aggregates. IntServ provides fine-grained
isolation and guarantees (which makes it more difficult to deploy, since it requires more
state). Best Effort doesn’t provide any isolation or guarantees, period.
4. Queueing Theory. Jorge wants to find the average number of people in his office hours, which are
from 1PM-2PM. He observes the following three people and the times that they arrive and leave:
• Alice: 1:00-1:20PM
• Bob: 1:10-1:45PM
• Eve: 1:40-2PM
Use Little’s Law to compute the mean number of people in his office.
Answer. Let λ be the mean arrival rate of people, and let d be the mean time people spend in the
office. Let N be the mean number of people in the office. Little’s Law states:
N = λd
We have λ = 3 people/hour. We can compute:
6
5. Time-Sequence Plots.
7
Trace 1
180000
Data
Ack
160000 Win
140000
120000
Sequence Number
100000
80000
60000
40000
20000
0
15.5 16 16.5 17 17.5 18 18.5 19 19.5
Time
8
Trace 2
180000
Data
Ack
160000 Win
140000
120000
Sequence Number
100000
80000
60000
40000
20000
0
17.5 18 18.5 19 19.5 20 20.5 21 21.5 22 22.5 23
Time
9
Trace 3
140000
Data
Ack
Win
120000
100000
Sequence Number
80000
60000
40000
20000
0
12 14 16 18 20 22 24 26
Time
10