This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: TCP/IP Stack packet regrouping


On Mon, Jul 16, 2001 at 01:51:55PM -0600, Trenton D. Adams wrote:

> I'm curious as to what happens if I send 30K worth of data in one send?
> Will it all send at one time?

Probably not.  If you're using Ethernet, only ~1500 bytes at a
time can be sent.

> What happens if I receive 30K of data, will it receive all 30K
> at one time?

Probably not.

> If not, in blocking mode it will most likely appear to happen all at one
> time right?

Probably not. If you're using Ethernet, it will come in 1500
bytes at a time.

> In non blocking mode will I have to do a loop until all the data has
> been sent/received while adjusting the buffer pointer?

Correct.  You must do that in blocking mode also.

> p.s.
> I know that the packets may be received in any order, and that they
> won't all come in at the same time.  I don't actually want to know what
> happens at this low of a level.  I just want to know from a programmer's
> perspective.

>From a programmer's perspective, TCP is a reliable stream of
bytes.  If you get the bytes, you will get the bytes in the
right order with no corruption or duplication.

The size of the chunks you get from read() is undefined.  Some
programs assume that a write of <1500 bytes will result in a
corresponding read() of the same number of bytes.  Those
programs work on some platforms and networks and not on others.

-- 
Grant Edwards
grante@visi.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]