title: Endianess of network data transmissions over TCP/IP
body: <p>Here is a question I've been trying to solve since quite some time ago. This does not attain a particular languaje, although it's not really beneficial for some that have a VM that specifies endianess. I know, like the 99.9999% of people that use sockets to send data using TCP/IP, that the protocol specifies a endianess for the transmission elements, like destination address, port and such. The thing I don't know is <strong>if it requires the payload to be in a specific format to prevent incompatibilities</strong>. </p>
  
  <p>For example, let's say I develop a protocol that is not a <a href="http://en.wikipedia.org/wiki/Presentation_Layer" rel="nofollow">presentation layer</a>, and that I, due to the inmense dominance that little endian devices have nowadays, decide to make it little endian (for example the positions of the players and such are transmitted in little endian order). For example a network module for a game engine, where latencies matter and byte conversion would cost a noticeable amount of time. Of course the address, port and all of that data that is protocol related would be specified in big endian as is mandatory, I'm talking about the payload, and only that.</p>
  
  <p>Would that protocol work out of the box (translating the contents as necessary, of course, once the the transmission is received) on a big endian machine? Or would the checksums of the IP protocol or something of the kind get computed wrong since the data is in a different order, and the programmer does not have control of them if raw_sockets aren't used?</p>
  
  <p>Since the whole explanation can be misleading, feel free to ask for clarifications.</p>
  
  <p>Thank you very much.</p>