<<

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; • (IM), and • Geo-presence systems • . 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 • Entity, Tag – JIDs for users look like email addresses, composed – However to extend XMPP we need to know basics of username, “@” sign and the domain Unchain my heart</ TITLE > • Schema • Three types of Stanzas: <ARTIST NAME ="Joe Cocker" /> Bare JID + Resource Identifier = Full JID: • DTD, XSD – – Message <COUNTRY >USA</ COUNTRY > • e.g., ozgur7@gmail.com/web-9z2 <COMPANY >EMI</ COMPANY > • Well-formed • method for getting info from one place to another <PRICE >8.20</ PRICE > • Routing traffic to one connection of user, web-client Valid – Presence <YEAR >1987</ YEAR > • rather than mobile or desktop client (which may be • availability and status <a href="/tags/Messages_(Apple)/" rel="tag">messages</a> of entities </ CD > Attribute simultaneously connected) <!– Add more CD Albums here… --> • Not recommended for data. – iq (Info/Query) </ CATALOG > • Prefer to use element: • request-response interactions and simple workflows <ARTIST> Special Syntax for empty elements, <NAME> Joe Crocker </NAME> where closing tag would come </ARTIST> 10 11 immediately after opening tag • Recommended for metadata 12</p><p>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. <bk:bookstore xmlns:bk ="urn:xmlns:dozturk.com:books"> <bk:book bk:title ="Lord of the Rings, Book 3"> Not a URL, just a namespace! <book for =“Ozgur Ozturk“/> </ bk:book ></p><p>Namespaces are not </ bk:bookstore > applied to attributes, unless you specify them These two are from two vocabularies. explicitly. One of the <book> tags means reserving.</p><p>13 14 15</p><p>1: Message Stanza 2: Presence Messages 2: Presence Stanza</p><p>• The “push” method for getting information • Advertises the network availability and status <presence from one place to another messages of entities from ="ozgur7@gmail.com/android-z2"> <message from ="ozgur7@gmail.com/wz2" • A specialized publish-subscribe method; <show >do not disturb</ show > to ="stpeter@jabber.org" people who requested subscription to your <status >in a meeting</ status > type ="chat"> presence and authorized by you receive from address </ presence > <body >How are you?</ body > •not provided by updated presence information when you <subject >Query</ subjec t> sending client, come online, and go offline, and change your •stamped by the </ message > sender’s server status •to avoid address spoofing 16 17 18</p><p>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. <iq from ="ozgur7@gmail.com" <iq from ="ozgur7@gmail.com/wz2" id ="rr82a1z7 " • Requests and responses are tracked using the to ="ozgur7@gmail.com/wz2" id attribute id ="rr82a1z7 " type ="result"> • type attribute included in the exchanged iq to ="ozgur7@gmail.com" <query xmlns ="jabber:iq:roster"> stanzas helps in establishing a structured IQ type ="get"> <item jid ="frnd1@gmail.com"/> interaction between two entities <query xmlns="jabber:iq:roster"/> <item jid ="spouse@facebook.com"/> • Next example: IM client software gets my </ query > </ iq > roster from its server and then updates it • </ iq ></p><p>19 20 21</p><p>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 <iq from ="ozgur7@gmail.com/wz2" <iq from ="ozgur7@gmail.com" id ="ru761vd7 " New transaction, new id. id ="ru761vd7 " Same id with request. Now is the time to install your software to ="ozgur7@gmail.com" to ="ozgur7@gmail.com/wz2" type ="set"> type ="result“/> When we are back we will code, yay! <query xmlns ="jabber:iq:roster"> <item jid ="stpeter@jabber.org"/> Each request needs a reply. Even if it is empty </ query > </ iq ></p><p>22 23 24</p><p>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</p><p>25 26 27</p><p>Visual Studio Toolbox MyFirstClient project with Jabber-Net</p><p>28 29 30</p><p>Ozgur Ozturk's Introduction to XMPP 5 Simplest Client App Five lines of code Voila! Our Weather Bot is Working</p><p>Double Click • Automatically added events and function templates:</p><p>• Just fill in the action:</p><p>31 32 33</p><p>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 <a href="/tags/Line_(software)/" rel="tag">line</a> or multiple lines, – http://xmpp.org/extensions/ – hidden fields, … – & extensibility for future data types • Related extension: CAPTCHA Forms XEP </p><p>34 35 36</p><p>Ozgur Ozturk's Introduction to XMPP 6 Publish-Subscribe XEP & In-<a href="/tags/Band_(software)/" rel="tag">Band</a> 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 <a href="/tags/Internet_Relay_Chat/" rel="tag">Internet Relay Chat</a> (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</p><p>37 38 39</p><p>Multimedia Networking Download Links for Extensions: <a href="/tags/Jingle_(protocol)/" rel="tag">Jingle</a> 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. </p><p>40 41 42</p><p>Ozgur Ozturk's Introduction to XMPP 7</p> </div> </div> </div> </div> </div> </div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.min.js" integrity="sha512-aVKKRRi/Q/YV+4mjoKBsE4x3H+BkegoM/em46NNlCqNTmUYADjBbeNefNxYV7giUp0VxICtqdrbqU7iVaeZNXA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="/js/details118.16.js"></script> <script> var sc_project = 11552861; var sc_invisible = 1; var sc_security = "b956b151"; </script> <script src="https://www.statcounter.com/counter/counter.js" async></script> <noscript><div class="statcounter"><a title="Web Analytics" href="http://statcounter.com/" target="_blank"><img class="statcounter" src="//c.statcounter.com/11552861/0/b956b151/1/" alt="Web Analytics"></a></div></noscript> </body> </html><script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script>