2008年10月1日 星期三

Endians

All processors must be designated as either big endian or little endian.
Intel's 80x86 processors and their clones are little endian.
Sun's SPARC, Motorola's 68K, and the PowerPC families are all big endian. The Java Virtual Machine is big endian as well.

Intel 80x86 is little endian (host byte order). The least significant byte first stored in the memory. So the memory dump is from the least significant byte to the most significant byte.

The network byte order format is big endian. So we need to transfer the byte order if we want to transfer data from Intel 80x86 machine onto the network.

For example.
General speaking, the packet format of adrress/port is like following syntax

Appearing in the physical packet
Address: 8c61 12ab ==> 140.97.18.171
Port: c268 ==> 0xc268 == 49768 (big endian format, network byte order, from the most significant byte to the least significant byte)

沒有留言: