Problem
Problem
a)
Prefix Match Link Interface
11100000 00 0
11100000 01000000 1
1110000 2
11100001 1 3
otherwise 3
b) Prefix match for first address is 5th entry: link interface 3
Prefix match for second address is 3nd entry: link interface 2
Prefix match for third address is 4th entry: link interface 3
Problem 11. Consider a datagram network using 8-bit host addresses. Suppose a router uses longest
prefix matching and has the following forwarding table:
Ans 11
Destination Address Range Link Interface
00000000
through 0
00111111
01000000
through 1
01011111
01100000
through 2
01111111
10000000
through 2
10111111
11000000
through 3
11111111
number of addresses for interface 0 = 2 64 6
number of addresses for interface 1 = 2 32 5
number of addresses for interface 2 = 2 2 64 32 96 6 5
number of addresses for interface 3 = 2 64 6
Problem 12
.Consider a datagram network using 8-bit host addresses. Suppose a router uses longest prefix matching
and has the following forwarding table:
Ans: Destination Address Range Link Interface
11000000
through (32 addresses) 0
11011111
10000000
through(64 addresses) 1
10111111
11100000
through (32 addresses) 2
11111111
00000000
through (128 addresses) 3
01111111
Problem 13
.Consider a router that interconnects three subnets: Subnet 1, Subnet 2, and Subnet 3. Suppose all of
the interfaces in each of these three subnets are required to have the prefix 223.1.17/24.
Ans
223.1.17.0/26
223.1.17.128/25
223.1.17.192/28
Problem 14
.In Section 4.2.2 an example forwarding table (using longest prefix matching) is given. Rewrite this
forwarding table using the a.b.c.d/x notation instead of the binary string notation
Ans:
Destination Address Link Interface
200.23.16/21 0
200.23.24/24 1
200.23.24/21 2
otherwise 3
Problem 15
.In Problem P10 you are asked to provide a forwarding table (using longest prefix matching). Rewrite this
forwarding table using the a.b.c.d/x notation instead of the binary string notation
ANS
Destination Address Link Interface
11100000 00 (224.0/10) 0
11100000 01000000 (224.64/16) 1
1110000 (224/8) 2
11100001 1 (225.128/9) 3
otherwise 3
Problem 16
.Consider a subnet with prefix 128.119.40.128/26. Give an example of one IP address (of form
xxx.xxx.xxx.xxx) that can be assigned to this network. Suppose an ISP owns the block of addresses of the
form 128.119.40.64/26.
ANS
Any IP address in range 128.119.40.128 to 128.119.40.191
Four equal size subnets: 128.119.40.64/28, 128.119.40.80/28, 128.119.40.96/28,
128.119.40.112/28
Problem 27
Consider the network shown in Problem P26. Using Dijkstra’s algorithm, and showing your work using a
table similar to Table 4.3, do the following:
ANS: a)
Step
N’
D(x), p(x)
D(u),p(u)
D(v),p(v)
D(w),p(w)
D(y),p(y)
D(z),p(z)
0
t
∞
2,t
4,t
∞
7,t
∞
1
tu
∞
2,t
4,t
5,u
7,t
∞
2
tuv
7,v
2,t
4,t
5,u
7,t
∞
3
tuvw
7,v
2,t
4,t
5,u
7,t
∞
4
tuvwx
7,v
2,t
4,t
5,u
7,t
15,x
5
tuvwxy
7,v
2,t
4,t
5,u
7,t
15,x
6
tuvwxyz
7,v
2,t
4,t
5,u
7,t
15,x
b)
Step
N’
D(x), p(x)
D(t),p(t)
D(v),p(v)
D(w),p(w)
D(y),p(y)
D(z),p(z)
u
∞
2,u
3,u
3,u
∞
∞
ut
∞
Problem 28: Consider the network shown below, and assume that each node initially knows the costs
to each of its neighbors. Consider the distance-vector algorithm and show the distance table entries at
node z.
Ans:
Cost to
uvxyz
v∞∞∞∞∞
From x ∞ ∞ ∞ ∞ ∞
z∞62∞0
Cost to
uvxyz
v103∞6
From x ∞ 3 0 3 2
z75250
Cost to
uvxyz
v10335
From x 4 3 0 3 2
z65250
Cost to
uvxyz
v10335
From x 4 3 0 3 2
z65250
Problem 29: Consider a general topology (that is, not the specific network shown above) and a
synchronous version of the distance-vector algorithm. Suppose that at each iteration, a node exchanges
its distance vectors with its neighbors and receives their distance vectors. Assuming that the algorithm
begins with each node knowing only the costs to its immediate neighbors, what is the maximum number
of itera
Ans:
The wording of this question was a bit ambiguous. We meant this to mean, “the number of
iterations from when the algorithm is run for the first time” (that is, assuming the only
information the nodes initially have is the cost to their nearest neighbors). We assume
that the algorithm runs synchronously (that is, in one step, all nodes compute their
distance tables at the same time and then exchange tables).
At each iteration, a node exchanges distance tables with its neighbors. Thus, if you are
node A, and your neighbor is B, all of B's neighbors (which will all be one or two hops
from you) will know the shortest cost path of one or two hops to you after one iteration
(i.e., after B tells them its cost to you).
Problem 30: Consider the network fragment shown below. x has only two attached neighbors, w and
y. w has a minimum-cost path to destination u (not shown) of 5, and y has a minimum-cost path to u o6.
The complete paths from w and y to u (and between w and y) are not shown. All link costs in the
network have strictly positive integer values.
ANS:
a) Dx(w) = 2, Dx(y) = 4, Dx(u) = 7
b) First consider what happens if c(x,y) changes. If c(x,y) becomes larger or smaller (as
long as c(x,y) >=1) , the least cost path from x to u will still have cost at least 7. Thus
a change in c(x,y) (if c(x,y)>=1) will not cause x to inform its neighbors of any
changes.
c) Any change in link cost c(x,y) (and as long as c(x,y) >=1) will not cause x to inform
its neighbors of a new minimum-cost path to u .
Problem 32:
Consider the count-to-infinity problem in the distance vector routing. Will the count-to-infinity problem
occur if we decrease the cost of a link? Why? How about if we connect two nodes which do not have a
link?
ANS: NO, this is because that decreasing link cost won’t cause a loop (caused by the next-hop
relation of between two nodes of that link). Connecting two nodes with a link is equivalent to
decreasing the link weight from infinite to the finite weight.
Problem 35:
. Describe how loops in paths can be detected in BGP.
ANS: Since full AS path information is available from an AS to a destination in BGP, loop
detection is simple – if a BGP peer receives a route that contains its own AS number in the AS
path, then using that route would result in a loop.
Problem 36:
Will a BGP router always choose the loop-free route with the shortest ASpath length? Justify your
answer
ANS: The chosen path is not necessarily the shortest AS-path. Recall that there are many issues
to be considered in the route selection process. It is very likely that a longer loop-free path is
preferred over a shorter loop-free path due to economic reason. For example, an AS might prefer
to send traffic to one neighbor instead of another neighbor with shorter AS distance.