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 位。
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
第 11 页 共 40 页
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 答:改变检查条件后,协议将变得不正确。假定使用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。修改后的检查条件将被置成“真”,不会报告已发现的丢失帧错误,而误认为丢失了的帧已被确认。另一方面,如果采用原先的检查条件,就能够报告丢失帧的错误。所以结论是:为保证协议的正确性,已接收的确认应答号应该小于下一个要发送的序列号。 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循环被去掉的话,这样会影响协议的正确性吗?还是仅仅影响协议的性能?请解释答案。 答:删除这一段程序会影响协议的正确性,导致死锁。因为这一段程序负责处理接收到的确认帧,没有这一段程序,发送方会一直保持超时条件,从而使得协议的运行不能向前进展。 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? 第 12 页 共 40 页 这样将使得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 是奇数才能正确的工作。然而其他的滑动窗口协议的实现并不具有这一性质。 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。确认信息总是 第 13 页 共 40 页 被捎带在数据帧傻姑娘。头部非常短,并且使用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 页 百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库计算机网络第四版课后习题答案(中文版)(3)在线全文阅读。
相关推荐: