According to big endian byte ordering or network byte order the bits are transmitted in this order: bits 0-7 first, then bits 8-15, then 16-23 and bits 24-31 last. Does this means that bits from version, identification, TTL etc go first and then bits from next fields?
There is a confusion here. The network byte order does not specify how bits are transmitted over the network. It specifies how values are stored in multi byte fields.
The Total Length field is composed of two bytes. It specifies in bytes the size of the packet.
Lets say we have the value 500 for that field. Using the Network Byte Order it will be seen over the wire like this, being transmitted transmission from left to right:
If we would use the little endian format then it would have been seen over the wire like this:
After the whole packet is constructed the bits will be sent starting with the lowest addressed bit of the header (bit 0), so the transmission will start with the Version field.
A final point to make here is that the Network byte order is, as you mentioned, the Big Endian Order. This was chosen arbitrarily to have a common format for all network protocols and implementations.
It's very easy to think that internet packets go on the wire in a very simple "serial port" kind of way. In practice there is nothing inherently serial about it.
If you think about some interface details it might make this clearer:
- Consider Parallel port IP, which actually sends the data 4-bits at a time over four wires. https://en.wikipedia.org/wiki/Parallel_Line_Internet_Protocol
- Actual 100baseTX scrambles 4-bit blocks and sends them as 5 bits serially but the original data isn't visible in the output, so the question about what order they go in doesn't have an answer. https://en.wikipedia.org/wiki/4B5B
- When you send a packet across a loopback interface, it might be copied inside the computer's bus 64-bits at a time; or indeed just by memory remapping which would really be whole packet in parallel.
Of course parallel port IP isn't common, but it illustrates the point; the other two are ubiquitous.
Hope that helps
Other protocols may be different, but Ethernet transmits most signficant octet/byte first and within each byte least significant bit first. So, a 16-bit field is transmitted 8-9-10-11-12-13-14-15 - 0-1-2-3-4-5-6-7 (0=least signficant bit, 15=most significant bit). Check IEEE 802.3 Clauses 3.1.1, 3.2.6, and 3.3.
(This is for purely serial Ethernet - depending on the physical layer, up to eight bits may be transferred simultaneously. Additionally, the bit order goes only for the unencoded layer 1.)
IPv4 also uses most significant octet first, check RFC 791. However, numbering in IETF RFCs is in order of transmission with the bit numbering in reverse to Ethernet: Bit 0 = most significant bit = transmitted first (where not otherwise defined).