计算机网络(第4版) 清华大学出版社 习题答案(中文版)

更新时间:2023-03-08 05:34:11 阅读量: 综合文库 文档下载

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

第 1 章 概述

1. 答:狗能携带21千兆字节或者168千兆位的数据。18 公里/小时的速度等于0.005 公里/秒,走过x公里的时间为x / 0.005 = 200x秒, 产生的数据传输速度为168/200x Gbps或者840 /x Mbps。因此,与通信线路相比较,若x<5.6 公里,狗有更高的速度。

2. 使用局域网模型可以容易地增加节点。如果局域网只是一条长的电缆,且不会因个别的失效而崩溃( 例如采用镜像服务器)的情况下,使用局域网模型会更便宜。使用局域网可提供更多的计算能力和更好交互式接口。

3. 答:横贯大陆的光纤连接可以有很多千兆位/秒带宽, 但是由于光速度传送要越过数千公里,时延将也高。相反,使用56 kbps调制解调器呼叫在同一大楼内的计算机则有低带宽和较低的时延。

4. 声音的传输需要相应的固定时间,因此网络时隙数量是很重要的。传输时间可以用标准偏差方式表示。 实际上,短延迟但是大变化性比更长的延迟和低变化性更糟。

5. 答:不,传送.速度为200,000 公里/秒或200米/ 微秒。信号在10微秒中传送了2千米,每个交换机相当于增加额外的2 公里电缆。 如果客户和服务器之间的距离为5000 公里,平均通过50个交换机给那些总道路只增加100 公里,只是2%。 因此,交换延迟不是这些情形中的主要因素。

6. 答:由于请求和应答都必须通过卫星,因此传输总路径长度为160,000千米。在空气和真空中的光速为300,000 公里/秒, 因此最佳的传播延迟为160,000/300,000秒,约533 msec。

7. 显而易见,在这里没有正确的独立的答案。但下列问题好像相关:目前的系统有它的很多惯性(检测和平衡)。 当新的团体掌握权力的时候,这惯性可保持法律、经济和社会制度的稳定。 此外,很多人对社会问题没有真的知道事情的真相,但却具有很强烈的、引起争论的意见。 将不允许讲道理的观点写进法律也许不合适。还必须考虑某些专业组织有影响的宣传活动。另一主要问题是安全。黑客可能侵入系统和伪造结果。

8. 答:将路由器称为A,B,C,D 和E.:则有10条可能的线路;AB, AC, AD, AE, BC, BD, BE, CD, CE,和DE。 每条线路有4 种可能性(3 速度或者不是线路),这样,拓扑的总数为410 = 1,048,576。

检查每个拓扑需要100 ms,全部检查总共需要104,857. 6秒,或者稍微超过29个小时。 9. 答:这意味着,从路由器到路由器的路径长度相当于路由器到根的两倍。 若在树中,根深度为1,深度为n,从根到第n层需要n-1跳,在该层的路由器为0.50。

从根到n-1 层的路径有router的0.25和n --2跳步。 因此,路径长度l为:

This expression reduces to l=n-2,The mean router-router 路径为2n-4。

10. 区分n-2 事件。 事件1到n由主机成功地、没有冲突地使用这条信道的事件组成。 这些可能性的事件的概率为p(1-p)n-1 。事件n+1是一个空闲的信道,其概率为(1- p)n。事件n+2是一个冲突。由于事件n+2互斥,它们可能发生的事件必须统一合计。 冲突的可能性等于那些小部分的槽的浪费,只是

11. 答:通过协议分层可以把设计问题划分成较小的易于处理的片段。分层意味着某一层的协议的改变不会影响高层或低层的协议。

12. 答:不.,在ISO 协议模型中,物理通讯只在最低的层里进行,不在每个层里。 13. 无连接通信和面向连接通信的最主要区别是什么? 答:主要的区别有两条。

其一:面向连接通信分为三个阶段,第一是建立连接,在此阶段,发出一个建立连接的请求。只有在连接成功建立之后,才能开始数据传输,这是第二阶段。接着,当数据传输完毕,必须释放连接。而无连接通信没有这么多阶段,它直接进行数据传输。

其二:面向连接的通信具有数据的保序性, 而无连接的通信不能保证接收数据的顺序与发送数据的顺序一致。

14. 答:不相同。在报文流中,网络保持对报文边界的跟踪;而在字节流中,网络不做这样的跟踪。例如,一个进程向一条连接写了1024 字节,稍后又写了另外1024 字节。那么接收方共读了2048 字节。对于报文流,接受方将得到两个报文。每个报文1024 字节。 而对于字节流,报文边界不被识别。接收方把全部的2048 个字节当作一个整体,在此已经体现不出原先有两个报文的事实。

15. 答:协商就是要让双方就在通信期间将使用的某些参数或数值达成一致。最大分组长度就是一个例子。

16. 服务是由k层向k+1层提供的。服务必须由下层k提供,即,对层k的服务是由k- 1层提供的。

17. The probability, Pk , of a frame requiring exactly k transmissions is the probability of the first k-1 attempts failing, pk-1 , times the probability of the k-th transmission succeeding, (1-p) . The mean number of transmission is then

just

18. OSI 的哪一层分别处理以下问题? 把传输的比特流划分为帧——数据链路层 决定使用哪条路径通过子网——网络层.

19. 答:帧封装包。 当一个包到达数据链路层时,整个数据包,包括包头、数据及全部内容,都用作帧的数据区。或者说,将整个包放进一个信封(帧)里面,( 如果能装入的话)。

20. 一个有n 层协议的系统,应用层生成长度为m 字节的报文,在每层都加上h 字节报头,那么网络带宽中有多大百分比是在传输各层报头?

hn/(hn+m)*100%

[注意:题中已说明每层都要附加报头,不要考虑实际的OSI 或者TCP/IP 协议]

21. 相似点:都是独立的协议栈的概念;层的功能也大体相似。

不同点:OSI更好的区分了服务、接口和协议的概念,因此比TCP/IP具有更好的隐藏性,能够比较容易的进行替换;OSI是先有的模型的概念,然后再进行协议的实现,而TCP/IP是先有协议,然后建立描述该协议的模型;层次数量有差别;TCP/IP 没有会话层和表示层,OSI不支持网络互连。OSI在网络层支持无连接和面向连接的通信,而在传输层仅有面向连接的通信,而TCP/IP在网络层仅有一种通信模式(无连接),但在传输层支持两种模式。

22. TCP 是面向连接的,而UDP 是一种数据报服务。

23. 如果3 枚炸弹炸毁与右上角那2个节点连接的3 个节点,可将那2个节点与其余的节点拆开。系统能禁得住任何两个节点的损失。

24. Doubling every 18 months means a factor of four gain in 3 years. In 9 years, the gain is then 43 or 64, leading to 6.4 billion hosts. My intuition says that is much too conservative, since by then probably every television in the world and possibly billions of other appliances will be on home LANs connected to the Internet. The average person in the developed world may have dozens of Internet hosts by then.

25. 如果网络容易丢失分组,那么对每一个分组逐一进行确认较好,此时仅重传丢失的分组。而在另一方面,如果网络高度可靠,那么在不发差错的情况下,仅在整个文件传送的结尾发送一次确认,从而减少了确认的次数,节省了带宽;不过,即使有单个分组丢失,也需要重传整个文件。

26. Small, fixed-length cells can be routed through switches quickly, and completely in

hardware. Small, fixed-size cells also make it easier to build hardware that handles many cells in parallel. Also, they do not block transmission lines for very long, making it easier to provide quality-of-service guarantees.

27. The speed of light in coax is about 200,000 km/sec, which is 200 meters/ìsec. At 10 Mbps, it takes 0.1 ìsec to transmit a bit. Thus, the bit lasts 0.1 ìsec in time, during which it propagates 20 meters. Thus, a bit is 20 meters long here.

28. The image is 1024 × 768 × 3 bytes or 2,359,296 bytes. This is 18,874,368 bits. At 56,000 bits/sec, it takes about 337.042 sec. At 1,000,000 bits/sec, it takes about 18.874 sec. At 10,000,000 bits/sec, it takes about 1.887 sec. At 100,000,000 bits/sec, it takes about 0.189 sec.

29. Think about the hidden terminal problem. Imagine a wireless network of five stations, A through E, such that each one is in range of only its immediate neighbors. Then A can talk to B at the same time D is talking to E. Wireless networks have potential parallelism, and in this way differ from Ethernet.

30. One disadvantage is security. Every random delivery man who happens to be in the

building can listen in on the network. Another disadvantage is reliability. Wireless networks make lots of errors. A third potential problem is battery life, since most wireless devices tend to be mobile.

31. 优点1:如果每个人都使用标准,那么每个人都可以与其他任何人交流;优点2:广泛使用标准将导致规模经济,比如生产大规模集成电路芯片。缺点1:为了取得标准化所需要的政治妥协经常会导致差的标准;缺点2:一旦标准被广泛采用了,要对它再做改变就会非常困难,即使发现了新的更好的技术或方法,也难以替换。

32. 具有国际标准的系统的例子包括CD 播放器和CD 盘片,随声听和录音磁带,照相机和35mm 胶卷等。缺乏国际标准的领域包括合适录像机和录像带(美国是NTSC VHS,欧洲是PAL),手提电话,电灯和灯泡(不同的国家使用不同的电压),影印机和纸(美国为8.5*11 英寸,其他地方为A4)等。

第 2 章 物理层 1.

答;本题是求周期性函数的傅立叶系数。而题面中所给出的为信号在一个周期内的解析式。

即;

2. 答:无噪声信道最大数据传输率公式:最大数据传输率=2Hlog2V b/s。因此最大数据传输率决定于每次采样所产生的比特数,如果每次采样产生16bits,那么数据传输率可达128kbps;如果每次采样产生1024bits,那么可达8.2Mbps。注意这是对无噪声信道而言的,实际信道总是有噪声的,其最大数据传输率由香农定律给出。

3. 答:采样频率12MHz,每次采样2bit,总的数据率为24Mbps。

4. 答:信噪比为20 dB 即 S/N = 100.由于 log2101≈6.658,由香农定理,该信道的信道容量为3log2(1++100) =19.98kbps。

