Homework Three
Homework Three
Homework Three
1. (15 points) Suppose that routing information is exchanged using link state routing protocol and
the shortest paths are computed using Dijkstra’s algorithm. Find the shortest path from A to all
other nodes in the network. Show the steps in your computation. Please use the table format in
the class slides.
1
5
B C 5
2
A 2 3 1
1 F
D E 2
1
Figure 1:
[Answer]:
Step N D(B), p(B) D(C), p(C) D(D), p(D) D(E), p(E) D(F), p(F)
0 A 2,A 1,A 1,A ∞ ∞
1 AC 2,A 1,A 2,C 6,C
2 ACD 2,A 2,C 6,C
3 ABCD 2,C 6,C
4 ABCDE 4,E
5 ABCDEF
1
2. (15 points) (Problem 5.9 in the book.) Consider a network with 6 nodes, A, B, C, D, E, and F. C
has three neighbors, B, D, and E. Distance vector routing is used, and the following vectors have
just come to router C: from B: (5,0,8,12,6,2); from D: (16,12,6,0,9,10), and from E: (7,6,3,9,0,4).
(The numbers in the vectors should be interpreted as, for example, E has a path of length 7 to A,
a path of length 6 to B, etc.) The measured delays to B, D, and E, are 6,3, and 5, respectively.
What is C’s new routing table? Give both the outgoing line to use and the expected delay.
[Answer]: The distance table at C is So the routing table is
B D E
A 11 19 12
B 6 15 11
D 18 3 14
E 12 12 5
F 8 13 9
3. (10 points) (Problem 5.40 in the book.) A large number of consecutive IP addresses are available
starting at 198.16.0.0. Suppose four organizations, A, B, C, and D, request 4096, 2048, 4096,
and 8192 IP addresses, respectively, and in that order. For each of these, give the first IP address
assigned, the last IP address assigned, and the mask in w.x.y.z/s notation. (Hint: recall that a 2i
address block must start with an address with the lowest i bits being 0.)
[Answer:]
A: 198.16.0.0 to 198.16.15.255, 198.16.0.0/20.
B: 198.16.16.0 to 198.16.23.255, 198.16.16.0/21.
C: 198.16.32.0 to 198.16.47.255, 198.16.32.0/20.
D: 198.16.64.0 to 198.16.95.255, 198.16.64.0/19.
4. (10 points) (Problem 5.41 in the book.) A router just received the following new IP addresses:
57.6.96.0/21, 57.6.104.0/21, 57.6.112.0/21, and 57.6.120.0/21. If all of them use the same out-
going line, can they be aggregated? If so, to what? If not, why not?
[Answer:] They can be aggregated into 57.6.96.0/19.
5. (10 points) (Problem 5.43 in the book.) A router has the following (CIDR) entries in its routing
table:
2
Address/mask Next hop
135.46.56.0/22 Interface 0
135.46.60.0/22 Interface 1
192.53.40.0/23 Router 1
default Router 2
For each of the following addresses, what will the router do if a packet with that address arrives?
(a) 135.46.63.10
(b) 135.46.57.14
(c) 135.46.52.2
(d) 192.53.40.7
(e) 192.53.56.7
[Answer:]
6. (15 points) Suppose TCP is used over a lossy link that loses one segment during the 4th , 8th ,
12th , 16th RTT. Assume that there is no variance of RTT. Show how congestion window varies
over time by filling in the following table. Assume that (1) initially the congestion window is
1 segment and threshold is 32 segments (2) fast retransmission and fast recovery algorithm are
NOT used (3) receiver’s window is always larger than the congestion window (4) when received
ACK, sender will send data immediately (5) if the congestion window reaches the threshold
during an RTT, it won’t further increase during that RTT (6) while computing threshold round it
up to the nearest integer (for example 2.5 is rounded 3) and (7) the numbers shown in the table
for RT Ti are the values of the congestion window and threshold immediately after the ith RTT.
[Answer]:
RTT # 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
congwin 1 2 4 8 1 2 4 5 1 2 3 4 1 2 3 4 1 2
threshold 32 32 32 32 4 4 4 4 3 3 3 3 2 2 2 2 2 2
7. (15 points) Suppose that you are using a TCP implementation over a 1 Gbps link with a round
trip delay of 100 ms to transfer 10 MB, and the TCP receive window is 1 MB. If TCP sends 1
KB segments (including the header),
3
(c) How many RTTs should have been passed until the 10MB is sent? Assume the starting
congestion window size is 1KB, the congestion threshold is 2.048 MB, and there is no
loss.
[Answer]:
8. (10 points) (Problem 8.14 in the textbook). Consider the RSA algorithm. If p = 5, q = 11, and
d = 27, find e and encrypt 1, 2, 3, 4, 5 (5 numbers).
[Answer.] n = 55, z = 40, and e = 3. So, “1,2,3,4,5” becomes “1,8,27,9,15.”