On Wed, 2009-08-26 at 18:03 +0200, Baptiste Chaboud-crousaz wrote: > Hi all, > > Is lwip able to reassemble fragmented TCP packets? If yes, how? > > In fact my stack is supposed to receive a HTTP POST request split into > 2 TCP fragments. At the TCP level, both fragments are set with > "Position fragment/Fragment offset" = 0 and "More fragment"=0. As a > result, ip_reass is never called. At the TCP level, does a mechanism > of reassembly exist?
TCP takes a stream of data from the application, splits it into segments, and these are sent by the network over IP. The receiving TCP then takes the segments and combines them back into a stream of data bytes that it gives to the application. There is no guarantee about the size of chunks that are delivered to the receiving application: they could match the chunks that the sending application used, but in most cases will not. It's therefore up to the application to call read() (or whatever API it's using) to get the data it requires, even if that means calling read() more than once and combining the two returned buffers. Kieran _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
