Skip site navigation (1)Skip section navigation (2)
Date:      28 Oct 2001 14:08:40 -0800
From:      swear@blarg.net (Gary W. Swearingen)
To:        Fabio Miranda <fmirand@yahoo.com>
Cc:        freebsd-chat@FreeBSD.ORG
Subject:   Re: offtopic: c questions
Message-ID:  <37d737h0yf.737@localhost.localdomain>
In-Reply-To: <20011027181836.26603.qmail@web11505.mail.yahoo.com>
References:  <20011027181836.26603.qmail@web11505.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Fabio Miranda <fmirand@yahoo.com> writes:

> hi, I am freebsd user, i want to know:
> 1. I would like to understand network byte ordering
> concepts. I know some machines are "little endian" and
> "big endian", and tcpip provides a standard called
> network ordering throught htonl, htons,etc fuctions.
> I want to know How does look like bigendians and
> network byte ordering?, how can i know if i am in a
> little or bigendian host?

These terms refer to "byte ordering" in systems which allow addressing
of the individual "bytes" of a larger "word" which is interpreted as an
integer.  In "big endian" systems, the bytes which have the word's
biggest-power-of-two bits have lower addresses; i.e., the big end of
the word comes first in memory.

Roughly speaking, Intel and DEC (x86,PDP,VAX,Alpha(?)) are little endian
and others are big endian.  The command "uname -m" should give you a
clue.

"Bit ordering" has to do with the number of the bits within bytes and
words; roughly speaking, left-to-right or right-to-left and I'll have
to refer you to the documentation of the CPUs or I/O devices involved
as I don't know who uses what conventions.  AFAIK, the "endian" terms
are never used in regard to bit ordering.

> dont have money to buy a book at amazon, but, is that
> the only way? can't i understand unix tcpip
> programming with free resources? 

There's lots of stuff on the web if you've the time to hunt it down.
Most of it is probably Linux-centric, but it should be helpful anyway.
Then there's discount (last year's books) and used books stores which
work fine for old subjects like this.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?37d737h0yf.737>