Implementing PseudoTcp in Java
Back when protocols for real-time communication were invented, everyone was supposed to communicate directly. If Bob wants to call Alice, they just exchange their IP addresses and the fun could start. Well … that was then. Things are a bit different now because, in the mean time, NATs arrived. Now we all have fake IP addresses and rely on our home gateways to translate them into actual IP addresses.
While most of the time using NATs, they make it rather complicated to establish a direct connection with peers that are also behind NATs of their own. Of course complicated does not mean tricky and people have set out on inventing a bunch of NAT traversal mechanisms such as ICE, STUN, TURN, UPnP, JingleNodes and many others. The thing is that most of these are quite easier to use with UDP rather than TCP.
Well, luckily, most audio/video communication today happens over UDP so that may not seem like a very big deal. However, one service where this is not true is file sharing. When exchanging files with others, you’d normally want for the entire file to reach its destination without losing a single bit. Obviously plain UDP doesn’t fit here.
So! This is where it gets interesting and this is what this project is about. In order to guarantee reliability but still benefit from UDP’s easy NAT traversal, the GoogleTalk developers came up with a tiny TCP variant that works on top of UDP. That protocol is called PseudoTcp and it is part of Google’s “libjingle”.
To sum it all up: the PseudoTcp protocol adds a thin layer on top of UDP in order to guarantee packet reliability.
We would like to make this protocol usable in Java and we would like to add it to our ice4j library.
You like the thought of that? Looking forward to reading your application then!
libjingle: Google Talk Voice and P2P Interoperability Library
Other Jitsi GSoC Projects
Other XMPP GSoC Projects
Jitsi Developer Documentation
The official Jitsi website