Sie sind auf Seite 1von 7

Krys Fudge

CPSC 4317 – Computer Networks

Chapter 5, Problem Assignment 1

Problem 22, page 369 (left over from Chapter 4)

It seems that we did this problem on the last assignment. I’ll reproduce the answer I gave for this
problem from there below:

We will need to construct four flow tables (as requested by the question). Again, we focus on datagrams
being sent to h3 and h4.

I am under the assumption that these flow tables implicitly block anything that is not specified to be
forwarded. Therefore, we can specify a table that allows for datagrams from h1 and h6 to be forwarded.
We should have four entries total (two entries for each host h3 and h4 with one entry for each of hosts
h1 and h6 incoming):

Flow Table (s2)

Match Action

IP Src = 10.1.0.1; IP Dst = 10.2.0.3 Forward(3)

IP Src = 10.1.0.1; IP Dst = 10.2.0.4 Forward(4)

IP Src = 10.1.0.6; IP Dst = 10.2.0.3 Forward(3)

IP Src = 10.1.0.6; IP Dst = 10.2.0.4 Forward(4)

The second table should cover datagrams coming from any host as long as the traffic involved is TCP.
Therefore, while we can have any source IP, we need to add in a line that checks for TCP. One entry
should suffice for each host.

Flow Table (s2)


Krys Fudge
CPSC 4317 – Computer Networks

Match Action

IP Src = *.*.*.*; IP Dst = 10.2.0.3; port = TCP Forward(3)

IP Src = *.*.*.*; IP Dst = 10.2.0.4; port = TCP Forward(4)

The third table should only specify an entry for h3 (as h4 is blocked), so any traffic to h3 is valid.

Flow Table (s2)

Match Action

IP Src = *.*.*.*; IP Dst = 10.2.0.3 Forward(3)

The last table only allows UDP traffic from one specific hosts, h1, to one specific host, h3. Therefore, this
should be very similar to the two tables above, except that only one entry is required, the source IP is
specified, and there is a check for UDP.

Flow Table (s2)

Match Action

IP Src = 10.1.0.1; IP Dst = 10.2.0.3; port = UDP Forward(3)

Reproduction of the answer for Problem 22 ends here.


Krys Fudge
CPSC 4317 – Computer Networks

P1:

Answer:

Figure 5.3 is reproduced above.

We will assume, since the path must not contain loops/cycles, that a node cannot be travelled to twice
in one path. With that in mind, the following should be acceptable pathways from y to u, sorted in
alphabetical order (i.e. routes with w as their second node will come before routes with x as their
second node):

1. y -> w -> u
2. y -> x -> u
3. y -> w -> v -> u
4. y -> w -> x -> u
5. y -> x -> v -> u
6. y -> x -> w -> u
7. y -> z -> w -> u
8. y -> w -> v -> x -> u
9. y -> w -> x -> v -> u
10. y -> x -> v -> w -> u
11. y -> x -> w -> v -> u
12. y -> z -> w -> v -> u
13. y -> z -> w -> x -> u
14. y -> z -> w -> v -> x -> u
15. y -> z -> w -> x -> v -> u

Some things to note here: We know that a route will always start with y and end with u. We also know
that the node right after y has to be either x, w or z because these are the only notes that y can reach in
one step. Similarly, the only nodes that can come right before u are w, v and x. The most nodes one path
can use are 6, since there are 6 nodes in the Figure and a node cannot be travelled to twice in one path.
Krys Fudge
CPSC 4317 – Computer Networks

P3:

Answer:

Table 5.1 is reproduced above. Note that the table uses the link-state algorithm rather than Dijkstra’s
shortest-path algorithm.

The resulting table for the question is shown below:

Step N’ D(t),p(t) D(u),p(u) D(v),p(v) D(w),p(w) D(y),p(y) D(z),p(z)


