+ All Categories
Home > Education > Latency war the present & the future

Latency war the present & the future

Date post: 09-Jul-2015
Category:
Upload: quantinsti
View: 165 times
Download: 3 times
Share this document with a friend
Description:
This webinar will cover the following topics: A. Latency - Metrics and Limits B. Tick to Trade Latencies C. Cause of Degradation D. Present Landscape and Foreseeable Future The webinar was taken by Mr. Gaurav Raizada, he is a Director at iRageCapital Advisory Private Ltd and also Senior faculty of QuantInsti, leads the firm's advisory practice in India on the Systems, Performance and Strategies. He has consulted extensively with core focus on strategy development and execution including trading systems development, latency reduction, optimization and transaction cost analysis. Gaurav is IIT and IIM Alumnus.
30
© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited Latency War - the Present & The Future Gaurav Raizada Quantinsti
Transcript
Page 1: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Latency War - the Present & The Future

Gaurav Raizada

Quantinsti

Page 2: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

It's the Latency, Stupid

Well known and referenced article

“a network link with low bandwidth can be made better with money, but network link with bad latency

cannot be helped”

This was the scene in 1996, when bandwidth was the constraint. Speeds were in Kbps.

Cheshire later become Wizard at Apple. Pioneering Zeroconf

http://rescomp.stanford.edu/~cheshire/rants/Latency.html

Page 3: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Misnomer – Bad Terminology

Would you say that a Boeing 747 is three times "faster" than a Boeing 737? Of course not. They both cruise at around 500 miles per hour. The difference is that the 747 carries 500 passengers where as the 737 only carries 150. The Boeing 747 is three times bigger than the Boeing 737, not faster. Now, if you wanted to go from New York to London, the Boeing 747 is not going to get you there three times faster. It will take just as long as the 737. In fact, if you were really in a hurry to get to London quickly, you'd take Concorde, which cruises around 1350 miles per hour. It only seats 100 passengers though, so it's actually the smallest of the three. Size and speed are not the same thing. On the other hand, If you had to transport 1500 people and you only had one aeroplane to do it, the 747 could do it in three trips where the 737 would take ten, so you might say the Boeing 747 can transport large numbers of people three times faster than a Boeing 737, but you would never say that a Boeing 747 is three times faster than a Boeing 737.

Page 4: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

System Architecture of a Traditional Trading System

• Traditionally a trading system would consist of – A system to read data from the market

– A storehouse of historical data

– A tool to analyse historical data

– A system where the trader can input his trading decisions

– A system to route orders to the exchange

Page 5: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

System Architecture of a Traditional Trading System

• The server – which is mostly a data store

Workshop on Algorithmic & High Frequency Trading

Order Manager

Market Data

Operational Data Store

Exchange

DataWarehouse

/

Storehouseof

historical data

Data Vendor

Trader’s tool

Main Centre of operations –analyzing market data wrt to historical data in operational

data store and generating orders

Server Exchange

Page 6: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

System Architecture of a Traditional Trading System

• If data operations are simple… operational data store can be in application layer (trader’s pc)

Workshop on Algorithmic & High Frequency Trading

Order Manager

Market Data

Operational Data Store

Exchange

DataWarehouse

/

Storehouseof

historical data

Data Vendor

Trader’s tool

Main Centre of operations –analyzing market data wrt to historical data in operational

data store and generating orders

Application Server Exchange

Page 7: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

System Architecture of an Automated Trading System

• With the advent of DMA & automated trading, the following changes in architecture took place:– Latency between Event Occurrence & Order Generation had to be

reduced to an order of milliseconds and lower.

– Order Management had to be made more robust to handle generation of thousands of orders in a second

– Risk Management had to be done in real time and without human intervention

Workshop on Algorithmic & High Frequency Trading

Page 8: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

System Architecture of an Automated Trading System

• To be able to back-test strategies, two components are required: (ii) a simulator destination instead of an actual exchange

Workshop on Algorithmic & High Frequency Trading

Application

Order Manager

Market Data

Complex Event Processing engine

Exchange 1

Storage

Application Server Exchange

Strategy Settings UI

State Mgmt (PnL + Position)

Order / Execution Monitor

Within application RMS

MathsCalc

RMS

Admin Monitor

Exchange 2

FIX

FIX

Data Normalizer

Order Router

Back office record

MktDataStore

Event History

Adaptor for third party apps – R, Matlab, etc

Data Retrieval

Data Vendor

Replay of stored data

Simulator exchange

Page 9: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Introduction to low latency

• Technology – State of Art

• Approach to latency improvement

