Software XMPP Protocol Access to This Tutorial that you will need to repeat exercises with me and • Start downloads now Application Development using • Latest version of slides available on – In the break you will have time to install – http://DrOzturk.com/talks • Visual C# 2008 Express Edition Open Source XMPP Software • Also useful for clicking on links – http://www.microsoft.com/express/downloads/ and Libraries • Eclipse IDE for Java Developers (92 MB) – http://www.eclipse.org/downloads/ Ozgur Ozturk Openfire & Spark Code: [email protected] • – http://www.igniterealtime.org/downloads/source.jsp Georgia Institute of Technology, Atlanta, GA – TortoiseSVN recommended for subversion check out Acknowledgement: This tutorial is based on the book “XMPP: The • http://tortoisesvn.net/downloads Definitive Guide, Building Real-Time Applications with Jabber Technologies” with permission from Peter Saint-Andre. • JabberNet code:
1 2 – http://code.google.com/p/jabber-net/ 3
What is XMPP Samples from its Usage
• Extensible Messaging and Presence Protocol • IM and Social Networking platforms – open, XML-based protocol – GTalk, and Facebook Part 1 – aimed at near-real-time, extensible • Collaborative services – Google Wave, and Gradient; • instant messaging (IM), and • Geo-presence systems • presence information. Introduction to XMPP – Nokia Ovi Contacts • Extended with features such as Voice over IP • Multiplayer games and file transfer signaling – Chesspark – and even expanded into the broader realm of • Many online live customer support and technical message-oriented middleware support services.
4 5 6
Ozgur Ozturk's Introduction to XMPP 1 Overview of Tutorial SIMPLE (contender to XMPP) Advantages of XMPP
• Introduction to XMPP • SIMPLE: SIP for Instant Messaging and • Open XML standard formalized by IETF • IM and Presence requirements, XML Refresher Presence Leveraging Extensions – Extensible for new service or information types • XMPP Extension Protocols (XEPs) • SIP: Session Initiation Protocol, established – Implementations with modular/pluggable APIs • Hands on exercises/demonstrations of using • Continuously extended through the standards some Open Source XMPP Libraries, Clients and signaling protocol for VOIP and IPTV Servers process of the XMPP Standards Foundation • Architecture options & extending XMPP • XMPP servers (via federation) form a • Talk slides, code and links will be available on decentralized network similar to e-mail http://DrOzturk.com/talks – anyone (with a domain) can run an XMPP server
7 8 9
Some XMPP Terminology Three Types of XMPP Stanzas XML Basics • Stanza: Basic unit of communication in XMPP • JabberID (JID): address of XMPP entities Terminology • Libraries abstract away from the XML layer
Ozgur Ozturk's Introduction to XMPP 2 Sample XML Standard: POSLog XML Namespaces Same Local Name, Different Qualified Names Namespaces needed for combining multiple existing vocabularies, to prevent conflict of names.
Namespaces are not bk:bookstore > applied to attributes, unless you specify them These two are from two vocabularies. explicitly. One of the
13 14 15
1: Message Stanza 2: Presence Messages 2: Presence Stanza
• The “push” method for getting information • Advertises the network availability and status
Ozgur Ozturk's Introduction to XMPP 3 3: IQ (Info/Query) Messages 3: IQ (Info/Query) Stanza 3: IQ (Info/Query) Stanza 1/4: Requesting Roster 2/4: Server Returning Roster • Structure for request-response interactions and simple workflows.
19 20 21
3: IQ (Info/Query) Stanza 3: IQ (Info/Query) Stanza 15 Minute Break 3/4: Client adds a new contact. 4/4:Server’s Acknowledgement
22 23 24
Ozgur Ozturk's Introduction to XMPP 4 Download Link for Download and install Jabber-Net .Net XMPP library • XMPP Library for .Net (written in C#) http://code.google.com/p/jabber-net/ Part 2 – I recommend to install from source code • So you can trace into the library code upon errors • I will show how to add components to toolbar manually Coding a Basic Client Without re-implementing the wheel: Using Jabber-Net .Net Library
25 26 27
Visual Studio Toolbox MyFirstClient project with Jabber-Net
28 29 30
Ozgur Ozturk's Introduction to XMPP 5 Simplest Client App Five lines of code Voila! Our Weather Bot is Working
Double Click • Automatically added events and function templates:
• Just fill in the action:
31 32 33
Extensibility and Data Forms XEP Available XEPs • XMPP is an XML based, extensible protocol • Specifies how a server sends the information • XMPP Standards Foundation (XSF) necessary for a client to render a form Part 3 standardizes extensions to XMPP through a • Defines several common field types process centered around XMPP Extension – boolean, Protocols (XEPs) – list options with single or multiple choice, XMPP Extension Protocols (XEPs) – text with single line or multiple lines, – http://xmpp.org/extensions/ – hidden fields, … – & extensibility for future data types • Related extension: CAPTCHA Forms XEP
34 35 36
Ozgur Ozturk's Introduction to XMPP 6 Publish-Subscribe XEP & In-Band Registration XEP Multi-User Chat XEP Personal Eventing Protocol (PEP) XEP • For in-band registration, password change or • To enable multiple XMPP users to exchange • Presents a more generalized form of the cancellation of an existing registration messages in the context of a room or channel publish/subscribe model than presence – similar to Internet Relay Chat (IRC). • Extensible via use of data forms – communicating “rich presence” such as moods • Standard chat-room features such as room topics – exchanging “lifestreaming” data, such as – enables services to gather a wide range of and invitations microblogs information during the registration process • A strong room control model, adds ability to: – also applied to storing personal data – kick and ban users • Bookmarks, client preferences… – name room moderators and administrators • Further extensions of PEP – require membership or passwords to join the room – User Tune , User Location , and User Activity XEPs
37 38 39
Multimedia Networking Download Links for Extensions: Jingle XEP Client and Server with • XMPP as the signaling channel to negotiate, Pluggable API manage & terminate media sessions • OpenFire: XMPP server – voice/video chat, file transfer, screen sharing… Part 4 • Spark: XMPP client – negote media codecs, bitrates and other • Both are open source Java implementation, parameters related to the voice format to be with multi-platform support used, deciding whether TCP or UDP will be used Compiling and Customizing • Openfire & Spark Code: – what IP addresses and ports will be used, etc Openfire XMPP Server – http://www.igniterealtime.org/downloads/source.jsp • Media data itself is sent either p2p or through and Spark Chat Client – TortoiseSVN recommended for subversion check out • http://tortoisesvn.net/downloads a media relay.
40 41 42
Ozgur Ozturk's Introduction to XMPP 7