Christian Seberino wrote:
Yes but wouldn't you need to know the size of *each* TCP packet?....
No. An entire IP packet (after defragmentation) is given to to the TCP stack. The stack then looks at the header to find out which 'socket' to put the payload into, and then pushes the payload onto the end of the socket buffer.
I assume you don't need an explicit TCP length field because you can calculate the TCP packet length by substracting the TCP header length from the *IP packet* length. (IP packets *do* have length field.)
Only the IP stack needs the length so it can generate a buffer big enough to give the 'data' to the TCP stack. Once this data gets to the TCP stack, the TCP stack only cares about everything after the header in the buffer. It doesn't care how big it is. UDP on the other hand does care, becoz each packet put into the socket buffer is self contained, and it's all or nothing with UDP.
Since you can do the same for UDP it still appears that the UDP length field is redundant and unnecessary.
No, that would assume that UDP has to run over IP, which it doesn't -- Michael O'Keefe | [EMAIL PROTECTED] Live on and Ride a 03 BMW F650GSDakar| [EMAIL PROTECTED] / | I like less more or less less than |Work:+1 858 845 3514 / | more. UNIX-live it,love it,fork() it |Fax :+1 858 845 2652 /_p_| My views are MINE ALONE, blah, blah, |Home:+1 760 788 1296 \`O'| blah, yackety yack - don't come back |Fax :+1 858 _/_\|_, -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
