Jingle: Cutting Edge VoIP

25
Jingle: Cutting Edge Open Source VoIP Matt Tucker CTO, Jive Software

description

Overview of the Jingle protocol extension for XMPP.

Transcript of Jingle: Cutting Edge VoIP

Page 1: Jingle: Cutting Edge VoIP

Jingle: Cutting Edge Open Source VoIPMatt Tucker

CTO, Jive Software

Page 2: Jingle: Cutting Edge VoIP

I like XMPP

Page 3: Jingle: Cutting Edge VoIP

The Vision:- People wouldn’t stop asking for

voice chat to be added toXMPP.

- or

- Worldwide federated network thatcombines messaging, presenceand voice. Ensure there areOpen Source tools for all of it.

Page 4: Jingle: Cutting Edge VoIP

Current approaches don’t work

- Skype

- Closed network

- Proprietary protocol

- SIP

- Poor protocol for IM and presence

- Very little world-wide federation

- Most implementations don’t do Skype-type p2p

Page 5: Jingle: Cutting Edge VoIP

In this talk- XMPP Overview

- All about Jingle

- Protocol flow

- NAT traversal (ICE)

- Open Source implementations

- Others uses for Jingle

Page 6: Jingle: Cutting Edge VoIP

XMPP- eXtensible Messaging and Presence Protocol

- Open standard approved by the IETF as RFC 3920 and 3921, maintained and extended by the XMPP Standards Foundation

- Countless servers and clients deployed in an open federation.

-XMPP already won as the open standard for

IM

Page 7: Jingle: Cutting Edge VoIP

XMPP Protocol Basics- XML based, making it very easy to use and

extend

- Strong security (TLS) and identity protection built-in Secure Communications with Jabber Peter Saint-Andre Time: 11:35AM - 12:20PM Location: D137-138

- Major packet types: Message, Presence and IQ

Page 8: Jingle: Cutting Edge VoIP

Sample XMPP Message

- <message to='[email protected]'

- from='[email protected]' type='chat'>

- <thread>thread1</thread>

- <body>How's that presentation going?</body>

- </message>

Page 9: Jingle: Cutting Edge VoIP

XEPs: XMPP Extension Protocols- Core RFC’s are extended through an open

process by the XSF

- Key extensions cover multi-user chat, file transfer, avatars, publish-subscribe

- Jingle is a set of XEPs

Page 10: Jingle: Cutting Edge VoIP

Example packet extension

- <message to='[email protected]'

- from='[email protected]'>

- <body>Blackjack!</body>

- <gameData xmlns='casino:blackjack'>

- <card1 rank='ace' suit='diamonds'/>

- <card2 rank='jack' suit='spades'/>

- </gameData>

- </message>

Page 11: Jingle: Cutting Edge VoIP

Jingle- Many attempts at VoIP were tried – stream initiation,

TINS, etc. None of them worked very well.

- Google launched their XMPP network with voice support, then joined the standards effort to define Jingle.

- Covered by several XMPP extensions: XEP-166: Jingle XEP-167: Jingle Audio via RTP XEP-176: Jingle ICE Transport XEP-177: Jingle Raw UDP Transport XEP-180: Jingle Video via RTP XEP-181: Jingle DTMF XEP-183: Jingle Telepathy Transport Method XEP-208: Bootstrapping Implementation of Jingle XEP-215: STUN Server Discovery for Jingle

- Acronym soup: ICE, STUN, TURN

Page 12: Jingle: Cutting Edge VoIP

Jingle in three easy steps1. Do you want a session?

Session Negotiation

2. What kind of session do you want to negotiate? (voice, video, file transfer?)

Content Negotiation

3. How are we going to make this session work? (direct connect, ICE, media proxy?)

Transport Negotiation

Page 13: Jingle: Cutting Edge VoIP

- <iq from='[email protected]/orchard‘ to='[email protected]/balcony‘ id='jingle1‘ type='set'>

<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns‘ action='session-initiate‘ initiator='[email protected]/orchard‘ sid='a73sjjvkla37jfea‘> <content creator='[email protected]‘ name='this-is-the-audio-content'>

<description xmlns='http://www.xmpp.org/extensions/xep-0167.html#ns'>

<payload-type id='96' name='speex' clockrate='16000'/>

<payload-type id='97' name='speex' clockrate='8000'/>

</description>

<transport xmlns='http://www.xmpp.org/extensions/xep-0177.html#ns'>

<candidate .../>

<candidate ip='10.1.1.104' port='13540' generation='0'/>

</transport>

</content>

</jingle>

- </iq>

Jingle packet example

Page 14: Jingle: Cutting Edge VoIP

SIP packet example- INVITE sip:[email protected] SIP/2.0

Via: SIP/2.0/TCP client.atlanta.example.com:5060;branch=z9hG4bK74bf9Max-Forwards: 70From: Alice <sip:[email protected]>;tag=9fxced76slTo: Bob <sip:[email protected]>Call-ID: [email protected]: 2 INVITEProxy-Authorization: Digest username="alice",realm="atlanta.example.com",nonce="wf84f1ceczx41ae6cbe5aea9c8e88d359", opaque="",uri="sip:[email protected]",response="42ce3cef44b22f50c6a6071bc8“Contact: <sip:[email protected];transport=tcp>Content-Type: application/sdpContent-Length: 151

