Chapters

3 Transport Layer Overview — Part 2

iot
transport-protocols
networking
Listen
Uses your device's voice. Tap ▶ beside any paragraph to hear just that one.
  • Podcast audio coming soon
  • Character narration audio coming soon
Lecture
Video lecture coming soon. The slides are the lecture for now.
Ask AI
Pick a prompt. We copy it for you and open an AI service; paste it there. Nothing is sent to IoTClass.

This is part 2 of 2. Begin with Part 1.

3.1 Practitioner: Build the Transport Overview Record

Turn the transport discussion into a short record that another reviewer can test. Name who owns each task and what lies outside the transport layer.

Walkthrough: Review One Flow

Review one flow at a time. State the message and roles, name the stream, datagram, protected-record, or mixed behavior, and assign each reliability task. Link what the sender sees to what the receiver decides. Then write the limit and retest trigger. Keep telemetry, commands, alarms, and transfers in separate records.

At every step, ask what artifact another reviewer can inspect: a configuration, trace, endpoint log, parser result, queue event, application state, or security record. If the path crosses a gateway, stop and record both segments and the handoff. This makes the final acceptance narrow, repeatable, and easy to reopen when one segment changes.

Close the walkthrough with a sentence that states the supported claim and the open responsibility. For example, a trace may prove an established TCP stream or an observed UDP datagram, while message framing, freshness, authorization, storage, or physical action remains for another record. Naming that boundary prevents successful transport mechanics from being reported as complete application delivery.

  1. State the flow. Name the exact message or stream, such as "device sends periodic temperature status" or "service sends configuration command through a gateway."
  2. Name the roles. Identify the sender, receiver, and any intermediary that terminates or changes the transport behavior.
  3. Choose the behavior to review. Record whether the path uses TCP stream behavior, UDP datagrams, DTLS-protected UDP records, or a mixed gateway path.
  4. Assign reliability ownership. Say where acknowledgement, retry, timeout, duplicate handling, ordering, or freshness evidence lives.
  5. Record the receiver evidence. A sender-side trace is not enough when the claim depends on the receiver accepting, rejecting, ignoring, or acting on the message.
  6. Set the limit and retest trigger. Write what the evidence does not prove and which change reopens the decision.

Transport Overview Ledger

Record Field
Question
Useful Evidence
Common Limit
Flow scope
Which message, stream, report, command, transfer, or handoff is being reviewed?
Flow name, message type, path segment, and observation point.
A broad product-wide conclusion that hides different message consequences.
Endpoint roles
Who sends, receives, forwards, terminates, or changes the transport path?
Device, gateway, broker, service, client, server, or peer role evidence.
Assuming a gateway acknowledgement proves downstream receiver action.
Transport behavior
Is the evidence about a stream, datagram, protected record, or mixed path?
TCP connection and close record, UDP datagram identity, or DTLS record boundary.
Using a protocol name without naming the observed behavior.
Reliability owner
Where are retry, timeout, duplicate, ordering, freshness, and loss decisions made?
Transport logs, application acknowledgements, receiver logs, sequence checks, or timeout records.
Calling a flow reliable without saying which layer owns acceptance evidence.
Security boundary
Which segment checks identity and protects records, if protection is part of the claim?
TLS or DTLS boundary, endpoint identity evidence, and gateway termination notes.
Treating transport protection as proof of application authorization.
Retest trigger
What change makes this decision stale?
Message format, endpoint role, retry policy, timeout, port expectation, or security-boundary change.
No owner, no trigger, and no way to know when the conclusion expired.

Here is the record filled in for an illustrative periodic temperature report from a device to a gateway.

Record fieldCompleted entry
Flow scopeOne temperature status report every 60 s, from the device to the gateway dashboard; review the gateway log.
Endpoint rolesThe device sends; the gateway receives and updates the dashboard.
Transport behaviorUDP sends each report as a separate datagram. The gateway log records each message ID.
Reliability ownerThe gateway ignores duplicate IDs and accepts a report only if it is no more than 120 s old. A later accepted report replaces a missing one; there is no retry. Two report periods are 2 × 60 s = 120 s.
Security boundaryNot yet established; the review must identify how this device-to-gateway segment checks identity and protects reports.
Retest triggerThe gateway review owner repeats the check if the report format, 60 s period, freshness rule, or security boundary changes.

Decision: UDP is a candidate for this dashboard flow, pending the security check and a test of the freshness rule. The gateway log and dashboard state must show acceptance, duplicate rejection, and replacement; they do not prove command delivery or device action.

