6

I realise this is a somewhat open ended question...

In the context of low latency applications I've heard references to by-passing the TCP-IP stack.

What does this really mean and assuming you have two processes on a network that need to exchange messages what are the various options (and associated trade-offs) for doing so?

Joel
  • 29,538
  • 35
  • 110
  • 138

3 Answers3

4

Typically the first steps are using a TCP offload engine, ToE, or a user-space TCP/IP stack such as OpenOnload.

Completely skipping TCP/IP means usually looking at InfiniBand and using RDMA verbs or even implementing custom protocols above raw Ethernet.

Generally you have latency due to using anything in the kernel and so user-space mechanisms are ideal, and then the TCP/IP stack is an overhead itself consider all of the layers and the complexity that in can be arranged: IP families, sub-networking, VLANs, IPSEC, etc.

Steve-o
  • 12,678
  • 2
  • 41
  • 60
  • Stupid question, but if you completely skip tcp-ip are processes still addressed by ip:port ? – Joel Sep 08 '11 at 09:35
  • @Joel there are many options including IP over IB and using IPv4 addressing for RDMA devices. Each avenue has been ventured to determine whether it is faster or more compatible. – Steve-o Sep 08 '11 at 09:38
  • From Open Onload: " It achieves performance improvements in part by performing network processing at user-level, bypassing the OS kernel entirely on the data path" .... as you said in your answer. Thanks, this is the sort of information I was looking for. – Joel Sep 08 '11 at 09:49
1

This is not a direct answer to your question but i thought it might give you another view on this topic.

Before trying to bypass TCP-IP stack I would suggest researching proven real-time communication middleware.

One good solution for real-time communication is Data Distribution Service from OMG (Object Management Group)

DDS offers 12 or so quality attributes and has bindings for various languages.

It has LATENCY_BUDGET ,TRANSPORT_PRIORITY and many other quality of service attributes that makes data distribution very easy and fast.

Check out an implementation of DDS standard by PrismTech. It is called OpenSplice and works well at LAN scale.

O.C.
  • 6,711
  • 1
  • 25
  • 26
0

Depends on the nature of your protocol really.

If by low-latency applications you mean electronic trading systems, than they normally use IP or UDP multi-cast for market data, such as Pragmatic General Multicast. Mostly because there is one sender and many receivers of the data, so that using TCP would require sending copies of the data to each recipient individually requiring more bandwidth and increasing the latency.

Trading connections traditionally use TCP with application-level heartbeats because the connection needs to be reliable and connection loss must be detected promptly.

Maxim Egorushkin
  • 131,725
  • 17
  • 180
  • 271
  • UDP makes sense for market data broadcasts - but I'm less familiar with options not involving tcp for p2p comms. – Joel Sep 08 '11 at 09:37
  • I suppose you could build your application layer to handle "UDP with dropped packet detection" to get something approaching reliable – Joel Sep 08 '11 at 09:40
  • Broadcasts are not normally used for market data since UDP broadcast can't be efficiently routed. Multicast with IGMP protocol are used. – Maxim Egorushkin Sep 08 '11 at 09:42
  • Sure, I mean broadcast figuratively, rather than the technical sense. – Joel Sep 08 '11 at 09:56