Application Protocols · Study deck

Modern HTTP: Implementation and Deployment

Inspect the HTTP/1.1, HTTP/2, and HTTP/3 preserve HTTP application semantics while changing framing, transport, and loss boundaries underneath diagram to find the layer where each HTTP version changes how concurrent work reacts to delay or packet loss.

Broker Bex is your guide for this deck.

httpmodern
Broker Bex, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • configure modern HTTP connection and gateway settings
  • validate library, memory, and server support for the selected protocol
  • plan a staged deployment with explicit trade-offs and recovery checks
  • Explain: HTTP/2 multiplexes streams over one TLS-protected TCP connection and benefits from mature deployment paths, but a lost TCP segment can delay every stream behind that byte gap.
iotclass.org

Major section

Real-World Tradeoffs

HTTP/2 multiplexes streams over one TLS-protected TCP connection and benefits from mature deployment paths, but a lost TCP segment can delay every stream behind that byte gap.

  • HTTP/3 moves HTTP semantics onto QUIC, where streams recover independently and the connection can survive an address change, at the cost of a larger and sometimes less widely permitted stack.
HTTP/2 vs HTTP/3 Tradeoff Analysis for IoT
HTTP/2 vs HTTP/3 Tradeoff Analysis for IoT
iotclass.org

Major section

Deep Dive: One Connection, Many Streams, No Head-of-Line Block

HTTP/1.1, HTTP/2, and HTTP/3 can be read as three attempts to reduce head-of-line blocking.

  • The remaining problem is underneath HTTP/2: TCP delivers bytes in strict order, so one lost segment stalls every HTTP/2 stream until retransmission.
  • HTTP/3 moves to QUIC over UDP, where streams are independent and a lost packet stalls only the affected stream.
  • HPACK is the HTTP/2 header-compression mechanism behind much of the gateway benefit.
  • A gateway posting readings sends almost identical headers every request: host, authorization, user-agent, and content-type.
HTTP/1.1, HTTP/2, and HTTP/3 preserve HTTP application semantics while changing framing, transport, and loss boundaries underneath.
HTTP/1.1, HTTP/2, and HTTP/3 preserve HTTP application semantics while changing framing, transport, and loss boundaries underneath.
iotclass.org

Major section

Deep Dive: One Connection, Many Streams, No Head-of-Line Block (continued)

HPACK uses a static table for common fields and a per-connection dynamic table for repeated values.

  • The first request sends literal values and inserts them into the dynamic table; later requests reference those fields by index, often shrinking hundreds of header bytes to a few bytes.
  • Short idle timeouts erase that dynamic table, so session reuse and header compression must be tuned together.
  • QPACK keeps the same goal, compact repeated header fields, but avoids letting one blocked header reference stall unrelated streams.
  • HTTP/3 uses QPACK rather than HPACK because QUIC streams can arrive out of order.
iotclass.org

Major section

Deep Dive: One Connection, Many Streams, No Head-of-Line Block (continued)

That distinction matters when telemetry, commands, and firmware chunks share one connection on a lossy link.

  • The connection identity is a QUIC Connection ID, not the client's current IP address and port.
  • QUIC does per-packet crypto in user space, uses more memory than HTTP/2, and depends on UDP being allowed end to end.
  • On a stable managed Ethernet or Wi-Fi link, HTTP/2 can be the pragmatic choice.
iotclass.org

Major section

What You Learned

Single TCP connection reduces TLS handshake overhead for persistent connections.

  • HTTP/2 Benefits: A gateway can send many requests on one link.
  • Multiplexing lets concurrent gateway requests share a TCP connection; the 50× figure applies only to the chapter’s sequential baseline.
  • 0-RTT resumption: eligible resumed requests can avoid setup waiting; total device power savings require measurement.

Why it matters

HPACK compression reduces repeated-header overhead in chatty IoT applications; the percentage depends on the header mix.

iotclass.org

Major section

What You Learned (continued)

HPACK compression reduces repeated-header overhead in chatty IoT applications; the percentage depends on the header mix.

  • Client-requested streaming or normal downloads can deliver firmware; HTTP/2 server push is optional and is not a reliable deployment assumption.
  • Independent streams: No cross-stream transport head-of-line blocking; shared congestion can still slow others.
  • Connection-level congestion control: QUIC streams share connection capacity; test mixed telemetry and firmware traffic.
iotclass.org

Major section

For Instructors: Teaching Suggestions

HTTP/2 Multiplexing Demo: Use curl --http2 with timing to compare 10 sequential vs. Parallel requests.

  • "HTTP/3 is always faster": Not true; on stable networks with low loss, HTTP/2 performs similarly.
  • "HTTP/2 needs multiple connections": The whole point is single connection with multiplexing.
  • "Modern HTTP works on any device": Memory constraints often make it impractical for constrained sensors.
iotclass.org

Major section

Concept Relationships

Related Technologies: TLS and CDN behavior affect delivery; the mobile case shows when HTTP/3 resumption changes setup waiting.

  • Prerequisites You Should Know: Handshake costs motivate connection reuse; compare the TCP and UDP paths before applying them to gateways and mobile devices.
  • TCP three-way handshake and why it adds latency.
  • Gateway design where a reusable connection carries concurrent requests.

Why it matters

What This Enables: Gateway reuse and mobile resumption solve different setup costs, so test each against the network scenario.

iotclass.org

Deck summary

Key takeaways

