Sequencing in FIX over Tcp

Imported from previous forum

Hello all,
Is the message fragmented at session & defragmented at the other end?

If the message is not fragmented then all the messages are independent to each other.So, is it necessary that the messages should be in order.
If the message is fragmented, and If we are using FIX protocol over TCP, Do we need sequencing. Tcp takes care of reliabilty by sequencing.

Please correct me, if I am wrongly interpreting the mechanism
My apologies for my partial knowledge about FIX.

Thanks & Regards,
Bhasker Reddy A.

Hi,

there are two types of fragmentation, one is at the tcp level which we do not worry about (you are correct in that context). The sequence numbers are not for fragmentation as such but in order to tell if all FIX messages have been received and,in order and that none have gone missing.

ie we send 10 indivdual orders and that order number 8 is not missing etc.

There is a fragmentation scenario where we send large lists of orders,
e.g: say we want to send 1000 order in one message - you might decide this is too large and break it up into 10 messages with 100 orders each.

This is not a tcp issue - its a way of breaking larger messages at an application level context down to smaller message sizes - and this is sometimes referred to as fragmenting… but its not tcp at all… The FIx spec does cover these scenarios…

hth

Hello all, Is the message fragmented at session & defragmented at the
other end?

If the message is not fragmented then all the messages are independent
to each other.So, is it necessary that the messages should be in
order. If the message is fragmented, and If we are using FIX protocol
over TCP, Do we need sequencing. Tcp takes care of reliabilty by
sequencing.

Please correct me, if I am wrongly interpreting the mechanism My
apologies for my partial knowledge about FIX.

Thanks & Regards, Bhasker Reddy A.

[ original email was from John Prewett - jprewett@lavatrading.com ]
> Hello all, Is the message fragmented at session & defragmented at the

other end?

If the message is not fragmented then all the messages are independent
to each other.So, is it necessary that the messages should be in
order. If the message is fragmented, and If we are using FIX protocol
over TCP, Do we need sequencing. Tcp takes care of reliabilty by
sequencing.

Please correct me, if I am wrongly interpreting the mechanism My
apologies for my partial knowledge about FIX.

Thanks & Regards, Bhasker Reddy A.

The FIX protocol specification intentionally doesn’t cover the transportation of messages. It is assumed that the transport delivers whole messages to the “FIX Session layer” for processing. The transport can use various FIX fields such as BeginString(tag 8), BodyLength (tag 9) and CheckSum (tag 10) to facilitate message framing.

If you are transporting FIX messages using TCP, then you are responsible for framing the TCP stream back into messages. Normal TCP rules apply that you might receive partial, incomplete and multiple messages in a packet and thus you must parse your TCP stream appropriately.

TCP delivers a sequence of bytes in the exact order they are transmitted, without omissions or duplicates assuming the TCP session doesn’t fail. As such, a sequenced protocol traveling over a TCP session that never fails wouldn’t need sequence numbers.

The importance of the FIX sequence numbers is to ensure consistency on a TCP session that fails and becomes reconnected.

A secondary (and important) point is that the sequence numbers are part of the standard and if you want to communicate with others using the standard, you must be compliant.

I hope this helps.

JohnP