Ethereal-dev: Re: [Ethereal-dev] different between network-to-host and little-endian-to-host

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Guy Harris" <gharris@xxxxxxxxx>
Date: Mon, 27 Feb 2006 14:13:09 -0800 (PST)
david martinez wrote:
> hi, can anybody tell me what the different between
> ntohs,ntohs,ntohs24 and letohs,letohl.....i use the
> first but i don't understand the different. thanks

It's a difference between two ways of storing multi-byte integral
quantities on byte-addressable machines, and transmitting multi-byte
integral quantities on bit-serial (and thus byte-serial) networks (and on
byte-serial bit-parallel networks, although there aren't many of those).

One way to store them is "big-endian", which is also called "network byte
order" as it's the byte order used in the core Internet protocols (IP,
TCP, UDP, etc.); another way is "little-endian", which is used in some
other network protocols (such as, for example, SMB). (There are some other
rarely-used ways of storing them.)

See

    http://en.wikipedia.org/wiki/Endianness

for a discussion of byte order.