SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
Architectural Differences in High-Frequency Trading Systems
Jim Wang, CFA
Program in Financial Engineering
Stevens Institute of Technology
Hoboken, NJ, 07030, USA
Base Architecture
Stock Exchange
Trading Engine
UDPx5 TCP
GUI
TCP
Latency Differences
• Based on Trading Engine Location:
Desktop – Broker – Exchange.
• 10 millisecond or larger: Engine on your
desktop.
• Btw 1-10 millisecond: Engine collocated
with your broker.
• 1 millisecond or less: Engine collocated
with exchange matching engine.
Engine on Desktop: Architecture
Exchange Match Engine
Broker Server
Broker GUI API
desktop
internet
Engine on Desktop: Performance
• I,090027.015,3007,THC,SEL 200@4.800000G
• S,090027.054,odId=3007 clId=0 pId=1646391774
st=PreSubmitted fil=0 rem=200 afPx=0.000000
lfPx=0.000000 pId=0 whyHeld=
• I,094334.875,3087,RAD,CXL -500@1.100000
• S,094334.914,odId=3087 clId=0 pId=1646391853
st=Cancelled fil=0 rem=500 afPx=0.000000
lfPx=0.000000 pId=0 whyHeld=
• Order = 54-15 = 39ms; Cancel = 914-875 = 39ms
Engine on Desktop: Cost
• Market Data Fee: NASDAQ Level I, NYSE Level I
• US Securities & Commodities Non-Professional Bundle
$10
• Free to clients who generate at least USD 30 per month.
• Commission: <=300,000 Shares USD 0.0035.
• Commission: 300,001-3,000,000 Shares USD 0.002.
• Island Exchange Fees: Remove $0.0030; Add ($0.0025).
• ARCA Exchange Fees: Remove $0.0030; Add ($0.0021)
Broker Collocation: Architecture
Exchange Match Engine
Broker Server
GUI
desktop
internet
API
Broker
Data
Center
Broker Collocation: Performance
• D36262260,OCCG001A 20100623100422CCG001A
00034927FMN T0000010000000000999992 14.5600
0.0000YISLD YN00000NNN 0.000000000INET,1437,1438,0,0
• <36262265,PCCG001A 13197704 3492700000013197704
FMN T00000100 14.5600100422ISLDINET
• Order = 65-60 = 5ms;
• D36262698,XCCG001A 20100623100422CCG001A
13188804,AFE,2336,2368,0,0
• <36262702,PCCG001A 13188804 3482700000013188804
AFE B00000000 23.1300100412ISLDINET
• Cancel = 702-698 = 4ms
Broker Collocation: Cost
• Collocation Fee: > $200 per month
• Market Data Fee: Level I and II, Professional > $600 per
month
• Commission: USD 0.0005 – 0.001 based on volume
• Island Exchange Fees: Remove $0.0030; Add ($0.0025).
• ARCA Exchange Fees: Remove $0.0030; Add ($0.0021)
Exchange Collocation: Architecture
Exchange Match Engine
Broker Check
GUIdesktop
internet
API
Exchange
Data
Center
Sponsored Access Naked Access
Source of Latency
• Propagation latency: speed of light 5us/km,
Mahwah – Weehawken 40km.
• Transmission latency: high speed communication
link throughput rate 1-10 Gbps. 1us/1kb to
serialize and transport.
• Processing latency. dedicated CPU for critical
threads, kernel bypass, hardware acceleration.
Propagation Latency
• Collocation within 200m 1us.
• Dark Fiber: Optical fiber infrastructure that
is currently in place, but is not being used
(dark).
• End-to-end direct connectivity, WAN
elimination.
• Dedicated use of a wavelength (not the
cable), Wavelength-division Multiplexing.
Transmission Latency
• Cut-through switching: the switch starts
forwarding a frame before the whole frame
has been received.
• Kernel Bypass: application communicate
with NIC using special supplied lib without
using standard system call.
• RDMA (remote direct memory access):
one computer place information directory
into the memory of another.
Context Switching
Step 0 Step 1 Step 2 Step 3 Step 4
Read (user context)
Sys Call Kernel Context
Write (user context)
Sys Call Kernel Context
Processing Latency
• Parallel Problem: With 10k symbols, 6
major exchanges, relatively independent,
tasks be streamlined.
• Through Software optimization:
flexibility, take advantage of general
purpose CPU improvements over time.
• Through Hardware Acceleration:
specialized hardware, improve consistency
by reducing jitter.
Software Optimization
• Separation of high speed vs high
complexity. Latency sensitive task in
critical path, computation intensive tasks
offload to separate thread/process.
• memory caching: critical decision thread
pined to a dedicated CPU.
• inline vs function calls: C, C++, Java.
Hardware Acceleration
• Parallel processors (general purpose multi-
core CPU, tile array architecture, cell
broadband engine)
• FPGA (field programmable gate array,
specialized communication)
• GPGPU (general purpose computation on
graphic processing units for computational
intensive tasks)

