计算机网络第四版习题答案(中文版)

更新时间:2023-12-21 08:52:01 阅读量: 教育文库 文档下载

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

第 1 章 概述

1-3 The performance of a client-server system is influenced by two network factors: the bandwidth of the network (how many bits/sec it can transport) and the latency (how many seconds it takes for the first bit to get from the client to the server). Give an example of a network that exhibits high bandwidth and high latency. Then give an example of one with low bandwidth and low latency. 客户-服务器系统的性能会受到两个网络因素的影响:网络的带宽(每秒可以传输多少位数据)和延迟(将第一个数据位从客户端传送到服务器端需要多少秒时间)。请给出一个网络的例子,它具有高带宽和高延迟。然后再给出另一个网络的例子,它具有低带宽和低延迟。 答:横贯大陆的光纤连接可以有很多千兆位/秒带宽, 但是由于光速度传送要越过数千公里,时延将也高。相反,使用56 kbps调制解调器呼叫在同一大楼内的计算机则有低带宽和较低的时延。

1-4 Besides bandwidth and latency, what other parameter is needed to give a good characterization of the quality of service offered by a network used for digitized voice traffic? 除了带宽和延迟以外,针对数字化的语音流量,想要让网络提供很好的服务质量,还需要哪个参数? 声音的传输需要相应的固定时间,因此网络时隙数量是很重要的。传输时间可以用标准偏差方式表示。 实际上,短延迟但是大变化性比更长的延迟和低变化性更糟。

1-6 A client-server system uses a satellite network, with the satellite at a height of 40,000 km. What is the best-case delay in response to a request? 一个客户-服务器系统使用了卫星网络,卫星的高度为40000km。在对一个请求进行响应的时候,最佳情形下的延迟是什么? 答:由于请求和应答都必须通过卫星,因此传输总路径长度为160,000千米。在空气和真空中的光速为300,000 公里/秒, 因此最佳的传播延迟为160,000/300,000秒,约533 msec。

1-9 A group of 2n - 1 routers are interconnected in a centralized binary tree, with a router at each tree node. Router i communicates with router j by sending a message to the root of the tree. The root then sends the message back down to j. Derive an approximate expression for the mean number of hops per message for large n, assuming that all router pairs are equally likely. 在一个集中式的二叉树上,有2n-1个路由器相互连接起来;每个树节点上都有一个路由器。路由器i为了与路由器j进行通信,它要给树的根发送一条信息。然后树根将消息送下来给j。假设所有的路由器都是等概率出现的,请推导出当n很大时每条消息的平均跳数的一个近似表达式。 答:这意味着,从路由器到路由器的路径长度相当于路由器到根的两倍。 若在树中,根深度为1,深度为n,从根到第n层需要n-1跳,在该层的路由器为0.50(50%)。

从根到n-1 层的路径的路由器为0.25(25%)和n--2跳步。 因此,路径长度l为:

表达式归约为 l=n-2,平均的路由器到路由器路径为2n-4。

1-11 What are two reasons for using layered protocols? 请说出使用分层协议的两个理由? 答:通过协议分层可以把设计问题划分成较小的易于处理的片段。分层意味着某一层协议的改变不会影响高层或低层的协议。

第 1 页 共 40 页

1-13 What is the principal difference between connectionless communication and connection-oriented communication? 在无连接通信和面向连接的通信二者之间,最主要的区别是什么? 答:主要的区别有两条。

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

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

1-14 Two networks each provide reliable connection-oriented service. One of them offers a reliable byte stream and the other offers a reliable message stream. Are these identical? If so, why is the distinction made? If not, give an example of how they differ. 两个网络都可以提供可靠的面向连接的服务。其中一个提供可靠的字节流,另一个提供可靠的报文流。这二者是否相同?如果你认为相同的话,为什么要有这样的区别?如果不相同,请给出一个例子说明它们如何不同。 答:不相同。在报文流中,网络保持对报文边界的跟踪;而在字节流中,网络不做这样的跟踪。例如,一个进程向一条连接写了1024 字节,稍后又写了另外1024 字节。那么接收方共读了2048 字节。对于报文流,接受方将得到两个报文。每个报文1024 字节。 而对于字节流,报文边界不被识别。接收方把全部的2048 个字节当作一个整体,在此已经体现不出原先有两个报文的事实。

1-17 In some networks, the data link layer handles transmission errors by requesting damaged frames to be retransmitted. If the probability of a frame's being damaged is p, what is the mean number of transmissions required to send a frame? Assume that acknowledgements are never lost. 在有些网络中,数据链路层处理传输错误的做法是,请求重传被损坏的帧。如果一帧被损坏的概率为p,那么发送一帧所需要的平均传输次数是多少?假设确认帧永远不会丢失。 帧请求正好是k次的概率Pk,就是起初的k-1次尝试都失败的概率。 pk-1 , 乘以第k次传输成功的概率。平均传输次数就是

1-22 What is the main difference between TCP and UDP? TCP和UDP之间最主要的区别是什么? TCP 是面向连接的,而UDP 是一种数据报服务。

1-25 When a file is transferred between two computers, two acknowledgement strategies are possible. In the first one, the file is chopped up into packets, which are individually acknowledged by the receiver, but the file transfer as a whole is not acknowledged. In the second one, the packets are not acknowledged individually, but the entire file is acknowledged when it arrives. Discuss these two approaches. 当一个文件在两台计算机之间传输的时候,可能会有两种不同的确认策略。在第一种策略中,该文件被分解成许多个分组,接收方会独立地确认每一个分组,但是文件传输过程作为整体并没有被确认。在第二种策略中,这些分组并没有被单独地确认,但是当整个文件到达的时候,它会被确认。请讨论这两种方案。 如果网络容易丢失分组,那么对每一个分组逐一进行确认较好,此时仅重传丢失的分组。而在另一方面,如果网络高度可靠,那么在不发差错的情况下,仅在整个文件传送的结尾发送一次确认,从而减少了确认的次数,节省了带宽;不过,即使有单个分组丢失,也需要重传整个文件。

