tcpip-fragmentation

What is the rationale for segmenting data in an application before sending via TCP/IP?


When sending via TCP/IP, is there a rationale for segmenting data in an application to avoid potential fragmentation in the IP layer?

Given that IP reassembles fragments prior to bubbling up to TCP, is there any processing/efficiency rationale for segmenting and reassembly in the application?


Solution

  • There isn't any. TCP will segment any way it likes, and IP will fragment any way likes, and both know a lot more about network conditions than the application does. The best way to use TCP is to write to it in large chunks as fast as possible and let it do what it is designed to do.

    Your second question is merely a rewording of the first.