Network byte order
Also called: big-endian, endianness, byte order
Network byte order commonly means representing a multi-byte integer with its most significant byte first, also called big-endian order. Agreeing on byte order lets machines with different internal representations interpret the same wire value. A protocol’s specification still decides its encoding; not every binary protocol uses this convention.
For example, the 32-bit hexadecimal value 0x01020304 is transmitted as the byte sequence 01 02 03 04 in big-endian order. Reading those bytes as little-endian would produce a different value. Byte order describes the arrangement of whole bytes, not the electrical order of bits on a cable. Libraries commonly provide conversion or packing operations for this boundary.
- Read first
- Serialization
- Related
- Protocol Buffers, Encapsulation
- Further reading
- IETF RFC 4506 — XDR: External Data Representation Standard