Re: Can recvfrom() return more than 1 packet?



David Schwartz wrote:
Robert Harris wrote:

Yes. If a UDP datagram is too large to fit in a single packet, it will
be sent in as many packets as needed and they will be re-assembled
before you receive them.

A fragment is a fragment: a fragment of a packet, not a packet. A UDP
datagram is a (one) IP packet.

I'm afraid you are mistaken. The IP layer fragments UDP datagrams into
as many IP packets as are needed. These IP packets are then reassembled
back into the original datagram.

Read RFC791, the specification for IP itself. It contains the following
excerpts:
[snip]

OK. The official term for a "whole" IP packet is a datagram. But,
getting back to the original post, what you get when you call recvfrom()
on a SOCK_DGRAM socket is the (possibly reassambled) datagram, not a
fragment thereof.

Robert
.



Relevant Pages

  • Re: CAsyncSocket datagram reading with ReceiveFrom()
    ... Your next read request will receive the next datagram. ... Your presumption that you can actually receive 4 packets is unfounded. ... and the network stack is free to discard any incoming packets after that if it ... And you absolutely do NOT want to make a socket "blocking". ...
    (microsoft.public.vc.mfc)
  • Re: Voice encryption (Stream vs CBC mode)
    ... > datagram for a short time to fill the gap until the next datagram ... a MAC every 10 packets is not possible. ... The redundancy in the voice data encoding could address packet loss (but ... "Smearing" redundant information about the voice data across ...
    (sci.crypt)
  • Re: Can recvfrom() return more than 1 packet?
    ... as many IP packets as are needed. ... back into the original datagram. ... " The internet modules use fields in the internet header to fragment ... " Fragmentation of an internet datagram is necessary when it ...
    (comp.unix.programmer)
  • Re: 64K limit for socket send
    ... 150 MTU, isn't it better for the server to send 1500 size packets ... arrive at the receiver for the datagram to be reassembled. ...
    (comp.os.vms)
  • Re: is a NAT device/home router - a router?
    ... >>Patrick Schaaf wrote: ... There is a slight difference in the meaning of IP datagram and IP ... datagram is the packet to be fragmented, and the packets after they are ... You seem to have more disdain for terminology than most that rsepodn on ...
    (comp.dcom.lans.ethernet)