Peer-to-Peer Information Systems Week 15: Instant Messaging Old Dominion University Department of Computer Science CS 495/595 Fall 2003 Michael L. Nelson 12/2/03
People 2 People For most people, computers are for communication, not computing “Killer applications” –Communications: asynchronous, 1-1, 1-many – –web pages (esp. blogs) synchronous, 1-1, 1-many –instant messaging (IM) –others: the most successful games have synchronous, person-2-person play many file sharing P2P applications assume the existence of a communications medium for resource discovery
Early IM Tools Unix “talk” – alk.htmlhttp:// alk.html Internet Relay Chat – Zephyr –
Proprietary IM Protocols Oscar/AIM – YMSG – – MSN Instant Messenger Protocol – ICQ (now owned by AOL) –
Centralized IM Alice Bob “Alice is online” “Bob is online” “Where is everyone going to lunch today?” “We’re headed to Rajput” MSN, Yahoo(?)
P2P IM Alice Bob “Alice is online” “Bob is online” “Where is everyone going to lunch today?” “We’re headed to Rajput” ICQ
Hybrid IM Alice Bob “Alice is online” “Bob is online” “Where is everyone going to lunch today?” “We’re headed to Rajput, here is a scan of their menu” AOL AIM, Yahoo?
IM Lock-in AIM, YMSG, MSN, etc. are an improvement over irc, talk, etc. in that they: –remove location dependency from identity –pass the P2P litmus test: variable connectivity & temp IP addresses autonomy for nodes at edges of the network But they are all proprietary: –limited to the supported client –locked in to the provider that supports the protocol you and your brother are on AOL, but you parents are on Yahoo! and your sister is on MSN –its like having 3 separate clients & addresses to communicate with all of your friends & colleagues
Multi-Protocol Clients Multi-protocol clients exist: –Everybuddy –Trillian –Fire –GAIM –etc. But they require identities for each of the services
Supporting Multiple Protocols DJ Recall DJ Precision DJ DJ
Jabber An open source / open protocol alternative – Features: –protocol is defined in XML cf. binary proprietary protocols! –adopted by the IETF as the platform for the evolving Extensible Messaging and Presence Protocol (XMPP) –separate clients and servers for installation –gateways for legacy protocols (AIM, YMSG, etc.) as well as person-2-application conversations
Romeo & Juliet montague.net capulet.com DiCaprio & Danes images from JID = = to: What man art thou that thus bescreen'd in night So stumblest on my counsel? to: By a name I know not how to tell thee who I am: My name, dear saint, is hateful to myself, Because it is an enemy to thee; Had I it written, I would tear the word. Jabber Servers Jabber Clients
A rich set of clients supported (many with built-in support for other IM protocols too) – Jabber IDs (JIDs) –they look like addresses, but they’re not but they’re similar in effect relative to hierarchical naming –they make explicit what was hardwired in AIM, YMSG, etc e.g.
Use a public server… …or run your own
Jabber URIs –resources generally used as connection ids –resource addresses are hidden from users; only used by software/protocol –“data”, as shown on p. 85, is not part of the Jabber IETF draft
XML Messages Plotting Here, sweet lord, at your service Angels and Ministers of Grace, Defend us! … from: from: ch. 6, p. 84 XML messages bundled through the use of tags (see section 5.2 of the Jabber draft; also section 10 for examples)
Extensibility Through Namespaces <iq type="result" from="service.denmark" id="1001"> Choose a username and password to register with this server. 106c0a7b5510f192a408a1d054150ed1065e255a from: Client request for registration information to a server service (service.denmark): Server response with registration fields required:
Extensibility Through Namespaces hamlet gertrude 106c0a7b5510f192a408a1d054150ed1065e255a <iq type="result" from="service.denmark" id="1002"/> Client request to register for an account: Successful registration: <iq type="error" from="service.denmark" id="1002"/> Not Acceptable Failed registration: from:
Presence xa Gone to England from:
Roster from: <item name="Uncle Claudius" subscription="from"> Family Friends <item name="Prince Fortinbras" subscription="none" ask="subscribe"/> Client request for current roster: Server response to client query:
People 2 Applications Using XML namespaces inside the element, we can create “conversations” with applications as well as people. Some hypothetical examples: football “What is the 5 day forecast for zip code 23508?” “What was the result of November 18th 1995 Virginia Tech football game?”
XMPP Extensible Messaging and Presence Protocol (XMPP) ( soon) defined in 4 drafts: –core protocol defines streams, stanzas, authentication & security, internationalization issues –extensions for IM & presence further definition & use cases particular to IM –end-to-end object encryption –mapping XMPP to the Common Presence and Instant Messaging Protocol (CPIM)
Streams and Stanzas stream: a container for the exchange of XML elements between any 2 entities over a network stanza: a discrete semantic unit of structured information that is sent from one entity to another over an XML stream from: | | | | | | | | | | | | | | | | | | |... | | | | | | |
Stream Examples from section 4.7: A basic "session": C: <stream:stream to='example.com' xmlns='jabber:client' xmlns:stream=' version='1.0'> S: <stream:stream from='example.com' id='someid' xmlns='jabber:client' xmlns:stream=' version='1.0'>... encryption, authentication, and resource binding... C: <message xml:lang='en'> C: Art thou not Romeo, and a Montague? C: S: <message xml:lang='en'> S: Neither, fair saint, if either thee dislike. S: C: S: A "session" gone bad: C: <stream:stream to='example.com' xmlns='jabber:client' xmlns:stream=' version='1.0'> S: <stream:stream from='example.com' id='someid' xmlns='jabber:client' xmlns:stream=' version='1.0'>... encryption, authentication, and resource binding... C: Bad XML, no closing body tag! S: <xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> S:
Security in XMPP XMPP Client XMPP Server TLS SASL TLS = Transport Layer Security, RFC 2246 SASL = Simple Authentication and Security Layer, RFC 2222
Additions in XMPP The core is very similar to the original Jabber protocol; some notable additions: –use of the “xml:lang” attribute to specify language type: –definition of a “jabber:iq:privacy” namespace to maintain privacy lists, block communication based on JID, group, subscription type, etc.