又根据乃奎斯特定理,发送二进制信号的3kHz 信道的最大数据传输速率为 2*3 log22=6 kbps。

所以可以取得的最大数据传输速率为6kbps。

5. 答:为发送T1 信号,我们需要

所以,在50kHz 线路上使用T1 载波需要93dB 的信噪比。

6. 答:无源星没有电子器件,来自一条光纤的光照亮若干其他光纤。有源中继器把光信号转换成电信号以作进一步的处理。

7. 答:

因此,在0.1的频段中可以有30THz。

8. 答:数据速率为480× 640×24× 60bps,即442Mbps。

需要442Mbps 的带宽,对应的波长范围是

9. 答:奈奎斯特定理是一个数学性质,不涉及技术处理。该定理说,如果你有一个函数,它的傅立叶频谱不包含高于f 的正弦和余弦,那么以2 f 的频率采样该函数,那么你就可以获取该函数所包含的全部信息。因此奈奎斯特定理适用于所有介质。

10. 答:3 个波段的频率范围大约相等,根据公式

小的波段⊿ 也小,才能保持⊿f 大约相等。

顺便指出,3 个带宽大致相同的事实是所使用的硅的种类的一个碰巧的特性反映。

11. 答:

12. 答:1GHz 微波的波长是30cm。如果一个波比另一个波多行进15cm,那么它们到达时将180异相。显然,答案与链路长度是50km 的事实无关。

13. 答:

If the beam is off by 1 mm at the end, it misses the detector. This amounts to a triangle with base 100 m and height 0.001 m. The angle is one whose tangent is thus 0.00001. This angle is about 0.00057 degrees.

14. With 66/6 or 11 satellites per necklace, every 90 minutes 11 satellites pass overhead. This means there is a transit every 491 seconds. Thus, there will be a handoff about every 8 minutes and 11 seconds.

15. The satellite moves from being directly overhead toward the southern horizon, with a maximum excursion from the vertical of 2?. It takes 24 hours to go from directly overhead to maximum excursion and then back.

16. The number of area codes was 8× 2× 10, which is 160. The number of prefixes was 8× 8 ×10, or 640. Thus, the number of end offices was limited to 102,400. This limit is not a problem.

17. With a 10-digit telephone number, there could be 1010 numbers, although many of the area codes are illegal, such as 000. However, a much tighter limit is given by the number of end offices. There are 22,000 end offices, each with a maximum of 10,000 lines. This gives a maximum of 220 million telephones. There is simply no place to connect more of them. This

could never be achieved in practice because some end offices are not full. An end office in a small town in Wyoming may not have 10,000 customers near it, so those lines are wasted.

18. 答:每部电话每小时做0.5 次通话,每次通话6 分钟。因此一部电话每小时占用一条电路3 分钟,60/3=20,即20 部电话可共享一条线路。由于只有10%的呼叫是长途,所以200 部电话占用一条完全时间的长途线路。局间干线复用了1000000/4000=250 条线路,每条线路支持200 部电话,因此,一个端局可以支持的电话部数为200*250=50000。

19. 答:双绞线的每一条导线的截面积是,每根双绞线的两条导线在10km 长的情况下体积是,即约为15708cm。

3

由于铜的密度等于9.0g/cm,每个本地回路的质量为9×15708 =141372 g,约为141kg。这样,

电话公司拥有的本地回路的总质量等于141×1000×104= 1.41× 10 9kg,由于每千克铜的价格是

99

3 美元,所以总的价值等于3× 1.4×10 =4.2 × 10美元。

20. Like a single railroad track, it is half duplex. Oil can flow in either direction, but not both ways at once.

21. 通常在物理层对于在线路上发送的比特不采取任何差错纠正措施。在每个调制解调器中都包括一个CPU 使得有可能在第一层中包含错误纠正码,从而大大减少第二层所看到的错误率。由调制解调器做的错误处理可以对第二层完全透明。现在许多调制解调器都有内建的错误处理功能。

22. 每个波特有4 个合法值,因此比特率是波特率的两倍。对应于1200 波特,数据速率是2400bps。

23. 相位总是0,但使用两个振幅,因此这是直接的幅度调制。

24. If all the points are equidistant from the origin, they all have the same amplitude, so amplitude modulation is not being used. Frequency modulation is never used in constellation diagrams, so the encoding is pure phase shift keying.

25. Two, one for upstream and one for downstream. The modulation scheme itself just uses amplitude and phase. The frequency is not modulated.

26. There are 256 channels in all, minus 6 for POTS and 2 for control, leaving 248 for data. If 3/4 of these are for downstream, that gives 186 channels for downstream. ADSL modulation is at 4000 baud, so with QAM-64 (6 bits/baud) we have 24,000 bps in each of the 186 channels. The total bandwidth is then 4.464 Mbps downstream.

27. A 5-KB Web page has 40,000 bits. The download time over a 36 Mbps channel is 1.1 msec. If the queueing delay is also 1.1 msec, the total time is 2.2 msec. Over ADSL there is no queueing delay, so the download time at 1 Mbps is 40 msec. At 56 kbps it is 714 msec.

28. There are ten 4000 Hz signals. We need nine guard bands to avoid any interference. The minimum bandwidth required is 4000× 10 + 400×9 =43,600 Hz.

29. 答:125的采样时间对应于每秒8000 次采样。一个典型的电话通道为4kHz。根据奈奎斯特定理,为获取一个4kHz 的通道中的全部信息需要每秒8000 次的采样频率。

(Actually the nominal bandwidth is somewhat less, but the cutoff is not sharp.)

30. 每一帧中,端点用户使用193 位中的168(7*24)位,开销占25(=193-168)位,因此开销比例等于25/193=13%。

31. 答:比较使用如下方案的无噪声4kHz 信道的最大数据传输率: (a) 每次采样2 比特的模拟编码 ——16kbps (b) T1 PCM 系统——56kbps

In both cases 8000 samples/sec are possible. With dibit encoding, two bits are sent per sample. With T1, 7 bits are sent per period. The respective data rates are 16 kbps and 56 kbps.

32. 答:10 个帧。

在数字通道上某些随机比特是0101010101 模式的概率是1/1024。察看10 个帧,若每一帧中的第一位形成比特串0101010101,则判断同步成功,而误判的概率为1/1024,小于0.001。

33. 答:有。编码器接受任意的模拟信号,并从它产生数字信号。而解调器仅仅接受调制了的正弦(或余弦)波,产生数字信号。

34. 答:a.CCITT 2.048Mbps 标准用32 个8 位数据样本组成一个125的基本帧,30 个信道用于传信息,2 个信道用于传控制信号。在每一个4kHz 信道上发送的数据率就是

8*8000=64kbps。

b.差分脉码调制(DPCM)是一种压缩传输信息量的方法,它发送的不是每一次抽样的二进制编码值,而是两次抽样的差值的二进制编码。现在相对差值是4 位,所以对应每个4kHz 信道实际发送的比特速率为4*8000=32bps。

c.增量调制的基本思想是:当抽样时间间隔s t 很短时,模拟数据在两次抽样之间的变化很小,可以选择一个合适的量化值? 作为阶距。把两次抽样的差别近似为不是增加一个?就是减少一个? 。这样只需用1bit 二进制信息就可以表示一次抽样结果,而不会引入很大误差。因此,此时对应每个4kHz 信道实际发送的数据速率为1*8000=8kHz。

35. 答:在波的1/4 周期内信号必须从0 上升到A。为了能够跟踪信号,在T/4 的时间内(假定波的周期是T)必须采样8 次,即每一个全波采样32 次,采样的时间间隔是1/x,因此波的全周期必须足够的长,使得能包含32 次采样,即T > 32/x,或f max =x/32。

36. 答:10-9 的漂移意味着109 秒中的1 秒,或1 秒中的10-9 秒。对于OC-1 速率,即51.840Mbps,取近似值50Mbps,大约一位持续20ns。这就说明每隔20 秒,时钟就要偏离1位。这就说明,时钟必须每隔10 秒或更频繁地进行同步,才能保持不会偏离太大。

37. 答:基本的SONET 帧是美125产生810 字节。由于SONET 是同步的,因此不论是否有数据,帧都被发送出去。每秒8000 帧与数字电话系统中使用的PCM 信道的采样频率完全一样。

810字节的SONET 帧通常用90列乘以9行的矩形来描述,每秒传送51.84Mbps,即8×810×8000=51840000bps。这就是基本的SONET 信道,它被称作同步传输信号STS-1,所有的SONET 干线都是由多条STS-1构成。

每一帧的前3 列被留作系统管理信息使用,前3 行包含段开销,后6 行包含线路开销。 剩下的87 列包含87×9×8×8000=50112000bps。被称作同步载荷信封的数据可以在任何位置开始。线路开销的第一行包含指向第一字节的指针。同步载荷信封(SPE)的第一列是通路开销。

通路开销不是严格的SONET 结构,它在嵌入在载荷信封中。通路开销端到端的流过网络,因此把它与端到端的运载用户信息的SPE 相关联是有意义的。然而,它确实从可提供给端点用户的50.112Mbps 中又减去1×9×8×8000=576000bps,即0.576Mbps,使之变成49.536Mbps 。OC-3相当于3个OC-1复用在一起,因此其用户数据传输速率是49.546× 3= 148.608 Mbps。

38. VT1.5 can accommodate 8000 frames/sec ×3 columns× 9 rows× 8 bits =1.728 Mbps. It can be used to accommodate DS-1. VT2 can accommodate 8000 frames/sec ×4 columns× 9 rows × 8 bits = 2.304 Mbps. It can be used to accommodate European CEPT-1 service. VT6 can accommodate 8000 frames/sec× 12 columns× 9 rows× 8 bits = 6.912 Mbps. It can be used to accommodate DS-2 service.

39. Message switching sends data units that can be arbitrarily long. Packet switching has a maximum packet size. Any message longer than that is split up into multiple packets.

