In reading the WebSocket protocol standard, I came across the following passage:
The length of the "Payload data", in bytes: if 0-125, that is the payload length. If 126, the following 2 bytes interpreted as a 16-bit unsigned integer are the payload length. If 127, the following 8 bytes interpreted as a 64-bit unsigned integer (the most significant bit MUST be 0) are the payload length. Multibyte length quantities are expressed in network byte order.
I have two questions:
- What is meant by "the most significant bit must be 0"? My understanding is that the 1 is more significant than 0, so the only number whose most significant bit is 0 would be 0 itself. Obviously, this can't be right. What does this actually mean?
- What is meant by "multibyte length quantities are expressed in network byte order"? I'm assuming this is to say that 2-byte and 8-byte payload lengths are expressed in network byte order, but what is network byte order?