Endianness
The term endianness refers to the order in which individual bytes are stored in memory or sent over a network.
Whenever we read a multi-byte number from a DNS message, we should be aware that it's in big-endian format (or so-called network byte order). The computer you're using likely uses little-endian format, although we are careful to write our code in an endian-independent manner throughout this book. We accomplish this by avoiding the conversion of multiple bytes directly to integers, and instead we interpret bytes one at a time.
For example, consider a message with a single 8-bit value, such as 0x05. We know that the value of that message is 5. Bytes are sent atomically over a network link, so we also know that anyone receiving ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access