40. 答:当一条线路(例如OC-3)没有被多路复用,而仅从一个源输入数据时,字母c(表示conactenation,即串联)被加到名字标识的后面,因此,OC-3 表示由3 条单独的OC-1 线路复用成155.52Mbps,而OC-3c 表示来自单个源的155.52Mbps 的数据流。OC-3c 流中所包含的3 个OC-1 流按列交织编排,首先是流1 的第1 列,流2 的第1 列,流3 的第1 列,随后是流1 的第2 列,流2 的第2 列,??以此类推,最后形成270 列宽9 行高的帧。 OC-3c 流中的用户实际数据传输速率比OC-3 流的速率略高(149.760Mbps 和

148.608Mbps),因为通路开销仅在SPE 中出现一次,而不是当使用3 条单独OC-1 流时出现的3 次。换句话说,OC-3c 中270 列中的260 列可用于用户数据,而在OC-3 中仅能使用258列。更高层次的串联帧(如OC-12c)也存在。

OC-12c 帧有12*90=1080 列和9 行。其中段开销和线路开销占12*3=36 列,这样同步载荷信封就有1080-36=1044 列。SPE 中仅1 列用于通路开销,结果就是1043 列用于用户数据。

由于每列9 个字节,因此一个OC-12c 帧中用户数据比特数是8 × 9×1043=75096。每秒8000 帧,得到用户数据速率75096×8000 =600768000bps,即600.768Mbps。

所以,在一条OC-12c 连接中可提供的用户带宽是600.768Mbps。

41. 答:The three networks have the following properties: 星型:最好为2,最差为2,平均为2; 环型:最好为1,最差为n/2,平均为n/4 如果考虑n 为奇偶数,

则n 为奇数时,最坏为(n-1)/2,平均为(n+1)/4 n 为偶数时,最坏为 n/2,平均为n/4(n-1) 全连接:最好为1,最差为1,平均为1。

42. 对于电路交换, t= s时电路建立起来;t =s+ + x /d 时报文的最后一位发送完毕;t == s++ x/b+kd时报文到达目的地。而对于分组交换,最后一位在t=x/b 时发送完毕。 为到达最终目的地,最后一个分组必须被中间的路由器重发k-1次,每次重发花时间p/ b,所以总的延迟为

2

为了使分组交换比电路交换快,必须:

所以:

43. 答:所需要的分组总数是x /p ,因此总的数据加上头信息交通量为(p+h)x/p位。 源端发送这些位需要时间为(p+h )x / /pb 中间的路由器重传最后一个分组所花的总时间为(k-1)(p +h )/ b 因此我们得到的总的延迟为

对该函数求p 的导数,得到

得到

因为 p>0,所以

时能使总的延迟最小。

44. Each cell has six neighbors. If the central cell uses frequency group A, its six neighbors can use B, C, B, C, B, and C respectively. In other words, only 3 unique cells are needed. Consequently, each cell can have 280 frequencies.

45. First, initial deployment simply placed cells in regions where there was high density of human or vehicle population. Once they were there, the operator often did not want to go to the trouble of moving them. Second, antennas are typically placed on tall buildings or mountains. Depending on the exact location of such structures, the area covered by a cell may be irregular due to obstacles near the transmitter. Third, some communities or property owners do not allow building a tower at a location where the center of a cell falls. In such cases, directional antennas are placed at a location not at the cell center.

46. If we assume that each microcell is a circle 100 m in diameter, then each cell has an area of 2500e. If we take the area of San Francisco, 1.2 × 108 m2 and divide it by the area of 1

microcell, we get 15,279 microcells. Of course, it is impossible to tile the plane with circles (and San Francisco is decidedly three-dimensional), but with 20,000 microcells we could probably do the job.

47. Frequencies cannot be reused in adjacent cells, so when a user moves from one cell to another, a new frequency must be allocated for the call. If a user moves into a cell, all of whose frequencies are currently in use, the user’s call must be terminated.

48. It is not caused directly by the need for backward compatibility. The 30 kHz channel was indeed a requirement, but the designers of D-AMPS did not have to stuff three users into it. They could have put two users in each channel, increasing the payload before error correction from 260 ×50= 13 kbps to 260× 75 = 19.5 kbps. Thus, the quality loss was an intentional trade-off to put more users per cell and thus get away with bigger cells.

49. D-AMPS uses 832 channels (in each direction) with three users sharing a single channel. This allows D-AMPS to support up to 2496 users simultaneously per cell. GSM uses 124 channels with eight users sharing a single channel. This allows GSM to support up to 992 users

simultaneously. Both systems use about the same amount of spectrum (25 MHz in each direction). D-AMPS uses 30 KHz× 892 = 26.76 MHz. GSM uses 200 KHz × 124 =24.80 MHz. The difference can be mainly attributed to the better speech quality provided by GSM (13 Kbps per user) over D-AMPS (8 Kbps per user).

50. The result is obtained by negating each of A, B, and C and then adding the three chip sequences. Alternatively the three can be added and then negated.

The result is (+3 +1 +1 .1 .3 .1 .1 +1).

51. By definition

If T sends a 0 bit instead of 1 bit, its chip sequence is negated, with the i-th element becoming .Ti . Thus,

52. When two elements match, their product is +1. When they do not match, their product is .1. To make the sum 0, there must be as many matches as mismatches. Thus, two chip sequences are orthogonal if exactly half of the corresponding elements match and exactly half do not match.

53. Just compute the four normalized inner products: (.1 +1 .3 +1 .1 .3 +1 +1) d (.1 .1 .1 +1 +1 .1 +1 +1)/8 = 1 (.1 +1 .3 +1 .1 .3 +1 +1) d (.1 .1 +1 .1 +1 +1 +1 .1)/8 = .1 (.1 +1 .3 +1 .1 .3 +1 +1) d (.1 +1 .1 +1 +1 +1 .1 .1)/8 = 0 (.1 +1 .3 +1 .1 .3 +1 +1) d (.1 +1 .1 .1 .1 .1 +1 .1)/8 = 1

The result is that A and D sent 1 bits, B sent a 0 bit, and C was silent.

54. 答:可以,每部电话都能够有自己到达端局的线路,但每路光纤都可以连接许多部电话。忽略语音压缩,一部数字PCM电话需要64kbps 的带宽。如果以64kbps 为单元来分割10Gbps,我们得到每路光缆串行156250 家。现今的有线电视系统每根电缆串行数百家。

55. 答:它既像TDM,也像FDM。100 个频道中的每一个都分配有自己的频带(FDM),在每个频道上又都有两个逻辑流通过TDM 交织播放(节目和广告交替使用频道)。

This example is the same as the AM radio example given in the text, but neither is a fantastic example of TDM because the alternation is irregular.

56. A 2-Mbps downstream bandwidth guarantee to each house implies at most 50 houses per coaxial cable. Thus, the cable company will need to split up the existing cable into 100 coaxial cables and connect each of them directly to a fiber node.

57. The upstream bandwidth is 37 MHz. Using QPSK with 2 bits/Hz, we get 74 Mbps

upstream. Downstream we have 200 MHz. Using QAM-64, this is 1200 Mbps. Using QAM-256, this is 1600 Mbps.

58. Even if the downstream channel works at 27 Mbps, the user interface is nearly always 10-Mbps Ethernet. There is no way to get bits to the computer any faster than 10-Mbps under these circumstances. If the connection between the PC and cable modem is fast Ethernet, then the full 27 Mbps may be available. Usually, cable operators specify 10 Mbps Ethernet because they do not want one user sucking up the entire bandwidth.

第 3 章 数据链路层

1. 答:由于每一帧有0.8 的概率正确到达,整个信息正确到达的概率为 p=0.810=0.107。 为使信息完整的到达接收方,发送一次成功的概率是p ,二次成功的概率是(1-p)p,三

2i-1

次成功的概率为(1-p ) p,i 次成功的概率为(1-p)p,因此平均的发送次数等于:

2. The solution is

(a) 00000100 01000111 11100011 11100000 01111110

(b) 01111110 01000111 11100011 11100000 11100000 11100000 01111110 01111110

(c) 01111110 01000111 110100011 111000000 011111010 01111110

3. After stuffing, we get A B ESC ESC C ESC ESC ESC FLAG ESC FLAG D.

4. If you could always count on an endless stream of frames, one flag byte might be enough. But what if a frame ends (with a flag byte) and there are no new frames for 15 minutes. How will the receiver know that the next byte is actually the start of a new frame and not just noise on the line? The protocol is much simpler with starting and ending flag bytes.

5. The output is 011110111110011111010.

6. 答:可能。假定原来的正文包含位序列01111110 作为数据。位填充之后,这个序列将变成01111010。如果由于传输错误第二个0 丢失了,收到的位串又变成01111110,被接收方看成是帧尾。然后接收方在该串的前面寻找检验和,并对它进行验证。如果检验和是16 位,那么被错误的看成是检验和的16 位的内容碰巧经验证后仍然正确的概率是1/216。如果这种概率的条件成立了,就会导致不正确的帧被接收。显然,检验和段越长,传输错误不被发现的概率会越低,但该概率永远不等于零。

7. 答:如果传播延迟很长,例如在探测火星或金星的情况下,需要采用前向纠错的方法。还有在某些军事环境中,接收方不想暴露自己的地理位置,所以不宜发送反馈信号。如果错误率足够的低,纠错码的冗余位串不是很长,又能够纠正所有的错误,前向纠错协议也可能是比较合理和简单的。

8. Making one change to any valid character cannot generate another valid character due to the nature of parity bits. Making two changes to even bits or two changes to odd bits will give another valid character, 所以Hamming 距离为2

9. Parity bits are needed at positions 1, 2, 4, 8, and 16, so messages that do not extend beyond bit 31 (including the parity bits) fit. Thus, five parity bits are sufficient. The bit pattern transmitted is 011010110011001110101

10. The encoded value is 101001001111.

11. If we number the bits from left to right starting at bit 1, in this example, bit 2 (a parity bit) is incorrect. The 12-bit value transmitted (after Hamming encoding) was 0xA4F. The original 8-bit data value was 0xAF.

12. 答:单个错误将引起水平和垂直奇偶检查都出错。两个错误,无论是否同行或者同列,也容易被检测到。对于有三位错误的情况,就有可能无法检测了。for example, if some bit is inverted along with its row and column parity bits. Even the corner bit will not catch this.

13. 答:用n 行k 列的矩阵来描述错误图案,在该矩阵中,正确的位用0 表示,不正确的位用1 表示。由于总共有4 位传输错误,每个可能的错误矩阵中都恰有4 个1。则错误矩

4

阵的个数总共有C nk个。而在错误矩阵中,当4 个1 正好构成一个矩形的4 个顶点的时候,这样的错误是检测不出来的。则检测不出来的错误矩阵的个数为C2n × C2k

所以,错误不能检测的概率是:

即;

14. 答:如所列的除式,所得的余数为x2+x+1。

. 15. The frame is 10011101. The generator is 1001. The message after appending three zeros is 10011101000. The remainder on dividing 10011101000 by 1001 is 100. So, the actual bit string transmitted is 10011101100. The received bit stream with an error in the third bit from the left is 10111101100.

Dividing this by 1001 produces a remainder 100, which is different from zero. Thus, the receiver detects the error and can ask for a retransmission.

16. 答:CRC 是在发送期间进行计算的。一旦把最后一位数据送上外出线路,就立即把CRC编码附加在输出流的后面发出。如果把CRC 放在帧的头部,那么就要在发送之前把整个帧先检查一遍来计算CRC。这样每个字节都要处理两遍,第一遍是为了计算检验码,第二遍是为了发送。把CRC 放在尾部就可以把处理时间减半。

17. 答:当发送一帧的时间等于信道的传播延迟的2 倍时,信道的利用率为50%。或者说,当发送一帧的时间等于来回路程的传播延迟时,效率将是50%。而在帧长满足发送时间大于延迟的两倍时,效率将会高于50%。

现在发送速率为4Mb/s,发送一位需要0.25。

只有在帧长不小于160kb 时,停等协议的效率才会至少达到50%。

18. 答;为了有效运行,序列空间(实际上就是发送窗口大小)必须足够的大,以允许发送方在收到第一个确认应答之前可以不断发送。信号在线路上的传播时间为

6×3000= 18000

,即18ms。

在T1 速率,发送64 字节的数据帧需花的时间:64×8÷(1.536×106) = 0.33。

所以,发送的第一帧从开始发送起,18.33ms 后完全到达接收方。确认应答又花了很少的发送时间(忽略不计)和回程的18ms。这样,加在一起的时间是36.33ms。发送方应该

有足够大的窗口,从而能够连续发送36.33ms。 36. 33/0.33=110

也就是说,为充满线路管道,需要至少110 帧,因此序列号为7 位。

19. It can happen. Suppose that the sender transmits a frame and a garbled acknowledgement comes back quickly. The main loop will be executed a second time and a frame will be sent while the timer is still running.

20. Let the sender’s window be (Sl , Su) and the receiver’s be (Rl , Ru). Let the window size be W. The relations that must hold are:

0 ≤ Su- Si + +1 ≤ W1

Ru -Rl + 1 = W Sl ≤ Rl ≤ Su + 1

21. 答:改变检查条件后,协议将变得不正确。假定使用3 位序列号,考虑下列协议运行过程:

A 站刚发出7 号帧;B 站接收到这个帧,并发出捎带应答ack。A 站收到ack,并发送0~6 号帧。假定所有这些帧都在传输过程中丢失了。B 站超时,重发它的当前帧,此时捎带的确认号是7。考察A 站在r.rack=7 到达时的情况,关键变量是ack_expected=0,r.rack=7,next_frame_to_send_=7。修改后的检查条件将被置成“真”,不会报告已发现的丢失帧错误,而误认为丢失了的帧已被确认。另一方面,如果采用原先的检查条件,就能够报告丢失帧的错误。所以结论是:为保证协议的正确性,已接收的确认应答号应该小于下一个要发送的序列号。

22. 答:可能导致死锁。假定有一组帧正确到达,并被接收。然后,接收方会向前移动窗口。

现在假定所有的确认帧都丢失了,发送方最终会产生超时事件,并且再次发送第一帧,接收方将发送一个NAK。然后NONAK 被置成伪。假定NAK 也丢失了。那么从这个时候开始,发送方会不断发送已经被接收方接受了的帧。接收方只是忽略这些帧,但由于NONAK 为伪,所以不会再发送NAK,从而产生死锁。如果设置辅助计数器(实现“else”子句),超时后重发NAK,终究会使双方重新获得同步。

23. 答:删除这一段程序会影响协议的正确性,导致死锁。因为这一段程序负责处理接收到的确认帧,没有这一段程序,发送方会一直保持超时条件,从而使得协议的运行不能向前进展。

24. It would defeat the purpose of having NAKs, so we would have to fall back to timeouts. Although the performance would degrade, the correctness would not be affected. The NAKs are not essential.

25. 答:这里要求r.rack+1

A 站发送0 号帧给B 站。B 站收到此帧,并发送ACK帧,但ACK丢失了。A 站发生超时,重发0 号帧。但B 站现在期待接收1 号帧,应此发送NAK,否定收到的0 号帧。显然,现在A 站最好不重发0 号帧。由于条件r.rack+1

26. 答:不可以。最大接收窗口的大小就是1。现在假定该接收窗口值变为2。开始时发送方发送0 至6 号帧,所有7 个帧都被收到,并作了确认,但确认被丢失。现在接收方准备接收7 号和0 号帧,当重发的0 号帧到达接收方时,它将会被缓存保留,接收方确认6 号帧。

当7 号帧到来的时候,接收方将把7 号帧和缓存的0 号帧传递给主机,导致协议错误。因此,能够安全使用的最大窗口值为1。

27. 答:发送1 位用时间1,发送1000bit 的最长帧花时间1ms。由于超时间隔是10ms,而1s 才能产生一个新的数据帧,所以超时是不可避免的。假定A 站向B 站发送一个帧,正确到达接收方,但较长时间无反向交通。不久,A 站发生超时事件,导致重发已发过的一帧。

B 站发现收到的帧的序列号错误,因为该序列号小于所期待接收的序列号。因此B 站将发送一个NAK,该NAK 会携带一个确认号,导致不再重发该帧。结果每个帧都被发送两次。

28. 答:不能,协议的运行将会失败。当MaxSeq=4,序列号的模数=4+1=5,窗口大小将等于:NrBufs<=5/2=2.5,即得到,NrBufs=2。因此在该协议中,偶数序号使用缓冲区1。这种映射意味着帧4 和0 将使用同一缓冲区。假定0 至3 号帧都正确收到了,并且都确认应答了,并且都确认应答了。如果随后的4 号帧丢失,且下一个0 号帧收到了,新的0 号帧将被放到缓冲区0 中,变量arrived[0]被置成“真”。这样,一个失序帧将被投递给主机。事实上,采用选择性重传的滑动窗口协议需要MaxSeq 是奇数才能正确的工作。然而其他的滑动窗口协议的实现并不具有这一性质。

29. 答:对应三种协议的窗口大小值分别是1、7 和4。

使用卫星信道端到端的典型传输延迟是270ms,以1Mb/s 发送,1000bit 长的帧的发送时间为1ms。我们用t=0 表示传输开始的时间,那么在t=1ms 时,第一帧发送完毕;t=271ms时,第一帧完全到达接收方;t=272ms,对第一帧的确认帧发送完毕;t=542ms,带有确认的帧完全到达发送方。因此一个发送周期为542ms。如果在542ms 内可以发送k 个帧,由于每一个帧的发送时间为1ms,则信道利用率为k/542,因此:

(a) k=1,最大信道利用率=1/542=0.18% (b) k=7,最大信道利用率=7/542=1.29% (c) k=4,最大信道利用率=4/542=0.74%

30. 答:使用选择性重传滑动窗口协议,序列号长度是8 位。窗口大小为128。卫星信道端到端的传输延迟是270ms。以50kb/s 发送,4000bit(3960+40)长的数据帧的发送时间是0.02*4000=80ms。我们用t=0 表示传输开始时间,那么,t=80ms,第一帧发送完毕; t=270+80=350ms,第一帧完全到达接收方;t=350+80=430ms,对第一帧作捎带确认的反向数据帧可能发送完毕;t=430+270=700ms,带有确认的反向数据帧完全到达发送方。因此,周期为700ms,发送128 帧时间80*128=10240ms,这意味着传输管道总是充满的。每个帧重传的概率为0.01,对于3960 个数据位,头开销为40 位,平均重传的位数为4000*0.01=40位,传送NAK 的平均位数为40*1/100=0.40 位,所以每3960 个数据位的总开销为80.4 位。

因此,开销所占的带宽比例等于80.4/(3960+80.4)=1.99%。

31. 答:使用卫星信道端到端的传输延迟为270ms,以64kb/s 发送,周期等于604ms。发送一帧的时间为64ms,我们需要604/64=9 个帧才能保持通道不空。

对于窗口值1,每604ms 发送4096 位,吞吐率为4096/0.604=6.8kb/s。 对于窗口值7,每604ms 发送4096*7 位,吞吐率为4096*7/0.604=47.5kb/s。 对于窗口值超过9(包括15、127),吞吐率达到最大值,即64kb/s。

32. 答:在该电缆中的传播速度是每秒钟200 000km,即每毫秒200km,因此100km 的电缆将会在0.5ms 内填满。T1 速率125传送一个193 位的帧,0.5ms 可以传送4 个T1 帧,即193*4=772bit。

33. Each machine has two key variables: next3frame3to3send and frame3expected, each of which can take on the values 0 or 1. Thus, each machine can be in one of four possible states. A message on the channel contains the sequence number of the frame being sent and the sequence number of the frame being ACKed. Thus, four types of messages exist. The channel may contain 0 or 1 message in either direction. So, the number of states the channel can be in is 1 with zero messages on it, 8 with one message on it, and 16 with two messages on it (one message in each direction). In total there are 1 + 8 + 16 = 25 possible channel states. This implies 4 × 4 × 25 = 400 possible states for the complete system.

34. The firing sequence is 10, 6, 2, 8. It corresponds to acceptance of an even frame, loss of the acknowledgement, timeout by the sender, and regeneration of the acknowledgement by the receiver.

35. The Petri net and state graph are as follows:

The system modeled is mutual exclusion. B and E are critical sections that may not be active simultaneously, i.e., state BE is not permitted. Place C represents a semaphore that can be seized by either A or D but not by both together.

36. PPP was clearly designed to be implemented in software, not in hardware as HDLC nearly always is. With a software implementation, working entirely with bytes is much simpler than working with individual bits. In addition, PPP was designed to be used with modems, and modems accept and transmit data in units of 1 byte, not 1 bit.

37. At its smallest, each frame has two flag bytes, one protocol byte, and two checksum bytes, for a total of five overhead bytes per frame.

第 4 章 介质访问子层

1. The formula is the standard formula for Markov queueing given in section 4.1.1, namely,

. Here C = 108 and, so sec. For the three arrival

rates, we get (a) 0.1 msec,(b) 0.11 msec, (c) 1 msec. For case (c) we are operating a queueing system with , which gives the 10×delay.

2. 答:对于纯的ALOHA,可用的带宽是0.184×56 Kb/s =10.304 Kb/ s。 每个站需要的带宽为1000/100=10b/s。而 N=10304/10≈1030 所以,最多可以有1030 个站,即N 的最大值为1030。

3. 答:对于纯的ALOHA,发送可以立即开始。对于分隙的ALOHA,它必须等待下一个时隙。这样,平均会引入半个时隙的延迟。因此,纯ALOHA 的延迟比较小。

4. 每个终端每200(=3600/18)秒做一次请求,总共有10 000 个终端,因此,总的负载是200 秒做10000 次请求。平均每秒钟50 次请求。每秒钟8000 个时隙,所以平均每个时隙的发送次数为50/8000=1/160。

5. 答:

(a)在任一帧时间内生成k 帧的概率服从泊松分布

生成0 帧的概率为e 对于纯的ALOHA,发送一帧的冲突危险区为两个帧时,在两帧内无其他帧发送的概率是e-G×e –G=e-2G

对于分隙的ALOHA,由于冲突危险区减少为原来的一半,任一帧时内无其他帧发送的概率是e-G 。

现在时隙长度为40ms,即每秒25 个时隙,产生50 次请求,所以每个时隙产生两个请求,

-22

G=2。因此,首次尝试的成功率是:e = 1/ e

(b)

-G

(c)尝试k 次才能发送成功的概率(即前k-1 次冲突,第k 次才成功)为:

那么每帧传送次数的数学期望为

6. 答:

(a)从泊松定律得到p0=e ,因此G= -lnp0= -ln0.1=2.3 (b) S=G e , G =2.3,e =0.1 S=2.3×0.1=0.23

(c)因为每当G>1 时,信道总是过载的,因此在这里信道是过载的。

7. 答:每帧传送次数的数学期望为:

-G

-G

–G

E 个事件为E-1 个长度等于4 个时隙的间隔时间所分隔。因此一个帧从第一次发送开始

G-G时间到最后一次尝试成功的发送开始时间之间的长度即延迟是4(e-1),吞吐率S= Ge。

对于每一个G 值,都可以计算出对应的延迟值D=4(eG--1),以及吞吐率值S=Ge-G 。 按此方法即可画出时延对吞吐率的曲线。

8. (a) The worst case is: all stations want to send and s is the lowest numbered station. Wait time N bit contention period + (N-1) d bit for transmission of frames. The total is N+(N-1) dbit times. (b) The worst case is: all stations have frames to transmit and s has the lowest virtual station number.

Consequently, s will get its turn to transmit after the other N-1 stations have transmitted one frame each, and N contention periods of size log2 N each.

Wait time is thus(N+1)× d+N×log2 bits.

9. 答:在解答这一问题之前,首先要了解什么是Mok 和Ward 版本的二进制倒计数法。在二进制倒计数法中,每个想要使用信道的站点首先将其地址以二进制位串的形式按照由高到低的顺序进行广播,并且假定所有地址的长度相同。为了避免冲突,必须进行仲裁:如果某站发现其地址中原本为0 的高位被置换为1,那么它便放弃发送。对于次高位进行同样的信道竞争操作,直到最后只有一个站赢得信道为止。一个站点在赢得信道竞争后便可发送一帧,然后另一个信道竞争周期又将开始。Mok 和Ward 提出了二进制倒计数法的一个变种。该方法采用了并行接口而不是串行接口:还使用虚拟站号,在每次传输之后对站重新编号,从0开始,已成功传送的站被排在最后。如果总共有N 个站,那么最大的虚拟站号是N-1。 在本题中,当4 站发送时,它的号码变为0,而0、1、2 和3 号站的号码都增1,10 个站点的虚站号变为8,3,0,5,2,7,4,6,9,1当3 站发送时,它的号码变为0,而0、1 和2 站的号码都增1,10 个站点的虚站号变为:8,0,1,5,3,7,4,6,9,2

最后,当9 站发送时,它变成0,所有其他站都增1,结果是:9,1,2,6,4,8,5,7,0,3。

10. 答:在自适应树遍历协议中,可以把站点组织成二叉树(见图)的形式。在一次成功的传输之后,在第一个竞争时隙中,全部站都可以试图获得信道,如果仅其中之一需用信道,则发送冲突,则第二时隙内只有那些位于节点B 以下的站(0 到7)可以参加竞争。如其中之一获得信道,本帧后的时隙留给站点C 以下的站;如果B 点下面有两个或更多的站希望发送,在第二时隙内会发生冲突,于是第三时隙内由D 节点以下各站来竞争信道。

本题中,站2、3、5、7、11 和13 要发送,需要13 个时隙,每个时隙内参加竞争的站的列表如下:

第一时隙:2、3、5、7、11、13 第二时隙:2、3、5、7 第三时隙:2、3 第四时隙:空闲 第五时隙:2、3 第六时隙:2 第七时隙:3 第八时隙:5、7 第九时隙:5 第十时隙:7 第十一时隙:11、13 第十二时隙:11 第十三时隙:13

11. 答: 2 n个站点对应n+1 级,其中0 级有1 个节点,1 级有2 个节点, n 级有2 n

i

个节点。在i 级的每个节点下面所包括的站的个数等于总站数的1/2 。本题中所需要的时隙数取决于为了到达准备好发送的两个站的共同先辈点必须往回走多少级。先计算这两个站具

n

有共同的父节点的概率p1。在2个站中,要发送的两个站共享一个指定的父节点的概率是

总共2 n -1个父节点,所以,

因为 2 >> 1 所以p1≈2

- n

n

在共享父节点的条件下遍历树,从第二级开始每一级访问两个节点,这样遍历树所走过的节点总数n1 = 1++2+…+2+2=1=2n,接下来,我们考察两个发送站共享祖父节点的概率p2和遍历树所走过的节点总数n2。此时在每个父节点下面仅可能有一个站发送。两个发送站共享一个指定的祖父节点的概率是1/ C 22n-1。

共有2 n -2个祖父节点

遍历树比1 n 减少两个节点,即

通过类似的分析和计算,可以得到,两个发送站共享曾祖父节点(属n-3 级祖先节点)

-n++2

的概率是 p3=2

遍历树所经过的节点总数比n2又少两个节点,

因此,最坏的情形是2n+1 个时隙(共享父节点),对应于i=0;

最好的情形是3 个时隙,对应于i=n-1 (两个发送站分别位于左半树和右半树),所以平均时隙数等于

该表达式可以简化为

12. 答:如果所有站的发射有效范围都很大,以至于任一站都可以收到所有其他站发送的信号,那么任一站都可以与其他站以广播方式通信。在这样的条件下,CSMA/CD 可以工作的很好。

13. 答:WDMA(wave length division multiple access)是一个波分多路访问协议。每个站点分配2 个信道;其中窄信道是控制信道,接收其他站发给该站的控制信号;宽信道用作该站点输出数据帧的信道。每个信道被划分成许多个时隙组。时隙0 用某种特殊的方式标记,以便于后继时隙的识别。所有的信道均用同一个全局时钟来同步。每个站点都有2 个发送端和2个接收端,它们分别是:

(1)一个波长固定不变的接收端,它用来侦听本站点的控制信道。 (2)一个波长可调的发送端,它用于向其他站点的控制信道发送帧。 (3)一个波长固定不变的发送端,它用于输出数据帧。

(4)一个波长可调的接收端,它用来选择要侦听的数据发送端。

也就是说,每个站点都侦听自己的控制信道,看是否有请求产生,并将接收端的波长调为发送端的波长,从而得到数据。

GSM(Global system for mobile communication)是一种数字蜂窝无线电系统信道分配方案。

系统中每个蜂窝最多可拥有200 多个全双工信道,每个信道包括下行链路频率(从基站到可移动站)和上行链路频率(从可移动站到基站),每个频段宽200kHz。每一个信道均可采用时分复用技术,支持多个独立的连接。

两种协议都使用FDM 和TDM 结合的方法,它们都可以提供专用的频道(波长),并且都划分时隙,实现TDM。

14. Yes. Imagine that they are in a straight line and that each station can reach only its nearest neighbors. Then A can send to B while E is sending to F.

15. (a) Number the floors 1-7. In the star configuration, the router is in the middle of floor 4. Cables are needed to each of the 7 × 15 . 1 = 104 sites. The total length of these cables is

The total length is about 1832 meters.

(b) For 802.3, 7 horizontal cables 56 m long are needed, plus one vertical cable 24 m long, for a total of 416 m.

16. 答:以太网使用曼彻斯特编码,这就意味着发送的每一位都有两个信号周期。标准以太网的数据率为10Mb/s,因此波特率是数据率的两倍,即20MBaud。

17. The signal is a square wave with two values, high (H) and low (L). The pattern is LHLHLHHLHLHLLHHLLHHL.

18. The pattern this time is HLHLHLLHHLLHLHHLHLLH.

19. The round-trip propagation time of the cable is 10 ìsec. A complete transmission has six phases:

transmitter seizes cable (10 ìsec) transmit data (25.6 ìsec)

Delay for last bit to get to the end (5.0 ìsec) receiver seizes cable (10 ìsec) acknowledgement sent (3.2 ìsec)

Delay for last bit to get to the end (5.0 ìsec)

The sum of these is 58.8 ìsec. In this period, 224 data bits are sent, for a rate of about 3.8 Mbps.

i-1 20. 答:把获得通道的尝试从1 开始编号。第i 次尝试分布在2 个时隙中。因此,i 次尝试碰撞的概率是2-(i-1),开头k-1 次尝试失败,紧接着第k 次尝试成功的概率是:

即:

上式可简化为:

所以每个竞争周期的平均竞争次数是∑ kpk 21. 答:对于1km 电缆,单程传播时间为1/200000 =5×10-6 s,即5,来回路程传播时间为2t =10。为了能够按照CSMA/CD 工作,最小帧的发射时间不能小于10。以1Gb/s 速率工作,10可以发送的比特数等于:

因此,最小帧是10 000 bit 或1250 字节长。

22. The minimum Ethernet frame is 64 bytes, including both addresses in the Ethernet frame header, the type/length field, and the checksum. Since the header fields occupy 18 bytes and the packet is 60 bytes, the total frame size is 78 bytes, which exceeds the 64-byte minimum. Therefore, no padding is used.

23. The maximum wire length in fast Ethernet is 1/10 as long as in Ethernet.

24. The payload is 1500 bytes, but when the destination address, source address, type/length, and checksum fields are counted too, the total is indeed 1518.

25. The encoding is only 80% efficient. It takes 10 bits of transmitted data to represent 8 bits of actual data. In one second, 1250 megabits are transmitted, which means 125 million codewords. Each codeword represents 8 data bits, so the true data rate is indeed 1000 megabits/sec.

26. The smallest Ethernet frame is 512 bits, so at 1 Gbps we get 1,953,125 or almost 2 million frames/sec. However, this only works when frame bursting is operating. Without frame bursting, short frames are padded to 4096 bits, in which case the maximum number is 244,140. For the largest frame (12,144 bits), there can be as many as 82,345 frames/sec.

27. Gigabit Ethernet has it and so does 802.16. It is useful for bandwidth efficiency (one preamble, etc.) but also when there is a lower limit on frame size.

28. Station C is the closest to A since it heard the RTS and responded to it by asserting its NAV signal. D did not respond so it must be outside A’s radio range.

29. A frame contains 512 bits. The bit error rate is p = 10.7. The probability of all 512 of them surviving correctly is (1 . p)512, which is about 0.9999488.

The fraction damaged is thus about 5 × 10.5. The number of frames/sec is 11 × 106 /512 or about 21,484. Multiplying these two numbers together, we get about 1 damaged frame per second.

30. It depends how far away the subscriber is. If the subscriber is close in, QAM-64 is used for 120 Mbps. For medium distances, QAM-16 is used for 80 Mbps. For distant stations, QPSK is used for 40 Mbps.

31. Uncompressed video has a constant bit rate. Each frame has the same number of pixels as the previous frame. Thus, it is possible to compute very accurately how much bandwidth will be needed and when. Consequently, constant bit rate service is the best choice.

32. One reason is the need for real-time quality of service. If an error is discovered, there is no time to get a retransmission. The show must go on. Forward error correction can be used here. Another reason is that on very low quality lines (e.g., wireless channels), the error rate can be so high that practically all frames would have to be retransmitted, and the retransmission would

probably damaged as well. To avoid this, forward error correction is used to increase the fraction of frames that arrive correctly.

33. It is impossible for a device to be master in two piconets at the same time. There are two problems. First, only 3 address bits are available in the header while as many as seven slaves

could be in each piconet. Thus, there would be no way to uniquely address each slave. Second, the access code at the start of the frame is derived from the master’s identity. This is how slaves tell which message belongs to which piconet. If two overlapping piconets used the same access code, there would be no way to tell which frame belonged to which piconet. In effect, the two piconets would be merged into one big piconet instead of two separate ones.

34. Bluetooth uses FHSS, just as 802.11 does. The biggest difference is that Bluetooth hops at a rate of 1600 hops/sec, far faster than 802.11.

35. An ACL channel is asynchronous, with frames arriving irregularly as data are produced. An SCO channel is synchronous, with frames arriving periodically at a well-defined rate.

36. They do not. The dwell time in 802.11 is not standardized, so it has to be announced to new stations that arrive. In Bluetooth this is always 625 ìsec. There is no need to announce this. All Bluetooth devices have this hardwired into the chip. Bluetooth was designed to be cheap, and fixing the hop rate and dwell time leads to a simpler chip.

37. The first frame will be forwarded by every bridge. After this transmission, each bridge will have an entry for destination a with appropriate port in its hash table. For example, D’s hash table will now have an entry to forward frames destined to a on LAN 2. The second message will be seen by bridges B, D, and A. These bridges will append a new entry in their hash table for frames destined for c. For example bridge D’s hash table will now have another entry to forward frames destined to c on LAN 2. The third message will be seen by bridges H, D, A, and B. These bridges will append a new entry in their hash table for frames destined for d. The fifth message will be seen by bridges E, C, B, D, and A. Bridges E and C will append a new entry in their hash table for frames destined for d, while bridges D, B, and A will update their hash table entry for destination d.

38. Bridges G, I and J are not used for forwarding any frames. The main reason for having loops in an extended LAN is to increase reliability. If any bridge in the current spanning tree fails, the (dynamic) spanning tree algorithm reconfigures the spanning tree into a new one that may include one or more of these bridges that were not a part of the previous spanning tree.

39. The simplest choice is to do nothing special. Every incoming frame is put onto the

backplane and sent to the destination card, which might be the source card. In this case, intracard traffic goes over the switch backplane. The other choice is to recognize this case and treat it specially, sending the frame out directly and not going over the backplane.

40. The worst case is an endless stream of 64-byte (512-bit) frames. If the backplane can handle 109 bps, the number of frames it can handle is 109 /512. This is 1,953,125 frames/sec.

41. The port on B1 to LAN 3 would need to be relabeled as GW.

42. A store-and-forward switch stores each incoming frame in its entirety, then examines it and forwards it. A cut-through switch starts to forward incoming frames before they have arrived completely. As soon as the destination address is in, the forwarding can begin.

43. Store-and-forward switches store entire frames before forwarding them. After a frame comes in, the checksum can be verified. If the frame is damaged, it is discarded immediately. With cut=through, damaged frames cannot be discarded by the switch because by the time the error is detected, the frame is already gone. Trying to deal with the problem is like locking the barn door after the horse has escaped.

44. No. Hubs just connect all the incoming lines together electrically. There is nothing to configure. No routing is done in a hub. Every frame coming into the hub goes out on all the other lines.

45. It would work. Frames entering the core domain would all be legacy frames, so it would be up to the first core switch to tag them. It could do this by using MAC addresses or IP addresses. Similarly, on the way out, that switch would have to untag outgoing frames.

第 5 章 网络层

1. 答:文件传送、远程登录和视频点播需要面向连接的服务。另一方面,信用卡验证和其他的销售点终端、电子资金转移,以及许多形式的远程数据库访问生来具有无连接的性质,在一个方向上传送查询,在另一个方向上返回应答。

2. 答:有。中断信号应该跳过在它前面的数据,进行不遵从顺序的投递。典型的例子是当一个终端用户键入退出(或kill)健时。由退出信号产生的分组应该立即发送,并且应该跳过当前队列中排在前面等待程序处理的任何数据(即已经键入但尚未被程序读取的数据)。

3. 答:不对。为了从任意源到任意目的地,为连接建立的分组选择路由,虚电路网络肯定需要这一能力。

4. 答:在连接建立的时候可能要协商窗口的大小、最大分组尺寸和超时值。

5. 答:虚电路实现需要在1000 秒内固定分配5*8=40 字节的存储器。数据报实现需要比虚电路实现多传送的头信息的容量等于(15-3 ) ×4×200=9600字节-跳段。现在的问题就变成了40000 字节-秒的存储器对比9600 字节-跳段的电路容量。如果存储器的使用期为两年,即3600×8×5×52×2= 1.7×107秒,一个字节-秒的代价为1/( 1.5×107) = 6.7×10-8 分,那么40000 字节-秒的代价为2.7 毫分。另一方面,1 个字节-跳段代价是10-6 分,9600 个字节-跳段的代价为10-6 × 9600=9.6×10-3分,即9.6 毫分,即在这1000 秒内的时间内便宜大约6.9 毫分。

6. 答:有可能。大的突发噪声可能破坏分组。使用k 位的检验和,差错仍然有2的概率被漏检。如果分组的目的地段或虚电路号码被改变,分组将会被投递到错误的目的地,并可能被接收为正确的分组。换句话说,偶然的突发噪声可能把送往一个目的地的完全合法的分组改变成送往另一个目的地的也是完全合法的分组。

7. It will follow all of the following routes: ABCD, ABCF, ABEF, ABEG, AGHD, AGHF, AGEB, and AGEF. The number of hops used is 24.

8. 答:使用最短通路搜索算法选择一条路径,然后,删除刚找到的路径中的使用的所有的弧(对应各条链路)。接着,再运行一次最短通路搜索算法。这个第2 条路径在第1 条路径中有线路失效的情况下,可以作为替代路径启用;反之亦然。

9. 答:通过B 给出(11,6,14,18,12,8) 通过D 给出(19,15,9,3,12,13) 通过E 给出(12,11,8,14,5,9)

-k

取到达每一目的地的最小值(C 除外)得到:(11,6,0,3,5,8) 输出线路是:(B,B,-,D,E,B)

10. 答:路由表的长度等于8*50=400bit。该表每秒钟在每条线路上发送2 次,因此400*2=800b/s,即在每条线路的每个方向上消耗的带宽都是800 bps。

11. 答:这个结论总是成立的。如果一个分组从某条线路上到达,必须确认包的到达。 如果线路上没有分组到达,它就是在发送确认。情况00 ( 没有分组到达并且不发送确认)和11 (到达和返回)逻辑上错误,因此不存在。

12. 所谓分级路由,就是将路由器按区(REGION)进行划分,每个路由器只须知道在自己的区内如何为分组选择路由到达目的地的细节,而不用知道其他区的内部结构。对于大的网络,也许两级结构是不够的,还可以把区组合成簇(CLUSTER),把簇再组合成域(ZONE),??对于等级式路由,在路由表中对应所有的本地路由器都有一个登录项,所有其他的区(本簇内)、簇(本域内)和域都缩减为单个路由器,因此减少了路由表的尺寸。 在本题中,4800=15*16*20。当选择15 个簇、16 个区,每个区20 个路由器时(或等效形式,例如20 个簇、16 个区,每个区15 个路由器),路由表尺寸最小,此时的路由表尺寸为15+16+20=51。