HTTP/2 multiplexes streams over one TLS-protected TCP connection and benefits from mature deployment paths, but a lost TCP segment can delay every stream behind that byte gap.

  • HTTP/1.1, HTTP/2, and HTTP/3 can be read as three attempts to reduce head-of-line blocking.
  • HPACK uses a static table for common fields and a per-connection dynamic table for repeated values.
  • That distinction matters when telemetry, commands, and firmware chunks share one connection on a lossy link.
  • Single TCP connection reduces TLS handshake overhead for persistent connections.
iotclass.org

Retrieval practice

Recall check 1 of 6

Broker Bex says: answer from memory, then check your reasoning.

Q1Complete the HTTP POST request to send sensor data and check specifically for HTTP 201 Created:

Aresponse = requests.post('https://api.example.com/sensors', json=sensor_data)
Bresponse = requests.send('https://api.example.com/sensors', data=sensor_data)
Cresponse = http.post('https://api.example.com/sensors', body=sensor_data)
Dresponse = requests.publish('https://api.example.com/sensors', json=sensor_data)
Show answer

Answer: A requests.post() with json= parameter automatically serializes and sets Content-Type. HTTP 201 (Created) is the standard response for successful resource creation, while 200 indicates general success.

iotclass.org

Retrieval practice

Recall check 2 of 6

Broker Bex says: answer from memory, then check your reasoning.

Q2A protocol looks fast in a lab. What must the team verify before approving it on a constrained device fleet?

AA reference gateway running the protocol with its standard client library
BTarget-device library, memory budget, and server support
CBrowser load-test results at the fleet's planned request rate
DSensor traffic staying below the protocol's published throughput limit
Show answer

Answer: B The selection only works if the actual client and server can support it.

iotclass.org

Retrieval practice

Recall check 3 of 6

Broker Bex says: answer from memory, then check your reasoning.

Q3Per this chapter's Common Pitfalls, why is HTTP/3's 0-RTT resumption risky for actuator commands but acceptable for sensor readings?

A0-RTT can be replayed: idempotent readings tolerate replay, but actuator commands need 1-RTT or replay protection.
B0-RTT accepts only GET requests, so actuator commands require HTTP/1.1 rather than HTTP/3 resumption.
C0-RTT encrypts data with a weaker cipher, so actuator commands need the stronger 1-RTT encryption mode.
D0-RTT packets cannot fit actuator commands, while small sensor readings fit in the first QUIC packet.
Show answer

Answer: A see answers page

iotclass.org

Retrieval practice

Recall check 4 of 6

Broker Bex says: answer from memory, then check your reasoning.

Q4Per this chapter's Common Pitfalls, what's wrong with opening a new HTTP connection for each sensor's POST request in a loop, even under HTTP/2?

AA supposed HTTP/2 rule forbids opening multiple connections to one server, so each POST violates the protocol.
BA double TLS 1.3 renegotiation for each new HTTP/2 connection is the specific cost of every sensor POST.
CAn HTTP/3-only setup overhead makes this pattern inefficient; HTTP/2 multiplexing would work unchanged.
DA new connection per POST prevents HTTP/2 from multiplexing many sensor streams on one shared connection.
Show answer

Answer: D see answers page

iotclass.org

Retrieval practice

Recall check 5 of 6

Broker Bex says: answer from memory, then check your reasoning.

Q5What organises concurrent HTTP exchanges into binary frames and streams beneath message semantics?

AHTTP Semantics (Methods, Headers)
BTLS 1.3 (integrated in QUIC for HTTP/3)
CBinary Framing / Stream Multiplexing
DTCP (HTTP/2) or UDP (HTTP/3 QUIC)
Show answer

Answer: C Binary frames and multiplexed streams organise concurrent exchanges below the semantic message.

iotclass.org

Retrieval practice

Recall check 6 of 6

Broker Bex says: answer from memory, then check your reasoning.

Q6Per this chapter's Deep Dive, why does HTTP/3 use QPACK instead of reusing HTTP/2's HPACK for header compression?

AQPACK handles out-of-order QUIC streams; HPACK assumes ordered headers, so a blocked reference could stall unrelated streams.
BQPACK achieves a claimed 99% reduction while HPACK reaches only 90%, making compression ratio decisive.
CHPACK cannot run over UDP at all, so HTTP/3 requires a wholly different header compression algorithm.
DQPACK serves firmware headers alone; HTTP/3 telemetry streams still use HPACK for their headers.
Show answer

Answer: A see answers page

iotclass.org

Print reference

Answers 1 of 4

Answer key.

  1. A · requests.post() with json= parameter automatically serializes and sets Content-Type. HTTP 201 (Created) is the standard response for successful resource creation, while 200 indicates general success.
  2. B · The selection only works if the actual client and server can support it.
iotclass.org

Print reference

Answers 2 of 4

Answer key.

  1. A · The chapter's pitfall #5 warns that 0-RTT early data can be replayed by an attacker; idempotent requests (a GET, a sensor reading) are safe to receive twice, but non-idempotent requests (a command, an actuator trigger) are not, so those should use 1-RTT or add explicit replay protection.
iotclass.org

Print reference

Answers 3 of 4

Answer key.

  1. D · The chapter's pitfall #3 contrasts opening a new connection per sensor request (which defeats multiplexing) against reusing a single async client so all requests share one multiplexed HTTP/2 connection -- the whole point of multiplexing is a single shared connection, not one per request.
  2. C · Binary frames and multiplexed streams organise concurrent exchanges below the semantic message.
iotclass.org

Print reference

Answers 4 of 4

Answer key.

  1. A · The chapter's Deep Dive explains that QUIC streams can arrive out of order, which would let a single blocked header reference under HPACK stall unrelated streams; QPACK keeps HPACK's compression goal but is designed so that doesn't happen -- a distinction that matters when telemetry, commands, and firmware chunks share one lossy connection.
iotclass.org