Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A Reliable UDP Implementation

I need an implementation of UDP that meets the following criteria:

  • Available on Linux and Mac (only latest versions matter)
  • Usable from C++
  • Orders packets
  • Guaranties packet delivery
  • Non conection oriented (like UDP)

NOTE: I do NOT want to use TCP for this. NOTE: It can be implemented by any socket API, as long as it is available on the two platforms and is available to C++.

EDIT: I have looked at the UDT, RUDP, and SCTP. These seem to be the major contenders. Any thoughts?

EDIT: UDT seems to be what I am looking for. Is the fact that it is implemented in user-space over the kernels UDP going to be a huge performance problem? Or will the speeds still be faster than TCP/STCP?

EDIT (2/15/12): I have came up with a solution that uses TCP and a central redirection server. The system lets one client send data to the server through an ever-open TCP connection, who them gives it along to the right other client along the server's TCP connection to the second.

like image 283
Linuxios Avatar asked Jan 27 '12 00:01

Linuxios


People also ask

Is it possible for UDP to be reliable?

UDP (User Datagram Protocol) is an unconnected transport layer protocol in the OSI (Open System Interconnection) reference model, providing a transaction-oriented simple unreliable information transfer service. It is called “unreliable” because there is no handshake or verification of the data transfer.

Can you make UDP 100% reliable?

Theres no 100% reliable method of ensuring your UDP messages are sent and received, however you can use acknowledgment messages to and from in your apps to see if you do get the send and receive message. Youre most reliable method would always be over TCPIP and send the packets, but then this isn't always 100%either.

Why UDP is reliable protocol?

As UDP provides unreliable data transfer protocol which is unreliable services of things and the worst it sometimes goes missing without notice. Reliable UDP uses both positive and negative feedback to provide data reliability which provides reliable data transfer.


1 Answers

This is an old question, but I saw that nobody answered anything about UDT. I have some experience with it, so I can share them.

UDT works pretty good. You basically use it like you would an UDP socket, and get all the thing that you listed from it.

Performance-wise, I haven't noticed any problems. Actually, it has several algorithms to maximise throughput, and you can get quite amazing results (I got >90 MB/s on a 100 MB/s Ethernet LAN). It works fine over slow / high latency links, too.

It's not perfect, of course, and some errors scenarios are not handled the way I'd like, but, for the most part, you just "plug it in" and you're good.

like image 189
srdjan.veljkovic Avatar answered Sep 21 '22 19:09

srdjan.veljkovic