FPGA와 NP 그리고 주문수탁규정

1.
지난 몇 일사이 재미있는 만남이 두번 있었습니다.

지난 주말 ZeroAOS에 대한 설명을 들으시러 두명의 손님이 찾아 왔습니다. 이런저런 이야기를 하는데 “NP(Network Processor)를 이용하여 시세피더(Feeder)를 개발하였는데 ZeroAOS와 통합하면 어떤가”라는 질문을 하시더군요. 모 증권사에서 DMA를 받고 있는 외국인투자자가 NP를 사용한다는 이야기를 들었던 적이 있어 좀더 자세히 질문을 드렸습니다. Intel의 IXP로 구현하였다고 하더군요.

또다른 만남은 어제 있었습니다. 자주 정보를 교류하는 RNIC전문가가 어떤 분을 모시고 방문하였습니다. 오년동안 FPGA로 한 우물을 판 분이더군요. DDOS탐지시스템을 FPGA로 개발하여 납품하거나 서비스를 제공하고 있다고 합니다. 자본시장내에서 FPGA로 기회를 만들어보고 싶은 듯 하였습니다.

관심이 가는 단어였지만 저와는 멀다고 느껴진 단어인 FPGA와 NP가 가까이 오고 있습니다.

2.
최근 해외 자료를 보면 FPGA만큼이나 네트워크 프로세서를 다룬 글을 자주 봅니다. 먼저 NP에 대한 개념을 잡을 수 있는 글을 소개합니다. 위키페디아가 정의한 NP입니다.

A network processor is an integrated circuit which has a feature set specifically targeted at the networking application domain.Network processors are typically software programmable devices and would have generic characteristics similar to general purpose central processing units that are commonly used in many different types of equipment and products.

좀더 자세한 글입니다. Network Processors of The Past, Present And Future입니다. 다른 글과 비교해보니 가장 잘 정리한 내용입니다.

저는 NP를 “Networking에 특화한 CPU”라고 이해했습니다. 그렇기 때문에 프로그래밍이 가능합니다. 프로그래밍이 가능하기때문에 자본시장도 많은 관심을 가지고 있습니다. 미국에서 열린 Low Latency Summit에서 이야기된 내용입니다.

Packet processors are general purpose CPUs that have been optimised to perform I/O functions, such as memory management, packet steering, and network interfaces. ?Mantara uses packet processors from GE Intelligent Platforms, and also leverages network stack technology from 6Wind.Arnold noted that a packet processor direction provides good performance at the right price point, and that they approach FPGAs in terms of performance, but offer more flexibility, because they can be programmed using traditional techniques.
Mantara writes its code in C, rather than C++, in order to keep more control over the execution of it – there are “no surprises” with C, Arnold said.
Summit Compute Panel – Mantara’s Arnold on Leveraging Technology중에서

위의 글을 보면 6Wind라는 회사가 나옵니다. 이 회사가 NP와 관련된 개발환경을 제공하는 회사입니다. 6WIND의 CEO가 High Freqeuncy Traders와 인터뷰한 내용중 일부입니다. NP를 이용한 트레이딩시스템 개발사례입니다.

HFT: Do you have any examples where implementation of your technology has brought benefits to trading organisations?

Eric: Without disclosing any specific names we have a number of deployments in financial organisations. Our solution is used to implement TCP proxy de-capsulation and encapsulation of the protocol. One customer, an HFT platform provider, gave us a latency budget for this networking layer, which we then implemented. One very interesting feature is that our technology is completely implemented on an inexpensive Cavium Octeon processor running at 750 Mhz. With this we were able to implement the TCP proxy running at less than 10 microseconds. The new generation of Cavium processors (Octeon II) is running much faster (up to 1.5Ghz), which means that when necessary we will be able to significantly improve the performance of our TCP proxy function thanks to the performance of the processor technology.

Coming from the mobile infrastructure market, we have already implemented a number of protocols such as firewall, security (IPsec) and so on. These security features are going to be requirements for HFT in the future, so thanks to our background in mobile infrastructure, we are well placed to service these requirements.
Packet Processing in High Frequency Trading중에서

