[EROS-Arch] number key endianness

Bill Frantz frantz@pwpconsult.com
Wed, 14 Mar 2001 18:03:42 -0800


At 3:27 PM -0800 3/1/01, Jonathan S. Shapiro wrote:
>"Karp, Alan" wrote:
>>
>> The first message sent by the Initiator was 4 bytes that encoded its byte
>> order, integer length, and character encoding.  (I only needed 8 bits, but I
>> left room for growth.)  The first reply from the Listener was its 4 bytes.
>> The rule was "Initiator makes right".
>
>This makes sense for a connectionful protocol, but capability
>invocations are frequently one shot, so a startup protocol adds too much
>overhead. I think we will have to design that service specifies byte
>order and client makes right. Note that we aren't going over networks
>with this stuff -- it's only a consideration on machines that emulate
>multiple architectures.

I have worked on a system which negotiated the endianness of the protocol.
Unfortunately, it did not automatically generate the conversions (through
an IDL or some other mechanism).  Failure to convert all the integers was a
frequent bug (which appeared in some released code!!)

"A more complex system is less secure on all fronts." - Bruce Schneier

A wise computer industry veteran is rumored to have said, "Everyone who
understands the endian issue has a strong opinion about whether big-endian
or little-endian is better; and wishes the other side had won."

Cheers - Bill


-------------------------------------------------------------------------
Bill Frantz       | Microsoft Outlook, the     | Periwinkle -- Consulting
(408)356-8506     | hacker's path to your      | 16345 Englewood Ave.
frantz@netcom.com | hard disk.                 | Los Gatos, CA 95032, USA