Transport Protocols · Study deck

Error Detection: CRC and Checksums

Picture a pressure reading that reaches a pump controller with one changed bit.

Packet Pete is your guide for this deck.

error-detectionchecksumspacket-evidence
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain: Error detection asks whether a receiver can notice a corrupted, malformed, repeated, or suspicious message before treating it as valid.
  • Explain: A simple checksum can catch many accidental changes, but a weak checksum may miss some error patterns.
  • Explain: For example, meter-12 sends a pressure sample with payload bytes, a sequence value, and a CRC.
  • Explain: The receiver must decide whether to accept, reject, ask again, or enter a safe unknown state.
Retry and sequence decision record fields for message boundary, observed condition, retry policy, acknowledgement result, sequence state, side-effect boundary, final decision, and retest trigger.
Retry and sequence decision record fields for message boundary, observed condition, retry policy, acknowledgement result, sequence state, side-effect boundary, final decision, and retest trigger.
iotclass.org

Major section

Start With the Suspicious Packet

The receiver must decide whether to accept, reject, ask again, or enter a safe unknown state.

  • A red error light is useful only if that decision and its limit are clear.
  • A checksum is a small value calculated from a stated part of a message.
  • A cyclic redundancy check, or CRC, is a stronger form designed to catch common bit changes.
iotclass.org

Major section

Overview: Detection Is a Bounded Claim

Error detection asks whether a receiver can notice a corrupted, malformed, repeated, or suspicious message before treating it as valid.

  • If the receiver drops the malformed frame and emits a diagnostic, the evidence supports bounded rejection.
  • For example, meter-12 sends a pressure sample with payload bytes, a sequence value, and a CRC.
Error-detection evidence becomes reviewable when every step connects a protected message to an observed receiver decision and a stated limit.
Error-detection evidence becomes reviewable when every step connects a protected message to an observed receiver decision and a stated limit.
iotclass.org

Major section

Practitioner: Build the Error-Detection Record

The method describes how the check is interpreted.

  • A routine telemetry sample might be dropped.
  • A command might be rejected and alarmed.
A compact record keeps method details, observed condition, receiver action, decision, limits, and retest ownership separate.
A compact record keeps method details, observed condition, receiver action, decision, limits, and retest ownership separate.
iotclass.org

Major section

Under the Hood: Know What the Check Cannot Prove

A simple checksum can catch many accidental changes, but a weak checksum may miss some error patterns.

  • Parity can support a narrow bit-level check.
  • Error detection also sits below several other review layers.
A CRC review is repeatable only when both sides use the same protected byte range, profile, and comparison rule, and the record still limits the claim to packet-level error detection.
A CRC review is repeatable only when both sides use the same protected byte range, profile, and comparison rule, and the record still limits the claim to packet-level error detection.
iotclass.org

Major section

Retries and Sequence Numbers

A gateway is the unit that links one device group to another network or service.

  • Retries reduce some loss; they do not prove the result.
  • Under the Hood defines receiver state, duplicate rules, wrap, and side-effect limits.
Retry and sequence evidence should close the loop from observation to final state.
Retry and sequence evidence should close the loop from observation to final state.
iotclass.org

Deck summary

Key takeaways

The receiver must decide whether to accept, reject, ask again, or enter a safe unknown state.

  • Error detection asks whether a receiver can notice a corrupted, malformed, repeated, or suspicious message before treating it as valid.
  • The method describes how the check is interpreted.
  • A simple checksum can catch many accidental changes, but a weak checksum may miss some error patterns.
  • A gateway is the unit that links one device group to another network or service.
iotclass.org

Retrieval practice

Recall check 1 of 6

Packet Pete says: answer from memory, then check your reasoning.

Q1A trace shows that a checksum rejected one corrupted datagram. What claim is supported?

AAll future corruption patterns are detected from this one rejected packet.
BA failed checksum proves the payload had application authorization.
CA bounded corruption-detection result for this packet and path.
DReceiver and format changes cannot affect the observed result.
Show answer

Answer: C Checksum and CRC evidence should be tied to scoped messages, observed receiver actions, limits, and retest triggers.

iotclass.org

Retrieval practice

Recall check 2 of 6

Packet Pete says: answer from memory, then check your reasoning.

Q2A receiver log shows that a frame was rejected after a CRC mismatch, but the record does not name the CRC profile or checked-byte scope. How should reviewers treat the CRC rejection record?

AKeep the rejection but request CRC profile and checked-byte scope.
BClaim full reliability from one CRC mismatch without error coverage tests.
CDiscard receiver logs because only packet captures count as evidence.
DTrust future payloads because this receiver rejected one bad frame.
Show answer

Answer: A Error-detection evidence should connect the method, checked bytes, observed condition, receiver action, and limits.

iotclass.org

Retrieval practice

Recall check 3 of 6

Packet Pete says: answer from memory, then check your reasoning.

Q3A packet passes its CRC check, but the application later applies the wrong actuator command because the payload was stale. What did the CRC evidence fail to prove?

AThat the receiver compared any check value on this packet.
BThat the packet contained bytes before its CRC was checked.
CThat a CRC can detect corruption in other packet examples.
DThat the command was fresh, authorized, and safe to apply.
Show answer

Answer: D Error detection is one evidence layer.

iotclass.org

Retrieval practice

Recall check 4 of 6

Packet Pete says: answer from memory, then check your reasoning.

Q4What must be shown before the command trace establishes its final outcome?

AAccept visible retries as proof of final command acceptance.
BHold until retry limit and final receiver state are evidenced.
CIgnore sequence and duplicate rules as sender-only concerns.
DRemove acknowledgements because fewer records improve the outcome without changing delivery certainty.
Show answer

Answer: B Retry and sequence evidence must name the protected message boundary, the bounded retry decision, receiver state, and final state.

iotclass.org

Retrieval practice

Recall check 5 of 6

Packet Pete says: answer from memory, then check your reasoning.

Q5A gateway receives sequence 42 again after a device reconnects. What should the receiver record before accepting, ignoring, or replay-protecting it?

APrior sequence state, reset boundary, duplicate rule, and receiver effect.
BThe repeated number alone without stored state or side-effect checks.
CThe transport name alone as a complete sequence decision rule.
DA later success alone as proof the duplicate caused no action.
Show answer

Answer: A A retry or sequence record should connect the observed value to receiver state, reconnect boundary, duplicate policy, side effects, and the final accept/ignore/reject decision.

iotclass.org

Retrieval practice

Recall check 6 of 6

Packet Pete says: answer from memory, then check your reasoning.

Q6A receiver accepts a command after a retry, then later receives the original delayed command. What evidence matters most under the hood?

AThe retry count alone, because a completed retry makes delayed originals harmless.
BThe sender log alone, because receiver state is outside the reliability decision.
CCommand identity, sequence state, duplicate guard, and final state.
DThe network path alone, because packet arrival order is the only reliability concern.
Show answer

Answer: C Under-the-hood review checks the state machine around late, duplicate, missing, reset, and wrapped values.

iotclass.org

Print reference

Answers 1 of 2

Answer key.

  1. C · Checksum and CRC evidence should be tied to scoped messages, observed receiver actions, limits, and retest triggers.
  2. A · Error-detection evidence should connect the method, checked bytes, observed condition, receiver action, and limits.
  3. D · Error detection is one evidence layer.
  4. B · Retry and sequence evidence must name the protected message boundary, the bounded retry decision, receiver state, and final state.
iotclass.org

Print reference

Answers 2 of 2

Answer key.

  1. A · A retry or sequence record should connect the observed value to receiver state, reconnect boundary, duplicate policy, side effects, and the final accept/ignore/reject decision.
  2. C · Under-the-hood review checks the state machine around late, duplicate, missing, reset, and wrapped values.
iotclass.org