• Latest in Low Latency -approaches and technologies being deployed to achieve low latency

Page 10: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Why aim for Low Latency or Lowest ?

• It may be necessary to lower latency just to remain competitive

• The strategy demands low latency, perhaps.

• It may be desirable to improve latency to stop getting picked off by competitors

• With introduction of Colocations and increasing focus in remaining fastest in the market, significant capital is invested. However it can all go waste, if correct technology is not identified and implemented.

• The issue is that latency is difficult to quantify. As a result the value of latency improvement, though easily understood, is extremely difficult to quantify

• Lower latency systems cost a lot more to build and deploy. Hence the objective should be to find the right balance between investment and return on investment in low latency

Page 11: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Latencies – Strategy wise

Citihub, 2009

Page 12: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Current Scenario

• Synchronized Markets – Correlated

• Volumes and Trades have increased

• Orders per Trade has increased drastically

• Synchronized Trading Patterns

• Need to increase throughput and lower latency simultaneously

• CPUs not getting faster – since 2007. Only cores are being added, not the frequency. Moore’s Law is failing

Page 13: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Performance Degradation with Throughput

http://www.ibm.com/developerworks/websphere/library/techarticles/0706_lou/0706_lou.html

Page 14: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Causes of Degradation

• Massive headroom to allow for bursts typically 10:1 (like bridges and dams)

• Can be triggered by a shortage of any one of it’s resources:

– CPU cycles

– Memory

– I/O channel capacity

– Disk transfers

– Network transfers

• Shortage of one can trigger another e.g. shortage of memory causing CPU Typical system response time against throughput and I/O thrashing

• Distributed deployments add an order of magnitude more complexity

Page 15: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Amdahl’s law

• Amdahl's law, also known as Amdahl's argument,is used to find the maximum expected improvement to an overall system when only part of the system is improved. It is often used in parallel computing to predict the theoretical maximum speedup using multiple processors.

Page 16: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Network Effects

Page 17: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Latency by Distance

Page 18: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Spread Networks

Estimated roundtrip time for an ordinary cable is 14.5 milliseconds, giving users of Spread Networks a slight advantage.

In October 2012, Spread Networks announced latency improvements, bringing the estimated roundtrip time from 13.1 milliseconds to 12.98 milliseconds.

Some companies, such as McKay Brothers and Tradeworx, are using air-based transmission to offer lower estimated roundtrip times (9 milliseconds and 8.5 milliseconds respectively) that are very close to the theoretical minimum possible (about 7.5-8 milliseconds).

Page 19: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Microbursts

Page 20: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Corvil Analysis

“For this feed, how much bandwidth is needed to protect 99.99% of packets from loss with no more than 100 microseconds of latency to be experienced during the busy 1 second of the trading day”

Page 21: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Latency Recommendations

Page 22: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Latency Breakdown

• Latency can be broken down into the following components

• L = P + N + S + I + AP

– P is Propagation time - sending the bits along the wire, speed of light constrained

– N is Network packet processing – routing, switching and protection

– S is Serialization time - pulling the bits on/off the wire

– I is Interrupt handling time – receiving the packet on a server

– AP is Application Processing time

Page 23: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Technology Mix

Page 24: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Costs in Time (Years) for Time Reduction (micro-seconds)

Page 25: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Tips

• Servers – Fastest Cores, Cache,

• Operating Systems – RT kernels

• Fastest Network Infra (Switches, Routers )

• Retune the TCP stack

• Program Runtime – isolcpus, stack bypass

• Solid State Drives

• Latency Tuning – TCP_NODELAY, sendfile(2), Lock Free Codes

Page 26: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Sample Solution Path

Page 27: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Important dates

http://www.quantinsti.com/importantdates.html*Scholarships: http://www.quantinsti.com/scholarships.html

Page 28: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Program Delivery• Weekends only program

– 3 hrs sessions on Saturday & Sunday both

– 4 months long program

– Practical Oriented

– 100 contact hours including practical sessions

• Convenience – Conducted online

• Open Source

• Virtual Classroom integration

• Student Portal

• Faculty supervision

• Placement assistance

Page 29: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Q&A

• Please type your questions in the chat window.

• For more information visit:

Youtube channel : http://www.youtube.com/quantinsti

LinkedIn group : http://www.linkedin.com/groups?gid=3412051

Facebook : https://www.facebook.com/quantinsti

Page 30: Latency war   the present & the future

© Copyright 2010-2014 QuantInsti Quantitative Learning Private Limited

Thanks!

THANK YOU

Contact us at: Email: [email protected] or [email protected]: +91-22-61691400, +91-9920448877


Recommended