98.7k views
4 votes
Suppose that one byte in a buffer covered by the Internet checksum algorithm needs to be decremented (e.g., a header hop count field). Give an algorithm to compute the revised checksum without rescanning the entire buffer. Your algorithm should consider whether the byte in question is low order or high order

User Eby Jacob
by
5.0k points

1 Answer

3 votes

Answer:

The algorithm required for the question is given below.

Step-by-step explanation:

Step 1: The data is shown below for the algorithm.

  • Original checksum.
  • Byte location is decrementable.
  • Price to decrease by what bit.

Step 2: Get a checksum compliment from one.

Step 3: Whether byte is of lesser importance to still be decremented by x.

  • Subtract x from those bytes.

Step 4: Whether byte is of higher importance to still be decremented by x.

  • Subtract 2⁸×x from those bytes.

Step 5: Start taking one's outcome compliment to get amended iterator checksum.

User Frostmatthew
by
6.0k points