Re: Variable Length Packets

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 02/09/04


Date: Mon, 09 Feb 2004 02:38:25 GMT

In article <yw1x1xp5qgmn.fsf@kth.se>, mru@kth.se (Måns Rullgård) wrote:

> Barry Margolin <barmar@alum.mit.edu> writes:
>
> > If you're using UDP, the behavior if your buffer isn't big enough
> > isn't specified. Some implementations will return the rest of the
> > packet in a subsequence call to read(),
>
> Is that right? How does the application determine packet boundaries
> in those cases?

You're expected to know the maximum size of the packet that can be sent
in the particular application protocol, and make your buffer big enough.
A call to read() will never return more than one datagram, so you don't
have to worry about packets getting combined.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


Relevant Pages

  • Re: Interesting TCP behaviour with large sends/small buffers
    ... My current workaround is simply setting the send buffer to a larger ... The server, upon connection, sends a configurable number of bytes to ... packet before sending the next packet. ... ACK, according to the delayed ACK algorithm - 50KB bytes means 34 MSS- ...
    (microsoft.public.win32.programmer.networks)
  • Re: Losing UDP packets with MFC Sockets
    ... a call to ReceiveFrom method is done. ... 2.- A CByteArray object is creating with 'new' with data received from buffer. ... class to indicate the packet arrival. ... CPU load is not the main culprit in UDP ...
    (microsoft.public.vc.mfc)
  • Re: Interesting TCP behaviour with large sends/small buffers
    ... The server, upon connection, sends a configurable number of bytes to ... I set the client's receive buffer size to 1MBps, ... packet before sending the next packet. ... ACK, according to the delayed ACK algorithm - 50KB bytes means 34 MSS- ...
    (microsoft.public.win32.programmer.networks)
  • Re: Fundamentals question, is this how it works?
    ... You maintain a buffer for the last incomplete packet. ... receiving that many bytes i then break and wait for the next set of data ... With a tcp stream socket what happens when it is reading say 4000bytes ...
    (microsoft.public.win32.programmer.networks)
  • Re: Design of a Router
    ... packet forward it and than close the port and move to the next and so ... would ideally like the router as small and as fast as possible. ... size of your buffer (just keep in mind that if you have 4 ports than ...
    (comp.lang.verilog)