Application data sent over TCP experiences multiple encapsulations:

  1. The application data is encapsulated within one or many TCP fragments
  2. The TCP fragment is encapsulated within one or many IP datagrams
  3. The IP datagram is encapsulated within an Ethernet frame

It turns out Ethernet frames are sent most-significant byte first, and within each byte, most-significant bit first. What about the multiple encapsulations? Are they performed MSB first or LSB first?

  • Sounds like homework - why do you need to know?
    – Chopper3
    Oct 19, 2012 at 9:23
  • Homework, hehe, no. I'm not a student. I'm trying to optimise sending financial orders using the FIX protocol over TCP. Actually, I'm thinking of writing an FPGA implementation for it.
    – Randomblue
    Oct 19, 2012 at 9:30
  • In that case you'll want to have the RFPs to hand as they'll be much more precise and useful than just getting someone's answer on here.
    – Chopper3
    Oct 19, 2012 at 9:31
  • Of course! But before I enbark into this level of detail, I just wanted a "high-level" idea of how encapsulation works so that I can determine straight-away if my optimisation idea works in theory or not.
    – Randomblue
    Oct 19, 2012 at 9:34
  • 1
    Implementing the protocol in an FPGA, eh? Zow. Skynet really wants those bits to move fast (and it knows how to motivate humans to help it)... Oct 19, 2012 at 10:54

2 Answers 2


First, one correction: IP datagrams are not sent within one or many Ethernet frames. One IP datagram is sent within exactly one Ethernet frame. The other stipulations in your description are true, although TCP tries hard to choose the segment size to that one TCP segment does not have to be fragmented into multiple IP datagrams.

All of the protocols in the TCP/IP suite use what's known as network byte order, which is the same thing as big endian, which is the same as MSB first.

TCP and IP do not really deal with things as the bit level, only at the byte level. So they are subject to whatever the physical layer (be it Ethernet or a serial link or something else) does with the bits.

  • I've corrected my question; thanks. It's reassuring that every protocol in the TCP/IP suite is big endian.
    – Randomblue
    Oct 19, 2012 at 15:27

Virtually everything in IP and its related protocols is most significant byte first. In older documents, such as the RFCs you should be reading, you will see this referred to as "network byte order".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.