Skip to content

Message Framing

Spicy — senior dev territoryNetworking

ELI5 — The Vibe Check

Message Framing is how you tell where one message ends and the next begins in a stream of bytes. TCP gives you a stream, not messages. You need framing — length prefixes, delimiters, or fixed-size headers — to chop that stream into meaningful chunks. Without it, your messages are just alphabet soup.

Real Talk

Message framing defines boundaries between discrete messages in a byte stream (TCP). Common approaches: length-prefixed (4-byte header with message size), delimiter-based (newline or null byte), and fixed-length. HTTP uses Content-Length and chunked transfer encoding. WebSocket and HTTP/2 have built-in framing.

When You'll Hear This

"We use length-prefixed framing — 4 bytes for the message size, then the message body." / "HTTP/2 frames have a 9-byte header that includes the stream ID and frame length."

Made with passive-aggressive love by manoga.digital. Powered by Claude.