Read the 120 s limit as a dashboard freshness rule, then check the gateway log and dashboard state against it.

Worked Review: Periodic Telemetry

Flow: device sends periodic temperature status to a gateway.

Evidence: each report is a separate datagram; the gateway records message identifiers; duplicates are ignored; a later accepted report can replace an older missing report for the dashboard view.

Decision: UDP can be accepted for this narrow telemetry flow if the security boundary and freshness rule are also recorded. The decision does not cover alarms, commands, firmware transfer, or audit history.

In this example the device sends a temperature report every minute. The device and gateway clocks are synchronized for the age check. The gateway subtracts the send time from the arrival time and accepts a report only if it is at most 60 seconds old, its ID is new, and it was sent after the last accepted report. The dashboard marks its last accepted value stale once that report is more than 60 seconds old.

Report ID and valueSent (s)Arrived (s)Gateway decisionDashboard at arrival
1, 20 °C010Accept. Age is 10 − 0 = 10 s.20 °C from report 1, fresh
1, 20 °C (repeat)020Ignore the repeated ID.20 °C from report 1, still fresh
2, 21 °C60130Reject. Age is 130 − 60 = 70 s, past the 60 s limit.20 °C from report 1, stale because 130 − 0 = 130 s

Times are measured from the start of this synthetic log. UDP provides no delivery guarantee or duplicate suppression. The sensor sends its next scheduled report without retrying a missed one. The gateway application owns the accept, ignore, and reject decisions and supplies the last accepted value and its age to the dashboard. In this example, DTLS protects the device-to-gateway segment and terminates at the gateway. Retest if the age limit, clock synchronization, or protection boundary changes.

Worked Review: Configuration Command

Flow: service sends a configuration command through a gateway to a device.

Evidence gap: a TCP connection from service to gateway proves only that segment reached a transport boundary. It does not prove the device received the complete command, rejected duplicates, or changed state safely.

See it

Did the Device Apply the Command? · Follow command C from a gateway receipt to the device log and compare what each observer can verify.

Open activity →

The animation follows C through a gateway timeout, then replays the device’s acceptance and shows how a retry returns the stored result.

Review action: split the path into service-to-gateway and gateway-to-device records, then require device-side acceptance and failure evidence before accepting the command-delivery claim.

Follow command 42 through a disconnect

StepWhat happensWhat the operator can check
SendThe service sends command 42 with an expiry time. The gateway receives it over TCP and queues it.The queue entry for command 42 shows gateway receipt.
DisconnectThe link from the gateway to the device is down. The command waits in the queue.Command 42 is still pending at the gateway.
ReconnectThe gateway forwards the queued command. The device checks the expiry and rejects command 42 because its deadline has passed.The device returns an expired result for command 42.
Read backThe operator reads the current setting from the device.The expired result and the prior setting are the evidence for this outcome.

Evidence ledger practice

Choose a greenhouse flow and a rule to test. Use the sample observations to model a late message or a dropped application result on paper. Compare what the sender logs with what the gateway or device does.

FlowChoose a rule to testSample observations
Humidity reportWould the gateway accept a late report or wait for a newer one?The sender logs the report. The gateway logs that it arrived after the freshness limit and records a rejection.
Frost alarmShould the sender retry when the application result is missing or record an unconfirmed outcome?The sender logs the alarm and gets no application result. The receiver logs that it accepted the alarm.
Valve commandIf the application result is missing, should the sender retry or check the valve state first?The sender logs the command and gets no application result. The gateway logs that it queued the command. The device logs that it rejected the command as expired.

Choose the log entry that supports your conclusion. For example, if the same report ID appears twice in the gateway’s receive log and once in its acceptance log, the gateway logged two receipts and one acceptance for that report ID. To conclude that the gateway accepted it only once, first verify that the acceptance log covers every acceptance for that ID during the test.

Use the ledger above to record the rule, who retries (if anyone), what outcome the evidence supports, and when to retest. Change the rule and revise your record with the receiver behavior you expect and the log or state check you would use to test it.

For practice comparing transport observations with application evidence, see Transport by Analogy.

Practitioner Knowledge Check

If you can write the ledger and explain the evidence gap in a mixed gateway path, you can stop here.

3.2 Under the Hood: Streams, Datagrams, Ports, and Boundaries

TCP and UDP present data to an application in different ways. This affects framing, retry, duplicate handling, congestion, and what a trace can prove. Framing marks where a message begins and ends.

Ports Identify Service Expectations, Not Full Semantics

