Data Communication chap 10, Exercises of Data Communication Systems and Computer Networks

Exercise of chap 10.. Data communication and networking

Typology: Exercises

2019/2020

Uploaded on 09/05/2020

alina-raza
alina-raza ๐Ÿ‡ฌ๐Ÿ‡ง

5

(1)

1 document

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
288 PART III DATA-LINK LAYER
Q10-11. In CRC, we have chosen the generator 1100101. What is the probability of
detecting a burst error of length
Q10-12. Assume we are sending data items of 16-bit length. If two data items are
swapped during transmission, can the traditional checksum detect this error?
Explain.
Q10-13. Can the value of a traditional checksum be all 0s (in binary)? Defend your
answer.
Q10-14. Show how the Fletcher algorithm (Figure 10.18) attaches weights to the data
items when calculating the checksum.
Q10-15. Show how the Adler algorithm (Figure 10.19) attaches weights to the data
items when calculating the checksum.
10.7.3 Problems
P10-1. What is the maximum effect of a 2-ms burst of noise on data transmitted at the
following rates?
P10-2. Assume that the probability that a bit in a data unit is corrupted during trans-
mission is p. Find the probability that x number of bits are corrupted in an n-
bit data unit for each of the following cases.
a. n = 8, x = 1, p = 0.2
b. n = 16, x = 3, p = 0.3
c. n = 32, x = 10, p = 0.4
P10-3. Exclusive-OR (XOR) is one of the most used operations in the calculation of
codewords. Apply the exclusive-OR operation on the following pairs of pat-
terns. Interpret the results.
P10-4. In Table 10.1, the sender sends dataword 10. A 3-bit burst error corrupts the
codeword. Can the receiver detect the error? Defend your answer.
P10-5. Using the code in Table 10.2, what is the dataword if each of the following
codewords is received?
P10-6. Prove that the code represented by the following codewords is not linear. You
need to find only one case that violates the linearity.
P10-7. What is the Hamming distance for each of the following codewords?
a. 5? b. 7? c. 10?
a. 1500 bps b. 12 kbps c. 100 kbps d. 100 Mbps
a. (10001) โŠ• (10001) b. (11100) โŠ• (00000) c. (10011) โŠ• (11111)
a. 01011 b. 11111 c. 00000 d. 11011
{(00000), (01011), (10111), (11111)}
a. d (10000, 00000) b. d (10101, 10000)
c. d (00000, 11111) d. d (00000, 00000)
pf3
pf4
pf5

Partial preview of the text

Download Data Communication chap 10 and more Exercises Data Communication Systems and Computer Networks in PDF only on Docsity!

288 PART III DATA-LINK LAYER

Q10-11. In CRC, we have chosen the generator 1100101. What is the probability of detecting a burst error of length

Q10-12. Assume we are sending data items of 16-bit length. If two data items are swapped during transmission, can the traditional checksum detect this error? Explain. Q10-13. Can the value of a traditional checksum be all 0s (in binary)? Defend your answer. Q10-14. Show how the Fletcher algorithm (Figure 10.18) attaches weights to the data items when calculating the checksum. Q10-15. Show how the Adler algorithm (Figure 10.19) attaches weights to the data items when calculating the checksum.

10.7.3 Problems

P10-1. What is the maximum effect of a 2-ms burst of noise on data transmitted at the following rates?

P10-2. Assume that the probability that a bit in a data unit is corrupted during trans- mission is p. Find the probability that x number of bits are corrupted in an n - bit data unit for each of the following cases. a. n = 8, x = 1, p = 0. b. n = 16, x = 3, p = 0. c. n = 32, x = 10, p = 0. P10-3. Exclusive-OR (XOR) is one of the most used operations in the calculation of codewords. Apply the exclusive-OR operation on the following pairs of pat- terns. Interpret the results.

