ÊýµÈÓÚ£º
2. The following character encoding is used in a data link protocol: A: 01000111;
B: 11100011; FLAG: 01111110; ESC: 11100000 Show the bit sequence 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?£¨M£© ¿ÉÄÜ¡£¼Ù¶¨ÔÀ´µÄÕýÎİüº¬Î»ÐòÁÐ 01111110 ½«±ä³É 011111010¡£Èç¹ûÓÉÓÚ´«Êä´íÎóµÚ¶þ¸ö 0
×÷ΪÊý¾Ý¡£Î»Ìî³äÖ®ºó£¬Õâ¸öÐòÁÐ ¶ªÊ§ÁË£¬ÊÕµ½µÄλ´®ÓÖ±ä³É
transmitted
(in binary) for the four-character frame: A B ESC FLAG when each of the following framing methods are used: a. (a) Character count.
b. (b) Flag bytes with byte stuffing.
c. (c) Starting and ending flag bytes, with bit stuffing.£¨E£© ½á¹ûΪ
(a)×Ö·û¼ÆÊý 00000101 01000111 11100011 11100000 01111110
(b)×Ö½ÚÌî³ä 01111110 01000111 11100011 11100000 11100000 11100000 01111110 01111110
(c)λÌî³ä 01111110 01000111 110100011 111000000 011111010 01111110
3. The following data fragment occurs in the middle of a data stream for which the byte-stuffing algorithm described in the text is used: A B ESC C ESC FLAG FLAG D. What is the output after stuffing?£¨E£©
Ìî³äºó½á¹ûΪ£ºA B ESC ESC C ESC ESC ESC FLAG ESC FLAG D. 4. One of your classmates, Scrooge, has pointed out that it is wasteful to end each
frame with a flag byte and then begin the next one with a second flag byte. One flag
byte could do the job as well, and a byte saved is a byte earned. Do you agree?£¨E£©
Ö»ÓÃÒ»¸ö±ê¼ÇλÎÞ·¨ÖªµÀÒ»Ö¡ºÎʱ½áÊø¡£Èç¹ûÖ¡Á÷ÊÇÎÞÏÞÁ¿µÄ£¬Ò»¸ö±ê¼Çλ»òÐí
ÊÇ¿ÉÒԵġ£µ«Êǵ±Ò»Ö¡ÒÔ±ê¼Çλ½áÊøÁËÖ®ºó£¬ÔÚÒ»¶Îʱ¼äÄÚ£¨±ÈÈç 15 ·ÖÖÓ£©Ã»ÓÐÐÂ
µÄÖ¡µ½´ïʱ£¬½ÓÊÕÕßÈçºÎÀ´·Ö±æ³öÏÂÒ»×Ö½ÚÊÇÕæÕýµÄÐÂÖ¡µÄ¿ªÊ¼»¹ÊÇÅöÇÉÊÇÏß·ÉÏ
µÄÔëÉùÄØ£¿ÕâÑùµÄÐÒéÉè¼ÆµÄ¹ýÓÚ¼òµ¥ÁË¡£
5. A bit string, 0111101111101111110, needs to be transmitted at the data link layer. What is the string actually transmitted after bit stuffing?£¨E£© Êä³ö£º011110111110011111010.
6. When bit stuffing is used, is it possible for the loss, insertion, or modification
01111110£¬±»½ÓÊÕ·½¿´³ÉÊÇ֡β¡£È»ºó½ÓÊÕ·½Ôڸô®µÄÇ°ÃæÑ°ÕÒ¼ìÑéºÍ£¬²¢¶ÔËü½ø
ÐÐÑéÖ¤¡£Èç¹û¼ìÑéºÍÊÇ 16 룬ÄÇô±»´íÎóµÄ¿´³ÉÊǼìÑéºÍµÄ 16 λµÄÄÚÈÝÅöÇɾÑé
Ö¤ºóÈÔÈ»ÕýÈ·µÄ¸ÅÂÊÊÇ 1/216¡£Èç¹ûÕâÖÖ¸ÅÂʵÄÌõ¼þ³ÉÁ¢ÁË£¬¾Í»áµ¼Ö²»ÕýÈ·µÄÖ¡±»
½ÓÊÕ¡£ÏÔÈ»£¬¼ìÑéºÍ¶ÎÔ½³¤£¬´«Êä´íÎó²»±»·¢ÏֵĸÅÂÊ»áÔ½µÍ£¬µ«¸Ã¸ÅÂÊÓÀÔ¶²»µÈ ÓÚÁã¡£
16. Data link protocols almost always put the CRC in a trailer rather than in a
header. Why?£¨E£©
CRC ÊÇÔÚ·¢ËÍÆÚ¼ä½øÐмÆËãµÄ¡£Ò»µ©°Ñ×îºóһλÊý¾ÝËÍÉÏÍâ³öÏß·£¬¾Í
numbers be?£¨M£©
ΪÁËÓÐЧÔËÐУ¬ÐòÁпռ䣨ʵ¼ÊÉϾÍÊÇ·¢ËÍ´°¿Ú´óС£©±ØÐë×ã¹»µÄ´ó£¬ÒÔÔÊÐí·¢ ËÍ·½ÔÚÊÕµ½µÚÒ»¸öÈ·ÈÏÓ¦´ð֮ǰ¿ÉÒÔ²»¶Ï·¢ËÍ¡£ÐźÅÔÚÏß·ÉϵĴ«²¥Ê±¼äΪ 6¡Á3000=18000 ÔÚ T1 ËÙÂÊ£¬·¢ËÍ 64
Ö¡Ð軨µÄʱ¼ä£º64¡Á8¡Â(1.536¡Á106)= 0.33
£¬¼´ 18ms¡£
×Ö½ÚµÄÊý¾Ý¡£
ËùÒÔ£¬·¢Ë͵ĵÚÒ»Ö¡´Ó¿ªÊ¼·¢ËÍÆð£¬18.33ms ºóÍêÈ«µ½´ï½ÓÊÕ·½¡£È·ÈÏÓ¦´ðÓÖ»¨ Á˺ÜÉٵķ¢ËÍʱ¼ä£¨ºöÂÔ²»¼Æ£©ºÍ»Ø³ÌµÄ 18ms¡£ÕâÑù£¬¼ÓÔÚÒ»ÆðµÄʱ¼äÊÇ 36.33ms¡£
·¢ËÍ·½Ó¦¸ÃÓÐ×ã¹»´óµÄ´°¿Ú£¬´Ó¶øÄܹ»Á¬Ðø·¢ËÍ 36.33ms¡£ 36. 33/0.33=110
Ò²¾ÍÊÇ˵£¬Îª³äÂúÏß·¹ÜµÀ£¬ÐèÒªÖÁÉÙ 110 Ö¡£¬Òò´ËÐòÁкÅΪ Á¢¼´°Ñ
CRC ±àÂ븽¼ÓÔÚÊä³öÁ÷µÄºóÃæ·¢³ö¡£Èç¹û°Ñ CRC ·ÅÔÚÖ¡µÄÍ·²¿£¬ÄÇ7 λ¡£ ô¾ÍÒªÔÚ·¢ËÍ ÕâÒ»ÌâÓÐÕùÒéµÄµØ·½ÊÇ T1 µÄËÙ¶È£¬T1 µÄÊý¾ÝËÙÂʸù¾ÝËüµÄ½á¹¹Ó¦¸ÃÊÇ£¨193-1-24£© ֮ǰ°ÑÕû¸öÖ¡Ïȼì²éÒ»±éÀ´¼ÆËã CRC¡£ÕâÑùÿ¸ö×Ö½Ú¶¼Òª´¦ÀíÁ½±é£¬µÚÒ»/193*1.544=1.344mbps,µ«ÊÇ´ð°¸ÖÐÊÇ£¨193-1£©/193*1.544=1.536mbps¡£ ±éÊÇΪÁË
- 9 -
¼ÆËã¼ìÑéÂ룬µÚ¶þ±éÊÇΪÁË·¢ËÍ¡£°Ñ CRC ·ÅÔÚβ²¿¾Í¿ÉÒÔ°Ñ´¦Àíʱ¼ä¼õ°ë¡£
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? £¨E£©
µ±·¢ËÍÒ»Ö¡µÄʱ¼äµÈÓÚÐŵÀµÄ´«²¥ÑÓ³ÙµÄ 2
±¶Ê±£¬ÐŵÀµÄÀûÓÃÂÊΪ
50%¡£»òÕß˵£¬
µ±·¢ËÍÒ»Ö¡µÄʱ¼äµÈÓÚÀ´»ØÂ·³ÌµÄ´«²¥ÑÓ³Ùʱ£¬Ð§Âʽ«ÊÇ 50%¡£¶øÔÚÖ¡³¤Âú×ã·¢ËÍ
ʱ¼ä´óÓÚÑÓ³ÙµÄÁ½±¶Ê±£¬Ð§Âʽ«»á¸ßÓÚ 50%¡£ ÏÖÔÚ·¢ËÍËÙÂÊΪ 4Mb/s£¬·¢ËÍһλÐèÒª 0.25 ¡£
Ö»ÓÐÔÚÖ¡³¤²»Ð¡ÓÚ 160kb ʱ£¬Í£µÈÐÒéµÄЧÂʲŻáÖÁÉÙ´ïµ½ 50%¡£
18. A 3000-km-long T1 trunk is used to transmit 64-byte frames using protocol 5.
If the propagation speed is 6 ¦Ìsec/km, how many bits should the sequence
19. In 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?(M)
ÐÒé 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.(M) ʹ·¢ËÍÕߵĴ°¿ÚΪ (Sl , Su) Ö®¼äµÄ¹ØÏµÓ¦Âú×㣺 0 <= Su- Sl +1 <= W1 Ru - Rl + 1 = W Sl <= Rl <=Su + 1 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.£¨H£© ¸Ä±ä¼ì²éÌõ¼þºó£¬ÐÒ齫±äµÃ²»ÕýÈ·¡£ ¼Ù¶¨Ê¹Óà 3 λÐòÁкţ¬¿¼ÂÇÏÂÁÐÐÒéÔËÐйý³Ì£ºA Õ¾¸Õ·¢³ö 7 ºÅÖ¡£»B Õ¾½ÓÊÕµ½ Õâ¸öÖ¡£¬²¢·¢³öÉÓ´øÓ¦´ð ack£»A Õ¾ÊÕµ½ ack£¬²¢·¢ËÍ 0~6 ºÅÖ¡¡£¼Ù¶¨ËùÓÐÕâЩ֡¶¼ £¬½ÓÊÕÕߵĴ°¿ÚΪ (Rl , Ru)£¬´°¿Ú´óСΪ W£¬ÔòËüÃÇ ÔÚ´«Êä¹ý³ÌÖжªÊ§ÁË£»B Õ¾³¬Ê±£¬ÖØ·¢ËüµÄµ±Ç°Ö¡£¬´ËʱÉÓ´øµÄÈ·ÈϺÅÊÇ 7£»¿¼²ì A Õ¾ÔÚ r.rack = 7 µ½´ïʱµÄÇé¿ö£¬¹Ø¼ü±äÁ¿ÊÇ ack_expected = 0£¬r.rack = 7£¬ next_frame_to_send_= 7¡£ Ð޸ĺóµÄ¼ì²éÌõ¼þ½«±»ÖóɨDÕæ¡¬£¬²»»á±¨¸æÒÑ·¢ÏֵĶªÊ§Ö¡´íÎ󣬶øÎóÈÏΪ¶ªÊ§ Á˵ÄÖ¡Òѱ»È·ÈÏ¡£ÁíÒ»·½Ã棬Èç¹û²ÉÓÃÔÏȵļì²éÌõ¼þ£¬¾ÍÄܹ»±¨¸æ¶ªÊ§Ö¡µÄ´íÎó¡£ ËùÒÔ½áÂÛÊÇ£ºÎª±£Ö¤ÐÒéµÄÕýÈ·ÐÔ£¬ÒѽÓÊÕµÄÈ·ÈÏÓ¦´ðºÅÓ¦¸ÃСÓÚÏÂÒ»¸öÒª·¢Ë굀 ÐòÁкš£ 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?(M)
ÓеÄÈ·ÈÏÖ¡¶¼¶ªÊ§ÁË£¬·¢ËÍ·½×îÖÕ»á²úÉú³¬Ê±Ê¼þ£¬²¢ÇÒÔٴη¢Ë͵ÚÒ»Ö¡£¬½ÓÊÕ·½
A Õ¾·¢ËÍ 0 ºÅÖ¡¸ø B Õ¾¡£B Õ¾ÊÕµ½´ËÖ¡£¬²¢·¢ËÍ ACK Ö¡£¬µ« ACK ¶ªÊ§ÁË¡£A Õ¾
½«·¢ËÍÒ»¸ö NAK¡£È»ºó NONAK ±»ÖóÉα¡£¼Ù¶¨ NAK
·¢Éú³¬Ê±£¬ÖØ·¢ 0 ºÅÖ¡¡£µ« B Õ¾ÏÖÔÚÆÚ´ý½ÓÊÕ 1 ºÅÖ¡£¬Òò´Ë·¢ËÍ NAK£¬·ñ
Ò²¶ªÊ§ÁË¡£ÄÇô´ÓÕâ¸öʱ ¶¨ÊÕµ½
ºò¿ªÊ¼£¬·¢ËÍ·½»á²»¶Ï·¢ËÍÒѾ±»½ÓÊÕ·½½ÓÊÜÁ˵ÄÖ¡¡£½ÓÊÕ·½Ö»ÊǺöÂÔÕâЩ֡£¬µ« µÄ 0 ºÅÖ¡¡£ÏÔÈ»£¬ÏÖÔÚ A Õ¾×îºÃ²»ÖØ·¢ 0 ºÅÖ¡¡£ÓÉÓÚÌõ¼þ ÓÉÓÚ NONAK ΪᣬËùÒÔ²»»áÔÙ·¢ËÍ NAK£¬´Ó¶ø²úÉúËÀËø¡£Èç¹ûÉèÖø¨Öú¼ÆÊýÆ÷ r.rack+1 removed from the code. Would this affect the correctness of the protocol or just the ¾Í˵Ã÷ÁËÕâ¶Î³ÌÐòÖеÄÁíÒ»¸öÌõ¼þ£¬¼´ r.rack+1 ɾ³ýÕâÒ»¶Î³ÌÐò»áÓ°ÏìÐÒéµÄÕýÈ·ÐÔ£¬µ¼ÖÂËÀËø¡£ÒòΪÕâÒ»¶Î³ÌÐò¸ºÔð´¦Àí½ÓÊÕ 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 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? 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 £¨M£© largest window that can be safely used?£¨E£© Õ⽫»áʧȥʹÓà NAKs µÄÄ¿µÄ£¬Òò´ËÎÒÃDz»µÃ²»»ØÍ˵½³¬Ê±¡£¾¡¹ÜÐÔÄÜÉÏÓÐËùÏ ½µ£¬µ«ÊDz»Ó°ÏìÐÒéµÄÕýÈ·ÐÔ¡£NAKs ²¢²»ÊǹؼüµÄ¡£ 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.£¨M£© ÕâÀïÒªÇó r.rack+1 ²»¿ÉÒÔ¡£×î´ó½ÓÊÕ´°¿ÚµÄ´óС¾ÍÊÇ 1¡£ÏÖÔÚ¼Ù¶¨¸Ã½ÓÊÕ´°¿ÚÖµ±äΪ 2¡£¿ªÊ¼Ê±·¢ËÍ ·½·¢ËÍ 0 ÖÁ 6 ºÅÖ¡£¬ËùÓÐ 7 ¸öÖ¡¶¼±»ÊÕµ½£¬²¢×÷ÁËÈ·ÈÏ£¬µ«È·Èϱ»¶ªÊ§¡£ÏÖÔÚ½Ó ÊÕ·½×¼±¸½ÓÊÕ 7 ºÅºÍ 0 ºÅÖ¡£¬µ±ÖØ·¢µÄ 0 ºÅÖ¡µ½´ï½ÓÊÕ·½Ê±£¬Ëü½«»á±»»º´æ±£Áô£¬ - 10 -