Core Networking · Study deck

Data Representation in Networks

Picture a sensor sending the two bytes 00 FA through a site bridge to a dashboard.

Packet Pete is your guide for this deck.

networkmechdata
Packet Pete, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain: That visual pairing grounds encoding and decoding are boundary contracts. A payload is not complete until the receiver validates the decoded meaning in named evidence.
  • Explain: A cold-room sensor sends two bytes, 09 C4, and the cloud must turn them back into the same temperature the device measured.
  • Explain: The returning evidence rail sends failed vectors or contract changes back to the definition, connecting one golden payload to rollout and rollback decisions.
  • Explain: Reversing the bytes gives 196 × 256+9=50{,}185, or 501.85 °C, which is valid arithmetic but the wrong data representation.
iotclass.org

Major section

Start With What the Bits Mean

The bytes may arrive unchanged while one system reads 250 and another reads 25.0 degrees.

  • A broker means a service that accepts and routes messages.
  • A gateway means a device or service that joins two system paths.
  • A payload means the useful reading or command carried inside a message.

Why it matters

Units, byte order, encoding, precision, and schema choices are part of the networking story because they decide whether the received data can be trusted.

iotclass.org

Major section

Start With What the Bits Mean (continued)

Swap byte order, omit the unit, send an older layout, repeat a missing value, and restart the gateway.

  • This runway does not prove trustworthy identity or delivery from correct decoding alone.
  • The deeper sections explain bits, numbers, text, schemas, time, translation, version change, and boundary tests.
  • A network can deliver bytes perfectly and still fail if the sender and receiver disagree about what those bytes mean.
iotclass.org

Major section

Practitioner: Build the Encoding Review Record

The fixed example makes sender and receiver agreement testable rather than leaving the schema as prose.

  • The returning evidence rail sends failed vectors or contract changes back to the definition, connecting one golden payload to rollout and rollback decisions.
Representation review loop from a versioned field contract through bytes, translation, validation, and use
Representation review loop from a versioned field contract through bytes, translation, validation, and use
iotclass.org

Major section

Under the Hood: Representation Fails at Boundaries

That visual pairing grounds encoding and decoding are boundary contracts. A payload is not complete until the receiver validates the decoded meaning in named evidence.

  • That sequence keeps under the hood: representation fails at boundaries tied to what is visibly labelled.
Encoding and decoding are boundary contracts. A payload is not complete until the receiver validates the decoded meaning.
Encoding and decoding are boundary contracts. A payload is not complete until the receiver validates the decoded meaning.
iotclass.org

Major section

Decode One Temperature Without Guessing

A cold-room sensor sends two bytes, 09 C4, and the cloud must turn them back into the same temperature the device measured.

  • The value is 0x09 × 256+0xC4=9 × 256+196=2500.
  • If the payload contract says hundredths of a degree, the decoded result is \(2500/100=25.00\ ^\circ\text{C}\).

Key terms

If FF FE
If FF FE is a signed 16-bit two’s-complement value, it represents −2; as an unsigned value, it represents 65,534.

Numbers to remember

501.85 °Cor 501.85 °C, which is valid arithmetic
Eight bit positions and their powers of two within one byte
Eight bit positions and their powers of two within one byte
iotclass.org

Major section

Decode One Temperature Without Guessing (continued)

The schema decision changed how their top bit and remaining pattern were interpreted.

  • Reversing the bytes gives 196 × 256+9=50{,}185, or 501.85 °C, which is valid arithmetic but the wrong data representation.
  • The two bytes did not change.
  • Transport can preserve every bit while the text encoding contract still fails.
iotclass.org

Major section

Summary

Network data is useful only when raw bytes can be decoded into the intended field meaning.

  • Bits and bytes provide the container; units, scale, byte order, schema, and versioning provide the interpretation.
  • Encoding reviews should include sample payloads, decoder tests, invalid examples, and boundary notes.
  • Gateways and storage systems can silently change identity, timestamps, units, precision, quality, and schema version.
iotclass.org

Deck summary

Key takeaways

The bytes may arrive unchanged while one system reads 250 and another reads 25.0 degrees.

  • Swap byte order, omit the unit, send an older layout, repeat a missing value, and restart the gateway.
  • The fixed example makes sender and receiver agreement testable rather than leaving the schema as prose.
  • That visual pairing grounds encoding and decoding are boundary contracts. A payload is not complete until the receiver validates the decoded meaning in named evidence.
  • A cold-room sensor sends two bytes, 09 C4, and the cloud must turn them back into the same temperature the device measured.
iotclass.org

Retrieval practice

Recall check 1 of 3

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

Q1A gateway receives the two bytes 00 FA from a sensor. What must the team know before treating the value as a temperature reading?

AOnly that the bytes arrived without a network checksum error.
BField meaning, units, scale, byte order, and version.
COnly the radio technology used by the device.
DOnly whether the payload is text or binary.
Show answer

Answer: B A payload is trustworthy only when the receiver knows how to decode the bytes into the intended field meaning.

iotclass.org

Retrieval practice

Recall check 2 of 3

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

Q2A team wants to replace readable JSON telemetry with a compact binary payload. Which review artifact is most important before rollout?

AA dashboard screenshot showing that one sample value appeared after the change.
BA statement that binary is always better for IoT.
CA tested payload contract.
DA radio data sheet with maximum link throughput.
Show answer

Answer: C Encoding changes should be approved with a testable payload contract, not only with size or throughput arguments.

iotclass.org

Retrieval practice

Recall check 3 of 3

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

Q3A cloud service receives packets reliably, but values from one firmware family are decoded incorrectly after a schema change. What is the strongest diagnosis?

AThe physical layer must have failed because decoding errors are always radio errors.
BThe problem can be ignored because the cloud accepted the packets.
CThe team should remove schema versions so all payloads look the same.
DDelivery worked, but schema versioning and decode evidence failed at the representation boundary.
Show answer

Answer: D Representation failures often appear after delivery succeeds.

iotclass.org

Print reference

Answers

Answer key.

  1. B · A payload is trustworthy only when the receiver knows how to decode the bytes into the intended field meaning.
  2. C · Encoding changes should be approved with a testable payload contract, not only with size or throughput arguments.
  3. D · Representation failures often appear after delivery succeeds.
iotclass.org