P10-4. In Table 10.1, the sender sends dataword 10. A 3-bit burst error corrupts the codeword. Can the receiver detect the error? Defend your answer. P10-5. Using the code in Table 10.2, what is the dataword if each of the following codewords is received?

P10-6. Prove that the code represented by the following codewords is not linear. You need to find only one case that violates the linearity.

P10-7. What is the Hamming distance for each of the following codewords?

a. 5? b. 7? c. 10?

a. 1500 bps b. 12 kbps c. 100 kbps d. 100 Mbps

a. (10001) โŠ• (10001) b. (11100) โŠ• (00000) c. (10011) โŠ• (11111)

a. 01011 b. 11111 c. 00000 d. 11011

{ (00000), (01011), (10111), (11111)}

a. d (10000, 00000) b. d (10101, 10000) c. d (00000, 11111) d. d (00000, 00000)

CHAPTER 10 ERROR DETECTION AND CORRECTION 289

P10-8. Although it can be formally proved that the code in Table 10.3 is both linear and cyclic, use only two tests to partially prove the fact: a. Test the cyclic property on codeword 0101100. b. Test the linear property on codewords 0010110 and 1111111.

P10-9. Referring to the CRC-8 in Table 5.4, answer the following questions:

a. Does it detect a single error? Defend your answer. b. Does it detect a burst error of size 6? Defend your answer. c. What is the probability of detecting a burst error of size 9? d. What is the probability of detecting a burst error of size 15?

P10-10. Assuming even parity, find the parity bit for each of the following data units.

P10-11. A simple parity-check bit, which is normally added at the end of the word (changing a 7-bit ASCII character to a byte), cannot detect even numbers of errors. For example, two, four, six, or eight errors cannot be detected in this way. A better solution is to organize the characters in a table and create row and column parities. The bit in the row parity is sent with the byte, the column parity is sent as an extra byte (Figure 10.23).

Show how the following errors can be detected: a. An error at (R3, C3). b. Two errors at (R3, C4) and (R3, C6). c. Three errors at (R2, C4), (R2, C5), and (R3, C4). d. Four errors at (R1, C2), (R1, C6), (R3, C2), and (R3, C6).

a. 1001011 b. 0001100 c. 1000000 d. 1110111

Figure 10.23 P10-

0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 1

1 1 0 0 1 1 1 1 1 0 1 1 1 0 1 1

R R R R

C1 C2 C3 C4 C5 C6C

0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 1

0 1 1 0 0 0 1 0

R1 1 1 0 0 1 1 1 1 R R R

C1 C2 C3 C4 C5 C6C

0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 1

1 0 1 1 1 0 1 1

R R R R

C1 C2 C3 C4 C5 C6C

0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 1

1 1 0 0 1 1 1 1 1 0 1 1 1 0 1 1

R R R R

C1 C2 C3 C4 C5 C6C

0 1 1 1 0 0 1 0 0 1 1 0 0 1 1 0

1 0 1 0 0 0 1 1 0 0 1 1 0 1 1 0

1 0 0 0 1 0 1 1

a. Detected and corrected

c. Detected d. Not detected

b. Detected

CHAPTER 10 ERROR DETECTION AND CORRECTION 291

P10-20. This problem shows a special case in checksum handling. A sender has two data items to send: (4567) 16 and (BA98) 16. What is the value of the checksum?

P10-21. Manually simulate the Fletcher algorithm (Figure 10.18) to calculate the checksum of the following bytes: (2B) 16 , (3F) 16 , (6A) 16 , and (AF) 16. Also show that the result is a weighted checksum.

P10-22. Manually simulate the Adler algorithm (Figure 10.19) to calculate the check- sum of the following words: (FBFF) 16 and (EFAA) 16. Also show that the result is a weighted checksum.

P10-23. One of the examples of a weighted checksum is the ISBN-10 code we see printed on the back cover of some books. In ISBN-10, there are 9 decimal dig- its that define the country, the publisher, and the book. The tenth (rightmost) digit is a checksum digit. The code, D 1 D 2 D 3 D 4 D 5 D 6 D 7 D 8 D 9 C , satisfies the following.

