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

发布时间 : 星期二 文章计算机网络第四版习题答案(中文版)更新完毕开始阅读

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 页