Weitere ähnliche Inhalte

Was ist angesagt?

LF_DPDK17_Implementation and Testing of Soft Patch Panel
LF_DPDK17_Implementation and Testing of Soft Patch PanelLF_DPDK17_Implementation and Testing of Soft Patch Panel
LF_DPDK17_Implementation and Testing of Soft Patch Panel
LF_DPDK
 
Microsofts Configurable Cloud
Microsofts Configurable CloudMicrosofts Configurable Cloud
Microsofts Configurable Cloud
Chris Genazzio
 

Was ist angesagt? (20)

Cloud Networking Trends
Cloud Networking TrendsCloud Networking Trends
Cloud Networking Trends
 
ProgrammableFlow for Open Virtualized Data Center Network
ProgrammableFlow for Open Virtualized Data Center NetworkProgrammableFlow for Open Virtualized Data Center Network
ProgrammableFlow for Open Virtualized Data Center Network
 
Ipv6 deployment at the university of warwick - networkshop44
Ipv6 deployment at the university of warwick - networkshop44Ipv6 deployment at the university of warwick - networkshop44
Ipv6 deployment at the university of warwick - networkshop44
 
Cumulus Linux 2.2 Overview
Cumulus Linux 2.2 OverviewCumulus Linux 2.2 Overview
Cumulus Linux 2.2 Overview
 
PLNOG 8: Piotr Szolkowski - Bezpieczne i wysoce skalowalne Data Center
PLNOG 8: Piotr Szolkowski - Bezpieczne i wysoce skalowalne Data CenterPLNOG 8: Piotr Szolkowski - Bezpieczne i wysoce skalowalne Data Center
PLNOG 8: Piotr Szolkowski - Bezpieczne i wysoce skalowalne Data Center
 
Interconnect Product Portfolio
Interconnect Product PortfolioInterconnect Product Portfolio
Interconnect Product Portfolio
 
FD.io - The Universal Dataplane
FD.io - The Universal DataplaneFD.io - The Universal Dataplane
FD.io - The Universal Dataplane
 
VMworld 2013: Extreme Performance Series: Network Speed Ahead
VMworld 2013: Extreme Performance Series: Network Speed Ahead VMworld 2013: Extreme Performance Series: Network Speed Ahead
VMworld 2013: Extreme Performance Series: Network Speed Ahead
 
LF_DPDK17_Implementation and Testing of Soft Patch Panel
LF_DPDK17_Implementation and Testing of Soft Patch PanelLF_DPDK17_Implementation and Testing of Soft Patch Panel
LF_DPDK17_Implementation and Testing of Soft Patch Panel
 
SDN-enabled Data Center Bridging
SDN-enabled Data Center BridgingSDN-enabled Data Center Bridging
SDN-enabled Data Center Bridging
 
SDN, Network Virtualization and the Software Defined Data Center – Brad Hedlund
SDN, Network Virtualization and the Software Defined Data Center – Brad HedlundSDN, Network Virtualization and the Software Defined Data Center – Brad Hedlund
SDN, Network Virtualization and the Software Defined Data Center – Brad Hedlund
 
PLNOG16: Data center interconnect dla opornych, Krzysztof Mazepa
PLNOG16: Data center interconnect dla opornych, Krzysztof MazepaPLNOG16: Data center interconnect dla opornych, Krzysztof Mazepa
PLNOG16: Data center interconnect dla opornych, Krzysztof Mazepa
 
ONOS-Based VIM Implementation
ONOS-Based VIM ImplementationONOS-Based VIM Implementation
ONOS-Based VIM Implementation
 
Network virtualization
Network virtualizationNetwork virtualization
Network virtualization
 
Network and Service Virtualization tutorial at ONUG Spring 2015
Network and Service Virtualization tutorial at ONUG Spring 2015Network and Service Virtualization tutorial at ONUG Spring 2015
Network and Service Virtualization tutorial at ONUG Spring 2015
 
Inside Microsoft's FPGA-Based Configurable Cloud
Inside Microsoft's FPGA-Based Configurable CloudInside Microsoft's FPGA-Based Configurable Cloud
Inside Microsoft's FPGA-Based Configurable Cloud
 
EMEA Airheads How licensing works in Aruba OS 8.x
EMEA Airheads  How licensing works in Aruba OS 8.xEMEA Airheads  How licensing works in Aruba OS 8.x
EMEA Airheads How licensing works in Aruba OS 8.x
 
Data center network architectures v1.3
Data center network architectures v1.3Data center network architectures v1.3
Data center network architectures v1.3
 
Microsofts Configurable Cloud
Microsofts Configurable CloudMicrosofts Configurable Cloud
Microsofts Configurable Cloud
 
Container Service Chaining
Container Service ChainingContainer Service Chaining
Container Service Chaining
 

Ähnlich wie Stevens Hfc2010

Data Center Network Trends - Lin Nease
Data Center Network Trends - Lin NeaseData Center Network Trends - Lin Nease
Data Center Network Trends - Lin Nease
HPDutchWorld
 
Lecture notes - Data Centers________.pptx
Lecture notes - Data Centers________.pptxLecture notes - Data Centers________.pptx
Lecture notes - Data Centers________.pptx
SandeepGupta229023
 

Ähnlich wie Stevens Hfc2010 (20)

Data Center Network Trends - Lin Nease
Data Center Network Trends - Lin NeaseData Center Network Trends - Lin Nease
Data Center Network Trends - Lin Nease
 
To be smart or not to be?
To be smart or not to be?To be smart or not to be?
To be smart or not to be?
 
Practice of large Hadoop cluster in China Mobile
Practice of large Hadoop cluster in China MobilePractice of large Hadoop cluster in China Mobile
Practice of large Hadoop cluster in China Mobile
 
Software Defined Networking: Primer
Software Defined Networking: Primer Software Defined Networking: Primer
Software Defined Networking: Primer
 
OpenKilda: Stream Processing Meets Openflow
OpenKilda: Stream Processing Meets OpenflowOpenKilda: Stream Processing Meets Openflow
OpenKilda: Stream Processing Meets Openflow
 
Citrix Day 2015 Net Scaler Release 10.5 Update v10
Citrix Day 2015 Net Scaler Release 10.5 Update v10Citrix Day 2015 Net Scaler Release 10.5 Update v10
Citrix Day 2015 Net Scaler Release 10.5 Update v10
 
Tech 2 Tech: Network performance
Tech 2 Tech: Network performanceTech 2 Tech: Network performance
Tech 2 Tech: Network performance
 
Choosing MikroTik for Your Network
Choosing MikroTik for Your NetworkChoosing MikroTik for Your Network
Choosing MikroTik for Your Network
 
The Real World - Plugging the Enterprise Into It (nodejs)
The Real World - Plugging  the Enterprise Into It (nodejs)The Real World - Plugging  the Enterprise Into It (nodejs)
The Real World - Plugging the Enterprise Into It (nodejs)
 
Chapter - 1 Introduction to networking (3).ppt
Chapter - 1 Introduction to networking (3).pptChapter - 1 Introduction to networking (3).ppt
Chapter - 1 Introduction to networking (3).ppt
 
Scale Kubernetes to support 50000 services
Scale Kubernetes to support 50000 servicesScale Kubernetes to support 50000 services
Scale Kubernetes to support 50000 services
 
Scaling Kubernetes to Support 50000 Services.pptx
Scaling Kubernetes to Support 50000 Services.pptxScaling Kubernetes to Support 50000 Services.pptx
Scaling Kubernetes to Support 50000 Services.pptx
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyser
 
Chapter11
Chapter11Chapter11
Chapter11
 
5 maximazing networkcapacity_v4-jorge_alvarado
5 maximazing networkcapacity_v4-jorge_alvarado5 maximazing networkcapacity_v4-jorge_alvarado
5 maximazing networkcapacity_v4-jorge_alvarado
 
Vsat day-2008-idirect
Vsat day-2008-idirectVsat day-2008-idirect
Vsat day-2008-idirect
 
Lecture notes - Data Centers________.pptx
Lecture notes - Data Centers________.pptxLecture notes - Data Centers________.pptx
Lecture notes - Data Centers________.pptx
 
Robotics technical Presentation
Robotics technical PresentationRobotics technical Presentation
Robotics technical Presentation
 
IBM System Networking Overview - Jul 2013
IBM System Networking Overview - Jul 2013IBM System Networking Overview - Jul 2013
IBM System Networking Overview - Jul 2013
 
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
 

Stevens Hfc2010

  • 1. Architectural Differences in High-Frequency Trading Systems Jim Wang, CFA Program in Financial Engineering Stevens Institute of Technology Hoboken, NJ, 07030, USA
  • 2. Base Architecture Stock Exchange Trading Engine UDPx5 TCP GUI TCP
  • 3. Latency Differences • Based on Trading Engine Location: Desktop – Broker – Exchange. • 10 millisecond or larger: Engine on your desktop. • Btw 1-10 millisecond: Engine collocated with your broker. • 1 millisecond or less: Engine collocated with exchange matching engine.
  • 4. Engine on Desktop: Architecture Exchange Match Engine Broker Server Broker GUI API desktop internet
  • 5. Engine on Desktop: Performance • I,090027.015,3007,THC,SEL 200@4.800000G • S,090027.054,odId=3007 clId=0 pId=1646391774 st=PreSubmitted fil=0 rem=200 afPx=0.000000 lfPx=0.000000 pId=0 whyHeld= • I,094334.875,3087,RAD,CXL -500@1.100000 • S,094334.914,odId=3087 clId=0 pId=1646391853 st=Cancelled fil=0 rem=500 afPx=0.000000 lfPx=0.000000 pId=0 whyHeld= • Order = 54-15 = 39ms; Cancel = 914-875 = 39ms
  • 6. Engine on Desktop: Cost • Market Data Fee: NASDAQ Level I, NYSE Level I • US Securities & Commodities Non-Professional Bundle $10 • Free to clients who generate at least USD 30 per month. • Commission: <=300,000 Shares USD 0.0035. • Commission: 300,001-3,000,000 Shares USD 0.002. • Island Exchange Fees: Remove $0.0030; Add ($0.0025). • ARCA Exchange Fees: Remove $0.0030; Add ($0.0021)
  • 7. Broker Collocation: Architecture Exchange Match Engine Broker Server GUI desktop internet API Broker Data Center
  • 8. Broker Collocation: Performance • D36262260,OCCG001A 20100623100422CCG001A 00034927FMN T0000010000000000999992 14.5600 0.0000YISLD YN00000NNN 0.000000000INET,1437,1438,0,0 • <36262265,PCCG001A 13197704 3492700000013197704 FMN T00000100 14.5600100422ISLDINET • Order = 65-60 = 5ms; • D36262698,XCCG001A 20100623100422CCG001A 13188804,AFE,2336,2368,0,0 • <36262702,PCCG001A 13188804 3482700000013188804 AFE B00000000 23.1300100412ISLDINET • Cancel = 702-698 = 4ms
  • 9. Broker Collocation: Cost • Collocation Fee: > $200 per month • Market Data Fee: Level I and II, Professional > $600 per month • Commission: USD 0.0005 – 0.001 based on volume • Island Exchange Fees: Remove $0.0030; Add ($0.0025). • ARCA Exchange Fees: Remove $0.0030; Add ($0.0021)
  • 10. Exchange Collocation: Architecture Exchange Match Engine Broker Check GUIdesktop internet API Exchange Data Center Sponsored Access Naked Access
  • 11. Source of Latency • Propagation latency: speed of light 5us/km, Mahwah – Weehawken 40km. • Transmission latency: high speed communication link throughput rate 1-10 Gbps. 1us/1kb to serialize and transport. • Processing latency. dedicated CPU for critical threads, kernel bypass, hardware acceleration.
  • 12. Propagation Latency • Collocation within 200m 1us. • Dark Fiber: Optical fiber infrastructure that is currently in place, but is not being used (dark). • End-to-end direct connectivity, WAN elimination. • Dedicated use of a wavelength (not the cable), Wavelength-division Multiplexing.
  • 13. Transmission Latency • Cut-through switching: the switch starts forwarding a frame before the whole frame has been received. • Kernel Bypass: application communicate with NIC using special supplied lib without using standard system call. • RDMA (remote direct memory access): one computer place information directory into the memory of another.
  • 14. Context Switching Step 0 Step 1 Step 2 Step 3 Step 4 Read (user context) Sys Call Kernel Context Write (user context) Sys Call Kernel Context
  • 15. Processing Latency • Parallel Problem: With 10k symbols, 6 major exchanges, relatively independent, tasks be streamlined. • Through Software optimization: flexibility, take advantage of general purpose CPU improvements over time. • Through Hardware Acceleration: specialized hardware, improve consistency by reducing jitter.
  • 16. Software Optimization • Separation of high speed vs high complexity. Latency sensitive task in critical path, computation intensive tasks offload to separate thread/process. • memory caching: critical decision thread pined to a dedicated CPU. • inline vs function calls: C, C++, Java.
  • 17. Hardware Acceleration • Parallel processors (general purpose multi- core CPU, tile array architecture, cell broadband engine) • FPGA (field programmable gate array, specialized communication) • GPGPU (general purpose computation on graphic processing units for computational intensive tasks)