Presentation is loading. Please wait.

Presentation is loading. Please wait.

Latin America Electronic Trading Conference 2008 Sao Paolo, Brazilian Mercantile & Futures Exchanges The FAST Protocol SM Optimising the Communication.

Similar presentations


Presentation on theme: "Latin America Electronic Trading Conference 2008 Sao Paolo, Brazilian Mercantile & Futures Exchanges The FAST Protocol SM Optimising the Communication."— Presentation transcript:

1 Latin America Electronic Trading Conference 2008 Sao Paolo, Brazilian Mercantile & Futures Exchanges The FAST Protocol SM Optimising the Communication of Financial Information

2 FPL Latin America Electronic Trading Conference 2008 2 Background Increased market data volumes High bandwidth and processing costs Classic FIX Widespread adoption Inadequate performance for Market data Quote driven markets Proprietary Alternatives Complicates integration (many different interfaces) No cost sharing of development and maintenance Limited adoption

3 FPL Latin America Electronic Trading Conference 2008 3 FAST Protocol Factors that Influenced the Design Efficiency Compression Ratio Resource Consumption (CPU, memory) Ease of Use (Conceptual, Implementation, Operation) Costs Implementation Validation Deployment Operation Maintenance Proof of Concept CME Archipelago ISE Microsoft Singapore Exchange London Stock Exchange

4 FPL Latin America Electronic Trading Conference 2008 4 FAST Protocol Characteristics Basic Feature Set Optimized for message streams Content aware (requires knowledge about message structure) Byte-oriented binary representation Variable-length fields Each message contains one or more fields A presence map enables efficient use of default values Several ways of deriving default values Empirically validated Very fast processing (encoding / decoding) High compression ratios on tested exchange feeds Simple implementation

5 FPL Latin America Electronic Trading Conference 2008 5 FAST Protocol Layers

6 FPL Latin America Electronic Trading Conference 2008 6 FAST Vocabulary A data stream consists of a sequence of messages. A message consists of a sequence of one or more fields. A field consists of a sequence of one or more bytes. Wire format refers to the byte representation that is used to transfer data on the wire. Encoding is the process of translating to wire format. Decoding is the process of translating from wire format. A CODEC (enCOder/DECoder) provides support for encoding or decoding a stream of messages. A byte consists of seven data bits and a stop bit (the ‘SBIT’) that when set indicates the byte is the last byte of a field. A presence map (‘PMAP’) is a field that is interpreted as a vector of bits, one bit (‘PBIT’) for each field in a message. A field operator enables previous values to be reused.

7 FPL Latin America Electronic Trading Conference 2008 7 FAST Transfer Encoding – Fields 7 bits 14 bits 21 bits nn bits FAST Transfer Encoding - SBIT Detail SBIT coding provides space efficient delimitation of fields More compact than byte delimiter for fields shorter than 7 bytes Empirical data shows average FAST field sizes of ~2 bytes ~33% more compact than a byte delimiter at 2 bytes Serialization of SBIT format is simple and efficient There are exceptional cases when SBIT coding is suboptimal Byte vector can be used for these cases

8 FPL Latin America Electronic Trading Conference 2008 8 FAST Transfer Encoding – Messages The tail of a pmap may be compressed The number of fields in a message depends on the pmap content A message may be as short as one byte (an empty pmap)

9 FPL Latin America Electronic Trading Conference 2008 9 FAST Field Data Types Unsigned Integer Signed Integer Decimal (aka Composite Scaled Number) ASCII Character String UNICODE Character String Bit Vector Byte Vector Additional FAST 1.0 Data types that were dreprecated Unsigned Integer without Null Signed Integer without Null Scaled Number The FAST transport representation supports unlimited size fields. Implementations will likely limit the supported size to match the native data representation in applications.

10 FPL Latin America Electronic Trading Conference 2008 10 Some helpful refreshers Some important values to remember 0x80 = 128 decimal = b‘10000000’ 0x80 is an Octet value of 0x00 with the SBIT (Stop Bit) set 0x7f = 127 decimal = b’01111111’ Operations & bitwise AND operation 0x00 & 0x80 => 0x00 0x7f & 0x80 => 0x00 | bitwise OR operation 0x00 | 0x80 => 0x80 0x7f | 0x80 => 0xff

11 FPL Latin America Electronic Trading Conference 2008 11 For FAST the fundamental data type is the bit SBIT – Stop Bit is the high order bit in the byte set to b’1’ (8 th byte) Bit 7 to indicate the end of a field, b’0’ otherwise DBITS – Bits 6 through 0 contain data

12 FPL Latin America Electronic Trading Conference 2008 12 Integer Data Types

