16 CoAP Advanced Features
16.1 Start With the Almost-Too-Large Update
Prove the Update Through a Broken Link
Picture a street sensor that needs a software fix over a weak radio link. The update is too large for one message, and the device may sleep before every part arrives. A safe release needs a clear final result, not a pile of successful sends.
A protocol means shared rules for an exchange. Constrained Application Protocol (CoAP) means a compact request method for small devices. User Datagram Protocol (UDP) means sending separate messages without a lasting connection. Transmission Control Protocol (TCP) means a stream that checks order and delivery. Transport layer security means protection for a network exchange. Datagram Transport Layer Security (DTLS) applies it to separate messages. Firmware means software stored on a device. An over-the-air update means replacing that software through the network; it is called OTA.
Start an update, lose one block, repeat another, delay the last block, and restart the device. It must keep the old safe version or accept one complete new version. The service must show which outcome occurred.
This runway does not choose block sizes or prove the radio budget. The deeper features show observation, block transfer, discovery, protection, and the tests that turn them into a release path.
A street-light controller can use basic CoAP for a temperature reading, but firmware chunks, resource discovery, proxies, multicast, and alternate transports all appear as soon as the deployment grows. The advanced features are not extras for their own sake; each one solves a constraint that a plain request-response exchange cannot handle alone.
Use this chapter as a set of escalation stories: when the payload is too large, split it; when devices must be found, discover them; when values are reused, cache them; when topology changes, consider proxies or transport alternatives.
First, use Block1 and Block2 for payloads that do not fit one datagram. Then use /.well-known/core instead of hard-coded resources. Next, decide when UDP, TCP, WebSockets, or DTLS changes the design. Finally, pressure-test NAT, timeout, proxy, and OTA evidence. Checkpoints summarize each layer; Deep-dive sections are optional.
16.2 Learning Objectives
By the end of this chapter, you will be able to:
- Implement Block-wise Transfer: Apply RFC 7959 to handle large payloads (firmware updates) over CoAP’s UDP transport
- Configure Resource Discovery: Construct
.well-known/coreendpoints with CoRE Link Format attributes - Evaluate CoAP Transport Options: Select between UDP, TCP, and WebSockets based on network constraints and device requirements
- Analyze DTLS Security Overhead: Calculate handshake RTT costs and justify security mode selection for constrained deployments
- Diagnose Block Transfer Failures: Distinguish between timeout cascade, packet loss, and NAT expiry failure modes
Read these points as one connected sequence: start with CoAP: Constrained Application Protocol — REST-style request/response protocol using UDP instead of TCP; then Confirmable Message (CON): Requires ACK from recipient — provides reliable delivery over UDP at the cost of one roundtrip; then Non-confirmable Message (NON): Fire-and-forget UDP datagram — lowest latency, no delivery guarantee; then Observe Option: CoAP extension enabling publish/subscribe: client registers to receive notifications on resource changes; then Block-wise Transfer: Fragmentation mechanism for transferring payloads larger than a single CoAP datagram; then Token: Client-generated value matching responses to requests — enables concurrent request/response pairing; and finish with DTLS: Datagram TLS — CoAP’s security layer providing encryption and authentication over UDP.
- CoAP: Constrained Application Protocol — REST-style request/response protocol using UDP instead of TCP
- Confirmable Message (CON): Requires ACK from recipient — provides reliable delivery over UDP at the cost of one roundtrip
- Non-confirmable Message (NON): Fire-and-forget UDP datagram — lowest latency, no delivery guarantee
- Observe Option: CoAP extension enabling publish/subscribe: client registers to receive notifications on resource changes
- Block-wise Transfer: Fragmentation mechanism for transferring payloads larger than a single CoAP datagram
- Token: Client-generated value matching responses to requests — enables concurrent request/response pairing
- DTLS: Datagram TLS — CoAP’s security layer providing encryption and authentication over UDP
16.3 For Beginners: CoAP Advanced Features
Beyond basic request-response messaging, CoAP offers features like resource observation (automatic notifications when data changes), block transfers (sending large data in chunks), and resource discovery (finding what services a device offers). These features make CoAP a powerful, lightweight communication tool for constrained IoT devices.
“I thought CoAP was just simple request-response,” said Temperature Terry. “But it can do way more!”
the microcontroller grinned. “You discovered Observe! Instead of the dashboard asking you for temperature every 10 seconds — which wastes energy — you register once and then automatically send updates whenever the temperature changes. It’s like subscribing to a newsletter instead of checking the mailbox every day.”
“And what about when I need to send a big firmware update?” asked the LED. “That’s Block Transfer!” said Max. “CoAP breaks the big file into small blocks, like cutting a pizza into slices. Each slice gets its own delivery confirmation, so if one slice gets lost, you only resend that one — not the whole pizza.”
the battery was most excited about Resource Discovery: “New devices can ask ‘hey, what services do you offer?’ and get back a list — like a phone directory. So when I join a network, I don’t need to be pre-configured. I just ask around and find out who does what. It’s plug-and-play for IoT!”
16.4 Prerequisites
Before diving into this chapter, you should be familiar with:
- CoAP Introduction - CoAP basics and design goals
- CoAP Message Format - Header structure and options
- CoAP Observe Extension - Server push notifications
Before choosing an extension, use Figure 16.1 to separate the three problems that advanced CoAP features solve: repeated updates, payloads too large for one datagram, and one-to-many operations.
Read Figure 16.1 from left to right. Observe replaces repeated polling with change-driven notifications; block-wise transfer divides a large representation into bounded pieces; multicast sends one request towards a group. These are independent extensions, so a design should select the branch that matches its traffic problem rather than treating “advanced CoAP” as one feature bundle. The chapter now follows those branches in that order.
16.5 Continue: CoAP Block Transfer and Discovery Contracts
The main chapter below stays focused on the advanced-feature tour. For the deeper contract behind Block1 and Block2 sizing, NUM/M/SZX encoding, retry and resume evidence, CoRE Link Format discovery, Max-Age, ETag revalidation, and proxy caching, continue to CoAP Block Transfer and Discovery Contracts.
16.6 Block-wise Transfer (RFC 7959)
The first problem is size. CoAP exchanges are intentionally small, so firmware images and log uploads need reviewable pieces.
Core Concept: CoAP messages are limited by UDP MTU (1280-1500 bytes), but firmware updates or images require 100KB+ payloads. Block-wise transfer splits large payloads into sequential blocks with automatic reassembly.
Why It Matters: Without block transfer, CoAP couldn’t handle firmware OTA updates, large configuration files, or image uploads - essential for production IoT deployments.
Key Takeaway: Use Block2 for large response payloads (downloads), Block1 for large request payloads (uploads). Each block includes block number, more-flag, and size.
16.6.1 Block2: Large Response Payloads
A large server response, such as a firmware image, cannot safely be treated as one oversized datagram. Use Figure 16.2 to see which state must survive while the client assembles that representation piece by piece.
Trace Figure 16.2 from each request’s NUM, M, and SZX fields through token, ETag, and content-format continuity. A retry may repeat a block and reordering may change arrival order, so the receiver must append each block exactly once and accept the result only after final length and hash checks. That evidence contract turns the option fields below into a reliable reconstruction procedure.
Block2 option format:
- NUM: Block number (0-based sequence)
- M: More flag (1 = more blocks follow, 0 = last block)
- SIZE: Block size in bytes (16, 32, 64, 128, 256, 512, 1024)
16.6.2 Block1: Large Request Payloads
Used when client sends large data to server (e.g., uploading logs):
Client -> Server: PUT /logs/daily
Block1: NUM=0, M=1, SIZE=512
Payload: [first 512 bytes]
Server -> Client: 2.31 Continue
Block1: NUM=0, M=1, SIZE=512
Client -> Server: PUT /logs/daily
Block1: NUM=1, M=1, SIZE=512
Payload: [next 512 bytes]
... until final block with M=0 ...
Server -> Client: 2.04 Changed
16.6.3 Implementation with Reliability
async def download_firmware(uri, output_file):
block_num = 0
block_size = 1024
consecutive_failures = 0
with open(output_file, 'wb') as f:
while True:
# Adaptive timeout with exponential backoff
timeout = min(2.0 * (1.5 ** consecutive_failures), 30.0)
try:
request = Message(
code=GET,
uri=uri,
msg_type=CON, # Reliable for each block
block2=(block_num, False, block_size)
)
response = await protocol.request(request, timeout=timeout).response
# Write block to file
f.write(response.payload)
consecutive_failures = 0
# Check if more blocks available
if response.opt.block2.more:
block_num += 1
else:
break # Last block received
except TimeoutError:
consecutive_failures += 1
if consecutive_failures > 10:
raise TransferFailed(f"Failed at block {block_num}")
print(f"Downloaded {block_num + 1} blocks")
16.6.4 Performance Analysis
Scenario: 256 kB firmware update over LoRaWAN (10% packet loss)
| Approach | Blocks | Retransmissions | Time | Success Rate |
|---|---|---|---|---|
| Single 256KB payload | 1 | Many | 146s | ~0% |
| 1KB blocks (NON) | 256 | 0 | 51s | ~0% |
| 1KB blocks + CON | 256 | Avg 1.11/block | 57s | ~99.99% |
| 512 byte blocks + CON | 512 | Avg 1.11/block | 114s | ~99.999% |
The success rate for block-wise transfer can be calculated using probability theory. With packet loss rate , the probability of successful delivery for blocks is:
For 1KB blocks (256 blocks total) without confirmations (NON):
For 1KB blocks with CON (each block confirmed), the expected number of transmissions per block is:
Total time for 256 blocks at 200 ms per confirmed block:
For 512-byte blocks (512 blocks total), the per-block success probability is the same ( per individual block), requiring the same expected retransmissions per block ( attempts). However, the overall transfer success is higher because each individual lost block wastes only 512 bytes instead of 1024 bytes. Total transfer time at 200 ms RTT: seconds.
Key insight: Smaller blocks = higher success rate on lossy links, but more overhead.
Checkpoint: Block-wise Transfer
You now know:
- Block2 handles large responses; Block1 handles large requests.
- The block option carries NUM, M, and a block size such as 512 or 1024 bytes.
- In the 256 KiB, 10% packet-loss example, 1 KiB confirmed blocks take about 57 seconds and 512 byte blocks take about 114 seconds.
Try It: Adjust the firmware size, block size, packet loss rate, and round-trip time to see how they affect transfer time and reliability. Notice how smaller blocks improve success rate at the cost of more overhead.
Key Principle: Block size should balance MTU constraints (avoid IP fragmentation), packet loss recovery (smaller blocks waste less bandwidth on retry), and overhead (fewer blocks = less header overhead).
16.7 Resource Discovery (RFC 6690)
Once payloads can move safely, the next question is how a client knows which resources exist. Discovery replaces guessed URIs with an inventory.
Core Concept: Every CoAP server exposes a standardized /.well-known/core endpoint that returns a machine-readable list of all available resources with their URIs, types, interfaces, and capabilities in Link Format (RFC 6690).
Why It Matters: Resource discovery enables true plug-and-play IoT - new devices can be added to a network and automatically discovered by clients without manual configuration.
Key Takeaway: Always implement /.well-known/core with semantic attributes (rt= for resource type, if= for interface, obs for observability).
16.7.1 Discovery Request-Response
Client Request:
GET coap://sensor.local/.well-known/core
Server Response (Link Format, Content-Format: 40):
</sensors/temp>;rt="temperature";if="sensor";obs,
</sensors/humidity>;rt="humidity";if="sensor";obs,
</sensors/pressure>;rt="pressure";if="sensor",
</actuators/led>;rt="light";if="actuator",
</config/interval>;rt="config";if="parameter"
16.7.2 Link Format Attributes
| Attribute | Meaning | Example |
|---|---|---|
| rt | Resource Type | rt="temperature" |
| if | Interface | if="sensor" |
| ct | Content Format | ct=50 (JSON) |
| sz | Max Size | sz=256 |
| obs | Observable | obs (flag) |
| title | Human Name | title="Room Temp" |
16.7.3 Filtered Discovery
Request only specific resource types:
# Find all temperature sensors
GET coap://sensor.local/.well-known/core?rt=temperature
Response:
</sensors/temp>;rt="temperature";if="sensor";obs,
</sensors/temp_outdoor>;rt="temperature";if="sensor";obs
# Find all observable resources
GET coap://sensor.local/.well-known/core?obs
16.7.4 Multicast Discovery
Multicast discovery asks every eligible node the same resource question without sending one request per address. Send a NON GET to the link-local CoAP multicast group and /.well-known/core; each server then returns its own unicast response after a randomized Leisure delay. NON avoids an acknowledgment storm, while the delayed unicast replies reduce collisions and let the client associate each discovery record with one endpoint. The result is efficient inventory evidence, not reliable group command delivery.
GET coap://[FF02::FD]/.well-known/core
# All CoAP devices respond with their resource list
Device 1: </temp>;rt="temperature"
Device 2: </humidity>;rt="humidity"
Device 3: </pressure>;rt="pressure"
Checkpoint: Discovery Contracts
You now know:
/.well-known/corereturns CoRE Link Format instead of guessed paths.rt,if,ct,sz,obs, andtitledescribe resources and behavior.- Multicast discovery can query
coap://[FF02::FD]/.well-known/core, but the client still initiates the request.
16.8 CoAP over TCP (RFC 8323)
16.8.1 Why CoAP-over-TCP?
Problem: UDP works great for constrained devices, but some networks:
- Block UDP entirely (corporate firewalls)
- Have asymmetric NAT breaking UDP return paths
- Require guaranteed ordering (financial transactions)
Solution: RFC 8323 defines CoAP over reliable transports (TCP, TLS, WebSockets).
16.8.2 Protocol Differences
| Feature | CoAP/UDP | CoAP/TCP |
|---|---|---|
| Transport | Unreliable UDP | Reliable TCP |
| Message Types | CON, NON, ACK, RST | Signaling only |
| Reliability | Application (CON/ACK) | Transport (TCP) |
| Message ID | Required | Optional |
| Connection | None | TCP 3-way handshake |
| Default Port | 5683 (coap://) | 5683 (coap+tcp://) |
| Secure Port | 5684 (coaps://) | 443 (coaps+tcp://) |
16.8.3 Header Format Changes
CoAP/UDP header (4 bytes):
|Ver| T | TKL | Code | Message ID |
CoAP/TCP header (2-4 bytes):
| Len | TKL | Code | Token |
Key changes: Read these points as one connected sequence: start with No Message ID (TCP sequence numbers handle ordering); then No Type field (TCP reliability eliminates CON/NON/ACK); and finish with Length field (for framing over stream).
- No Message ID (TCP sequence numbers handle ordering)
- No Type field (TCP reliability eliminates CON/NON/ACK)
- Length field (for framing over stream)
Decision Framework: Select your network constraints, requirements, and device characteristics to see which CoAP transport is recommended for your use case.
16.8.4 When to Use
Use CoAP/TCP when:
Read these points as one connected sequence: start with Corporate/enterprise networks block UDP; then Web dashboard integration (WebSockets); then Guaranteed ordering requirements; and finish with Long-lived bidirectional streams.
- Corporate/enterprise networks block UDP
- Web dashboard integration (WebSockets)
- Guaranteed ordering requirements
- Long-lived bidirectional streams
Avoid CoAP/TCP when:
Read these points as one connected sequence: start with Battery-powered sensors (UDP more efficient); then Multicast scenarios (TCP is unicast only); and finish with Intermittent communication (connection overhead wasteful).
- Battery-powered sensors (UDP more efficient)
- Multicast scenarios (TCP is unicast only)
- Intermittent communication (connection overhead wasteful)
16.9 DTLS Security
Transport and security choices are connected. TCP can solve firewall or NAT pressure; DTLS keeps UDP deployments encrypted.
CoAP uses DTLS (Datagram TLS) for security over UDP:
16.9.1 Security Modes
| Mode | Description | Use Case |
|---|---|---|
| NoSec | No security | Development only |
| PreSharedKey | Symmetric keys pre-installed | Factory provisioning |
| RawPublicKey | Asymmetric without certificates | Lightweight devices |
| Certificate | Full X.509 certificates | Enterprise deployments |
16.9.2 DTLS Handshake
Securing a datagram transport requires a handshake that can tolerate loss without letting an unauthenticated sender consume unlimited server state. Figure 16.3 shows where the DTLS cookie challenge fits before keys protect application traffic.
Follow Figure 16.3 downward. The first ClientHello prompts a stateless cookie challenge; the client proves return reachability by repeating ClientHello with that cookie. Only then do the server parameters, certificate and key exchange, and Finished messages establish the protected session. Encrypted application data starts after this exchange, which explains the setup cost explored by the calculator next.
Key Insight: DTLS 1.2 full handshake requires approximately 4 round-trips including the DTLS cookie exchange (vs 1-2 for session resumption). The interactive calculator above uses 6 as a conservative estimate counting each message flight. For battery-powered devices with frequent reconnections, session resumption can reduce security overhead by 50-75% while maintaining encryption.
Checkpoint: Transport and Security
You now know:
- CoAP/UDP uses CON, NON, ACK, RST, and Message IDs; CoAP/TCP removes those message types.
- CoAP/TCP helps when UDP is blocked, strict ordering is required, or WebSocket integration matters; avoid it for multicast and many battery sensors.
- DTLS modes run from NoSec through PreSharedKey, RawPublicKey, and Certificate; the chapter models 6 RTTs for a full handshake and 2 RTTs for session resumption.
16.10 Common Pitfalls
The Mistake: Using default CoAP timeout values for block-wise transfers, causing transfer failures at 60-80% completion on lossy links.
Why It Happens: CoAP’s 2-second ACK timeout works for single messages but fails for multi-block transfers. Any single timeout can cause restart.
The Fix: Implement adaptive timeouts and resumable transfers:
def download_with_resume(uri, resume_from=0):
block_num = resume_from
consecutive_failures = 0
base_timeout = 2.0
while True:
timeout = min(base_timeout * (1.5 ** consecutive_failures), 30.0)
try:
response = coap_get(uri, block2=(block_num, 0, 1024), timeout=timeout)
save_progress(block_num, response.payload)
consecutive_failures = 0
if response.block2.more:
block_num += 1
else:
return assemble_firmware()
except TimeoutError:
consecutive_failures += 1
if consecutive_failures > 10:
save_resume_point(block_num)
raise TransferSuspended(block_num)
The Mistake: Deploying CoAP devices behind NAT gateways without considering that UDP NAT mappings expire quickly (30-120 seconds).
The Fix:
Read these points as one connected sequence: start with Test UDP connectivity before design; then Implement NAT keepalive (send messages every 25 seconds); then Consider CoAP over TCP for NAT-hostile networks; and finish with Use DTLS session resumption for faster reconnects.
- Test UDP connectivity before design
- Implement NAT keepalive (send messages every 25 seconds)
- Consider CoAP over TCP for NAT-hostile networks
- Use DTLS session resumption for faster reconnects
16.11 Worked Example: OTA Firmware Update for 500 Street Lights
The pieces now meet one operational question: can block transfer, frame limits, packet loss, and gateway parallelism finish inside a fixed maintenance window?
Scenario: A city council needs to push a 128 kB firmware update to 500 CoAP-enabled LED street lights over a LoRaWAN network. Each light has a Semtech SX1276 radio module with a 242-byte maximum application payload per LoRaWAN uplink/downlink. The network experiences 8% average packet loss. The council wants to complete the rollout within a single maintenance window (4 AM to 6 AM, 2 hours).
Step 1: Calculate block count and transfer time per device
Firmware size: 128 KB = 131,072 bytes
Block size: 128 bytes (leaving room for CoAP headers within 242-byte limit)
CoAP header + Block2 option: ~12 bytes
Total per-message payload: 128 + 12 = 140 bytes (fits in 242-byte LoRaWAN frame)
Block count: 131,072 / 128 = 1,024 blocks per device
Each block requires a CON request (device requests block) and a 2.05 Content response (server sends block). On LoRaWAN Class C (continuous receive), the round-trip is approximately 1-2 seconds per block:
Optimistic transfer time: 1,024 blocks x 1.5 seconds = 1,536 seconds = 25.6 minutes
With 8% packet loss and 1 retry per loss:
Expected retransmissions: 1,024 x 0.08 = ~82 extra blocks
Adjusted time: (1,024 + 82) x 1.5 = 1,659 seconds = 27.7 minutes per device
Step 2: Assess parallelism constraints
LoRaWAN gateways can handle approximately 8 simultaneous downlinks on different channels (EU868 has 8 channels). Each device update occupies one channel for ~28 minutes:
Devices per gateway: 8 parallel streams
Time per batch: 28 minutes
Batches needed: 500 / 8 = 62.5 -> 63 batches
Total time with 1 gateway: 63 x 28 = 1,764 minutes = 29.4 hours
This far exceeds the 2-hour window. The council needs more gateways:
Available time: 120 minutes
Batches possible per gateway: 120 / 28 = 4.3 -> 4 batches
Devices per gateway: 4 batches x 8 channels = 32 devices
Gateways needed: 500 / 32 = 15.6 -> 16 gateways
Step 3: Design the update strategy with CoAP Block-wise features
| Design Decision | Choice | Rationale |
|---|---|---|
| Block size | 128 bytes | Fits LoRaWAN frame with CoAP headers |
| Message type | CON | Must guarantee delivery for firmware integrity |
| Resume support | Yes (save block_num to flash) | Device can resume after power cycle or temporary failure |
| Integrity check | SHA-256 hash verified after final block | Corrupted firmware bricks the light |
| Rollback plan | Keep previous firmware in secondary flash partition | Failed update reverts automatically |
Step 4: Cost analysis
Option A: Sequential update (1 gateway, no parallelism)
Time: 500 devices x 28 min = 14,000 minutes = 9.7 days
Gateway cost: 1 x $1,500 = $1,500
Labor: 0 (unattended)
Risk: Very slow, devices run outdated firmware for days
Option B: Parallel update (16 gateways, 2-hour window)
Time: 2 hours (single maintenance window)
Gateway cost: 16 x $1,500 = $24,000 (but gateways serve normal traffic too)
Labor: 1 technician x 2 hours = $100
Risk: Low, all devices updated simultaneously
Option C: Incremental rollout (4 gateways, 4 nights)
Time: 4 maintenance windows x 2 hours = 8 hours total
Gateway cost: 4 x $1,500 = $6,000
Devices per night: 128
Risk: Medium -- staged rollout catches firmware bugs before full deployment
Recommendation: Option C (incremental rollout). While slower overall, updating 128 devices on night 1 provides a live validation of the firmware. If the update causes issues (dimming failures, communication bugs), only 25% of lights are affected. The city saves $18,000 on gateways compared to Option B and gains the safety net of staged deployment. CoAP’s Block-wise resume capability means any interrupted transfers pick up where they left off the next night.
Checkpoint: OTA Rollout Evidence
You now know:
- The 128 kB firmware image becomes 1,024 blocks at 128 bytes each.
- One gateway cannot finish 500 lights in 2 hours: 63 batches at 28 minutes is about 29.4 hours.
- The accepted design is not just faster transfer; it needs resume state, SHA-256 verification, rollback, staged rollout, and gateway capacity evidence.
Match each CoAP advanced feature concept to its correct definition or use case.
Bridge a constrained observation into enterprise work without merging protocol guarantees in the diagram Figure 16.4.
In the diagram Figure 16.4, discover and cache at the edge uses CoAP discovery and Max-Age, while Route through the broker uses an AMQP exchange, binding, and durable queue. Acknowledge the chosen guarantee then distinguishes at-most-once loss from at-least-once duplication.
16.12 Summary
CoAP’s advanced features enable production IoT deployments:
Read these points as one connected sequence: start with Block-wise transfer: Split large payloads into reliable blocks; then Resource discovery: Standardized .well-known/core with Link Format; then CoAP/TCP: Firewall-friendly alternative when UDP is blocked; and finish with DTLS security: Encryption and authentication for constrained devices.
- Block-wise transfer: Split large payloads into reliable blocks
- Resource discovery: Standardized
.well-known/corewith Link Format - CoAP/TCP: Firewall-friendly alternative when UDP is blocked
- DTLS security: Encryption and authentication for constrained devices
Key decisions:
Read these points as one connected sequence: start with Use smaller blocks (256-512 bytes) on lossy networks; then Always implement resource discovery with semantic attributes; then Choose UDP for battery efficiency, TCP for NAT/firewall traversal; and finish with Use PSK for constrained devices, certificates for enterprise.
- Use smaller blocks (256-512 bytes) on lossy networks
- Always implement resource discovery with semantic attributes
- Choose UDP for battery efficiency, TCP for NAT/firewall traversal
- Use PSK for constrained devices, certificates for enterprise
16.13 Concept Relationships
Advanced CoAP features connect to:
Foundation Concepts:
Read these points as one connected sequence: start with CoAP Message Format - Options and payload marker used in block transfer; then CoAP Observe Extension - Related push notification pattern; and finish with CoAP Fundamentals - Basic architecture that advanced features extend.
- CoAP Message Format - Options and payload marker used in block transfer
- CoAP Observe Extension - Related push notification pattern
- CoAP Fundamentals - Basic architecture that advanced features extend
Practical Applications:
Read these points as one connected sequence: start with OTA Firmware Updates - Block-wise transfer for production updates; then 6LoWPAN Integration - CoAP over constrained networks; and finish with Thread Networking - CoAP as application layer.
- OTA Firmware Updates - Block-wise transfer for production updates
- 6LoWPAN Integration - CoAP over constrained networks
- Thread Networking - CoAP as application layer
Security:
Read these points as one connected sequence: start with DTLS for IoT - Securing CoAP communications; and finish with CoAP Security Modes - NoSec, PSK, certificates.
- DTLS for IoT - Securing CoAP communications
- CoAP Security Modes - NoSec, PSK, certificates
16.14 See Also
Standards:
Read these points as one connected sequence: start with RFC 7959: Block-Wise Transfer - Official specification; then RFC 6690: CoRE Link Format - Resource discovery; and finish with RFC 8323: CoAP over TCP - Firewall-friendly alternative.
- RFC 7959: Block-Wise Transfer - Official specification
- RFC 6690: CoRE Link Format - Resource discovery
- RFC 8323: CoAP over TCP - Firewall-friendly alternative
Implementation:
Read these points as one connected sequence: start with CoAP Block Transfer and Discovery Contracts - Deep block option, retry, discovery, cache, ETag, and proxy evidence; then CoAP Advanced Features Lab - Hands-on ESP32 implementation; and finish with aiocoap Examples - Python code samples.
- CoAP Block Transfer and Discovery Contracts - Deep block option, retry, discovery, cache, ETag, and proxy evidence.
- CoAP Advanced Features Lab - Hands-on ESP32 implementation
- aiocoap Examples - Python code samples
Comparison:
Read these points as one connected sequence: start with CoAP vs HTTP - When to use CoAP over HTTP; and finish with Block Transfer vs HTTP Chunking - Design rationale.
- CoAP vs HTTP - When to use CoAP over HTTP
- Block Transfer vs HTTP Chunking - Design rationale
16.15 What’s Next
| Chapter | Focus | Why Read It |
|---|---|---|
| CoAP Block Transfer and Discovery Contracts | Block option encoding, per-block retries, discovery metadata, and proxy cache evidence | Turn the feature overview into a reviewable implementation contract |
| CoAP API Design | RESTful resource modeling and URI design | Apply the resource discovery patterns from this chapter to design well-structured CoAP APIs |
| CoAP Decision Framework | When to use CoAP vs MQTT vs HTTP | Evaluate trade-offs using the transport and security knowledge built here |
| CoAP Fundamentals and Architecture | Core CoAP message model and architecture | Reinforce the foundation that all advanced features extend |
| OTA Firmware Updates | Production firmware update workflows | See Block-wise Transfer applied end-to-end in a real OTA update pipeline |
| DTLS and Security | DTLS handshake mechanics and cipher suites | Deepen understanding of the security modes introduced in this chapter |
| 6LoWPAN Overview | IPv6 adaptation for constrained networks | Understand the network layer that CoAP block transfer and discovery operate over |
