On Fri, 08 Mar 2013 07:17:32 -0500, Peter C. Chapin wrote:
> On 03/08/2013 07:12 AM, Dmitry A. Kazakov wrote:
>
> > Yes. UDP is wrong choice, almost always. For multicast purposes there exist
> > stream-oriented protocols which supersede UDP, e.g. PGM. So, except for
> > communication to legacy devices and LAN broadcasts UDP should never be
> > used.
>
> UDP is a good choice for simple request/response protocols where both
> the request and the response are small enough to fit into a single
> datagram.
No, because of non-delivery and ordering issues.
> For example: DNS. Also in this situation the overhead of TCP
> might be considered undesirable.
Which is largely an urban legend.
1. Once the non-delivery, acknowledge, ordering etc issues solved, UDP
would likely have bigger overhead than TCP. Remember that some parts of
those in the case TCP are implemented directly by the hardware. Whereas for
UDP it is the application = the CPU, which must do all the job.
2. There is no OS under which you could choke 1000 Base, even 100 Base
Ethernet on a P2P connection.
3. We did measurements actually. Latencies of TCP/IP (with NO_DELAY) and
UDP are basically same under VxWorks and Windows.
UDP could be used for connectionless (=> stateless) stuff which is
basically limited to network announcements.