<div dir="ltr">Thanks Paul for the explanation. I am still reading it.<div><br></div><div>Regards,</div><div><br></div><div>Kaushal</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, 24 Nov 2015 at 05:20 Paul Wouters <<a href="mailto:paul@nohats.ca">paul@nohats.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, 23 Nov 2015, Kaushal Shriyan wrote:<br>
<br>
> Is it better to go with IPsec over TLS for server to server communication?<br>
> I know TLS is at Layer 7 (Application layer) and IPsec is at Layer 3 and inside linux kernel.<br>
<br>
Do you mean use TLS on the application or use a TLS VPN? There is a big<br>
difference. If you are just doing HTTP between the servers, perhaps TLS<br>
is easier. If you are going to do all kinds of different communication<br>
between the servers, then IPsec is much better.<br>
<br>
IPsec covers all traffic while (application) TLS only covers only specific<br>
port/application. If using a TLS VPN then all ports are covered too, but things<br>
are also worse, because the packet goes from kernel to userland, decrypts there,<br>
then back to the kernel. That's a lot of overhead. And if there is<br>
packet loss, you will have two application layers attempting to<br>
retransmit and things get even worse. Or your UDP application suddenly<br>
turns from Unreliable to Reliable, which is not what you want for<br>
instance for audio streams where lost packets should be forgotten, not<br>
retransmited.<br>
<br>
You can read this draft's introduction on why doing VPN over TCP should<br>
only be a last ditch effort at doing a VPN:<br>
<br>
<a href="https://tools.ietf.org/html/draft-pauly-ipsecme-tcp-encaps-01" rel="noreferrer" target="_blank">https://tools.ietf.org/html/draft-pauly-ipsecme-tcp-encaps-01</a><br>
<br>
Paul<br>
</blockquote></div>