13 FPL Latin America Electronic Trading Conference 2008 13 Unsigned Integer Without Null Support Data Type Transfer from low order to high order 7 bits at a time Set the Stop Bit in the low order byte

14 FPL Latin America Electronic Trading Conference 2008 14 Unsigned Integer Without Null Transfer Encoding Value(hex)Seven Data Bits per Byte (bin)Len 1270000007F0000000 0000000 0000000 0000000 1111111 0xff 1 1638300003FFF0000000 0000000 0000000 1111111 1111111 0x7f 0xff 2 2097151001FFFFF0000000 0000000 1111111 1111111 1111111 0x7f 0x7f 0xff 3 2684354510FFFFFFF0000000 1111111 1111111 1111111 1111111 0x7f 0x7f 0x7f 0xff 4 4294967295FFFFFFFF0001111 1111111 1111111 1111111 1111111 0x0f 0x7f 0x7f 0x7f 0xff 5

15 FPL Latin America Electronic Trading Conference 2008 15 Unsigned Integer The number is incremented by 1 in the transfer process to account for the NULL value being supported Why is the NULL value 0x00 encoded as 0x80?

16 FPL Latin America Electronic Trading Conference 2008 16 Signed Integer Data Type Two’s Complement Arithmetic When the 7 bit value is converted to a 32 bit value the first data bit is taken as a sign bit and is copied to the 25 high end bits of the 32 bit value yielding 0xffffffff (which corresponds to -1 10 in 2’s complement representation). The most significant data bit of the first byte encoded is the sign

17 FPL Latin America Electronic Trading Conference 2008 17 Signed Integer Transfer Encoding for Positive Values Value(hex)Seven Data Bits per Byte (bin)Len 0000000000000000 0000000 0000000 0000000 0000000 0x80 1 630000003F0000000 0000000 0000000 0000000 0111111 0xbf 1 819100001FFF0000000 0000000 0000000 0111111 1111111 0x7f 0xff 2 1048575000FFFFF0000000 0000000 0111111 1111111 1111111 0x3f 0x7f 0xff 3 13421772703FFFFFF0000000 0111111 1111111 1111111 1111111 0x3f 0x7f 0x7f 0xff 4 21474836477FFFFFFF0000111 1111111 1111111 1111111 1111111 0x07 0x7f 0x7f 0x7f 0xff 5

18 FPL Latin America Electronic Trading Conference 2008 18 Signed Integer Transfer Encoding for negative values Value(hex)Seven Data Bits per Byte (bin)Len FFFFFFFF1111111 1111111 1111111 1111111 1111111 0xff 1 -64FFFFFFC01111111 1111111 1111111 1111111 1000000 0xc0 1 -8192FFFFE0001111111 1111111 1111111 1000000 0000000 0x80 2 -1048576FFF000001111111 1111111 1000000 0000000 0000000 0x40 0x00 0x80 3 -134217727F80000001111111 1000000 0000000 0000000 0000000 0x40 0x00 0x00 0x80 4 -2147483648800000001111000 0000000 0000000 0000000 0000000 0x78 0x00 0x00 0x00 0x80 5

19 FPL Latin America Electronic Trading Conference 2008 19 Signed Integer with Null Support Still Two’s Complement Arithmetic – does not change for negative numbers Plus, just like with the Unsigned Integer with Null Support Data Type, we get to increment positive values by 1 PLUS ONE ENCODING Good thing we have computers to do this stuff for us

20 FPL Latin America Electronic Trading Conference 2008 20 FAST Scaled Number (decimal) Data Type Base-10 Single field Requires one field in the PMAP First byte is interpreted as a Signed Integer specifying the Exponent Remaining bytes are treated as a Signed Integer representing the Mantissa Provides exact decimal representation Mantissa X 10 Exponent MantissaExponentValue 0-1*10^0 = -1 127-2127*10^-2 = 1.27 141*10^4 = 10000 X Obsolete

21 FPL Latin America Electronic Trading Conference 2008 21 FAST Decimal Datatype aka Composite Scaled Number Data Type MantissaExponentValue 0-1*10^0 = -1 127-2127*10^-2 = 1.27 141*10^4 = 10000 Base-10 Consists of two fields Requires two places in a PMAP if field encoded Exponent maximum is -63 to +63 Mantissa X 10 Exponent

22 FPL Latin America Electronic Trading Conference 2008 22 FAST ASCII String Data Type 7 Bit ASCII Character Set Supported Last Byte in string has the Stop Bit set 0x54 0x68 0x61 0x6e 0x6b 0x20 0x59 0x6f 0x75 0x20 0x42 0x4d 0x46 0xa1 What is the decoded string in ASCII?

23 FPL Latin America Electronic Trading Conference 2008 23 What is in the String? 0x54 0x68 0x61 0x6e 0x6b 0x20 0x59 0x6f 0x75 0x20 0x42 0x4d 0x46 0xa1

24 FPL Latin America Electronic Trading Conference 2008 24 UnicodeString Datatype Byte Vector Data Type Length specified as a FAST Unsigned Integer Value Length number of Octets follow Full 8 bit values 0x00 – 0xff A NULL Byte Vector is represented by setting the length to Null Can be used for non-ASCII character sets

25 FPL Latin America Electronic Trading Conference 2008 25 Bit Vector Data Type Series of zero or more continuation bytes followed by one stop byte There is no NULL value defined for this type

26 FPL Latin America Electronic Trading Conference 2008 26 A Transfer Encoding Example BeginStr SeqNum SenderID SendingTime Price Symbol 8=FIX.4.4|34=10000|49=CLIENT1|52=20060126-13:06:58.100|44=1200|55=FOO1| 8=FIX.4.4|34=10001|49=CLIENT1|52=20060126-13:06:58.200|44=1210|55=FOO1| 8=FIX.4.4|34=10002|49=CLIENT1|52=20060126-13:06:58.300|44=1190|55=BAR2| Original size 71 bytes FIX.4.4|10000|CLIENT1|20060126-13:06:58.100|1200|FOO1| FIX.4.4|10001|CLIENT1|20060126-13:06:58.200|1210|FOO1| FIX.4.4|10002|CLIENT1|20060126-13:06:58.300|1190|BAR2| FIX.4.4nnCLIENT120060126-13:06:58.100nnFOO1 FIX.4.4nnCLIENT120060126-13:06:58.200nnFOO1 FIX.4.4nnCLIENT120060126-13:06:58.300nnBAR2 Implicit Tagging 54 bytes (-24%) SBIT Encoding 48 bytes (-33%) SBIT+Binary Encoding 43 bytes (-39%) FIX.4.410000CLIENT120060126-13:06:58.1001200FOO1 FIX.4.410001CLIENT120060126-13:06:58.2001210FOO1 FIX.4.410002CLIENT120060126-13:06:58.3001190BAR2 Greg

27 FPL Latin America Electronic Trading Conference 2008 27 Beyond Transfer Encoding Further compaction requires information about data affinity and predictability. BeginStr SeqNum SenderID SendingTime Price Symbol 8=FIX.4.4|34=10000|49=CLIENT1|52=20060126-13:06:58.100|44=1200|55=FOO1 8=FIX.4.4|34=10001|49=CLIENT1|52=20060126-13:06:58.200|44=1210|55=FOO1 8=FIX.4.4|34=10002|49=CLIENT1|52=20060126-13:06:58.300|44=1190|55=BAR2 Affinity Predictability Field Encoding...

28 FPL Latin America Electronic Trading Conference 2008 28 Templates A template specifies how to encode an application message into the transfer encoding A template conveys Message Structure Data Types Field Operators

29 FPL Latin America Electronic Trading Conference 2008 29 Template Overview Data Types Field Operators Structure

30 FPL Latin America Electronic Trading Conference 2008 30 Characteristics of FAST Templates Semantics are formally and unambiguously defined Enables consistent behavior and interoperability among implementations Concrete Syntax Default format for authoring, storing and interchanging templates Human and machine readable XML Syntax Supports evolution of the template specification Extensible – enables inclusion of custom data in templates Widespread knowledge and good tool support Alternative concrete representations Hard coded in encoder and/or decoder FAST encoded as specified by the Session Control Protocol (SCP)

31 FPL Latin America Electronic Trading Conference 2008 31 The Transfer Encoding Example Revisited BeginStr SeqNum SenderID SendingTime Price Symbol 8=FIX.4.4|34=10000|49=CLIENT1|52=20060126-13:06:58.100|44=1200|55=FOO1| 8=FIX.4.4|34=10001|49=CLIENT1|52=20060126-13:06:58.200|44=1210|55=FOO1| 8=FIX.4.4|34=10002|49=CLIENT1|52=20060126-13:06:58.300|44=1190|55=BAR2| Original size 71 bytes FIX.4.4|10000|CLIENT1|20060126-13:06:58.100|1200|FOO1| FIX.4.4|10001|CLIENT1|20060126-13:06:58.200|1210|FOO1| FIX.4.4|10002|CLIENT1|20060126-13:06:58.300|1190|BAR2| FIX.4.4nnCLIENT120060126-13:06:58.100nnFOO1 FIX.4.4nnCLIENT120060126-13:06:58.200nnFOO1 FIX.4.4nnCLIENT120060126-13:06:58.300nnBAR2 Implicit Tagging 54 bytes (-24%) SBIT Encoding 48 bytes (-33%) Binary Encoding 43 bytes (-39%) FIX.4.410000CLIENT120060126-13:06:58.1001200FOO1 FIX.4.410001CLIENT120060126-13:06:58.2001210FOO1 FIX.4.410002CLIENT120060126-13:06:58.3001190BAR2