A transport port helps an endpoint deliver traffic to the expected service, but the port number does not prove the application protocol, payload validity, user authorization, or receiver action. A review can use port evidence as part of the record, but it must still identify the actual message, role, and observation point.

TCP Is a Byte Stream

TCP manages a connection, sequence space, acknowledgements, retransmission, congestion control, and ordered delivery to the application. The application gets a stream of bytes, not separate messages. To claim a complete command, file, or frame arrived, show how the application frames it and that the receiver accepted it. A TCP connection alone is not enough.

See it

From TCP Reads to Application Messages · Trace the bytes from the sender through the receiver’s reads and parser.

Open activity →

The animation shows how a later read can finish a buffered message and carry the next one, then follows the receiver’s acceptance checks and shows what happens if the stream ends early.

UDP Is a Datagram Service

UDP keeps message boundaries visible as datagrams and carries minimal transport state. It does not provide transport-managed acknowledgement, retransmission, ordering, duplicate suppression, or congestion control. That makes UDP useful for some constrained and time-sensitive flows, but only when the application or another layer explicitly owns loss, retry, duplicate, stale-message, and receiver behavior. For Internet UDP flows, assign congestion control to the application or another layer as well.

Check yourself. A service sends a command over TCP. What tells the gateway where that command ends? How would the gateway see the same command if it arrived in one UDP datagram?

Answer. With TCP, the application uses its framing rule to find the end of the command in the byte stream. With UDP, the datagram has a visible boundary. In either case, the reviewer still needs receiver evidence to show that the command was valid and accepted.

DTLS Protects UDP Records

DTLS adapts the TLS security model to datagram transport. The review should identify which UDP traffic is protected, which peer identity model is accepted, what record or handshake evidence supports the claim, and which application-security questions remain outside the transport boundary. DTLS protection does not prove that the payload should change device state.

Gateway Paths Create Separate Records

Many IoT systems bridge between constrained networks and cloud services. A gateway may terminate TCP, accept UDP, translate to another protocol, buffer a command, or acknowledge upstream before a downstream device has acted. When this happens, do not force the entire path into one transport conclusion. Write one record per segment and preserve the handoff limit.

Mechanics and Review Failure Modes

Mechanic
What It Can Prove
Evidence to Request
Failure Mode If Overclaimed
TCP connection
A transport connection was established or failed between endpoints.
Connection state, close or reset behavior, timeout, retry, and application framing evidence.
Claiming complete payload handling from a socket-open event.
TCP stream ordering
Bytes are delivered in order to the receiving application within the connection.
Stream framing, complete-message parsing, receiver action, and recovery behavior.
Confusing ordered bytes with valid commands or authorized state changes.
UDP datagram
A bounded datagram was sent or observed at an endpoint or capture point.
Datagram identity, freshness rule, duplicate handling, loss tolerance, and receiver log.
Assuming missing, late, repeated, or reordered datagrams are harmless without evidence.
DTLS record
A UDP path has protected records and an identity model at a security boundary.
Handshake, peer identity, record protection, replay handling, and boundary location.
Treating transport protection as complete application authorization.
Gateway handoff
One segment reached a gateway or the gateway created a downstream segment.
Upstream receipt, downstream delivery, buffering behavior, acknowledgement point, and owner.
Letting a gateway acknowledgement stand in for device-side acceptance.

Under-the-Hood Knowledge Check

If you can separate transport-boundary evidence from application acceptance evidence, you can review the rest of the transport module without turning protocol names into claims they cannot support.

3.3 Summary

Review one flow at a time. Name the message, endpoint roles, port or service, and transport behavior. Record who owns reliability, where security applies, what the receiver shows, and what would trigger a retest. TCP, UDP, and DTLS answer different questions.

TCP can support claims about a stream and connection. UDP can support claims about datagrams and low state. DTLS can support claims about protected UDP records. More evidence is needed to prove that a payload was valid, allowed, or acted on.

3.4 Key Takeaway

A transport decision is only as strong as its flow record. Name the message, roles, behavior, evidence, limit, and retest trigger before accepting TCP, UDP, DTLS, or a gateway split.

3.5 See Also

Hi, I’m Packet Pete. What do you need?

Find help

Let’s find what you need

Find a lesson or return to your module guide.

Give feedback

Help improve this chapter

Tell us what helped or what needs fixing.

Tips

Try a small next step

A few ways to get more from this chapter.

Ask AI

Continue the conversation

Take the conversation further with your preferred assistant.

AI help is available in supported modules when enabled in Settings.

No live person answers on independent study. Feedback does not promise a personal reply.

For welfare or safety concerns, follow your school’s procedures outside IoTClass.