Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

High Frequency Trading - TCP > UDP?

I was told that for a High Frequency Trading (HFT) system that requires low-latency, TCP is used over UDP. I was told that with TCP you can make point to point connections, whereas you cannot with UDP, however from my understanding you can send UDP packets to specific IP/port.

There are several arguments used in this article as to why UDP > TCP for gaming but I can see relevance for HFT.

Why would TCP be a better protocol to use for HFT?

(Admins: My previous post of this question was silently removed with no explanation. If I am violating terms of use please alert me of this instead of silently removing the question)

like image 582
n00b Avatar asked Oct 31 '11 02:10

n00b


People also ask

Which is better TCP or UDP?

TCP is more reliable than UDP. It transfers your data packets from your device to a web server. UDP is faster and simpler, but it doesn't guarantee the delivery of packets.

Does Instagram use TCP or UDP?

Hence TCP is used in Text Communication due to its reliable transmission, error control, and in order receiving of the data. Example : Whatsapp, Instagram, Google Chat,iMessage. TCP is used in File transfer when we cannot tolerate the loss of data and receiving the data incorrect order is of utmost importance.

What is TCP UDP used for?

TCP provides apps a way to deliver (and receive) an ordered and error-checked stream of information packets over the network. The User Datagram Protocol (UDP) is used by apps to deliver a faster stream of information by doing away with error-checking.

Which is faster between UDP and TCP?

TCP is a connection-oriented protocol, whereas UDP is a connectionless protocol. A key difference between TCP and UDP is speed, as TCP is comparatively slower than UDP. Overall, UDP is a much faster, simpler, and efficient protocol, however, retransmission of lost data packets is only possible with TCP.


1 Answers

UDP is superior to TCP if you don't need some of the features TCP provides. Every feature has a cost, and so if you don't need features, you are paying that cost for no reason.

In an HFT application, you need pretty much every feature TCP requires. So if you picked UDP, you'd have to implement those features yourself. That means you'd have to implement connection establishment, connection teardown, retransmissions, transmit pacing, windows, and so on.

If there was a way to do all those things that was better than the way TCP was doing it, TCP would be doing it that way. You'd have one hand tied behind your back because TCP is heavily optimized by some of the best minds on the planet and implemented in/with the kernel.

like image 171
David Schwartz Avatar answered Sep 23 '22 13:09

David Schwartz