0 x ∞ ∞ 3,x 6,x 6,x 8,x
1 xv 7, v 6, v 3,x 6,x 6,x 8,x
2 xvu 7, v 6, v 3,x 6,x 6,x 8,x
3 xvuw 7, v 6, v 3,x 6,x 6,x 8,x
4 xvuwy 7, v 6, v 3,x 6,x 6,x 8,x
5 xvuwyt 7, v 6, v 3,x 6,x 6,x 8,x
6 xvuwytz 7, v 6, v 3,x 6,x 6,x 8,x
Krys Fudge
CPSC 4317 – Computer Networks

P5:

Answer:
We can find the answer through a series of tables.
Cost To
u v x y z
From v ∞ ∞ ∞ ∞ ∞
x ∞ ∞ ∞ ∞ ∞
z ∞ 6 2 ∞ 0
Nodes x and v are immediately reachable from z. As stated in the problem, each node knows the costs
to each of its neighbors, so node z will know the immediate length from itself to v and x.

Cost To
u v x y z
From v 1 0 3 ∞ 6
x ∞ 3 0 3 2
z 7 5 2 5 0
Now we “update” with the information that v and x know, which allows us to calculate most of the costs
(though they may not be the most efficient yet). We can also update the connection from z to v since
the path from z -> x -> v is faster than the direct path from z -> v.

Cost To
u v x y Z
From v 1 0 3 3 5
x 4 3 0 3 2
z 6 5 2 5 0
We “update” one last time to give us the distances we were missing, which also shows us that there is a
more efficient path from v to z and from z to u, so we need to update these as well. In a real system,
there would likely be one more update to make sure that there are no more node link costs missing.
Krys Fudge
CPSC 4317 – Computer Networks

P7:

Answers:
a. The distance from x to w should be 2, from x to y should be 2 + 2 = 4 (less than 5 from x -> y),
and x to u should be 2 + 5 = 7 (as u is connected to w, just not shown). Therefore, Dx(w) = 2,
Dx(y) = 4, and Dx(u) = 7.

b. Just for practice, let’s try both (since the problem only said either one or the other). Let’s
assume that costs must be non-negative (i.e. a cost can be 0 or more).

Consider a link-cost change for c(x,y) that will cause x to inform its neighbors of a new path to u.
The minimum-cost path from x to u (as shown in answer a) is 7, and the cost path using x and y
is 5 + 2 + 5 = 12. If c(x,y) were to increase, this would not cause x to inform its neighbors as the
connection through that path is already larger than the minimum and would not make a less
costly path. On the other hand, consider c(x,y) = 1 and c(x,y) = 0. The first would make a path
with the cost 1 + 2 + 5 = 8, which still fails to update, but 0 + 2 + 5 = 7, which is equal to the
other minimum-cost path and might cause an update if the system is set to inform of equally
costly paths. Of course, this is only doable if a path can have a cost of 0, and this would be very
unlikely in a real life situation.

Now we consider a link-cost change for c(x,w). The minimum-cost path from x to u is 7, and the
current path uses the immediate connection between x and w. For any changes that make
c(x,w) less than its current value (2, i.e. the cost would be 0 or 1), the path will still be the most
efficient path as it was already the most efficient in the first place, so this would not cause x to
inform its neighbors. Additionally, the path will still be the most efficient if the value increases to
a certain point (i.e. if the total cost becomes 8 or 9, it will be less efficient than before, but still
more efficient than the alternative). However, consider the alternate path x -> y -> w -> u which
has a cost of 5 + 2 + 5 = 12. Suppose that c(x,w) changes to a value equal to or larger than 7; this
would give us either a cost of 7 + 5 = 12, which is equal to the alternative path and may cause an
update depending on the system, or a cost larger than 12, which will definitely cause x to inform
its neighbors of a new minimum-cost path.
Krys Fudge
CPSC 4317 – Computer Networks

c. Technically, I have considered this in the answer above: any link-cost change for c(x,y) that is not
0 (in a case that link costs must be non-negative) will not cause x to inform its neighbors, and
any link-cost change for c(x,w) that is less than 7 will not cause x to inform its neighbors.

Das könnte Ihnen auch gefallen