3
\$\begingroup\$

Yesterday,I asked What is better? Lots of small TCP packets, or one long one?. At first, the answers tallied with what I thought the answer would be.


"enter image description here"


However, as the question got more and more views (How on earth did I get 1000+ views in a day??), I got more and more conflicting answers:


"enter image description here"


I am getting more and more answers which keep contradicting each other. They all have upvotes, which means that people must obviously agree with them.

What should I do in this scenario to try and get an understandable answer?

\$\endgroup\$
  • \$\begingroup\$ For future reference, this kind of broad, discussion-oriented question (your original question, not the meta one) is better asked in Game Development Chat. \$\endgroup\$ – Josh Mar 20 '15 at 15:45
  • \$\begingroup\$ "All the previous answers are incorrect." So... you're going to ignore all of the "edit" links and post another answer?? Ok. In my opinion, THAT is a problem with this format, not the questions. [Many] people [, here,] have an innate need to be "righter" than the other guy; "one-upper's". As if they are the only person in the universe with that specific knowledge. Like most cooperative/multiplayer games these days, most of the players are pursuing singleplayer goals. \$\endgroup\$ – Jon Apr 7 '15 at 1:17
  • \$\begingroup\$ From your description, I could visit the [deleted] question, compile the 3 partially-correct answers into "my" completely-correct answer and "induce" cooperation. \$\endgroup\$ – Jon Apr 7 '15 at 1:18
  • \$\begingroup\$ In other words, many of the "superusers", that you'd think would know better, still provide THEIR best answer, not 'A' best answer. (Not realizing that edits can quickly outpace answers, "point-wise") \$\endgroup\$ – Jon Apr 7 '15 at 1:19
6
\$\begingroup\$

The "problem", in this case, is that for any "What is better?" question, the answer will inevitably be "Well, that depends".

Phillips answer looks at it from a pure network protocol standpoint, pointing out that each packet will have overhead that could be avoided and things like packetloss and the routers in between the host and the client.

My answer doesn't delve into that (though that is part of the reasoning behind it, Phillip's answer is better) but notes that in standard TCP this doesn't really come up either way due to Nagle's algorithm.

Panda Pajama's answer points out that TCP is a stream protocol, you're not sending packets, your adding data to a stream that may be send in a single packet, it could also be split up at arbitrary point (even inside of one of your calls to send!).

All of these answers are different points of view on the same question, they don't contradict each other as much as complement each other. The reason you are getting multiple answers is that there are multiple answers, in some cases, small packets are better, in others larger. You're gonna have to figure out what is best for your application.

How you figure that out is typically by implementing the easiest and seeing if there are problems with using it in your application, if there are, you can see if it's worth trying out an alternative to make it work better.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .