Endianness

Picture writing the number 305,419,896 as 12 34 56 78 or 78 56 34 12. Same number, opposite byte order in memory.

little-endian (x86, ARM64 usual):   78 56 34 12
big-endian    (network order):       12 34 56 78

Almost every CPU you’ll meet is little-endian. Network protocols insist on big-endian, which is why htonl and ntohl exist.