第 2 页 共 40 页

1-27 How long was a bit on the original 802.3 standard in meters? Use a transmission speed of 10 Mbps and assume the propagation speed in coax is 2/3 the speed of light in vacuum. 在原始的802.3标准中,一位是多长(按米来计算)?请使用10Mbps的传输速率,并且假设同轴电缆的传播速度是真空中光速的2/3. 波在同轴电缆中的速度是大约200,000 km/sec, 即200 m/μsec. 在10 Mbps, 传输一位需要 0.1μsec。 因此, 这个位在时间上持续0.1μsec, 在此期间传播20 meters。因此,这里的一位是20米。

1-28 An image is 1024 x 768 pixels with 3 bytes/pixel. Assume the image is uncompressed. How long does it take to transmit it over a 56-kbps modem channel? Over a 1-Mbps cable modem? Over a 10-Mbps Ethernet? Over 100-Mbps Ethernet? 一幅图像的分辨率为1024×768像素,每个像素用3字节来标识。假设该图像没有被压缩。请问,通过56kbps的调制解调器信道来传输这幅图像需要多长时间?通过1Mbps的电缆调制解调器(cable modem)呢?通过10Mbps的因特网呢?通过100Mbps的因特网呢? 图像是1024×768×3 bytes或2,359,296 bytes. 就是18,874,368 bits. 在56,000 bits/sec速度下, 传输需要大约337.042 sec. 在1,000,000 bits/sec,需要大约18.874 sec. 在10,000,000 bits/sec, 需要大约1.887 sec. 在100,000,000 bits/sec, 需要大约0.189 sec.

1-30 Wireless networks are easy to install, which makes them inexpensive since installation costs usually far overshadow equipment costs. Nevertheless, they also have some disadvantages. Name two of them. 无线网络很容易安装,这使得它们并不非常昂贵。因为安装费用通常会占去整个设备费用的很大比例。然而,它们也有一些缺点。请说出两个缺点。 一个缺点是安全性。每个碰巧在此房屋内的随机发送者都能在网络上监听。另一个缺点是可靠性。无线网络造成大量错误。第三个潜在的问题是电池寿命,因为多数无线设备倾向于可移动性。

1-31 List two advantages and two disadvantages of having international standards for network protocols. 请列举出网络协议国际标准化的两个优点和缺点。 优点1:如果每个人都使用标准,那么每个人都可以与其他任何人交流;优点2:广泛使用标准将导致规模经济,比如生产大规模集成电路芯片。缺点1:为了取得标准化所需要的政治妥协经常会导致差的标准;缺点2:一旦标准被广泛采用了,要对它再做改变就会非常困难,即使发现了新的更好的技术或方法,也难以替换。

第 3 页 共 40 页

第 2 章 物理层

2-2 A noiseless 4-kHz channel is sampled every 1 msec. What is the maximum data rate? 一条无噪声4kHz信道按照每1ms一次进行采样,请问最大数据传输率是多少? 答:无噪声信道最大数据传输率公式:最大数据传输率=2Hlog2V b/s。因此最大数据传输率决定于每次采样所产生的比特数,如果每次采样产生16bits,那么数据传输率可达128kbps;如果每次采样产生1024bits,那么可达8.2Mbps。注意这是对无噪声信道而言的,实际信道总是有噪声的,其最大数据传输率由香农定律给出。

2-3 Television channels are 6 MHz wide. How many bits/sec can be sent if four-level digital signals are used? Assume a noiseless channel. 电视频道的带宽是6MHz。如果使用4级数字信号,则每秒钟可以发送多少位?假设电视频道为无噪声信道。 答:采样频率12MHz,每次采样2bit,总的数据率为24Mbps。

2-4 If a binary signal is sent over a 3-kHz channel whose signal-to-noise ratio is 20 dB, what is the maximum achievable data rate? 如果在一条3kHz信道上发送一个二进制信号,该信道的信噪比为20dB,则最大可达到的数据传输率为多少? 答:信噪比为20 dB 即 S/N =100.由于 log2101≈6.658,由香农定理,该信道的信道容量为3log2(1?+100)?=19.98kbps。

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

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

2-5 What signal-to-noise ratio is needed to put a T1 carrier on a 50-kHz line? 在50kHz的线路上使用T1线路需要多大的信噪比? 答:为发送T1 信号,我们需要

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

2-7 How much bandwidth is there in 0.1 micron of spectrum at a wavelength of 1 micron? 在1μm波长上,在0.1μm的频段中有多少带宽? 答:

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

第 4 页 共 40 页

2-8 It is desired to send a sequence of computer screen images over an optical fiber. The screen is 480 x 640 pixels, each pixel being 24 bits. There are 60 screen images per second. How much bandwidth is needed, and how many microns of wavelength are needed for this band at 1.30 microns? 现需要在一条光纤发送一系列计算机屏幕图像,屏幕的分辨率为480×640像素,每个像素为24位。每秒钟有60幅屏幕图像。请问,需要多少带宽?在1.30μm波长上,这段带宽需要多少μm的波长? 答:数据速率为480×?640×24×?60bps,即442Mbps。

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

2-18 A simple telephone system consists of two end offices and a single toll office to which each end office is connected by a 1-MHz full-duplex trunk. The average telephone is used to make four calls per 8-hour workday. The mean call duration is 6 min. Ten percent of the calls are long-distance (i.e., pass through the toll office). What is the maximum number of telephones an end office can support? (Assume 4 kHz per circuit.) 一个简单的电话系统包括两个端局和一个长途局,每个端局通过一条1MHz全双工干线连接到长途局。在每8小时的工作日中,平均每部电话有4次呼叫,每次呼叫平均6分钟,10%的呼叫是长途(即通过长途局)。请问一个端局能够支持最多多少部电话?(假设每条线路为4kHz) 答:每部电话每小时做0.5 次通话,每次通话6 分钟。因此一部电话每小时占用一条电路3 分钟,60/3=20,即20 部电话可共享一条线路。由于只有10%的呼叫是长途,所以200 部电话占用一条完全时间的长途线路。局间干线复用了1000000/4000=250 条线路,每条线路支持200 部电话,因此,一个端局可以支持的电话部数为200*250=50000。

2-22 A modem constellation diagram similar to Fig. 2-25 has data points at the following coordinates: (1, 1), (1, -1), (-1, 1), and (-1, -1). How many bps can a modem with these parameters achieve at 1200 baud? 一个类似于图2.25的调制解调器星座图有以下几个坐标点(1,1)、(1,-1)、(-1,1)、(-1,-1)。请问一个具备这些参数的调制解调器在1200波特上可以达到多少bps? 每个波特有4 个合法值,因此比特率是波特率的两倍。对应于1200 波特,数据速率是2400bps。

第 5 页 共 40 页

2-28 Ten signals, each requiring 4000 Hz, are multiplexed on to a single channel using FDM. How much minimum bandwidth is required for the multiplexed channel? Assume that the guard bands are 400 Hz wide. 有10个信号,每个都要求4000Hz,现在用FDM将它们复用在一条信道上。对于被复用的信道,最小要求多少带宽?假设防护频段为400Hz宽。 有10个4000Hz信号。我们需要9个防护频段来避免干扰。最小带宽需求是4000×10+400×9 =43,600 Hz.

2-29 Why has the PCM sampling time been set at 125 μsec?

答:125的采样时间对应于每秒8000 次采样。一个典型的电话通道为4kHz。根据奈奎斯特定理,为获取一个4kHz 的通道中的全部信息需要每秒8000 次的采样频率。 (实际上额定带宽稍有些少,截止点并不清晰)

2-30 What is the percent overhead on a T1 carrier; that is, what percent of the 1.544 Mbps are not delivered to the end user?

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

2-33 What is the difference, if any, between the demodulator part of a modem and the coder part of a codec? (After all, both convert analog signals to digital ones.)

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

第 6 页 共 40 页

2-34 A signal is transmitted digitally over a 4-kHz noiseless channel with one sample every 125 μsec. How many bits per second are actually sent for each of these encoding methods?

(a) CCITT 2.048 Mbps standard. (b) DPCM with a 4-bit relative signal value. (c) Delta modulation.

答: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。

2-39What is the essential difference between message switching and packet switching?

信息交换发送到数据单元可以是任意长度。分组交换有最大报文大小限制,任何大于限制的信息将被拆分成多个报文。

2-41 Three packet-switching networks each contain n nodes. The first network has a star topology with a central switch, the second is a (bidirectional) ring, and the third is fully interconnected, with a wire from every node to every other node. What are the best-, average-, and-worst case transmission paths in hops? 三个分组交换网络每个包含n个节点。第一个网络是一个星型拓扑结构,有一个中心交换机;第二个网络是一个双向环;第三个网络是一个全连接结构,从任何一个节点到其他的节点都有一条线路。请问从传输路径的跳数来看,哪个最好?其次?最差? 答: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,平均为n2/4(n1) 全连接:最好为1,最差为1,平均为1。

第 7 页 共 40 页

2-42 Compare the delay in sending an x-bit message over a k-hop path in a circuit-switched network and in a (lightly loaded) packet-switched network. The circuit setup time is s sec, the propagation delay is d sec per hop, the packet size is p bits, and the data rate is b bps. Under what conditions does the packet network have a lower delay? 请比较一下在一个电路交换网络中和在一个负载较轻的分组交换网络中,沿着k跳到路径发送x位消息的延迟情况。电路建立的时间为s秒,每一跳的传播延迟为d秒,分组的大小为p位,数据传输率为b bps。在什么条件下分组网络的延迟比较短? 对于电路交换, t= s时电路建立起来;t=s+ x /d 时报文的最后一位发送完毕;t=? s+x/b+kd时报文到达目的地。而对于分组交换,最后一位在t=x/b时发送完毕。

为到达最终目的地,最后一个分组必须被中间的路由器重发k1次,每次重发花时间p/ b,所以总的延迟为

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

所以:

2-43 Suppose that x bits of user data are to be transmitted over a k-hop path in a packet-switched network as a series of packets, each containing p data bits and h header bits, with x p + h. The bit rate of the lines is b bps and the propagation delay is negligible. What value of p minimizes the total delay? 假定x位用户数据将以一系列分组的形式,在一个分组交换网络中沿着一条共有k跳到路径向前传输,每个分组包含p位数据和h位的头,这里x>>p+h。线路的传输率为b bps,传播延迟忽略不计。请问什么样的p值使总延迟最小? 答:所需要的分组总数是x /p ,因此总的数据加上头信息交通量为(p+h)x/p位。

源端发送这些位需要时间为(p+h?)x?/pb;中间的路由器重传最后一个分组所花的总时间为(k-1)(p?+h?)/ b 因此我们得到的总的延迟为

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

得到

因为p>0,所以

时能使总的延迟最小。

第 8 页 共 40 页

2-44 In a typical mobile phone system with hexagonal cells, it is forbidden to reuse a frequency band in an adjacent cell. If 840 frequencies are available, how many can be used in a given cell? 在一个典型的移动电话系统中,蜂窝单元为六角形,在相邻的单元内禁止重新使用频段。如果总共有840个频率可以使用的话,则任何一个给定的单元内可以使用多少个频率? 每个单元有6个邻居。如果中间的单元使用频段组合A,它的六个邻居可以分别使用的频段组合B, C, B, C, B, C。换句话说,只需要3个单一的单元。因此,每个单元可以使用280个频率。

2-50 Suppose that A, B, and C are simultaneously transmitting 0 bits, using a CDMA system with the chip sequences of Fig. 2-45(b). What is the resulting chip sequence?

FIG 2-45(b)

结果是通过对A、B、C求反再将这三个码片序列相加得到的。 结果是(+3 +1 +1 ?1 ?3 ?1 ?1 +1).

2-53 A CDMA receiver gets the following chips: (-1 +1 -3 +1 -1 -3 +1 +1). Assuming the chip sequences defined in Fig. 2-45(b), which stations transmitted, and which bits did each one send? 一个CDMA接收器得到了下面的时间片(-1+1-3+1-1-3+1+1)。假设时间片序列如图2.45b中所定义,请问那些移动站传输了数据?每个站发送了什么位? 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

结果是 A 和 D 发送了1位, B发送了0位, C 没有发送。

第 9 页 共 40 页

第 3 章 数据链路层

3-1 An upper-layer packet is split into 10 frames, each of which has an 80 percent chance of arriving undamaged. If no error control is done by the data link protocol, how many times must the message be sent on average to get the entire thing through? 一个上层的分组被切分成10帧,每一帧有80%的机会可以无损地到达。如果数据链路协议没有提供错误控制的话,请问,该报文平均需要发送多少次才能完整地到达接收方? 答:由于每一帧有0.8 的概率正确到达,整个信息正确到达的概率为 p=0.810=0.107。

为使信息完整的到达接收方,发送一次成功的概率是p ,二次成功的概率是(1-p)p,三次成功的概率为(1-p)2 p,i 次成功的概率为(1-p)i-1 p,因此平均的发送次数等于:

3-2The following character encoding is used in a data link protocol: A: 01000111; B: 11100011; FLAG: 01111110; ESC: 11100000 Show the bit sequence transmitted (in binary) for the four-character frame: A B ESC FLAG when each of the following framing methods are used:

(a) Character count. (b) Flag bytes with byte stuffing. (c) Starting and ending flag bytes, with bit stuffing.

结果是

(a) 00000100 01000111 11100011 11100000 01111110

(b) 01111110 01000111 11100011 11100000 11100000 11100000 01111110 01111110

(c) 01111110 01000111 110100011 111000000 011111010 01111110

3-5 A bit string, 0111101111101111110, needs to be transmitted at the data link layer. What is the string actually transmitted after bit stuffing? 位串0111101111101111110需要在数据链路层上被发送,请问,经过位填充之后实际被发送出去的是什么? 输出是1110111110011111010.

第 10 页 共 40 页

3-6 When bit stuffing is used, is it possible for the loss, insertion, or modification of a single bit to cause an error not detected by the checksum? If not, why not? If so, how? Does the checksum length play a role here? 假设使用了位填充成帧方法,请问,因为丢失一位,插入一位,或者篡改一位而引起的错误是否有可能通过校验和检测出来?如果不能的话,请问为什么?如果能的话,请问校验和长度在这里是如何起作用的? 答:可能。假定原来的正文包含位序列01111110 作为数据。位填充之后,这个序列将变成01111010。如果由于传输错误第二个0 丢失了,收到的位串又变成01111110,被接收方看成是帧尾。然后接收方在该串的前面寻找检验和,并对它进行验证。如果检验和是16 位,那么被错误的看成是检验和的16 位的内容碰巧经验证后仍然正确的概率是1/216。如果这种概率的条件成立了,就会导致不正确的帧被接收。显然,检验和段越长,传输错误不被发现的概率会越低,但该概率永远不等于零。

3-16 Data link protocols almost always put the CRC in a trailer rather than in a header. Why? 数据链路协议几乎总是将CRC放在尾部,而不是头部,为什么? 答:CRC 是在发送期间进行计算的。一旦把最后一位数据送上外出线路,就立即把CRC编码附加在输出流的后面发出。如果把CRC 放在帧的头部,那么就要在发送之前把整个帧先检查一遍来计算CRC。这样每个字节都要处理两遍,第一遍是为了计算检验码,第二遍是为了发送。把CRC 放在尾部就可以把处理时间减半。

3-17 A channel has a bit rate of 4 kbps and a propagation delay of 20 msec. For what range of frame sizes does stop-and-wait give an efficiency of at least 50 percent? 一个信道的位速率为4kbps,传输延迟为20ms。请问帧的大小在什么范围内,停-等协议才可以获得至少50%的效率? 答:当发送一帧的时间等于信道的传播延迟的2 倍时,信道的利用率为50%。或者说,当发送一帧的时间等于来回路程的传播延迟时,效率将是50%。而在帧长满足发送时间大于延迟的两倍时,效率将会高于50%。 现在发送速率为4Mb/s,发送一位需要0.25。

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

3-18 A 3000-km-long T1 trunk is used to transmit 64-byte frames using protocol 5. If the propagation speed is 6 祍ec/km, how many bits should the sequence numbers be? 一条3000公里长的T1骨干线路被用来传输64字节的帧,两端使用了协议5.如果传输速度为6μs/公里,则序列号应该有多少位? 答;为了有效运行,序列空间(实际上就是发送窗口大小)必须足够的大,以允许发送方在收到第一个确认应答之前可以不断发送。信号在线路上的传播时间为 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 位。

第 11 页 共 40 页

3-19In protocol 3, is it possible that the sender starts the timer when it is already running? If so, how might this occur? If not, why is it impossible?

有可能发生。假设发送方传输率一个帧、很快返回了一个引起误解的确认。主循环将再次被执行,一个帧将在定时器仍在运行的情况下被发送。

