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

Respuesta :

Answer:

The algorithm required for the question is given below.

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.