v=0o=alice 2890844526 2890844526 IN IP4 client.atlanta.example.coms=-c=IN IP4 192.0.2.101t=0 0m=audio 49172 RTP/AVP 0a=rtpmap:0 PCMU/8000

Page 15: Jingle: Cutting Edge VoIP

Transport approaches1. Always use the server to transport media

- Pro: always works (we’re using the server to send XMPP packets already)

- Con: overloads the server, may be too slow for real-time protocols like voice/video. (~2000 concurrent users max)

2. Try to go peer to peer

- Pro: scales forever. Best way to build a worldwide network.

- Con: gets really complicated with firewalls and NATs.

Page 16: Jingle: Cutting Edge VoIP

Making peer to peer work- Step 1: try direct connect between IP addresses.

(typically only works inside a local network)

- Step 2: if #1 fails, the parties are probably behind a firewall or NAT. Do some “crazy stuff” to punch through.(can work up to 90% of the time)

- Step 3: if #2 fails, there’s a pretty strict firewall in place so failover to using the server (media relay)(catch the other 10% or so)

- The sum of these techniques is ICE, at the cutting edge of VoIP connectivity

Page 17: Jingle: Cutting Edge VoIP

Jingle connection architecture

Page 18: Jingle: Cutting Edge VoIP

What is NAT?- Problem: the internet was running out of IPv4

addressesWhoops. In the same category as the fake Bill Gates quote: ”640K ought to be enough for anybody”

- Solution: group a bunch of computers behind a single IP address using Network Address TranslationYou don’t know your public IP when behind a NAT. The NAT device dynamically assigns ports to internal hosts to keep all the network traffic going to the right places

- Better Solution: IPv6 – bigger addresses (not being adopted worldwide anytime soon) 340,282,366,920,938,463,463,374,607,431,768,211,456 addresses, or enough to give multiple IP addresses to every grain of sand on the planet. Could run into problems when humans conquer multiple galaxies?

Page 19: Jingle: Cutting Edge VoIP

“Crazy stuff”: punching through NATs- Step 1: use a STUN server to find your public IP address

- Me: Hey STUN server, I don’t know my IP Address. Can you help?NUTS (the STUN server): Looking at the packet you sent me, I see that the IP address of your NAT device is AAA.BBB.CCC.DDDMe: Sweet!

- Step 2: figure out more stuff using the STUN server

- Me: Ok, now I want to check to see what my NAT device does with ports. Does the public port change when I connect to different IP addresses?NUTS: Well, good question. I have another IP address you can connect to in order to try that.Me: Awesome, I tried that out and now I know more about my NAT device. Based on my local addresses, what you told me, plus what the other guy told me, I now have have a bunch of address/port options I can try with the other party.NUTS: No problem, glad to help! Buh-bye.

- Step 3: connectivity checking to try to create a hole

- Me: Can you hear me on this IP/port?You: …[Silence]Me: Hmm, the last one didn’t work. How about this one?You: …[Silence]Me: This is taking awhile… arg! How about this one?You: I hear you, I hear you! Yay, we found a hole.

- (Punching holes works better with UDP vs. TCP)

Page 20: Jingle: Cutting Edge VoIP

Jingle Client Libraries- libjingle from Google --

http://code.google.com/apis/talk/libjingle/index.html

- Telepathy -- http://telepathy.freedesktop.org

- Smack – http://www.igniterealtime.org

Page 21: Jingle: Cutting Edge VoIP

Jingle server support- Openfire: an Open Source XMPP server

with enhancements for Jingle.

1. Built-in media relay

- Without it, P2P calls won’t always complete

2. Built-in STUN server

- Without it, you’ll have to use public STUN servers

Page 22: Jingle: Cutting Edge VoIP

Jingle: not just for voice- File transfer

- Screen sharing

- Video

- Whiteboard

- Anything else that uses a lot of bandwidth or that does streaming

Page 23: Jingle: Cutting Edge VoIP

Jingle: what’s missing- Haven’t defined a way to do VoIP conferencing

- Advanced call controls are missing (hold, transfer, etc).There’s a general consensus that this stuff shouldn’t be added to Jingle. Leave it to SIP.

- Other Jingle content types (besides audio) are either not defined or immature

Page 24: Jingle: Cutting Edge VoIP

Current Jingle status- Standards work on the fundamentals and audio

content profile is wrapping up.

- Waiting for Google to switch to official Jingle protocol.

- Need interop work between different implementations.

- Jingle is poised to fulfill its promise as an open standard for a federated, world-wide VoIP

network.

Page 25: Jingle: Cutting Edge VoIP

Questions?Contact me via IM or email:

[email protected]

Resources

- http://www.xmpp.org

- http://www.igniterealtime.org

- Secure Communications with Jabber Peter Saint-Andre Time: 11:35AM - 12:20PM Location: D137-138