The minimum occurs at 15 clusters, each with 16 regions, each region having 20 routers, or one of the equivalent forms, e.g., 20 clusters of 16 regions of 15 routers. In all cases the table size is 15 + 16 + 20 = 51.

13. Conceivably it might go into promiscuous mode, reading all frames dropped onto the LAN, but this is very inefficient. Instead, what is normally done is that the home agent tricks the router into thinking it is the mobile host by responding to ARP requests. When the router gets an IP packet destined for the mobile host, it broadcasts an ARP query asking for the 802.3 MAC-level address of the machine with that IP address. When the mobile host is not around, the home agent responds to the ARP, so the router associates the mobile user’s IP address with the home agent’s 802.3 MAC-level address.

14. 答:在一个子网中,从所有的源到一个指定的目的地的最佳路由的集合形成一棵以该目的地为根的树。这样的树就称作汇集树。汇集树不必是唯一的,其他具有相同通路长度的树可能存在。所有路由选择算法的目标都是要为所有的路由器寻找和使用汇集树。在广播形式的应用中,源主机需要向所有其他的主机发送报文。在称为反向通路转发的广播路由选择中,当广播分组到达路由器时,路由器对此分组进行检查,查看该分组是否来自于通常用于发送分组到广播源的线路,如果是,则此广播分组本身非常有可能是从源路由器来的第一个拷贝。

在这种情况下,路由器将此分组复制转发到进入线路以外的所有线路。然而,如果广播分组到来的线路不是到达源端的线路,那么分组就被当作副本而扔掉。

(1)反向通路转发算法,算法进行到5 个跳段后结束,总共产生28 个分组。

(2)使用汇集树算法,需要4 个跳段,总共产生14 个分组。

15. Node F currently has two descendants, A and D. It now acquires a third one, G, not circled because the packet that follows IFG is not on the sink tree. Node G acquires a second descendant, in addition to D, labeled F. This, too, is not circled as it does not come in on the sink tree.

16. Multiple spanning trees are possible. One of them is:

17. When H gets the packet, it broadcasts it. However, I knows how to get to I, so it does not broadcast.

18. Node H is three hops from B, so it takes three rounds to find the route.

19. It can do it approximately, but not exactly. Suppose that there are 1024 node identifiers. If node 300 is looking for node 800, it is probably better to go clockwise, but it could happen that there are 20 actual nodes between 300 and 800 going clockwise and only 16 actual nodes between them going counterclockwise.

The purpose of the cryptographic hashing function SHA-1 is to produce a very smooth

distribution so that the node density is about the same all along the circle. But there will always be statistical fluctuations, so the straightforward choice may be wrong.

20. The node in entry 3 switches from 12 to 10.

21. 答:对时间以T 秒为单位分时隙。在时隙中,源路由器发送第一个分组。在时隙2 的开始,第2 个路由器收到了分组,但不能应答。在时隙3 的开始,第3 个路由器收到了分组,但也不能应答。这样,此后所有的路由器都不会应答。仅当目的地主机从目的地路由器取得分组时才会发送第1 个应答。现在确认应答开始往回传播。在源路由器可以发送第2 个分组之前,需要两次穿行该子网,需要花费的时间等于2(n-1)T 秒/分组,显然,这种协议的效率是很低的。

22. 答:(1)由源主机发送的每个分组可能行走1 个跳段、2 个跳段或3 个跳段。走1 个跳段的概率为p ,走2 个跳段的概率为(1- p)p ,走3 个跳段的概率为(1- p)2 p。那么,一个分组平均通路长度的期望值为:

即每次发送一个分组的平均跳段数是 p-3 p++3。

(2)一次发送成功(走完整个通路)的概率为( 1- p )2,令a = ( 1- p)2,两次发射

2

成功的概率等于 ( 1- a) a,三次发射成功的概率等于 ( 1- a) a ,…,因此一个分组平均发送次数为:

2

即一个分组平均要发送1/(1- p )次。

(3)最后,每一个接收到的分组行走的平均跳段数等于

23. First, the warning bit method explicitly sends a congestion notification to the source by setting a bit, whereas RED implicitly notifies the source by simply dropping one of its packets. Second, the warning bit method drops a packet only when there is no buffer space left, whereas RED drops packets before all the buffer are exhausted.

24. 答:通常计算机能够以很高的速率产生数据,网络也可以用同样的速率运行。然而,路由器却只能在短时间内以同样高的速率处理数据。对于排在队列中的一个分组,不管它有多大,路由器必须做大约相同分量的工作。显然,处理10 个100 字节长的分组所作的工作比处理1 个1000 字节长的分组要做的工作多得多。

25. 答:不可以发送任何大于1024 字节的分组。

26. 答:每5产生一个令牌,1 秒中可以发送200 000 个信元。每个信元含有48 个数据字节,即8×48= 384bit。

384×2×105 =76.8 × 106b/s

所以,最大的可持续的净数据速率为76.8Mb/s。

27. 答:本题乍看起来,似乎以6Mb/s 速率发送用4/3 秒的时间可以发送完桶内8Mb 的数据,使漏桶变空。然而,这样回答是错误的,因为在这期间,已有更多的令牌到达。正确的答案应该使用公式S= C /(M-P ),这里的S表示以秒计量的突发时间长度,M 表示以每

2

秒字节计量的最大输出速率,C 表示以字节计的桶的容量,P 表示以每秒字节计量的令牌到达速率。则:

因此,计算机可以用完全速率6Mb/s 发送1.6 s 的时间。

28. 答:令最大突发时间长度为? t 秒,在极端情况下,漏桶在突发期间的开始是充满的(1MB),在突发期间另有10? t MB 进入桶内。在传输突发期间的输出包含50? t MB。由等式1+10? t=50? t,得到? t=1/40s,即25ms。因此,以最大速率突发传送可维持25ms 的时间。

29. The bandwidths in MB/sec are as follows: A: 2, B: 0, C: 1, E: 3, H: 3, J: 3, K:2, and L: 1.

30. Here is 2 million and is 1.5 million, so is 0.75, and from queueing theory, each packet experiences a delay four times what it would in an idle system. The time in an idle system is 500 nsec, here it is 2sec. With 10 routers along a path, the queueing plus service time is 20 sec.

31. There is no guarantee. If too many packets are expedited, their channel may have even worse performance than the regular channel.

32. 答:在这两种情况下都需要分割功能。即使在一个串接的虚电路网络中,沿通路的某些网络可能接受1024 字节分组,而另一些网络可能仅接受48字节分组,分割功能仍然是需要的。

33. 答:可以。只需把分组封装在属于所经过的子网的数据报的载荷段中,并进行发送。

34. The initial IP datagram will be fragmented into two IP datagrams at I1. No other fragmentation will occur.

Link A-R1:

Length = 940; ID = x; DF = 0; MF = 0; Offset = 0 Link R1-R2:

(1) Length = 500; ID = x; DF = 0; MF = 1; Offset = 0 (2) Length = 460; ID = x; DF = 0; MF = 0; Offset = 60 Link R2-B:

(1) Length = 500; ID = x; DF = 0; MF = 1; Offset = 0

(2) Length = 460; ID = x; DF = 0; MF = 0; Offset = 60

35. If the bit rate of the line is b, the number of packets/sec that the router can emit is b/8192, so the number of seconds it takes to emit a packet is 8192/b.

To put out 65,536 packets takes 229 /b sec. Equating this to the maximum packet lifetime, we get 229 /b = 10. Then, b is about 53,687,091 bps.

36. 答:因为为每一个分割的片段选择路由都需要该选项信息,因此该选项必须出现在每一个片段中。

37. 答:除去2 位作为前缀,将剩下18 位表示网络。概念上,网络数目可以有18 2 或262144 个。然而,全0 和全1 是特别地址,所以只有262142 个可供分配。

38. 答:The address is 194.47.21.130.

39. 答:对于一个B 类网络,高端16 位形成网络号,低端16 位是子网或主机域。在子网掩码的低端16 位中,最高有效4 位为1111,因此剩下12 位用于主机号。因此,存在4096 个主机地址。但由于全0 和全1 是特别地址,因此最大的主机数目为4094。

40. To start with, all the requests are rounded up to a power of two. The starting address, ending address, and mask are as follows: A: 198.16.0.0 –198.16.15.255 written as 198.16.0.0/20

B: 198.16.16.0 – 198.23.15.255 written as 198.16.16.0/21 C: 198.16.32.0 – 198.47.15.255 written as 198.16.32.0/20 D: 198.16.64.0 – 198.95.15.255 written as 198.16.64.0/19 41. They can be aggregated to 57.6.96/19.

42. It is sufficient to add one new table entry: 29.18.0.0/22 for the new block. If an incoming packet matches both 29.18.0.0/17 and 29.18.0.0./22, the longest one wins. This rule makes it possible to assign a large block to one outgoing line but make an exception for one or more small blocks within its range.

43. The packets are routed as follows: (a) Interface 1 (b) Interface 0 (c) Router 2

(d) Router 1 (e) Router 2

44. After NAT is installed, it is crucial that all the packets pertaining to a single connection pass in and out of the company via the same router, since that is where the mapping is kept. If each router has its own IP address and all traffic belonging to a given connection can be sent to the same router, the mapping can be done correctly and multihoming with NAT can be made to work.

45. 答:不对。ARP 不是向网络层提供服务,它本身就是网络层的一部分,帮助向传输层提供服务。在数据链路层不存在IP 地址的问题。数据链路层协议是像HDLC 和PPP 这样的协议,它们把比特串从线路的一端传送到另一端。

46. 答:在RARP 的实现中有一个RARP 服务器负责回答查询请求。在ARP 的实现中没有这样的服务器,主机自己回答ARP 查询。