32 FPL Latin America Electronic Trading Conference 2008 32 Data Types Strings, Integer and Decimal numbers, Boolean, Byte Vector Restricted types for numbers – 8-bit up to 64-bit sizes BeginStr SeqNum SenderID SendingTime Price Symbol Sz 8=FIX.4.4|34=10000|49=CLIENT1|52=20060126-13:06:58.100|44=1200|55=FOO1 44 8=FIX.4.4|34=10001|49=CLIENT1|52=20060126-13:06:58.200|44=1210|55=FOO1 44 8=FIX.4.4|34=10002|49=CLIENT1|52=20060126-13:06:58.300|44=1190|55=BAR2 44 Original Size: 71 bytes

33 FPL Latin America Electronic Trading Conference 2008 33 Field Operators Constant – Always the same value Increment – Frequently previous value incremented by one Copy – Frequently the same as the previous value Delta – Values differ slightly Default – Frequently a specific value

34 FPL Latin America Electronic Trading Conference 2008 34 Constant Operator BeginStr SeqNum SenderID SendingTime Price Symbol Sz 8=FIX.4.4|34=10000|49=CLIENT1|52=20060126-13:06:58.100|44=1200|55=FOO1 37 8=FIX.4.4|34=10001|49=CLIENT1|52=20060126-13:06:58.200|44=1210|55=FOO1 37 8=FIX.4.4|34=10002|49=CLIENT1|52=20060126-13:06:58.300|44=1190|55=BAR2 37 Original Size: 71 bytes

35 FPL Latin America Electronic Trading Conference 2008 35 Increment Operator BeginStr SeqNum SenderID SendingTime Price Symbol Sz 8=FIX.4.4|34=10000|49=CLIENT1|52=20060126-13:06:58.100|44=1200|55=FOO1 37 8=FIX.4.4|34=10001|49=CLIENT1|52=20060126-13:06:58.200|44=1210|55=FOO1 35 8=FIX.4.4|34=10002|49=CLIENT1|52=20060126-13:06:58.300|44=1190|55=BAR2 35 Original Size: 71 bytes

36 FPL Latin America Electronic Trading Conference 2008 36 Copy Operator BeginStr SeqNum SenderID SendingTime Price Symbol Sz 8=FIX.4.4|34=10000|49=CLIENT1|52=20060126-13:06:58.100|44=1200|55=FOO1 37 8=FIX.4.4|34=10001|49=CLIENT1|52=20060126-13:06:58.200|44=1210|55=FOO1 24 8=FIX.4.4|34=10002|49=CLIENT1|52=20060126-13:06:58.300|44=1190|55=BAR2 28 Original Size: 71 bytes

37 FPL Latin America Electronic Trading Conference 2008 37 Delta Operator BeginStr SeqNum SenderID SendingTime Price Symbol Sz 8=FIX.4.4|34=10000|49=CLIENT1|52=20060126-13:06:58.100|44=1200|55=FOO1 37 8=FIX.4.4|34=10001|49=CLIENT1|52=20060126-13:06:58.200|44=1210|55=FOO1 6 8=FIX.4.4|34=10002|49=CLIENT1|52=20060126-13:06:58.300|44=1190|55=BAR2 10 Original Size: 71 bytes

38 FPL Latin America Electronic Trading Conference 2008 38 Naming Names identify messages, templates and fields Names of messages are typically global Maintained by the owner of a protocol, for example FPL Names of templates are typically local Maintained locally by companies using or implementing FAST Standard templates can be maintained by for example FPL Name collision must be avoided Templates use the same method as in Java and XML Names belong to a namespace based on the company domain name

39 FPL Latin America Electronic Trading Conference 2008 39 Naming Example <templates templateNs="http://www.example.org/ns/example" ns="http://www.fixprotocol.org/ns/fix44"> … …

40 FPL Latin America Electronic Trading Conference 2008 40 Additional information Session Control Protocol Version 1.1 More and more vended solutions Majority of FIX engine vendors: ORC, TransactTools, NYFIX, Rapid Addition, and others Open source solutions http://www.openfast.org (Java only) http://www.openfast.org At least two more efforts underway

41 FPL Latin America Electronic Trading Conference 2008 41 Questions?


Download ppt "Latin America Electronic Trading Conference 2008 Sao Paolo, Brazilian Mercantile & Futures Exchanges The FAST Protocol SM Optimising the Communication."

Similar presentations


Ads by Google