chrisapotek
chrisapotek

Reputation: 6227

Can you optmize/configure TCP inside your controlled network so it becomes as fast as UDP?

I am considering writing my own implementation of reliable UDP (packet ordering and retransmission for packet drops). This is for internal systems inside my controlled network. I wonder if it is possible on a Linux system to optimize TCP so much that it becomes as fast as UDP? If it is I will just use super-optimized TCP and not worry about implementing reliable UDP.

Upvotes: 1

Views: 233

Answers (2)

Quentin Casasnovas
Quentin Casasnovas

Reputation: 1099

There are a few things that you can do to adapt TCP to your specific needs. You can increase the maximum buffer size, change the congestion algorithm and much more. I think it's really worth trying before re-inventing the wheel, especially since you seem to have a good control over your internal network. This article describe a few of those things. Another good source of information for all those parameters is Documentation/networking/ip-sysctl.txt in your Linux source code.

You can also check that the TCP Selective Acknowledgement (SACK) is enabled on your Linux by looking at /proc/sys/net/ipv4/tcp_sack.

Upvotes: 2

Ben Voigt
Ben Voigt

Reputation: 283684

There are different measures of performance (throughput, latency, jitter, robustness to packet drop).

You can't get packet delivery and ordering guarantees without introducing arbitrary delay. In that sense, reliable UDP cannot be "faster" than TCP.

It's possible to use FEC to reduce the number of retransmits, at the expense of additional bandwidth. That would only improve throughput over a very lossy link though. It will reduce jitter and maximum latency over a link with any drops.

Or are you talking about TCP fairness vs UDP greediness?

In any case, your OS TCP layer is already very highly optimized, it's unlikely you can do better without changing the rules of the game (e.g. sacrificing fairness).

Upvotes: 2

Related Questions