3-20 Imagine a sliding window protocol using so many bits for sequence numbers that wraparound never occurs. What relations must hold among the four window edges and the window size, which is constant and the same for both the sender and the receiver. 想象这样一个滑动窗口协议,它的序列号有非常多的位,所以序列号几乎永远不会回转。请问4个窗口边界和窗口大小之间必须满足什么样的关系?这里的窗口大小是固定不变的,并且发送方和接收方的窗口大小相同。 令发送方窗口为(Sl , Su)接收方窗口为(Rl , Ru),令窗口大小为W。二者必须保持的关系是:

0 ≤ Su ? Sl + 1 ≤ W1 Ru ? Rl + 1 = W Sl ≤ Rl ≤ Su + 1

3-21 If the procedure between in protocol 5 checked for the condition a b c instead of the condition a b < c, would that have any effect on the protocol's correctness or efficiency? Explain your answer. 如果协议5中的between过程检查的条件是a<=b<=c,而不是a<=b

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。修改后的检查条件将被置成“真”,不会报告已发现的丢失帧错误,而误认为丢失了的帧已被确认。另一方面,如果采用原先的检查条件,就能够报告丢失帧的错误。所以结论是:为保证协议的正确性,已接收的确认应答号应该小于下一个要发送的序列号。

3-22 In protocol 6, when a data frame arrives, a check is made to see if the sequence number differs from the one expected and no_nak is true. If both conditions hold, a NAK is sent. Otherwise, the auxiliary timer is started. Suppose that the else clause were omitted. Would this change affect the protocol's correctness? 在协议6中,当一个数据帧到达的时候,需要执行一个检查,看它的序列号是否与期望的序列号不同,而且no_nak为真。如果这两个条件都成立,则发送一个NAK,否则的话,启动辅助定时器。假定else字句被省略掉,这种改变会影响协议的正确性吗? 答:可能导致死锁。假定有一组帧正确到达,并被接收。然后,接收方会向前移动窗口。 现在假定所有的确认帧都丢失了,发送方最终会产生超时事件,并且再次发送第一帧,接收方将发送一个NAK。然后NONAK 被置成伪。假定NAK 也丢失了。那么从这个时候开始,发送方会不断发送已经被接收方接受了的帧。接收方只是忽略这些帧,但由于NONAK 为伪,所以不会再发送NAK,从而产生死锁。如果设置辅助计数器(实现“else”子句),超时后重发NAK,终究会使双方重新获得同步。

3-23 Suppose that the three-statement while loop near the end of protocol 6 were removed from the code. Would this affect the correctness of the protocol or just the performance? Explain your answer. 假设在协议6中接近尾部的内含三条语句的while循环被去掉的话,这样会影响协议的正确性吗?还是仅仅影响协议的性能?请解释答案。 答:删除这一段程序会影响协议的正确性,导致死锁。因为这一段程序负责处理接收到的确认帧,没有这一段程序,发送方会一直保持超时条件,从而使得协议的运行不能向前进展。

第 12 页 共 40 页

3-24 Suppose that the case for checksum errors were removed from the switch statement of protocol 6. How would this change affect the operation of the protocol?

这样将使得NAK的作用失效,于是我们将退回到超时。尽管效率会降低,正确性却不会受到影响。NAK不是必不可少的。

3-25 In protocol 6 the code for frame_arrival has a section used for NAKs. This section is invoked if the incoming frame is a NAK and another condition is met. Give a scenario where the presence of this other condition is essential. 在协议6中,针对frame_arrival的代码中有一部分被用于NAK。如果收到的帧是一个NAK,并且另一个条件也满足的话,则这部分代码会被调用到。请给出一个场景,在此场景下这另一个条件是非常关键的。 答:这里要求r.rack+1

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

3-26 Imagine that you are writing the data link layer software for a line used to send data to you, but not from you. The other end uses HDLC, with a 3-bit sequence number and a window size of seven frames. You would like to buffer as many out-of-sequence frames as possible to enhance efficiency, but you are not allowed to modify the software on the sending side. Is it possible to have a receiver window greater than 1, and still guarantee that the protocol will never fail? If so, what is the largest window that can be safely used? 想象你正在编写一个数据链路层软件,它被用在一条专门给你发送数据的线路上,而不是让你往外发送数据。另一端使用了HDLC,3位序列号和一个可容纳7帧的窗口。你希望将乱序的帧尽可能多地缓存起来,以提高效率,但是你又不允许修改发送方的软件。是否有可能让接收方的窗口大于1,并且仍然保证该协议不会失败呢?如果可能的话,能够安全使用的最大窗口是多少? 答:不可以。最大接收窗口的大小就是1。现在假定该接收窗口值变为2。开始时发送方发送0 至6 号帧,所有7 个帧都被收到,并作了确认,但确认被丢失。现在接收方准备接收7 号和0 号帧,当重发的0 号帧到达接收方时,它将会被缓存保留,接收方确认6 号帧。当7 号帧到来的时候,接收方将把7 号帧和缓存的0 号帧传递给主机,导致协议错误。因此,能够安全使用的最大窗口值为1。

3-28 In protocol 6, MAX_SEQ = 2n - 1. While this condition is obviously desirable to make efficient use of header bits, we have not demonstrated that it is essential. Does the protocol work correctly for MAX_SEQ = 4, for example? 在协议6中,MAX_SEQ=2n-1.这个条件显然是希望尽可能地利用头部的位,但是我们无法证明这个条件确实很关键。例如,协议在MAX_SEQ=4的时候也能够正确地工作吗? 答:不能,协议的运行将会失败。当MaxSeq=4,序列号的模数=4+1=5,窗口大小将等于:NrBufs<=5/2=2.5,即得到,NrBufs=2。因此在该协议中,偶数序号使用缓冲区1。这种映射意味着帧4 和0 将使用同一缓冲区。假定0 至3 号帧都正确收到了,并且都确认应答了,并且都确认应答了。如果随后的4 号帧丢失,且下一个0 号帧收到了,新的0 号帧将被放到缓冲区0 中,变量arrived[0]被置成“真”。这样,一个失序帧将被投递给主机。事实上,采用选择性重传的滑动窗口协议需要MaxSeq 是奇数才能正确的工作。然而其他的滑动窗口协议的实现并不具有这一性质。

