[Standards] Jingle bootstrapping

Thiago Camargo thiago at jivesoftware.com
Fri Mar 2 02:26:52 UTC 2007


Here at Jive Software, I implemented a very nice and reliable transport negotiation for Jingle using "UDP Echo" instead STUN Connectivity Check.
This new method is very simple to implement and it's very reliable.
And we get almost everything that we need from the XMPP Server except client public address (which can be got from XMPP Server also, but just if the XMPP is direct connected to internet).
In other words, we are taking as much advantage as possible from using a XMPP channel, using a pretty smart way to negotiate a reliable transport channel.

Here goes a quick brief of the process:

* First we get every candidate, local and public.
* Try to get another extra one from XMPP Server that can be used as a Dynamic Relay Address. Uses a XMPP Stanza to get a Relay Candidate.
 * Sort them (candidates) using ICE rules.

Well, here comes the nice part:

* Open an ECHO Socket for every candidate. Everything that arrives goes back from where it came.
* Send our candidates, local, public and Relay.
* For every remote candidate that arrives for us from another party, we start to send UDP Packets with Random Passwords from our ECHO Sockets and waiting for a reply.
* When the first correct reply (Correct password for the correspondent ECHO Socket) arrives, we mark that candidate as "Valid", and stop its ECHO Socket. 
* Send back every valid remote candidate that we found.
* Wait for other party to send their preferred.
* Send our local preferred candidate from "Valid" candidates that arrived.

Voilá! We get 2 IPs and 2 ports to communicate.

It's very fast, reliable and don't demands many implementations using another protocols then XMPP.
Our goal is to get a fastest, reliable and XMPP only, transport negotiation.
We already started some tests to get rid of STUN Servers as soon as we can. Building a reliable XMPP Only transport negotiation.

You can check our implementation in Smack SVN in the trunk directory. And you can try it running Spark trunk version also located in SVN repository.

Thiago Camargo

More information about the Standards mailing list