[Twisted-Python] How to achieve a reliable "connection" over UDP?

Peter Valdemar Mørch swp5jhu02 at sneakemail.com
Mon Jul 23 02:48:47 EDT 2007


I'm looking to implement an application that needs reliable connections,
like one gets with TCP, but only using UDP "on the wire".

The application can only use UDP, as I'd like to rely on UDP hole
punching (p2p). (P2P over TCP is notoriously difficult).

I want to be certain that my packets get delivered, that they are in
order, to transfer data larter than 64K, etc - just like in TCP.

Of course, I could implement the TCP protocol myself for use over UDP,
just as the IP protocol stack does for TCP over IP. Or use TCP over PPP
over UDP. But is there "a better way"?

I'm thinking basically all p2p applications will need this sort of
"reliability" over UDP for e.g. file transfer, so I'm hoping there is
something already written.

How would one go about this?

Peter Valdemar Mørch

More information about the Twisted-Python mailing list