47. In the general case, the problem is nontrivial. Fragments may arrive out of order and some may be missing. On a retransmission, the datagram may be fragmented in different-sized chunks. Furthermore, the total size is not known until the last fragment arrives. Probably the only way to handle reassembly is to buffer all the pieces until the last fragment arrives and the size is known. Then build a buffer of the right size, and put the fragments into the buffer, maintaining a bit map with 1 bit per 8 bytes to keep track of which bytes are present in the buffer. When all the bits in the bit map are 1, the datagram is complete.

48. 答:对接收方而言,这是一个新的IP 数据报的一部分,该数据报的其他部分还不得而知,收到的这个片段被放在队列中,等待其余片段的到来,显然,在其余的片段不可能到达的情况下,这个片段最终也会因为超时而被丢弃。

49. 答:在头中的错误比在数据中的错误更严重。例如,一个坏的地址可能导致分组被投递到错误的主机。许多主机并不检查投递给它们的分组是否确实是要投递给它们的。它们假定网络从来不会把本来是要前往另一个主机的分组邮递给它们,有的时候数据不参与检验和的计算,因为这样做代价大,上层协议通常也做这种检验工作,从而引起重复和多余。

50. 答:在回答这一问题之前,我们需要搞清楚移动IP 的概念,允许其用户漫游的每个场点都必须建立一个本地代理。允许外界访问的每个场点都要建立一个外部代理。当一个移动主机抵达一个外部场点时,它与那里的外部代理主机联系,并进行登记。然后,该外部代理主机与移动用户的原居住地的本地代理联系,并给它一个转交地址,通常就是该外部代理的IP 地址。

当一个分组到达用户的本地LAN 时,它进入连接到该LAN 的某个路由器。路由器然后尝试以通常的方式寻找主机的位置。它广播一个ARP 分组,询问(例如)“160.80.40.20”的以太网地址是什么?“本地代理通过给出自己的以太网地址来应答这个询问。路由器把前往160.80.40.20 的分组发送给本地代理。本地代理又以隧道通信的方式把分组发送给转交地

址,即前往外部代理。外部代理再取出IP 分组,并投递到移动主机的数据链路地址。此外,原居住地的本地代理把转交地址提供给发送方,使得随后的分组可直接地隧道发往外部代理。

现在回到本题的解答。答案是仍然需要通过上述的本地代理和外部代理的一整套过程。实际上,明尼阿波利斯的局域网是无线网的事实并不会使得波士顿发给该用户的分组会突然的跳到明尼阿波利斯。在波士顿的本地代理必须把分组以隧道方式传给明尼阿波利斯的无线LAN 上的外部代理。看待这一问题的最好方法是用户必须接入明尼阿波利斯的LAN,并且是以与在明尼阿波利斯的其他用户一样的方式接入。连接是使用无线方式还是有线没有关系。

51*注意根据英文版,本题中应为每1ps 分配100 万地址,而不是12ps。

答:使用16 个字节,总的地址数为2或3.4×10。如果我们以每皮秒10,即每秒10的速率分配它们,这些地址将会持续3.4×1020 s,大约1013年。这个数字是宇宙年龄的1000 倍。 当然,地址空间不是扁平的,因此它们的分配不会是线性的。但这个计算结果表明,这么大的地址空间,几乎是永远也用不完的。

52. 答:设置协议段的目的是要告诉目的地主机把IP 分组交给那一个协议处理程序。中途的路由器并不需要这一信息,因此不必把它放在主头中。实际上,这个信息存在于头中,但被伪装了。最后一个(扩展)头的下一个字段就用于这一目的。

53. 答:从概念上讲,不需要改变。在技术上,由于被请求的IP 地址现在变大了,因此需要比较大的域。

128

38

6

18

第 6 章 传输层

1. 答:不是。事实上,LISTEN 调用可以表明建立新连接的意愿,但不封锁。当有了建立连接的尝试时,调用程序可以被提供一个信号。然后,它执行,比如说,OK 或REJECT 来接受或拒绝连接。然而,在原先的封锁性方案中,就缺乏这种灵活性。

2. 答:从“被动连接建立在进行中”到“已建立”的虚线不再依确认的传输情况而定。该变迁可立即发生。实质上,“被动连接建立在进行中”状态已经消失,因为它们什么时候都不可见。

3. If the client sends a packet to SERVER3PORT and the server is not listening to that port, the packet will not be delivered to the server.

4. 答:在具体解答这个问题之前,需要先熟悉一下时钟驱动方案的内容。首先我们引入参数T,假定在发送出一个分组之后等待长度等于T 的时间,我们就可以肯定,所有关于该分组的踪迹都已消失,不管是该分组本身,还是对于它的确认都不会再以外的出现。我们还假定,每个主机都配有一个表示一天的时间的时钟,不同主机上的时钟不必同步。每个时钟都采用二进制计数器的形式,并且以长度一致的间隔时间递增。而且,计数器的比特数必须等于或超过序列号所使用的比特数。最后一点,时钟被假定是连续运行,即使主机关闭时也不间断。

时钟驱动方案的基本思想是同一时间不会有两个活动的TPDUs 使用相同的序列号。在一条连接建立的时候,时钟的低端k 个比特被用作初始序列号(也是k 位)。因此,每条连接可以从不同的序列号开始为TPDU 编号。序列号空间应该足够大,使得当编号循环一周时,具有相同号码的旧的TPDU 已经不复存在。

当主机系统崩溃时会产生一些问题。在重新启动后,主机的传输层实体不知道它曾经处在序列号空间的什么位置。一种解决方法是要求传输实体在恢复后的T 秒内处于空闲状态,让所有老的TPDUs 都消失。然而,在一个复杂的互联网上,T 值可能很大,所以这不是一个好的解决方法。

为了避免从崩溃恢复后的T 秒不工作状态,需要对序列号的使用施加新的限制。在一些编号可能被用作初始序列号之前,必须在长度为T 的时间内禁止使用这些编号。在任何连接上发送TPDU 之前,传输层实体必须读一次时钟,检查该TPDU 的编号是否在禁止区内。 显然,在任何连接上的最大数据率是每个时钟滴答发送一个TPDU。在系统崩溃后重启动时,在打开一条新的连接之前,传输实体必须等待到下一个时钟滴答,以避免同样的号码重复使用。如果数据速率低于始终速率,实际使用的序列号对于时间的曲线将最终从左边进入禁止区。如果这样的情况发生了,要么延迟TPDU 达T 长度时间,或者重新同步序列号。 作为例子,如果在坐标起点发1 号TPDU,到接近时钟大循环编码的末尾才发送第2 个TPDU,此时为避免在下一大循环开始重复使用序列号,就需要在大循环接近末尾处重新同步,使用大的初始序列号,以避免使用禁止区号码。

(a) 时钟大循环周期是215,即32768 滴答,每滴答100ms,即0.1 秒,所以大循环周期是3276.8s 。假定数据产生速率非常低(接近零),那么发送方在3276.8-60=3271.8 秒时进入禁止区,需要进行一次重新同步。

(b) 每分钟使用240 个序列号,即每秒使用4 个号码,如果时间以t 表示(以秒为单位),那么实际的序列号是4t。当接近大循环的末尾时以及在下一大循环的开始阶段,4t 有一定的大小,位于禁止区的上方,现在由于每秒钟10个滴答,禁止区的左边是10(t-3216.8)。令 4t =10(t-3216.8),得 t=5316.3秒。即当 t=5316.3时,开始进入禁止区,因此当 t=5316.3时需要进行一次重新同步。

5. 答:首先看三次握手过程是如何解决延迟的重复到达的分组所引起的问题的。 正常情况下,当主机1 发出连接请求时,主机1 选择一个序号x,并向主机2 发送一个包含该序号的请求TPDU;接着,主机2 回应一个接受连接的TPDU,确认x,并声明自己所选用的初始序列号y;最后,主机1 在其发送的第一个数据TPDU 中确认主机2 所选择的初始序列号。

当出现延迟的重复的控制TPDU 时,一个TPDU 是来自于一个已经释放的连接的延迟重复的连接请求( CONNECTION REQUEST),该TPDU 在主机1 毫不知情的情况下到达主机2。

主机2 通过向主机1 发送一个接受连接的TPDU(CONNECTION ACCEPTED)来响应该TPDU,而该接受连接的TPDU 的真正目的是证实主机1 确实试图建立一个新的连接。在这一点上,关键在于主机2 建议使用y 作为从主机2 到主机1 交通的初始序列号,从而说明已经不存在包含序列号为y 的TPDU,也不存在对y 的应答分组。当第二个延迟的TPDU 到达主机2 时,z 被确认而不是y 被确认的事实告诉主机2 这是一个旧的重复的TPDU,因此废止该连接过程。在这里。三次握手协议是成功的。

最坏的情况是延迟的“连接请求”和对“连接被接收”的确认应答都在网络上存活。可以设想,当第2 个重复分组到达时,如果在网上还存在一个老的对序列号为y 的分组的确认应答,显然会破坏三次握手协议的正常工作,故障性的产生一条没有人真正需要的连接,从而导致灾难性的后果。

6. 答:我们知道,3 次握手完成两个重要功能,既要双方做好发送数据的准备工作(双方都知道彼此已准备好),也要允许双方就初始序列号进行协商,这个序列号在握手过程中被发送与确认。

现在把三次握手改成仅需要两次握手,死锁是可能发生的。作为例子。考虑计算机A和B 之间的通信。假定B 给A 发送一个连接请求分组,A 收到了这个分组,并发送了确认应答分组。按照两次握手的协定,A 认为连接已经成功的建立了,可以开始发送数据分组。 可是,B 在A 的应答分组在传输中被丢失的情况下,将不知道A 是否已经准备好,不知道A 建议什么样的序列号用于A 到B 的交通,也不知道A 是否同意A 所建议的用于B 到A交通的初始序列号,B 甚至怀疑A 是否收到自己的连接请求分组。在这种情况下,B 认为连接还未建立成功,将忽略A 发来的任何数据分组,只等待接收连接确认应答分组。而A在发出的分组超时后,重复发送同样的分组。这样就形成了死锁。

7. 答:(a)参见教材。

(b)不存在。对于多于两支部队的情况,问题在实质上是同样的。

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

Top