binary protocol
A network or file format that encodes messages as raw bytes at fixed positions instead of readable text.
In more detail
Binary formats are compact and fast to parse, but both sides must agree exactly on field sizes, positions and byte order. Examples include the HTTP/2 framing layer and the WebSocket frame format.
Related terms
- endianness — The order in which the bytes of a multi-byte number are stored: most significant first (big-endian) or least significant first (little-endian).
- DataView — A JavaScript object for reading and writing numbers of different sizes at any position in an ArrayBuffer, with the byte order chosen on every call.
- framing — The rule that marks where one message or record ends and the next begins in a stream of bytes.
- magic number — A fixed value, placed at the start of a file or message or built into a protocol, that lets a reader recognise the format.
Taught in
- Binary Data Manipulation: TypedArrays & Endianness — Node.js Internals & Backend Services
- Transform Streams: Custom Packet Decoding & Codecs — Node.js Internals & Backend Services
- Native HTTP/2 Protocols: Multiplexed Streams & Push — Node.js Internals & Backend Services