이렇게 NP를 사용하는 이유가 무엇일까요? 앞서 소개한 자료중 Mantara의 Anold는 이렇게 말합니다.

Arnold noted that the company has divided its technology approach into two streams, based on the latency needs of its customers. ?For those requiring less than 100 microseconds, it has a software platform running on commodity x86 hardware. ?For below 10 microseconds, it has a hardware/firmware offering.

For its software platform, Mantara focuses on the application architecture, paying attention to such details as binding threads to cores, keeping inter-thread communication to cores on the same chip, and making use of kernel bypass to deliver network traffic direct to the application. ?Using these techniques, latencies as low as 10 to 20 microseconds can be achieved.

For the sub-10 microsecond world, where improvements in the 100s of nanoseconds are sought, Mantara relies on a hardware PCIe card, hosting a packet processor, which executes functions in firmware.

위의 글중 소프트웨어적인 방법이 이미 ZeroAOS도 적용하는 방법입니다. 그렇지만 10마이크로초이하로 레이턴시를 관리하고자 할 때 하드웨어적인 방식을 사용한다는 의견입니다.

FPGA는 많이 소개하였습니다.

FPGA가 미래?
JPMorgan과 FPGA
하드웨어를 이용한 금융시스템의 성능 향상

그리고 dolppi님도 긴 글을 번역 소개한 적이 있습니다.

FPGA, The Next Wave of HFT Technology? (by David Quarrell)

어제 FPGA와 관련된 대화는 주제가 달랐습니다. 어떤 제품이나 서비스를 개발하면 가능할까라는 질문이었기때문입니다. 저의 답변은 “Hardware Accelerated FIX Engine”이었습니다. 이미 사례도 있습니다. 미국 WallstreetFPGA라는 회사가 FIX관련 FPGA제품을 공급하고 있기때문입니다. ?Exture+의 시대가 도래하면 FIX접속이 보편화합니다. 더불어 Low Latency를 지원하여야 합니다. 이 때 소프트웨어적인 방식보다는 하드웨어적인 방식이 훨씬 높은 성능을 낼 수 있습니다. 그래서 의견을 말씀드렸습니다.

3.
그러면 FPGA와 NP기술과 주문수탁규정이 무슨 관계가 있을까요? 앞서 주문수탁규정을 소개한 글에서 방화벽이 무척이나 중요하다고 이야기했습니다. 그래서 FPGA로 개발된 방화벽을 도입하여 방화벽 레이턴시를 줄여야 한다고 권고하였습니다. 그 다음은 어떤 프로세스에 하드웨어를 도입할 수 있을까요?

먼저 든 부분은 FEP입니다. 그렇지만 암호화를 알고리즘이 아니라 제품으로 규정한 어처구니 없는 거래소의 정책때문에 쉽지 않습니다. 더불어 현재 거래소의 프로토콜은 씽크방식입니다. 이래저래 머리만 아픕니다. 그래서 저는 ?미니원장이라고 생각해 보았습니다. 비슷한 사례가 해외에 있습니다. SEC가 15C3-5규정을 도입하면 Pre-Trade Risk Filtering이 의무화되었습니다. 이 때문에 Latency가 늘어난 회사들이 좀더 빠른 방법을 찾은 곳이 FPGA입니다. Sungard나 ULLink등이 FPGA로 서비스를 제공하고 있습니다.

현재까지 원장프로세스가 ?레이턴시를 줄이는 방법은 데이타관리입니다. DBMS를 디스크에서 메인메모리로 변경하였고 오버헤드가 높은 DBMS를 대신하여 Shared Memory를 이용하고 있습니다. ZeroAOS도 Shared Memory를 사용하지만 Hash Table을 구성하는 알고리즘을 별도로 개발하여 속도를 높이고자 했습니다. 소프트웨어 해쉬보다 더 빠른 것이 하드웨어 해쉬입니다. FPGA나 NP를 이용한 하드웨어해쉬는 한자리정도의 나노초라고 합니다. 미니원장서비스가 매력적인 이유입니다.

한번 도입하실 의향이 없으세요? 남과 같은 기술과 방법으론 레이턴시경쟁에서 이길 수 없습니다.

Leave a Comment

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.