high speed networks - applications in finance
TRANSCRIPT
Introduction - Education
NED University of Engineering & Technology, Pakistan
BE (Avionics Systems Engineering) - 1989
Loughborough University of TechnologyMSc IT (Electronic Communications) – 1995
Loughborough UniversityPhD (Computer Networks) – 1998
1989-2002
Introduction - Career
Communications Enabling Technologies
2002-2003
2003-2004 2004-2005
2005-2006
20062006-2010
2010-2016
A Successful Trade
● Opportunity
● Information
● Connectivity
● Speed
The Need For Speed
● US Funding Act (1790)– Address the devaluation of US war bonds.
● Trading at a nickel on a dollar in expectation of a default.
– Guaranteed, dollar for dollar, all debt of the Union and the states.
– Land messangers carried the notification.
● Innovative traders chartered fast boats– Front ran the messangers.
– Bought war bond for pennies on the dollar.
The Need for Speed
● Napoleonic Wars (1815)– Panic in London on Napoleon’s successes.
– Financial markets crashed.– Dealers sold government bonds.
● Nathan Meyer Rothschild– Used fast carrier pigeons to get the news of Nepoleon’s
defeat.
– Bought all British financial products in the markets.
– Prices soared when official news finally arrived.
– Rothschild became the richest man in Europe.
Evolution of Financial Technology
Wall Street with telegraph wires 1880s
Trader examining price ticker tapereceived via telegraph
Evolution of Financial Technology
Prices and products on screens, trading via voice over phone
Evolution of Financial Technology
Screen trading
Evolution of Financial Technology
Data Center
Evolution of Financial Technology
Algorithmic and High Frequency Trading
Objectives
“The trading floors of banks and exchanges will have one man, one dog and one machine.
The machine to trade,
the dog to guard the machine,
and the man to feed the dog.”
But these machines have to be connected to trade
and they have to be able to communicate at speed
Computer Networks
Protocol Layers
WAN Optimisations● Each layer adds data and processing overheads.● Functionality overlap in protocol layers.● Carrier grade fibre optic networks have infinitesimally
low error rates.● Physical layer switching components.
– ADM (Add Drop Multiplexers)
– Cross connects
– Traffic across WAN carried over a virtual topology.
● Hence a reduced need for data link layer in WANs.● IP (network layer) carried directly over SONET, SDH
or DWDM.
Racing Against Light
Co-Location (CoLo)
When signals travel at 671 million miles per hour, every mile matters.
Racing Against Light
Physical Data Path Optimisation
Gigabit data rates with higher compression.Adaptive coding and modulation for low error rates.Forward error correction.
Hardware Implementation of Protocols
The Bitter Truth
● Data on the wire is serial, one bit at a time.● Application level message throughput more
significant to the application than the bit rate.– Message formats matter
– Example, transferring the number 157,
Format Message on the wire
Text (ASCII) 0011 0001 0011 0101 0011 0111
BCD 0000 0001 0101 0111
Binary 1001 1101
Which format gets the message delivered faster at the same bit rate ?
Conventional Financial Protocols
● Primarily text-based– FIX (Financial Information Exchange)
● Tag=Value;Tag=Value;Tag=Value…..8=FIX.4.2<SOH>9=153<SOH>35=D<SOH>49=BLP<SOH>56=SCHB<SOH>34=1<SOH>50=30737<SOH>97=Y<SOH>52=20000809-20:20:50<SOH>11=90001008<SOH>1=10030003<SOH>21=2<SOH>55=TESTA<SOH>54=1<SOH>38=4000<SOH>40=2<SOH>59=0<SOH>44=30<SOH>47=I<SOH>60=20000809-18:20:32<SOH>10=061<SOH>
● Initially developed for pre-trade workflow, now extended to execution and post-trade processing.
– FpML (Financial Products Markup Language)● XML-based● Standard for dealing and processing of derivatives
FpML Snippet<requestAllocation xmlns="http://www.fpml.org/FpML5/confirmation" xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" fpmlVersion="50" xsi:schemaLocation="http://www.fpml.org/FpML5/confirmation ../../fpmlmain50.xsd"> <header> <messageId messageIdScheme="http://www.party2.com/messageid">123453212</messageId> <sentBy>PARTY2US33</sentBy> <creationTimestamp>20021203T09:57:00Z</creationTimestamp> </header> <isCorrection>false</isCorrection> <correlationId correlationIdScheme="http://www.party2.com/correlationid">18671867</correlationId> <sequenceNumber>1</sequenceNumber> <blockTradeIdentifier> <partyReference href="party2"/> <tradeId tradeIdScheme="http://www.swapswire.com/spec/2001/tradeid10">10000</tradeId> </blockTradeIdentifier> <allocations> <allocation> <allocationTradeId> <partyReference href="party2"/> <tradeId tradeIdScheme="http://www.swapswire.com/spec/2001/tradeid10">30001</tradeId> </allocationTradeId> <partyReference href="party3"/> <accountReference href="ACC2"/> <allocatedFraction>0.40</allocatedFraction>
Text-based Financial Protocols
● Holistic verbosity– Heavy in the band,
● Large packet sizes.
– Heavy on the box,● Parsing from text and mapping to internal application
structures.
● Potential solutions– Compression
● Easy on the band but still heavy on the box.
– Encoding● Can be succinct on the wire and naturally map to
application structures.
Proprietary Binary Alternatives● ITCH
– Lightweight protocol for subscriptions.
– TCP and UDP based.
● OUCH– Order management protocol.
● RASHPort– Routing And Special Handling.
– Order management in options market.
● SoupBinTcp– TCP based lightweight point-to-point protocol.
– Used in conjunction with higher layer protocols.● ITCH and OUCH ride on it.
FIX: The Next Generation
● Reducing semantic verbosity.– Redefining workflows to remove redundant
messages.
● Optimising message structures.● Binary encoding.
– SBE: Simple Binary Encoding.
– GPB: Google Protocol Buffers.
– ASN.1: Abstract Syntax Notation One.
Transport Layer Optimisations
● UDP in a CoLo environment.– Broadcast/multicast support.– Lower protocol overhead in the band as well as the
box.● TCP across subnets
– Reliable communication.– Can be replaced by UDP if reliable links connect
venues and clients.● Building in-band reliability over UDP is sub-
optimal.
Out of Band Reliability over UDP
Customer VenueSequenced UDP Message Streams
MessagePersistance
Message Store Flow
Message Store Flow
TCP TCP
Missing Message Queries and Results
Missing Message Queries and Results
Application Architecture and Implementation
Trading Systems
● Best practices ensuring scalability, extensibility and flexibility.
● Focused optimisations,– Start optimising the slowest elements.
● Microservices– Functionally granular implementations.
● Keeping latency intensive processes out of critical path,– e.g. persistence.
Conclusions
● Speed and agility provide competitive business advantage.
● Performance is a holistic concept,– Optimisations should focus on the entire information
and processing chain.
● Continuous monitoring and performance analysis essential for optimisations.