In other words, the weights are 10, 9,.. .,1. If the calculated value for C is 10, one uses the letter X instead. By replacing each weight w with its complement in modulo 11 arithmetic (11 โˆ’ w ), it can be shown that the check digit can be calculated as shown below.

Calculate the check digit for ISBN-10: 0-07-296775-C.

P10-24. An ISBN-13 code, a new version of ISBN-10, is another example of a weighted checksum with 13 digits, in which there are 12 decimal digits defining the book and the last digit is the checksum digit. The code, D 1 D 2 D 3 D 4 D 5 D 6 D 7 D 8 D 9 D 10 D 11 D 12 C , satisfies the following.

In other words, the weights are 1 and 3 alternately. Using the above descrip- tion, calculate the check digit for ISBN-13: 978-0-07-296775-C.

P10-25. In the interleaving approach to FEC, assume each packet contains 10 samples from a sampled piece of music. Instead of loading the first packet with the first 10 samples, the second packet with the second 10 samples, and so on, the sender loads the first packet with the odd-numbered samples of the first 20 samples, the second packet with the even-numbered samples of the first 20 samples, and so on. The receiver reorders the samples and plays them. Now assume that the third packet is lost in transmission. What will be missed at the receiver site?

P10-26. Assume we want to send a dataword of two bits using FEC based on the Ham- ming distance. Show how the following list of datawords/codewords can auto- matically correct up to a one-bit error in transmission.

[(10 ร— D 1 ) + (9 ร— D 2 ) + (8 ร— D 3 ) +... + (2 ร— D 9 ) + (1 ร— C )] mod 11 = 0

C = [(1 ร— D 1 ) + (2 ร— D 2 ) + (3 ร— D 3 ) +... + (9 ร— D 9 )] mod 11

[(1 ร— D 1 ) + (3 ร— D 2 ) + (1 ร— D 3 ) +... + (3 ร— D 12 ) + (1 ร— C )] mod 10 = 0

292 PART III DATA-LINK LAYER

P10-27. Assume we need to create codewords that can automatically correct a one-bit error. What should the number of redundant bits ( r ) be, given the number of bits in the dataword ( k )? Remember that the codeword needs to be n = k + r bits, called C( n , k ). After finding the relationship, find the number of bits in r if k is 1, 2, 5, 50, or 1000. P10-28. In the previous problem we tried to find the number of bits to be added to a dataword to correct a single-bit error. If we need to correct more than one bit, the number of redundant bits increases. What should the number of redundant bits ( r ) be to automatically correct one or two bits (not necessarily contiguous) in a dataword of size k? After finding the relationship, find the number of bits in r if k is 1, 2, 5, 50, or 1000. P10-29. Using the ideas in the previous two problems, we can create a general formula for correcting any number of errors ( m ) in a codeword of size ( n ). Develop such a formula. Use the combination of n objects taking x objects at a time. P10-30. In Figure 10.22, assume we have 100 packets. We have created two sets of packets with high and low resolutions. Each high-resolution packet carries on average 700 bits. Each low-resolution packet carries on average 400 bits. How many extra bits are we sending in this scheme for the sake of FEC? What is the percentage of overhead?

10.8 SIMULATION EXPERIMENTS

10.8.1 Applets

We have created some Java applets to show some of the main concepts discussed in this chapter. It is strongly recommended that the students activate these applets on the book website and carefully examine the protocols in action.

10.9 PROGRAMMING ASSIGNMENTS

For each of the following assignments, write a program in the programming language you are familiar with. Prg10-1. A program to simulate the calculation of CRC. Prg10-2. A program to simulate the calculation of traditional checksum. Prg10-3. A program to simulate the calculation of Fletcher checksum. Prg10-4. A program to simulate the calculation of Adler checksum.