You are on page 1of 3

计算机网络第3次作业

方钧同 2021011783

Exercise 1 (R3)

Routing is the process of determining the route of packets from source to route, while forwarding
is the process of moving packets from the router's input to the router's output according to the
routing table.

Exercise 2 (R21)

Link state is a global algorithm based on Dijkstra algorithm, which updates routes with the lowest
cost to different nodes every time when the cost of a single path changes.

Distance vector is a decentralized algorithm mainly using the dynamic programming idea. Each
node possessing a distance vector, recording the shortest distances to its neighbor. Periodically,
each node sends its distance vector to all its neighbors in case that the cost of path may change.
And when a nodes receive the distance vector, it needs to update its own distance vector
according to the Bellman-Ford equation.

Exercise 3 (P5)

a.

There are no VC numbers available anymore.

b.

There are four links in each VC and each link has two available VC numbers. So there are
combinations in all.

Exercise 4 (P10)

a.

Prefix Match Link Interface

11100000 01000000 1

11100000 00 0

11100001 1 3

1110000 2

otherwise 3

b.

Since my table is ordered descend by the length of prefix, so we just need to find the first table
item that can match the datagram's destination address from the top to the bottom.

The first datagram's destination address can't match anything so it will be forwarded to interface
3.
The second datagram's destination address matches the fourth one so it will be forwarded to
interface 2.

The third datagram's destination address matches the third one so it will be forwarded to
interface 3.

Exercise 5 (P11)

Interface Destination Address Range Number of Addresses

0 00000000 through 00111111 64

1 01000000 through 01011111 32

2 01100000 through 10111111 96

3 11000000 through 11111111 64

Exercise 6 (P12)

Interface Destination Address Range Number of Addresses

0 11000000 through 11011111 32

1 10000000 through 10111111 64

2 11100000 through 11111111 32

3 00000000 through 01111111 128

Exercise 7 (P17)

a.

A: 214.97.255.0/25 - 214.97.255.0/29 supports 128 - 8 = 120 interfaces

B: 214.97.254.0/24 supports 256 interfaces

C: 214.97.255.128/25 supports 128 interfaces

D: 214.97.255.0/31 supports 2 interfaces

E: 214.97.255.2/31 supports 2 interfaces

F: 214.97.255.4/30 suppports 4 interfaces

b.

Forwarding table for Router 1:

Prefix Match Link Interface

11010110 00110001 11111111 0 Subnet A

11010110 00100001 11111111 0000000 Subnet D

110100110 00100001 11111111 000001 Subent F


Forwarding table for Router 2:

Prefix Match Link Interface

11010110 00110001 11111110 Subnet B

11010110 00100001 11111111 0000000 Subnet D

110100110 00100001 11111111 0000001 Subent E

Forwarding table for Router 3:

Prefix Match Link Interface

11010110 00110001 11111111 1 Subnet C

110100110 00100001 11111111 0000001 Subnet E

110100110 00100001 11111111 000001 Subent F

Exercise 8 (P19)

The number of fragments generated is .

The identifers of 4 fragments are all 422.

The flags of 4 fragments are 1, 1, 1 and 0.

The frament offsets are 0, 85, 170, 255.

Exercise 9(P28)

We can create the distance vector initially as follow:

u v x y z

u 0 1 / / /

v 1 0 3 / 6

x / 3 0 3 2

y / / 3 0 /

z / 6 2 / 0

And we should update the table according to the Bellman-Ford Equation, which is

So the updated table for z should be

u v x y z

z 6 5 2 5 0

You might also like