Re: A throttle needed for UDP sendto()???



On Mar 8, 1:40 pm, guu...@xxxxxxxxxxx wrote:

I use UDP to transfer 64K datagrams between two local PC's over
100Mbps
Ethernet connection. Works fine under normal conditions. However, when
my sender code generates calls to sendto() at max speed, the datagrams
are
lost.

UDP is a best effort protocol. Datagrams can always be lost.

sendto() does not return any error code, send buffer is set to
50MB
but it does not make any difference because sendto() with large
datagrams
of 64K blocks the caller until all bits are sent. The receiving PC
does not
see any of the lost datagrams. It only sees the datagrams that get
through.

Apparently, the datagrams are trashed in the physical connection.

Actually, they're most likely being discarded by the sender. But UDP
datagrams can be lost anywhere. The sender can opt not to send them,
the network can lose, reorder, or duplicate them, and the receiver can
throw them away. That's how UDP works.

I tried a direct connection with crosswire cable, and through a switch
and the datagrams are lost in either case.

Again, that is the nature of UDP.

When I put a very small delay/sleep between each call to sendto(),
then all datagrams get through. Does it mean that sendto() requires
a throttle?

UDP requires the application to do transmit pacing if the traffic is
very bursty or a very large amount of data needs to be sent. I
strongly recommend you use TCP if you need its features, rather than
trying to re-implement TCP yourself.

DS

.



Relevant Pages

  • Re: A throttle needed for UDP sendto()???
    ... my sender code generates calls to sendto() at max speed, ... UDP is a best effort protocol. ... Datagrams can always be lost. ...
    (comp.os.linux.networking)
  • Re: A throttle needed for UDP sendto()???
    ... when my sender code generates calls to sendto() ... at max speed, the datagrams are lost. ... type, those 64K messages you hand to UDP ...
    (comp.os.linux.networking)
  • Re: A question regarding MTU: how it can effect TCP performance + other queries
    ... my question is not regarding TCP. ... My concern is about UDP throughput that why UDP Iperf is reporting UDP ... Sending 1470 byte datagrams ... did not receive ack of last datagram after 10 tries. ...
    (microsoft.public.development.device.drivers)
  • Performance on udp socket
    ... (UDP 150 byte) ... with bad checksum ... broadcast/multicast datagrams dropped due to no socket ...
    (freebsd-performance)
  • Lost datagrams on z/OS 1.12?
    ... that uses sendtoto send UDP messages (datagrams). ... There is relatively little difference between how the two issue sendto(). ... send email to listserv@xxxxxxxxxxxxxxx with the message: INFO IBM-MAIN ...
    (bit.listserv.ibm-main)