第 13 页 共 40 页

3-29 Frames of 1000 bits are sent over a 1-Mbps channel using a geostationary satellite whose propagation time from the earth is 270 msec. Acknowledgements are always piggybacked onto data frames. The headers are very short. Three-bit sequence numbers are used. What is the maximum achievable channel utilization for (a) Stop-and-wait. (b) Protocol 5. (c) Protocol 6. 利用地球同步卫星在一个1Mbps的信道上发送1000位的帧,该信道离开地球的传输延迟为270ms。确认信息总是被捎带在数据帧傻姑娘。头部非常短,并且使用3位序列号。在下面的协议中,最大可获得的信道利用率是多少?(a)停-等协议(b)协议5(c)协议6 答:对应三种协议的窗口大小值分别是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%

3-30 Compute the fraction of the bandwidth that is wasted on overhead (headers and retransmissions) for protocol 6 on a heavily-loaded 50-kbps satellite channel with data frames consisting of 40 header and 3960 data bits. Assume that the signal propagation time from the earth to the satellite is 270 msec. ACK frames never occur. NAK frames are 40 bits. The error rate for data frames is 1 percent, and the error rate for NAK frames is negligible. The sequence numbers are 8 bits.

答:使用选择性重传滑动窗口协议,序列号长度是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%。

3-32 A 100-km-long cable runs at the T1 data rate. The propagation speed in the cable is 2/3 the speed of light in vacuum. How many bits fit in the cable?

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

第 14 页 共 40 页

第 4 章 介质访问子层

4-1 For this problem, use a formula from this chapter, but first state the formula. Frames arrive randomly at a 100-Mbps channel for transmission. If the channel is busy when a frame arrives, it waits its turn in a queue. Frame length is exponentially distributed with a mean of 10,000 bits/frame. For each of the following frame arrival rates, give the delay experienced by the average frame, including both queueing time and transmission time. (a) 90 frames/sec. (b) 900 frames/sec. (c) 9000 frames/sec. (time delay, T // a channel of capacity C bps // with an arrival rate of ? frames/sec)

这个公式是4.1.1段落给出的Markov排队问题的标准公式。也就是,。这里C =108 、,

sec。对于这三种到达速率,我们得出的是(a) 0.1 msec,(b) 0.11 msec, (c) 1 msec. 对于c

的情况,我们操作一个带来10倍延迟的排队系统

4-2 A group of N stations share a 56-kbps pure ALOHA channel. Each station outputs a 1000-bit frame on an average of once every 100 sec, even if the previous one has not yet been sent (e.g., the stations can buffer outgoing frames). What is the maximum value of N? N个站共享一个56kbps的纯ALOHA信道。每个站平均每100秒输出一个1000位的帧,及时前面的帧还没有被送出,它也这样进行(比如这些站可以将送出的帧缓存起来)。请问N的最大值是多少? 答:对于纯的ALOHA,可用的带宽是0.184×56 Kb/s?=10.304?Kb/ s。每个站需要的带宽为1000/100=10b/s。而N=10304/10≈1030 所以,最多可以有1030 个站,即N 的最大值为1030。

4-3 Consider the delay of pure ALOHA versus slotted ALOHA at low load. Which one is less? Explain your answer.

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

4-4 Ten thousand airline reservation stations are competing for the use of a single slotted ALOHA channel. The average station makes 18 requests/hour. A slot is 125 μsec. What is the approximate total channel load?

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

第 15 页 共 40 页

that expedited packets experience a shorter delay than regular packets? Why or why not? 不能保证。如果过多报文被加快,它们的通道性能可能比常规通道更差。

5-32 Is fragmentation needed in concatenated virtual-circuit internets or only in datagram systems? 答:在这两种情况下都需要分割功能。即使在一个串接的虚电路网络中,沿通路的某些网络可能接受1024 字节分组,而另一些网络可能仅接受48字节分组,分割功能仍然是需要的。

5-34 Suppose that host A is connected to a router R 1, R 1 is connected to another router, R 2, and R 2 is connected to host B. Suppose that a TCP message that contains 900 bytes of data and 20 bytes of TCP header is passed to the IP code at host A for delivery to B. Show the Total length, Identification, DF, MF, and Fragment offset fields of the IP header in each packet transmitted over the three links. Assume that link A-R1 can support a maximum frame size of 1024 bytes including a 14-byte frame header, link R1-R2 can support a maximum frame size of 512 bytes, including an 8-byte frame header, and link R2-B can support a maximum frame size of 512 bytes including a 12-byte frame header. 开头的IP数据报会在I1被拆分成两个IP数据包,不会出现其他的拆分。??? 链路 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 链路 R2-B:

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

第 26 页 共 40 页

第 6 章 传输层

6-1 In our example transport primitives of Fig. 6-2, LISTEN is a blocking call. Is this strictly necessary? If not, explain how a nonblocking primitive could be used. What advantage would this have over the scheme described in the text? 答:不是。事实上,LISTEN 调用可以表明建立新连接的意愿,但不封锁。当有了建立连接的尝试时,调用程序可以被提供一个信号。然后,它执行,比如说,OK 或REJECT 来接受或拒绝连接。然而,在原先的封锁性方案中,就缺乏这种灵活性。

6-2 In the model underlying Fig. 6-4, it is assumed that packets may be lost by the network layer and thus must be individually acknowledged. Suppose that the network layer is 100 percent reliable and never loses packets. What changes, if any, are needed to Fig. 6-4? 答:从“被动连接建立在进行中”到“已建立”的虚线不再依确认的传输情况而定。该变迁可立即发生。实质上,“被动连接建立在进行中”状态已经消失,因为它们什么时候都不可见。

第 27 页 共 40 页

6-4 Suppose that the clock-driven scheme for generating initial sequence numbers is used with a 15-bit wide clock counter. The clock ticks once every 100 msec, and the maximum packet lifetime is 60 sec. How often need resynchronization take place (a) in the worst case? (b) when the data consumes 240 sequence numbers/min? 答:在具体解答这个问题之前,需要先熟悉一下时钟驱动方案的内容。首先我们引入参数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时需要进行一次重新同步。

第 28 页 共 40 页

6-5 Why does the maximum packet lifetime, T, have to be large enough to ensure that not only the packet but also its acknowledgements have vanished? 答:首先看三次握手过程是如何解决延迟的重复到达的分组所引起的问题的。 正常情况下,当主机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-6 Imagine that a two-way handshake rather than a three-way handshake were used to set up connections. In other words, the third message was not required. Are deadlocks now possible? Give an example or show that none exist. 答:我们知道,3 次握手完成两个重要功能,既要双方做好发送数据的准备工作(双方都知道彼此已准备好),也要允许双方就初始序列号进行协商,这个序列号在握手过程中被发送与确认。 现在把三次握手改成仅需要两次握手,死锁是可能发生的。作为例子。考虑计算机A和B 之间的通信。假定B 给A 发送一个连接请求分组,A 收到了这个分组,并发送了确认应答分组。按照两次握手的协定,A 认为连接已经成功的建立了,可以开始发送数据分组。

可是,B 在A 的应答分组在传输中被丢失的情况下,将不知道A 是否已经准备好,不知道A 建议什么样的序列号用于A 到B 的交通,也不知道A 是否同意A 所建议的用于B 到A交通的初始序列号,B 甚至怀疑A 是否收到自己的连接请求分组。在这种情况下,B 认为连接还未建立成功,将忽略A 发来的任何数据分组,只等待接收连接确认应答分组。而A在发出的分组超时后,重复发送同样的分组。这样就形成了死锁。

6-7 Imagine a generalized n-army problem, in which the agreement of any two of the blue armies is sufficient for victory. Does a protocol exist that allows blue to win? 答:(a)参见教材。

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

第 29 页 共 40 页

6-8 Consider the problem of recovering from host crashes (i.e., Fig. 6-18). If the interval between writing and sending an acknowledgement, or vice versa, can be made relatively small, what are the two best sender-receiver strategies for minimizing the chance of a protocol failure?

答:在解答本题前,让我们先考察主机从崩溃恢复所带来的问题。我们总是希望,在服务器崩溃随后又很快重新引导的情况下,客户机能够继续工作。为了说明这一问题的难度,我们假定一个客户主机发送一个长文件给另一个服务器主机,并且使用简单的停-等协议。在服务器上的传输层只是简单的把接收到的TPDU 一个一个的递交给传输用户。假定在文件传输的过程中,服务器崩溃了。当服务器恢复的时候,它的表被重新初始化,因此再也不知道崩溃前文件传送到什么地方了。

在试图恢复先前状态的过程中,服务器可能发送一个广播到所有其他主机,宣布自己刚刚发生了一次崩溃,请求客户告知所有打开的连接的状态。此时。每个客户机都可能处于二中选一的状态:有一个悬而未决的TPDU 的S1 状态,或者没有未确认应到的TPDU 的S0 状态。

可以想到的一种解决方案是基于这一状态信息,客户机决定是否要重复发最近的一个TPDU。

乍看起来,这一解决方案似乎能解决问题,可是深入仔细的分析一下,困难仍然很大。作为示例,假定服务器的传输层实体先发送ACK,在ACK 被发出之后,再执行把收到的TPDU写到应用进程的操作。把TPDU 写到输出设备和发送ACK 是两个不同的事件,不能同时进行。如果服务器主机的崩溃刚好发生在应答被发送之后,并且是在写操作之前,那么客户机将接收到确认应答,当崩溃恢复到达时会处于状态S0。因此,客户机不会重传TPDU,错误的认为服务器成功的接收到并存放好了它最后一次发送的TPDU。实际的情况并非如此,从而结果是丢失了最后一个TPDU。

到此,你也许认为:“这个问题容易解决,只要你重新编写程序,让传输实体先执行写操作然后再发送ACK就可以了。”可是,写操作尽管成功了,但崩溃可能发生在发送出ACK之前。此时客户机将会处于状态S1,因而重新发送,导致对服务器的应用进程的输出中产生未检测到的重复TPDU。

如图6-18 所示,服务器可以选择两种方式中的一种:先确认应答,或者先执行写操作。客户机可以选择4 种方式中的一种:总是重传最后一个TPDU,永不重传最后一个TPDU,仅在S0 状态时重传,或者仅在S1 状态时重传。这样就存在8 种可能的组合,但可以看出,对于每一种组合,都有一些事件会使协议的运行失败。 在服务器方可能发生3 种事件:发送一个ACK(A),对输出进程的写操作(W)和系统崩溃(C)。3 种事件可能以6 种不同的次序发生:AC(W),AWC,C(AW),C(WA),WAC和WC(A),这里的圆括号表示,在系统崩溃C 后,A 和W 事件就不可能了。图6-18 示出了客户机和服务器的策略的所有8 种组合,以及对于每一种组合的有效事件序列。值得注意的是,对于每一种策略都存在某些事件会引起协议失败。例如,如果客户机选择总是重发送,AWC 事件将产生检测不出来的收到重复分组的错误。尽管对于C(AW)和C(WA)该协议都工作的很好。

本题的答案。如果AW 或WA 间隔时间很短,事件AC(W)和W(CA)就不太可能发生。此时最好发送方策略是,如果崩溃恢复时处于状态S1,应该重传最后一个TPDU,接收方采用顺序AW 或WA 则无关紧要。

第 30 页 共 40 页

6-19 What is the total size of the minimum TCP MTU, including TCP and IP overhead but not including data link layer overhead? 默认的分段是536bytes。TCP增加20 bytes ,IP也是如此,造成默认合计576 bytes。

6-20 Datagram fragmentation and reassembly are handled by IP and are invisible to TCP. Does this mean that TCP does not have to worry about data arriving in the wrong order? 答:尽管到达的每个数据报都是完整的,但可能到达的数据报的顺序是错误的,因此,TCP必须准备适当的重组报文的各个部分。

6-23 A process on host 1 has been assigned port p, and a process on host 2 has been assigned port q. Is it possible for there to be two or more TCP connections between these two ports at the same time?

答:不可以。一条连接仅仅用它的套接口标识。因此,(1,p)-(2,q)是在这两个端口之间唯一可能的连接。

第 36 页 共 40 页

第 7 章 应用层

7-1 Many business computers have three distinct and worldwide unique identifiers. What are they?

它们是DNS名称,IP地址,以太网地址。

7-2 According to the information given in Fig. 7-3, is little-sister.cs.vu.nl on a class A, B, or C network?

它的IP地址以130开始,所以它在一个B级网络上。

第 37 页 共 40 页

7-5 DNS uses UDP instead of TCP. If a DNS packet is lost, there is no automatic recovery. Does this cause a problem, and if so, how is it solved? DNS 是幂等的,操作可以被重复而不会导致损害。当一个进程发起DNS请求时,它启动一个定时器。当定时器终止时,它仅仅再次发起请求。没有损害会发生。

7-6 In addition to being subject to loss, UDP packets have a maximum length, potentially as low as 576 bytes. What happens when a DNS name to be looked up exceeds this length? Can it be sent in two packets? 这问题不会发生。DNS名字必须短于256 bytes。标准要求如此,因此所有的DNS名称都能适合一个单一的最小长度报文。.

7-7 Can a machine with a single DNS name have multiple IP addresses? How could this occur? 使得,事实上,在图7-3(7.2题),我们能看到一个多重IP地址的例子。记住,IP地址由网络号和主机号组成。如果一台机器有两个以太网卡,它可以处于两个单独的网络上,假如这样的话,它需要两个IP地址。

7-8 Can a computer have two DNS names that fall in different top-level domains? If so, give a plausible example. If not, explain why not. 有可能,www.large-bank.com和www.large-bank.ny.us可能拥有相同的IP地址。因此,一个com域下的项目和一个国家域下的项目无疑是可能的(而且常见)。

7-9 The number of companies with a Web site has grown explosively in recent years. As a result, thousands of companies are registered in the com domain, causing a heavy load on the top-level server for this domain. Suggest a way to alleviate this problem without changing the naming scheme (i.e., without introducing new top-level domain names). It is permitted that your solution requires changes to the client code. 显然有许多方法。一种是把顶级服务器转为服务器外包;另一种是有26台分开的服务器,一台用于以a开头的名称,一台用于b,等等。在引入新服务器后的某些时间周期(比方说3年),旧的服务器仍能继续运行以向人们提供一个适用他们软件的机会。

7-10 Some e-mail systems support a header field Content Return:. It specifies whether the body of a message is to be returned in the event of nondelivery. Does this field belong to the envelope or to the header?

它属于信封,因为分发系统需要知道它的值,用来处理无法递送的电子邮件。

第 38 页 共 40 页

7-11 Electronic mail systems need directories so people's e-mail addresses can be looked up. To build such directories, names should be broken up into standard components (e.g., first name, last name) to make searching possible. Discuss some problems that must be solved for a worldwide standard to be acceptable.

这远比你能想到的要复杂。以开始而言,全世界一半人先写名字,而后写姓氏。另外一半人(例如中国)则不同。命名系统将不得不辨别任意数量的特定名字,加上姓氏,尽管后者可能具有若干部分,例如 John von Neumann。接着有些人有一个中间首字母,但没有中间名。各种各样的称谓,例如Mr., Miss, Mrs., Ms., Dr., Prof., 或 Lord,可以作为名字的前缀称谓。人们来自不同世代,于是 Jr., Sr., III, IV等等不得不也被包括进来。一些人在名字中使用他们的学术头衔,所以我们需要B.A., B.Sc., M.A., M.Sc., Ph.D,以及其它学位。最后,有些人在名字中列入了奖励和荣誉。例如,英格兰队皇家协会的会员可能加上FRS。现在我们能够接受学者的名字: Prof. Dr. Abigail Barbara Cynthia Doris E. de Vries III, Ph.D., FRS

7-26 A multithreaded Web server is organized as shown in Fig. 7-21. It takes 500 μsec to accept a request and check the cache. Half the time the file is found in the cache and returned immediately. The other half of the time the module has to block for 9 msec while its disk request is queued and processed. How many modules should the server have to keep the CPU busy all the time (assuming the disk is not a bottleneck)?

如果一个模块得到两个请求,平均一个缓存命中一个缓存缺失。总的CPU时间消耗是 1 msec,总的等待时间是 9 msec。这得出一个10%的CPU利用率。所以10个模块能使得CPU保持忙碌。

第 39 页 共 40 页

7-27 The standard http URL assumes that the Web server is listening on port 80. However, it is possible for a Web server to listen to some other port. Devise a reasonable syntax for a URL accessing a file on a nonstandard port.

正式的Internet标准(草案)RFC 1738方法是 http://dns-name:port/file.

7-28 Although it was not mentioned in the text, an alternative form for a URL is to use the IP address instead of its DNS name. An example of using an IP address is http://192.31.231.66/index.html. How does the browser know whether the name following the scheme is a DNS name or an IP address?

DNS名称不会以数字终止,所以不会有歧义。

第 40 页 共 40 页

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

Top