TCP – Why Creating a New TCP Connection is Regarded as Expensive

networkingtcp

I do not understand why creating a new TCP connections is considered an expensive task. Basically setting up a new connection refers to performing TCP's 3-way handshake. So that's sending two packets and receiving one. Considering that thousands of (data-)packets will follow, the handshake can't be the expensive part. Can it?

Best Answer

I believe, generally speaking, that opening a TCP connection is considered expensive when compared to the ability to reuse already open connections by keeping it open. You are correct, opening a connecting will take only 3 packets/turns, but that time - 3 x your RTT - is far beyond the cost of reusing an already open connection, which is far closer to 0. The disparity grows even faster if you're opening and closing connections frequently.

You are certainly correct though, when compared to the number of turns you're going to see as the application "does it's thing," those 3 packets can seem pretty small, but again, it depends on how you want to compare the options AND how your application behaves/how many times you plan on opening a connection.

Edit If we're talking UDP vs. TCP though, Cheekaleek here is 100% correct - the overhead of is massive in the long term when compared to the connectionless operations of UDP

Related Topic