Instructor: Ashish Goel
Since there is no class on 10/13, please slip your HW under my door before noon.
Collaboration Policy: You are allowed to discuss general strategies for solving a problem with other students in the class, and also to clarify your understanding of the problem. You are not allowed to copy or see somebody else’s homework.
Problem 5 can be done in groups of at most 3. All members of the group must include the same answer in their submission, and cite each other.
171.64.132.0/22 Interface
A
171.64.128.0/20 Interface
B
0.0.0.0/0 Interface
C
171.64.135.21/32 Local
To
which interface should packets for the following destinations be forwarded?
171.64.135.17
171.64.136.0
171.64.144.0
A’s
table: 0.0.0.0/0 cost=2 via
P
B’s
table: 0.0.0.0/0 cost=3 via
A
C’s
table: 0.0.0.0/0 cost=4 via
B
D’s
table: 0.0.0.0/0 cost=10 via
Q
Now
suppose the link from A to P gets disrupted. Show a sequence of events which
would result in there being a routing loop among A, B, and C. When will this loop get removed, assuming
that no other links come up or go down? An event is something of the form: “Router
X sends its routing table entries to Y”.
Code:
#include
<stdio.h>
#include
<stdlib.h>
#include
<assert.h>
int
main(int argc, char **argv) {
int n,i;
int a,b,c,d;
assert (argc == 2);
n = atoi(argv[1]);
assert(n > 0);
assert(n < 1000);
for (i=0; i<n; ++i) {
a = random() % 256;
b = random() % 256;
c = random() % 256;
d = random() % 256;
printf("%0d.%0d.%0d.%0d\n",a,b,c,d);
}
}
Figure 1: The
labels on the links, when provided, denote costs.