[SGVLUG] Bit order (was Linux based web-server appliance)

David Lawyer dave at lafn.org
Sat May 20 03:03:23 PDT 2006


[snip, to be responded to later]
> On Fri, May 19, 2006 at 12:57:42PM -0700, David Lawyer wrote:
> > they are stored in memory since the computer will always interpret
> > them correctly.  But it does matter for the Internet which transmits
> > bits in a serial manner, one at a time.
> 
On Fri, May 19, 2006 at 01:51:01PM -0700, Dustin Laurence wrote:
> Hmm.  The internet does no such thing; it's too high in the stack to
> know about bit transmission or, indeed, whether the transmission is
> serial or parallel.  Do you mean ethernet?  It certainly cares about
> byte-order, though, and specifies big-endian.

Doesn't the Internet have a physical layer ??

Transmission over the Internet (outside of computers and parallel port
cables) is serial by streams of bits.  This happens on cables
connected to a PC's serial ports, analog telephone lines, coax
telephone lines (like T1, T2), fiber optic cables, twisted pair
ethernet cables, wireless ethernet, etc.  Ethernet on wires uses
Manchester encoding with 2 electrical pulses for each bit (very
inefficient).  T1 uses straight digital where 0 volts is a 0-bit and 3
volts (plus or minus) is a 1-bit.  Normally, the 1-bits alternate as
+-+-+-+ etc. but violations (like ++) are cleverly used for signalling
and synchronization.  Serial ports have inverted logic: +12v is a 0-bit
and -12v is a 1-bit.  Fiber optics uses intensity modulation of a light
beam with light off = 0-bit, light on = 1-bit (not completely sure of
this).

So you see, the Internet flow is mostly serial streams of bits flowing
in cables and thru the ether.  If you don't think the ether exists
:-), check out Miller's measurement of the ether wind at "Ether Rocks"
on "Mt.  Wilson" (It's on the Internet).

Well, bit streams are sometimes represented by a sequence of "symbols".
Wireless ethernet can use QAM-16 with 4 bits per symbol (and higher).
A 34k modem has 14 bits per symbol, also using QAM.  QAM = Quadrature
Amplitude Modulation.  QAM is really phase-amplitude modulation of a
carrier frequency.  The Q originally meant that there could be 4
possible phase shifts (quad = 4).  But today there are often many more
possible phase shifts.

But since each symbol transmitted represents a sequence of bits, it
too is in effect a bit stream with a first bit and a last bit.  These
bit streams represent sequences of bytes and certain synchronization
bits (or bit sequences) are used to determine the boundaries between
bytes.  Thus to make any sense out of such bytes, the hardware must
know which bit is the low order one: the first or last.

I just went on Google and typed "most significant bit first"
and "least significant bit first".  I got roughly 50k hits for each.
So it depends on the hardware.  For modems it's least first
(little endian) and until just now I incorrectly thought that the
whole internet would be like this, but it's not per the Google
results.  For ethernet, I saw it claimed both ways but it may depend
on the numbers after the 802.  So it seems that there isn't a
universal standard for bit order.  The order depends on the system
specifications.

			David Lawyer


More information about the SGVLUG mailing list