Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.


Livres associés

Gratuit avec un essai de 30 jours de Scribd

Tout voir

Livres audio associés

Gratuit avec un essai de 30 jours de Scribd

Tout voir
  • Soyez le premier à commenter


  1. 1. Collaboration: Instant Messaging <ul><li>Real Time Interactive Content Delivery </li></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  2. 2. Reference Model for Instant Messaging Presence Service Instant Message Service Presentity Watcher Presence UA Watcher UA Instant Inbox Inbox UA Sender UA Sender Principal A Principal B Based on RFC 2778 Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  3. 3. Understanding the Model – Agents & Rules <ul><li>The Principal interacts thru agents: </li></ul><ul><ul><li>Presence UA </li></ul></ul><ul><ul><li>Watcher UA </li></ul></ul><ul><ul><li>Sender UA </li></ul></ul><ul><ul><li>Inbox UA </li></ul></ul><ul><li>Rules: </li></ul><ul><ul><li>Access rules determines how presence information is made available to watchers </li></ul></ul><ul><ul><li>Visibility rules determine how watcher information is made available </li></ul></ul><ul><ul><li>Delivery rules allow the receiving principal to decide how instant messages are filtered from the instant inbox </li></ul></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  4. 4. Understanding the model – Presence Service Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com Component Function Principal User – human or program Presence Service “ I am here” Presentity Provides information about the principal to the presence service Watcher Receives information from the presence service. Can be a fetcher (requests presence information) or a subscriber (sent notifications). Fetcher that periodically requests information is a poller. Presence Protocol Carries precise information between the presentities , the presence service and the watchers Presence Tuples Combines to form presence information. Each tupple includes: - status information (open/closed – ready/not ready to receive messages) - communication address (includes communication means and contact address)
  5. 5. Understanding– Instant Message Service Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com Component Function IM Service Delivers Instant Messages to the correct instant inbox Sender Provides instant messages for delivery Instant Inbox Receives intsant messages from the service Instant Message Protocol Carries instant messages from the sender thru the service to the instant inbox
  6. 6. Understanding the Model – Agents & Rules <ul><li>The Principal interacts thru agents: </li></ul><ul><ul><li>Presence UA </li></ul></ul><ul><ul><li>Watcher UA </li></ul></ul><ul><ul><li>Sender UA </li></ul></ul><ul><ul><li>Inbox UA </li></ul></ul><ul><li>Rules: </li></ul><ul><ul><li>Access rules determines how presence information is made available to watchers </li></ul></ul><ul><ul><li>Visibility rules determine how watcher information is made available </li></ul></ul><ul><ul><li>Delivery rules allow the receiving principal to decide how instant messages are filtered from the instant inbox </li></ul></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  7. 7. Common Profile for Presence Defines common semantics and data formats for presence Subscribe (request from a watcher to a presence service to subscribe to the presence information about a particular presentity) Watcher – specified by a URI Target - the presentity specified by a URI Duration – maximum number of seconds a subcription should be active (set to zero for a one time fetcher) Subscription ID Transaction ID – used to correlate with response Response (response from presence service to watcher on receiving subscription request) Status – success/failure TransactionID - same used in subscribe request Duration – the number of seconds the subcription will be active (may differ from request) e Notify (response from presence service to watcher to communicate the presence information) Watcher Target TransID Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  8. 8. Presence Information Data Format (PIDF) Defines the XML based format used for expressing presence information Presence element <presence> <entity> - presentity URI <xmlns> - namespace declaration Presence Tuples <identifier> <status> - <open> or <closed> <communication address> <communication means> <contact address> - optional <relative priority> - optional of this address relative to other addresses <timestamp> - optional time of status change <note> - presentity human readable comment a free text memo (optional) Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  9. 9. Common Profile for instant messaging (CPIM) Provides a means for preserving end to end features (especially security) as messages pass thru instant messaging interoperability gateways Also provides recommendations for IM document formats Message (to send a message to an instant inbox) Source – originator specified by a URI Destination - specified by a URI MaxForwards – a hop counter to avoid loops. Counter decremented by each IM gaeway Transaction ID – used to correlate with response Content Response (on receipt of a message) Transaction ID – same as in message Status Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  10. 10. CPIM message format <ul><li>A mime type common message format which is used by any CPIM-compliant transport protocol. </li></ul><ul><li>This achieves the following: </li></ul><ul><ul><li>internetworking diverse set of instant messaging protocols </li></ul></ul><ul><ul><li>meeting security needs so that end to end- to end signatures and encryption </li></ul></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  11. 11. A slide on MIME <ul><li>Multipurpose Internet Mail Extensions </li></ul><ul><li>Extends the format of e-mail to support: </li></ul><ul><ul><li>text in character sets other than US-ASCII; </li></ul></ul><ul><ul><li>non-text attachments; (images, sounds, movies, and computer programs) </li></ul></ul><ul><ul><li>multi-part message bodies; and </li></ul></ul><ul><ul><li>header information in non-ASCII character sets. </li></ul></ul><ul><li>Fundamental component of HTTP: </li></ul><ul><ul><li>which requires that data be transmitted in the context of e-mail-like messages </li></ul></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  12. 12. Internet based Instant Messaging <ul><li>Two main IETF based open standards: </li></ul><ul><ul><li>SIMPLE </li></ul></ul><ul><ul><li>XMPP </li></ul></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  13. 13. SIMPLE <ul><li>Session Initiation Protocol </li></ul><ul><ul><li>Application layer control and signaling protocol for creating, modifying and terminating sessions with multiple participants </li></ul></ul><ul><ul><li>These sessions can be diverse: multimedia sharing/conference, VoIP </li></ul></ul><ul><li>SIMPLE </li></ul><ul><ul><li>SIP for Instant Messaging and Presence Leverage </li></ul></ul>The full scope of SIP is beyond the session – we will learn some basics Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  14. 14. SIP Protocol - Basics <ul><li>SIP: </li></ul><ul><ul><li>Runs on a variety of transport protocols notably TCP and UDP </li></ul></ul><ul><ul><li>Is independent of transport protocol, type of media and type of session </li></ul></ul><ul><li>SIP ‘s similarities with HTTP: </li></ul><ul><ul><li>Based on a request-response transaction medel </li></ul></ul><ul><ul><li>SIP requests invoke a method on the server that carries out a function </li></ul></ul><ul><li>SIP Proxy Servers </li></ul><ul><ul><li>route requests to each users current locations </li></ul></ul><ul><ul><li>Authenticates users </li></ul></ul><ul><li>User agents </li></ul><ul><ul><li>Agree on session characteristics that will best allow them to communicate </li></ul></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  15. 15. SIP methods <ul><li>Invite </li></ul><ul><ul><li>Signaling messages used to invite users to participate in sessions </li></ul></ul><ul><ul><li>Carry session descriptors to agree on media types and specific encoding </li></ul></ul><ul><li>Register </li></ul><ul><ul><li>Allow users to announce current locations to systems </li></ul></ul><ul><li>Subscribe </li></ul><ul><ul><li>Allow watchers to get presence information </li></ul></ul><ul><li>Notify </li></ul><ul><ul><li>Allow watchers to receive presence information </li></ul></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  16. 16. SIP Session : Call Set Up INVITE INVITE INVITE 1 2 4 Bejing.com proxy Barcelona.com proxy 100 Trying 3 Tracy Durga 100 Trying 5 180 Ringing 6 180 Ringing 7 180 Ringing 8 200 OK 9 200 OK 10 200 OK 11 ACK 12 Media Session (independent of SIP BYE 13 OK 14 This is a very simple call set up. The SIP protocol acomodates much more complex situations including security and conferencing Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  17. 17. SIP Call Session - explained 1 – Tracy invites Durga by addressing her by her SIP identifier. Tracy’s invitation is sent to the local SIP proxy at Beijing. 2- The beijing.com proxy on receipt of the INVITE determines the IP addresses of barcelona.com and forwards it 3- The beijing.com proxy also sends a code 100 Trying message to Tracy 4- The barcelona.com proxy receives the INVITE and forwards it to the IP address of Durga’s SIP phone 5 – The barcelona.com proxy also sends a 100 Trying message to the beijing.com proxy 6- Durga’s phone responds with a 180 Ringing message to the barcelona.com proxy 7- The 180 Ringing message is forwarded to the beijing.com proxy where 8 - The 180 Ringing message is forwarded to Tracy’s phone where it can be used to initiate ringback 9- Durga decides to answer the call. As she picks it up his SIP phone sends a 200 OK message 10- The 200 OK message is forwarded to the beijing.com proxy 11. The 200 OK message is forwaded to Tracy’s phone which stops the ringback 12 Tracy’s SIP phone sends an ACK (acknowledgement) message directly to Durga’s SIP phone and thwe media session proceeds between the two endpoints without involving the SIP proxies. 13. Durga decides to end the call and when she hangs up a BYE message is sent to Tracy 14. Tracy responds with OK and the session is terminated. Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  18. 18. SIP invite message INVITE sip:durga@barcelona. com SIP/2.0 Via: SIP/2.0/UDP pc33.beijing.com;branch=z9xchk777656ssdhe Max-Forwards: 70 To: Durga < sip:durga@barcelona.com > From Tracy < sip:tracy@beijing.com >; tag=1987634 Call-ID: a06545bnf667pc33.beijing.com Cseq:342356 INVITE Contact: <sip: [email_address] > Content-Type:application/sdp Content Length: 142 INVITE method Durga’s SIP URI Protocol Identifier Unique Transaction Identifier Decremented on Each SIP proxy hop Address to respond to sender Identifying Tag Command Sequence incremented for each new dialog request A SIP URI providing a direct route to contact Tracy without requiring SIP proxy servers Session Descriptor Protocol (explained later) The type of message content Globally Unique Call Identifier Durga and Tracy’s diplay name and SIP URI Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  19. 19. SIP registration method How is the correct IP address of Durga’s SIP phone identified in Step 4 ? REGISTER REGISTER REGISTER Registration Server Location Server Beijing.com proxy Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com Durga’s Cell Phone Durga’s Wireless PDA Durga’s Home PC
  20. 20. SIP Registration method - explained User (Durga) has three phones that she uses in SIP sessions Each of her phones sends REGISTER messages to the SIP registration server The registration server is addressed within the beijing.com domain but need not be co-located with the beijing.com proxy Each REGISTER message associates the IP address of her phone with the SIP URI The association between the IP address and the SIP URI is stored by the Location Server and is accessible by the SIP Proxy Durga may have: - a single URI in which case the most recent phone to be activated will be bound to that URI - several SIP URIs allowing her to maintain association between each of her URIs and phones The signaling protocol allows for serial or parallel forking where her several devices can be alerted sequentially or simultaneously Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  21. 21. Getting Back to IM How can SIP be used to generate presence information? Watcher (subscriber) Presence Agent Presence UA SIP Proxies Presence Server SUBSCRIBE 200 OK NOTIFY+ PIDF 200 OK NOTIFY+ PIDF 200 OK Presence Status Presence Status Change Definition: Presence Agent Accepts subscriptions, stores subscription requests and generates notifications when there are changes in presence information. The presence agent knows the presence state of each presentity within its scope. Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com 1 2 3 4 5 6
  22. 22. SIMPLE - generate Presence Information Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com 1 – Subscriber (watcher) creates a SUBSCRIBE request identifying the presentity. The SUBSCRIBE request is carried along by SIP proxies and arrives at the presence server which forwards it to the presence gent serving the identified presentity 2 -If authorized by presence agent a 200 OK response is returned. 3 – A NOTIFY message is also sent containing presence information in PIDF format. 4 – The watcher acknowledges receipt of the NOTIFY message with a 200 OK message 5 – After some time when the presentity state changes, the presence agent uses a NOTIFY method to send updated presence information in PIDF format 6 – The watcher acknowledges receipt of the notify message with a 200 OK
  23. 23. SIMPLE – implement instant messaging service <ul><li>Pager mode </li></ul><ul><ul><li>Exchanging a small number of short messages without the overhead of creating a SIP dialog </li></ul></ul><ul><li>Message mode </li></ul><ul><ul><li>Exchanging longer messages and first creates a SIP dialog </li></ul></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com Definition: SIP dialog Peer to peer SIP relationship between two user agents that persists for some time
  24. 24. SIMPLE Pager mode Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com Sender UA (UAC) Tracy SIP Proxies Inbox UA (UAS) MESSAGE OK OK 1 2 3 4 Durga MESSAGE
  25. 25. SIMPLE Pager mode - explained Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com <ul><li>1 – The UAC for Tracy begins the session by sending a MESSAGE method to the local SIP proxy. The actual message is sent along in MIME format </li></ul><ul><ul><li>The instant inbox is identified by a SIP URI </li></ul></ul><ul><li>2 – The proxy recognizes the domain specified by the SIP URI & looks up Durga in the location server and forwards it to the UAS acting as the instant inbox. </li></ul><ul><li>3 A OK response is generated by the UAS and sent back to proxy </li></ul><ul><li>4. The OK response is forwarded by the proxy to Tracy </li></ul><ul><li>Definitions: </li></ul><ul><ul><li>MESSAGE method: allows transfer of instant messages in MIME format </li></ul></ul><ul><ul><li>User Agent Client (UAC) – creates and sends new request </li></ul></ul><ul><ul><li>User Agent Server (UAS) – generates a response to a SIP request </li></ul></ul>
  26. 26. SIMPLE: Message mode Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com SDP SIP MSRP TCP IP Uses Session Description Protocol (SDP) over SIP to describe the session Message Session Relay Protocol (MSRP) over TCP to transmit the messages Application Layer Transport Layer Network Layer
  27. 27. Session Description Protocol <ul><li>Describes multimedia sessions </li></ul><ul><li>Purely a format for describing a session and it can be used over a variety of transport protocols </li></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com Information used in SDP <ul><li>The session name and purpose </li></ul><ul><li>Times the session is active (start/stop, recurring times) </li></ul><ul><li>Media used for the session </li></ul><ul><ul><li>Type of media </li></ul></ul><ul><ul><li>Type of media format </li></ul></ul><ul><ul><li>Transport protocol used </li></ul></ul><ul><li>Communications information needed to receive those media (network addresses, ports, formats) </li></ul><ul><li>Optional information (bandwidth, contact information) </li></ul>
  28. 28. Message Session Relay Protocol (MSRP) <ul><li>MSRP supports conferencing, third party call control, call transfer, quality of service integration and privacy </li></ul><ul><li>MSRP uses the following two methods: </li></ul><ul><ul><li>SEND delivers a complete message or a portion of a complete message </li></ul></ul><ul><ul><li>REPORT sends a report on the status of an earlier SEND request </li></ul></ul><ul><li>MSRP uses the SIP INVITE method to initialize a conversation </li></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  29. 29. IM with MSRP, SDP over SIP Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com Tracy Sender UA, Sender Durga Inbox UA, Receiver SDP/SIP INVITE SDP/SIP 200 OK SIP ACK MSRP SEND 1 2 3 4 MSRP 200 OK 5 MSRP 200 OK 6 MSRP SEND 7 SIP BYE 3 SIP 200 OK 3
  30. 30. IM with MSRP, SDP over SIP - exaplained Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com 1- Tracy sends a SIP INVITE message with SDP embedded 2- Durga sends a SIP OK and includes the negotiated SDP parmeters 3- Tracy replies with a SIP ACK At this point the connection to the endpoints is established 4- Tracy opens a connection to Durga and uses the MSRP SEND to transmit her first text message 5 –Durga sends a MSRP OK message 6. Now Durga send a text message using MSRP SEND 7. Tracy acknowledges receipt with MSRP OK message 8. Tracy send a SIP BYE to terminate 9. Durga responds with a SIP 200 OK and terminates the session
  31. 31. XMPP and Jabber <ul><li>XMPP is the standardised version of Jabber ( www.jabber.org ) </li></ul><ul><li>Extensible Messaging and Presence Protocol (XMPP) </li></ul><ul><ul><li>Streaming XML elements in near real time between any two network endpoints </li></ul></ul><ul><ul><li>Provides a generalized extensible framework for exchanging XML data </li></ul></ul><ul><ul><li>Used mainly for the purpose of IM </li></ul></ul><ul><li>Google Talk uses the XMPP protocol </li></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  32. 32. XMPP Network Architecture Elements <ul><li>Clients </li></ul><ul><li>Servers </li></ul><ul><ul><li>Manage connections and sessions </li></ul></ul><ul><ul><li>Route XML elements over TCP among network elements </li></ul></ul><ul><ul><li>Stores persistent data such as contact lists used by clients </li></ul></ul><ul><ul><li>Typiclly intercommunicate using TCP on port 5269 </li></ul></ul><ul><li>Jabber Identifier (JID) </li></ul><ul><ul><li>Unique identifier for each network endpoint </li></ul></ul><ul><ul><li>JIDs identify IM users , servers and the particular client device ( resource ) </li></ul></ul><ul><li>Gatways </li></ul><ul><ul><li>Translate XMPP into the protocol used by a non-XMPP messaging system </li></ul></ul><ul><li>Foreign networks </li></ul><ul><ul><li>Messaging system which does not use XMPP (IRC,SMS,SIMPLE,SMTP,AIM,ICQ,MSN,Yahoo) </li></ul></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  33. 33. XMPP network architecture Server 1 Server 2 Gateway Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com Durga’s Cell Phone Client Durga’s Wireless PDA Client Durga’s PC client Tracy’s PC client Brian’s PC client Foreign network
  34. 34. XAMPP uses XML Streams and Stanzas <ul><li>XML stream: Container for exchanging XML elements between any two network entities </li></ul><ul><li>XML stanza: a unit of information sent over an XML stream </li></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  35. 35. Basic XMPP instant message session Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com Tracy’s PC Client Server 1 <stream> 1 3 4 Durga’s PC Client Server 2 <stream> 2 <message> </stream/stream> 5 6 <message> </stream/stream>
  36. 36. Basic XMPP instant message session - explained Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com 1 – Tracy initiates a <stream> towards her XMPP server by opening a TCP connection 2- Her server responds by opening a stream towards Tracy. 3 – Tracy sends a <message> to Durga. She sends the <message stanza> over the connection to her local server including her JID in the “from field” and Durga’s JID in the “to field”. She includes her message inside the <body> element of the stanza 4 – Durga sends her own <message> stanza to her local server including her JID in the from field and Tracy’s JID in the to field. Her server forwards it to Tracy’s server which in turn forwards it to Tracy 5 – Tracy terminates her session by sending </stream:stream> to her local server. 6 – Her local server terminates the stream by sending </stream:stream> to her.
  37. 37. XMPP based presence services Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com <presence> stanzas are used to implement presence services <presence> <type> - describes the client’s presence status <show> - supplements the presence information <status> - contains text and allows presence info to be read by humans <priority> - guide stanza routing to preferred devices </presence>
  38. 38. Other XMPP features <ul><li>Allows users to manage contact lists called rosters </li></ul><ul><ul><li>User’s roster is stored on the server </li></ul></ul><ul><ul><li>can be accessed by the client from any device </li></ul></ul><ul><li>Provides blocking lists </li></ul><ul><li>Includes several security features. Can be used over: </li></ul><ul><ul><li>Transport Layer Security (TLS) </li></ul></ul><ul><ul><li>Simple Authentication and Security Layer (SASL) </li></ul></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com
  39. 39. Summary <ul><li>Oops …this was long. You need to IM your friends and go out tonight for a few tequila shots </li></ul><ul><li>You need to know who is present (Presence) </li></ul><ul><li>You need to message them (Instant Messaging service) </li></ul><ul><li>Two main general standards: SIMPLE and XMPP to do that. </li></ul>Sanjoy Sanyal:www.itforintelligentfolks.blogspot.com

    Soyez le premier à commenter

    Identifiez-vous pour voir les commentaires

  • JoleStar

    Nov. 8, 2015
  • jiangsukid

    Nov. 8, 2015


Nombre de vues

2 213

Sur Slideshare


À partir des intégrations


Nombre d'intégrations









Mentions J'aime