计网 - 第四章作业

更新时间:2023-11-04 22:26:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

Chapter 4

4.1,4.2,4.3节后作业

1. (R3)What are the two most important network-layer functions in a datagram network? What

are the three most important network-layer functions in a virtual-circuit network? 答:

forwarding and routing.

forwarding, routing and connection setup.

2. (R2)What is the difference between routing and forwarding?

答:

Forwarding is about moving a packet from a router’s input link to the appropriate output link. Routing is about determining the end-to-routes between sources and destinations.

3. (R9)Describe how packet loss can occur at input ports. Describe how packet lossat input ports

can be eliminated (without using infinite buffers). 答:

The queue size at the input port grows large because of slow switching fabric speed and exhausting router’s buffer space. It can be eliminated if the switching fabric speed is at least n times as fast as the input line speed, where n is the number of input ports.

4.4,4.5,4.6,4.7节后作业

4. (R12)What is the 32-bit binary equivalent of the IP address 223.1.3.27?

答:

11011111 00000001 00000011 00011011

5. Do routers have IP addresses? If so, how many?

答:

Yes. They have one address for each interface.

6. Consider Figure 4.34. Starting with the original table in D, suppose that Dreceives from A the

following advertisement.Will the table in D change? If so how?

答:

No. If the advertisement said that A were only 4 hops away from z by way of C, then D would indeed change its forwarding table.

7. (P8)Consider a datagram network using 32-bit host addresses. Suppose a routerhas five links,

numbered 0 through 4, and packets are to be forwarded to thelink interfaces as follows:

DestinationAddressRangeLink Interface

11100000 00000000 00000000 00000000

Through 0 11100000 00000000 11111111 11111111

11100000 00000001 00000000 00000000

Through 1

11100000 00000001 11111111 11111111

11100000 00000010 00000000 00000000

Through 2

11100000 11111111 11111111 11111111

11100001 00000000 00000000 00000000

Through 3

11100001 11111111 11111111 11111111

Otherwise 4

a. Provide a forwarding table that has five entries, uses longest prefix matching, and forwards

packets to the correct link interfaces.

b. Describe how your forwarding table determines the appropriate link interface for datagrams with destination addresses:

11001000 10010001 01010001 01010101 11100000 10101101 11000011 00111100 11100001 1000000000010001 01110111

答: a. IP 11100000 00000000 11100000 00000001 11100000 11100001 Otherwise b. Prefix match for first address is 4th entry: link interface 3 Prefix match for second address is 2nd entry: link interface 1 Prefix match for first address is 3rd entry: link interface 2

8. (P9)Consider a datagram network using 4 bit host addresses. Suppose a routeruses longest

prefix matching and has the following forwarding table: Prefix Match 00 01 10 11 Interface 0 1 2 3 Link interface 0 1 2 3 4 For each of the four interfaces, give the associated range of destination hostaddresses and the number of addresses in the range. 答: Destination Address Ranges 00000000~00111111 01000000~01111111 10000000~10111111 11000000~11111111

9. (P11)Consider a router that interconnects three subnets: Subnet 1, Subnet 2, andSubnet 3.

Suppose all ofthe interfaces in each ofthese three subnets arerequired to have the prefix 220.2.240/20. Also suppose that Subnet 1 isrequired to support up to 2000 interfaces, and Subnets 2 and3 are eachrequired to support up to 1000 interfaces. Provide three network addresses (ofthe form a.b.c.d/x) that satisfy these constraints. 答:

223.1.17.0/25 223.1.17.128/26

Number of address 64 64 64 64 Link Interface 0 1 2 3 223.1.17.192/26

10. (P14)Consider a subnet with prefix 101.101.101.64/26. Give an example of oneIP 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 101.101.128/17.Suppose it wants to create four subnets from this block, with each blockhaving the same number of IP addresses. What are the prefixes (of forma.b.c.d/x) for the four subnets? 答:

The IP address in range is from 101.101.101.64 to 101.101.101.128 The four equal size subnets (extends 18 and 19) 101.101.128/19 101.101.160/19 101.101.192/19 101.101.224/19

11. (P15)Consider the topology shown in Figure 4.17. Denote the three subnets withhosts

(starting clockwise at l2:00)) as Networks A, B, and C. Denote the subnets without hosts as Networks D, E, and F.

a. Assign network addresses to each of these six subnets, with the following

A constraints: All addresses must be

allocated from214.97.254/23;Subnet A should have enough addresses to support 250 interfaces; Subnet B should haveenough addresses to support 120 interfaces; andSubnet C should have F D enough addresses to support 120 interfaces. Ofcourse, subnets D, E and F should each be able to support two interfaces.For each subnet, the E assignment should take the form a.b.c.d/x ora.b.c.d/x - e.f.g.h/y. C B b. Using your answer to part (a), provide the forwarding tables (using longestprefix matching)

for each of the three routers. 答:

a. From 214.97.254/23, the assignments are

Subnet A: 214.97.255/24(28=256 addresses)

Subnet B: 214.97.254.0/25-214.97.254.0/29(27-8=120 addresses) Subnet C: 214.97.254.128/25(27=128 addresses) Subnet D: 214.97.254.0/31(21=2 addresses) Subnet E: 214.97.254.2/31(21=2 addresses)

Subnet F: 214.97.254.4/30(22=4 addresses)

b. Assume that no datagrams have router interface as ultimate destinations. Also, label D,E,F

for the upper-right, bottom, and upper-left interior subnets, respectively. Router1:Outgoing Interface A F D Router2:Outgoing Interface F E C Router3:Outgoing Interface B D E

12. (P16)Consider sending a 4,000-byte datagram into a link that has an MTU of400 bytes.

Suppose the original datagram is stamped with the identificationnumber 422-How many fragments are generated? What are their characteristics? 答:

The maximum size of data field in each fragment = 380(20 bytes IP header). Thus the number of required fragments = (4000-20)÷380=11

Each fragment will have identification number 422. Each fragment except the last one will be of size 500 bytes(including IP header). The last datagram will be of size 120 bytes (including IP header). The offsets of 7fragments will be 0,60,120,180,240,300,360. Each of the first 6 fragments will have flag = 1; the last fragment will have flag = 0 .

Longest Prefix Match 11011111 00000001 00000001 11011111 00000001 00001001 11011111 00000001 00000111 Longest Prefix Match 11011111 00000001 00001001 11011111 00000001 00001000 11011111 00000001 00000010 Longest Prefix Match 11011111 00000001 00000101 11011111 00000001 00000111 11011111 00000001 00001000 13. (P25)Consider the network fragment shown below. -r has only two attached neighbors, w andy.

w has a minimum-cost path to destination u (not shown) of 5,and y has a minimum-cost path to u of 6. The complete paths from w and y toz (and between w and y) are not shown. All link costs in the network havestrictly positive integer values.

5 u 6

a. Give x's distance vector for destinations w, y, and u.

b. Give a link-cost change for either c(x,w) or c(x,y) such that -r will informits neighbors of a new minimum-cost path to u as a result of executing thedistance-vector algorithm.

c. Give a link-cost change for either c(x,w) or c(x,y) such that x will not inform its neighbors of a new minimum-cost path to u as a result of executing the distance-vector algorithm. 答:

a. Dx(y)=5,Dx(w)=2,Dx(u)=7

b. If c(x, y) becomes longer or shorter, the least cost path from x to u will still have cost at

least 7. If c(x, w) changes, x will inform its neighbors of new cost. c. No way.

本文来源:https://www.bwwdw.com/article/ska2.html

Top