📝 Checksum Error Detecting Technique (14 MCQs)
Message Check Values for Detecting Altered Data
A checksum detects accidental changes by calculating a compact value from a message and sending that value with the data. The sender and receiver perform matching arithmetic over fixed-width words. If the receiver's verification result is inconsistent, the message is rejected or reported as damaged, although some error patterns may leave the checksum unchanged. This distinction helps the receiver choose an appropriate integrity check for each frame.
Fixed-Width Words and One's-Complement Arithmetic
A traditional Internet checksum divides the message into equal-width words, commonly 16-bit units, and adds them using one's-complement arithmetic. Any carry beyond the word width is wrapped around and added to the low-order bits. The final sum is complemented to form the checksum field. Both endpoints must use matching parameters for the check to be interpreted correctly.
Checksum Generation and Verification at the Endpoints
The sender initializes the sum, adds each message word with end-around carry, complements the result, and transmits the checksum. The receiver adds all message words and the received checksum using the same arithmetic. A correct result produces all ones before complementing, or zero after the final complement. This check takes place before the receiver accepts the protected information.
Calculating a Checksum for a Short Message
For four-bit words 7, 11, 12, 0, and 6, the ordinary sum is 36. Wrap the high carry into four bits: 0010 plus 0100 gives 0110, decimal 6. Complementing 0110 gives checksum 1001, decimal 9; the receiver's total should verify to all ones. The example makes the coding rule visible through a reproducible bit sequence.
Where Internet Protocols Use Checksums
Internet checksums are used in selected network and transport headers, such as IPv4 and TCP or UDP checksum fields. They are simple and inexpensive to calculate, but link-layer protocols may use CRC for stronger detection. A checksum is an integrity check for accidental errors, not a security authenticator. Its suitability depends on traffic type, delay limits, and acceptable redundancy overhead.
Checksum Weaknesses Compared with CRC
'A checksum is a mathematical sum without a complement' omits the usual one's-complement step. 'A matching checksum proves no bits changed' is too strong because collisions exist. 'Checksums detect every transposition' is false for an unweighted sum; reordered words can retain the same total. These distinctions prevent confusion between detection, recovery, and general data integrity.
Solving Word-Based Checksum Problems
Practice dividing messages into fixed-width words, performing end-around carry, complementing the sum, and verifying the receiver result. State the word size and arithmetic convention. Compare checksum simplicity with CRC's stronger burst-error detection, and do not describe a checksum as encryption or guaranteed correction. Show intermediate steps and state assumptions behind any calculated result.
Checksum Arithmetic Terms
- Checksum - Detects accidental message changes.
- One's complement - Inverts every bit value.
- End-around carry - Wraps overflow into sum.
- Word - Fixed-width data unit.
- Verification - Checks the received sum.
- Collision - Different messages share value.
📝 All Checksum Error Detecting Technique MCQs
Q1. What is the primary purpose of a checksum in network communication?
📖 Explanation: A checksum is calculated from the original data and sent along with it. The receiver recomputes the checksum and compares it with the received value. If they differ, an error is indicated. Thus its main role is error detection, not encryption, compression, or routing.
Q2. In one's complement addition used for checksum calculation, how are overflow bits handled?
📖 Explanation: One's complement addition treats any bit that overflows beyond the most‑significant position as a carry. That carry is added back into the least‑significant position, effectively wrapping around. This property ensures the sum fits within the original word size.
Q3. If a single‑bit error flips a ‘1’ to ‘0’ in one of the data words, will the checksum computed at the receiver detect this error?
📖 Explanation: A checksum is the arithmetic sum of all data words. Changing any single bit changes the numeric value of that word, which changes the overall sum. Consequently the receiver’s recomputed checksum will differ from the transmitted one, revealing the error.
Q4. Consider a message with a 4‑bit checksum. Under what condition will a two‑bit error in different words go undetected by the checksum?
📖 Explanation: When two bits flip from 0→1 and 1→0 in separate words, their contributions to the total sum can offset each other. If the numeric increase caused by one flip equals the numeric decrease caused by the other, the final sum remains unchanged, so the checksum fails to detect the error.
Q5. A sender transmits three 8‑bit data words [0xAB, 0x34, 0xFF] with a checksum of 0x58. If the checksum bit pattern is altered to 0x59 during transmission, what will the receiver’s final sum be after adding all words and the received checksum?
📖 Explanation: First compute the sum: 0xAB + 0x34 = 0xDF, then +0xFF = 0x1DE. Wrapping the overflow gives 0xDE + 0x01 = 0xDF. Adding the altered checksum 0x59 yields 0xDF + 0x59 = 0x138, which wraps to 0x38 with a carry of 0x1 added back, resulting in 0x39. Since the expected all‑zero result is not obtained, the receiver detects an error; the closest option is 0x01, representing the non‑zero residual after complement.
Q6. When computing a checksum using one's complement addition over 16‑bit words, if the intermediate sum before wrap‑around is , what 16‑bit value is transmitted as the checksum?
📖 Explanation: The sum exceeds 16 bits. Separate the overflow bit (the leading 1) and add it to the lower 16 bits: lower part = 0xFFFE, overflow = 0x1. Adding yields 0xFFFE + 0x1 = 0xFFFF. In one's complement, the final checksum is the wrapped sum before any complement, so the transmitted value is 0xFFFE after the wrap‑around step.
Q7. Which of the following statements correctly compares a simple additive checksum with a CRC‑32 in terms of error‑detection capability?
📖 Explanation: A CRC treats the data as a polynomial and performs division, providing strong guarantees: it detects all single‑bit errors, all double‑bit errors, any odd number of errors, and burst errors up to its degree (32 bits). An additive checksum merely sums words, so many burst patterns can produce the same sum, making CRC‑32 markedly superior.
Q8. Inserting the checksum in the middle of a message rather than appending it at the end can affect detection of burst errors. Which placement offers better protection against a burst error that spans the checksum field?
📖 Explanation: When a burst error covers the checksum field, placing the checksum in the middle forces the error to affect both preceding and following data words. This creates two separate sums that must simultaneously cancel, a much less likely event than a single sum cancellation when the checksum is simply appended. Hence middle insertion improves burst‑error detection.
Q9. How does overflow handling differ between one's complement and two's complement checksum calculations?
📖 Explanation: In one's complement arithmetic, any overflow (carry out of the most‑significant bit) is added back into the least‑significant bit, preserving the word size. Two's complement arithmetic, by contrast, simply discards the overflow, because the representation already incorporates sign and magnitude without needing a wrap‑around addition.
Q10. If the checksum length is increased from bits to bits, which of the following best explains the improvement in detecting multiple‑bit errors?
📖 Explanation: Doubling the checksum size expands the number of distinct checksum values from to . With a larger space, the chance that two different error patterns map to the same checksum drops dramatically, making accidental collisions (undetected errors) far less probable, especially for multi‑bit error patterns.
Q11. Using one's complement addition, compute the checksum for the 4‑bit data words . What 4‑bit value is transmitted as the checksum?
📖 Explanation: Add the numbers: (0b10010). Wrap overflow: lower 4 bits 0b0010 (2) plus carry 1 gives 0b0011 (3). Add 12 → 3+12=15 (0b1111). Add 0 → still 0b1111. Add 6 → 15+6=21 (0b10101). Wrap: lower 4 bits 0b0101 (5) plus carry 1 gives 0b0110 (6). Thus the transmitted checksum is 6.
Q12. Consider a scenario where a single‑bit error flips a ‘1’ to ‘0’ in the data and simultaneously flips a ‘0’ to ‘1’ in the checksum field. Why would a simple additive checksum fail to detect this error while a CRC would succeed?
📖 Explanation: An additive checksum adds all words, including the checksum. If a bit error in the data decreases the sum by a certain amount and a complementary error in the checksum increases it by the same amount, the total sum stays the same, causing the error to be missed. CRC calculations, however, involve polynomial division; any change to the data or checksum alters the remainder, so the error is detected.
Q13. A message consists of three 8‑bit words [0xFF, 0x01, 0x02]. Using one's complement addition (without complement), what checksum value is transmitted?
📖 Explanation: First add 0xFF and 0x01: sum = 0x100. Wrap overflow: lower 8 bits 0x00 plus carry 0x1 gives 0x01. Add the third word 0x02: 0x01 + 0x02 = 0x03. No further overflow occurs, so the transmitted checksum is 0x03.
Q14. For an -bit checksum, assuming uniformly random error patterns, what is the probability that a random error goes undetected?
📖 Explanation: A checksum maps any possible data block to one of distinct values. For a random error, the altered block is equally likely to map to any checksum value, including the original one. Hence the chance that the erroneous block produces the same checksum as the original is . This expression quantifies the undetected‑error probability.