Docsity

Computer Networks Homework Assignment 5 for CPSC 5157 - Prof. Edward Bosworth, Assignments of Computer Systems Networking and Telecommunications

Toggle sidebar
bg1
CPSC 5157 Computer Networks Summer 2007
Homework Assignment 5 Due Tuesday, July 24, 2007
1. Problem P1 (page 503 of the fourth edition), the same as
problem 1 (page 494 of the third edition)
Suppose the information content of a packet is the bit pattern
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1.
What would be the value of the checksum field for the case of a two–dimensional
parity scheme? Minimize the length of the checksum field.
Answer. This is a string of 16 bits. One could make either 8 rows of 2 bits each, 4 rows of 4
bits each, or 2 rows of 8 bits each. The corresponding checksum sizes are 10, 8, and 10.
The rightmost column and bottom row are for parity bits.
1 0 1 0 | 0
1 0 1 0 | 0
1 0 1 0 | 0
1 0 1 1 | 1 Note: The answer giving just 0001 and 0001 as the two fields is OK.
0 0 0 1 | 1
2. Problem P2 (page 503 of the fourth edition), the same as
problem 2 (page 494 of the third edition)
Show (give an example other than the one in Figure 5.6) that two dimensional
parity bits can correct and detect a single bit error. Show (give an example) a
double–bit error that can be detected but not corrected.
Answer: Any reasonable 2–D scheme can detect and correct a single–bit error.
Any reasonable 2–D scheme can detect all two–bit errors.
It appears that no combination of two–bit errors can be corrected.
For a specific example, considerthe book’s example.
Correct 1–bit error 2–bit error 2–bit error 2–bit error
1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 0
1 0 1 0 | 0 1 0 1 0 | 11 1 1 1 | 0 1 1 1 0 | 0 1 0 1 1 | 0
1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 0
1 0 1 1 | 1 1 0 1 1 | 1 1 0 1 1 | 1 1 0 1 0 | 1 1 1 1 1 | 1
0 0 0 1 | 1 0 0 0 1 | 1 0 0 0 1 | 1 0 0 0 1 | 1 0 0 0 1 | 1
In the one–bit error, we see that the row 2 parity does not add up and that the parity column
parity does not add up. The error must be in the parity column of row 2; the data are OK.
In the first 2–error variant, we see that two columns have bad checksums, but that no row has
a bad checksum. We know that one of the rows has bits 2 and 4 bad, but cannot say which.
In the last two 2–bit error scenarios, be have ideas as to the bad rows and columns. The
difficulty is that the last two scenarios present identically.
pf2

Partial preview of the text

Download Computer Networks Homework Assignment 5 for CPSC 5157 - Prof. Edward Bosworth and more Assignments Computer Systems Networking and Telecommunications in PDF only on Docsity!

CPSC 5157 Computer Networks Summer 2007 Homework Assignment 5 Due Tuesday, July 24, 2007

  1. Problem P1 (page 503 of the fourth edition), the same as problem 1 (page 494 of the third edition) Suppose the information content of a packet is the bit pattern 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1. What would be the value of the checksum field for the case of a two–dimensional parity scheme? Minimize the length of the checksum field. Answer. This is a string of 16 bits. One could make either 8 rows of 2 bits each, 4 rows of 4 bits each, or 2 rows of 8 bits each. The corresponding checksum sizes are 10, 8, and 10. The rightmost column and bottom row are for parity bits. 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 1 | 1 Note: The answer giving just 0001 and 0001 as the two fields is OK. 0 0 0 1 | 1
  2. Problem P2 (page 503 of the fourth edition), the same as problem 2 (page 494 of the third edition) Show (give an example other than the one in Figure 5.6) that two dimensional parity bits can correct and detect a single bit error. Show (give an example) a double–bit error that can be detected but not corrected. Answer: Any reasonable 2–D scheme can detect and correct a single–bit error. Any reasonable 2–D scheme can detect all two–bit errors. It appears that no combination of two–bit errors can be corrected. For a specific example, considerthe book’s example. Correct 1–bit error 2–bit error 2–bit error 2–bit error 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 1 1 1 1 1 | 0 1 1 1 0 | 0 1 0 1 1 | 0 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 0 | 0 1 0 1 1 | 1 1 0 1 1 | 1 1 0 1 1 | 1 1 0 1 0 | 1 1 1 1 1 | 1 0 0 0 1 | 1 0 0 0 1 | 1 0 0 0 1 | 1 0 0 0 1 | 1 0 0 0 1 | 1 In the one–bit error, we see that the row 2 parity does not add up and that the parity column parity does not add up. The error must be in the parity column of row 2; the data are OK. In the first 2–error variant, we see that two columns have bad checksums, but that no row has a bad checksum. We know that one of the rows has bits 2 and 4 bad, but cannot say which. In the last two 2–bit error scenarios, be have ideas as to the bad rows and columns. The difficulty is that the last two scenarios present identically.
  1. Problem P5 (page 503 of the fourth edition), the same as problem 4 (page 494 of the third edition) Consider the four–bit generator G = 1001 (as shown in figure 5.8), and suppose that D = 1010 1010. What is the value of R? Answer: First note that R will have 3 bits as G has 4 bits. The dividend is 1010 1010 000, the data with 3 zero bits appended _ 10111101 1001 ) 1001 0011 1 0000 111 0 1001 0111 1 1001 0110 0 1001 0101 0 First of 3 appended 0’s 1001 0011 0 Second appended 0 0000 110 0 Third and last appended 0 1001 **0101 R = 101. Recall that this process uses XOR, not straight subtraction. Thus we have 1010 1001
  2. Straight subtraction would give 0001.**
  3. Review question R1 (page 501 of the fourth edition), the same as review question 1 (page 493 of the third edition). The answer from the instructor’s manual. Although each link guarantees that an IP datagram sent over the link will be received at the other end of the link without errors, it is not guaranteed that IP datagrams will arrive at the ultimate destination in the proper order. With IP, datagrams in the same TCP connection can take different routes in the network, and therefore arrive out of order. TCP is still needed to provide the receiving end of the application the byte stream in the correct order. Also, IP can lose packets due to routing loops or equipment failures.