Exchange Architecture

Deepak Sanchety
4 min readMar 1, 2019

--

This article is a refresher on the high level NSE trading architecture. The article tries to explain the overall data flow from order to tick and back in any exchange environment with a special emphasis on NSE.

Image Courtesy: https://pixabay.com/photos/stock-exchange-trading-floor-738671/

A typical order driven electronic exchange using TBT (Tick By Tick) dissemination broadly has the architecture as shown in figure 1 below. The figure only shows a high level data flow and does not intend to capture finer details.

Figure 1: Exchange Architecture [1, 2]

1. Order Gateways: IPs or Gateways from where the brokers / customers send their orders. Millions of customers sending orders via thousands of brokers and intermediaries land up at these gateways. Orders may get routed via satellite, fixed line, internet or even wireless.

2. Accumulator: All the orders at various gateways are accumulated into a single stream of orders. Based on the Price-Time priority, orders are sequenced.

3. RMS: All orders pass through an exchange Risk management system to ensure that order is safe to be entered into the market. These checks are mostly to check if the order is within predefined parameters of price, size, capital adequacy etc.

4. Matching Engine: Once an order is given a clearance, orders are sent to matching engine to be placed into the order book. Matching engine is like the old-time trading floor where based on price, qty and time of arrival, the orders are either matched or asked to wait in the order book.

5. Primary Data Server (PDC): Once the order is matched, the information packet about the order/trade is given to PDC to be converted into a tick. PDC groups multiple packets of information together into a single packet called a tick. This tick is then given to TBT server for distribution [1, 2].

6. Network: All of the above components transfer data between each other on the network. These network components often consist of switches, routers, firewalls etc.

7. TBT POP server: All of the ticks are disseminated to various members by the POP server. During TCP TBT, each POP server at NSE had 3 ports which disseminated data to various members. TBT feed was available only for colocated servers of members[1, 2].

8. Broadcast servers: All the ticks are also disseminated as a level 2 feed. This feed is slower than TBT feed. This snapshot feed is available everyone, whether colocated or not.

9. Exchange Network: The ticks then go through a network link between the exchange and the member to reach the member’s network.

10. Member’s Colocation Network: The tick goes through the member’s network to the Member’s trading system. In colocation, the member network is located in the exchange premises in close proximity to the exchange’s network.

11. WAN Network: Members on VSAT or leased line get the ticks after passing through a much longer network spanning across cities, states and even countries.

12. Member’s Non Colocation Network: After going through the Colocation Network or the WAN network, the tick finally reaches the member’s trading servers.

13. Trading System: Member’s trading system is large enterprise software which reads the tick, creates a market book, runs a strategy, creates a decision, performs risk management checks and finally creates an order. This order is then routed to the gateways via the network.

NSE TBT data dissemination architecture

During 2010–16, NSE disseminated TBT data on TCP. This was later changed to Multicast protocol. During 2014–16, both protocols co-existed. 2016 onwards, TCP-IP was discontinued and only multicast protocol is being used.

The NSE’s TBT tick data dissemination for TCP dissemination was three-layer architecture [1, 2].

Layer 1 (7.1 in Figure 1): PDC server received information from matching engine and converted them into ticks. These ticks were disseminated to layer 2.

Layer 2 (7.2 in Figure 1): There were five POP servers which received ticks from layer 1. Each POP server independently sent this tick to layer 3.

Layer 3 (7.3 in Figure 1): There were three sender ports for each POP server. Each sender port independently sent ticks to clients connected to it.

Data from one layer to another was sent sequentially i.e. one after the other. Between layer1 and layer2 the order of data dissemination was fixed for a given day. But this order changed day after day. This meant no single POP server in layer2 was given any preference. Between layer2 and layer3, the order of data dissemination was not only fixed for a given day but was fixed throughout. Data was first disseminated to port 10990, then to port 10991 and finally to port 10992. Thus port 10990 could have been said to have had preference in data dissemination.

[1] Deloitte forensic report on NSE colocation , as posted on wordpress. Contents not verified by the author of this blog. Readers to use discretion.

[2] E&Y forensic report on NSE colocation , NSE press release.

Next, I’ll try to explain how things are very different across trading firms and there is no ceteris paribus.

All articles are here. The author advises market participants in legal matters related to securities markets and has advised some noticees in this matter also.

--

--

Deepak Sanchety

Engineer, retired bureaucrat (IRS), Ex-Chief of Market Surveillance at SEBI. Advisor to corporates and market participants. Technology enthusiast.