31
INSTANT MESSAGING ON INSTANT MESSAGING ON THE INTERNET THE INTERNET ARCHITECTURE AND PROTOCOL USED ARCHITECTURE AND PROTOCOL USED FOR FOR INSTANT MESSAGING INSTANT MESSAGING - Dande, Venkata Kranthi - Dande, Venkata Kranthi Kiran Kiran

Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

Embed Size (px)

Citation preview

Page 1: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

INSTANT MESSAGING ON THE INSTANT MESSAGING ON THE INTERNETINTERNET

ARCHITECTURE AND PROTOCOL USED FORARCHITECTURE AND PROTOCOL USED FOR INSTANT MESSAGINGINSTANT MESSAGING

- Dande, Venkata Kranthi Kiran- Dande, Venkata Kranthi Kiran

Page 2: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

OUTLINE:OUTLINE:

• IntroductionIntroduction• Architecture of IMArchitecture of IM• Modes of IMModes of IM• Protocols Used for IMProtocols Used for IM

Dande,Venkata Kranthi Kiran 2

Page 3: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

Instant messaging Instant messaging (IM) is an Internet (IM) is an Internet protocol(IP) based application that allowsprotocol(IP) based application that allows Real- Real-Time Text-Based communicationTime Text-Based communication between two between two or more participants over the Internet, or other or more participants over the Internet, or other types of network using a variety of different types of network using a variety of different device types. The content in an IM is typically a device types. The content in an IM is typically a text message, but can be an HTML page, a text message, but can be an HTML page, a picture, a file containing a song, or any generic picture, a file containing a song, or any generic file.file.

What is Instant Messaging?What is Instant Messaging?

Dande,Venkata Kranthi Kiran 3

Page 4: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

The most familiar form today is computer-to-The most familiar form today is computer-to-computer instant text messaging, but IM also can computer instant text messaging, but IM also can work with mobile devices-to-computer messaging.work with mobile devices-to-computer messaging.

IMIM service combines perfectly with the presence service combines perfectly with the presence service. service.

Presence provides a user with the ability to Presence provides a user with the ability to maintain a list of people, called a “buddy list”. maintain a list of people, called a “buddy list”.

IMIM monitors the buddy list and the contacts monitors the buddy list and the contacts status of being either online or offline. status of being either online or offline.

Features of IMFeatures of IM

Dande,Venkata Kranthi Kiran 4

Page 5: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

D.V. Kranthi Kiran 5

 The figure shows the BUDDY LIST where , users can know who is online/available, who webcams is active, or who is available to talk directly (using a microphone and headphones or loudspeakers).

Page 6: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

Contd..Contd.. In certain cases IM involves additional features, which In certain cases IM involves additional features, which

make it even more popular,make it even more popular,• Multiple Messaging Parties.Multiple Messaging Parties.• Voice chat, Video chat.Voice chat, Video chat.• Application sharing, File transfer/Sharing.Application sharing, File transfer/Sharing.• Game requests.Game requests.• Remote assistance, Whiteboard and IM images. Remote assistance, Whiteboard and IM images.

D.V. Kranthi Kiran 6

Page 7: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

D.V. Kranthi Kiran 7

The basic Instant Messaging The basic Instant Messaging architecture to provide the architecture to provide the features, you need to install features, you need to install the following componentsthe following components::1.1.Instant Messaging server Instant Messaging server and one or more Instant and one or more Instant Messaging multiplexors.Messaging multiplexors.2.2.Instant Messaging Instant Messaging resources.resources.3.3.Web server such as Sun Java Web server such as Sun Java System Web Server.System Web Server.4.4.LDAP(LDAP(Lightweight Directory Lightweight Directory Access Protocol)Access Protocol) server such server such as Sun Java System Directory as Sun Java System Directory Server.Server.

IM ArchitectureIM Architecture

Page 8: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

In this exampleIn this example:-:-• The LDAP( The LDAP( Lightweight Directory Access Protocol)Lightweight Directory Access Protocol)

is an application protocol for querying and is an application protocol for querying and modifying data using directory services running modifying data using directory services running over TCP/IP. This server provides user entries for over TCP/IP. This server provides user entries for authentication and lookup.authentication and lookup.

• The clients download the Instant Messaging The clients download the Instant Messaging resources from either a web server or Sun Java resources from either a web server or Sun Java System Application Server.System Application Server.

• Clients always connect to the Instant Messaging Clients always connect to the Instant Messaging server through an Instant Messaging multiplexor.server through an Instant Messaging multiplexor.

D.V. Kranthi Kiran 8

Page 9: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

There are two modes of operation of the instant There are two modes of operation of the instant message service:message service:

1.1. Pager- mode Instant Messaging(stand-alone message): Pager- mode Instant Messaging(stand-alone message): This mode of IM is referred to as “pager-mode” because the This mode of IM is referred to as “pager-mode” because the model resembles the way a to-way pager works. The model model resembles the way a to-way pager works. The model is very much similar to SMS in cellular networks.is very much similar to SMS in cellular networks.

2.2. Session-based Instant Messaging: Session-based Instant Messaging: We refer to this mode of We refer to this mode of instant message as one that is sent as part of an existing instant message as one that is sent as part of an existing session, typically established with a SIP INVITE request. session, typically established with a SIP INVITE request. Where the media plane is not audio or video, but exchange Where the media plane is not audio or video, but exchange of instant messages.of instant messages.

Both models have different requirement and constraints; Both models have different requirement and constraints; hence, their implementation is different.hence, their implementation is different.

Modes of Instant MessagesModes of Instant Messages

D.V. Kranthi Kiran 9

Page 10: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

D.V. Kranthi Kiran 10

The IETF has created an extension to SIP that allow a SIP The IETF has created an extension to SIP that allow a SIP UA to send an instant message to another UA. The UA to send an instant message to another UA. The extension consists of a new SIP method named extension consists of a new SIP method named MESSAGE (specified in RFC 3428). Which, is able to MESSAGE (specified in RFC 3428). Which, is able to transport any kind of payload in the body of the transport any kind of payload in the body of the message, formatted with an appropriate MIME type. message, formatted with an appropriate MIME type.

PAGER-MODE PAGER-MODE

Page 11: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

DISADVANTAGES AND SOLUTION:DISADVANTAGES AND SOLUTION:• As SIP does not offer a mechanism for the UA to indicate As SIP does not offer a mechanism for the UA to indicate

that all proxies must use a transport protocol that that all proxies must use a transport protocol that implements end-to-end congestion control. To over come implements end-to-end congestion control. To over come this problem the this problem the CONTENT INDIRECTION MECHANISM CONTENT INDIRECTION MECHANISM is is used. The UAC uses HTTP, or any other protocol that runs used. The UAC uses HTTP, or any other protocol that runs over a congestion-controlled transport protocol. over a congestion-controlled transport protocol.

• Another solution to getting around the size limit problem Another solution to getting around the size limit problem

with MESSAGE is to use with MESSAGE is to use Session-based Instant Message Session-based Instant Message modemode..

D.V. Kranthi Kiran 11

Contd..Contd..

Page 12: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

The session-based instant message mode uses the SIP INVITE The session-based instant message mode uses the SIP INVITE method to establish a session where the media plane is not method to establish a session where the media plane is not audio or video, but an exchange of instant message. audio or video, but an exchange of instant message.

To send and receive audio or video, the media is sent via To send and receive audio or video, the media is sent via Real Real Time Protocol(RTP, specified in RFC 3550Time Protocol(RTP, specified in RFC 3550). ).

To send and receive instant messages the actual media(the To send and receive instant messages the actual media(the collection of instant messages) are sent over the collection of instant messages) are sent over the Message Message Session Relay Protocol( MSRP, specified in RFC 4975). Session Relay Protocol( MSRP, specified in RFC 4975).

Advantages of using this MSRP protocol are:Advantages of using this MSRP protocol are:

(1) It runs over transport protocols that offer congestion control.(1) It runs over transport protocols that offer congestion control.

(2) It runs on the media plane, i.e. MSRP messages do not (2) It runs on the media plane, i.e. MSRP messages do not traverse SIP proxies.traverse SIP proxies.

Session-Based Instant MessagingSession-Based Instant Messaging

D.V. Kranthi Kiran 12

Page 13: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

• MSRPMSRP is a text based protocol whose messages are either is a text based protocol whose messages are either requests or responses. However, unlike SIP, not every MSRP requests or responses. However, unlike SIP, not every MSRP request is answered by an MSRP response. There are request is answered by an MSRP response. There are currently 3 methods defined in MSRP.currently 3 methods defined in MSRP.

SEND: Sends an instant message of any arbitrary length from SEND: Sends an instant message of any arbitrary length from one endpoint to another.one endpoint to another.

REPORT: An endpoint or a relay provides message delivery REPORT: An endpoint or a relay provides message delivery notifications.notifications.

AUTH: Used by endpoints to authenticate to relays.AUTH: Used by endpoints to authenticate to relays.

An example of an MSRP URL isAn example of an MSRP URL is

Msrp://[email protected]/dslkj2nd;tcpMsrp://[email protected]/dslkj2nd;tcp

MSRP OVERVIEWMSRP OVERVIEW

D.V. Kranthi Kiran 13

Page 14: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

D.V. Kranthi Kiran 14

Alice

(1) SIP: INVITE

Bob

(5) MSRP: SEND

(2) SIP: 200 OK

(3) SIP: ACK

(6) MSRP: 200 OK

(7) MSRP: SEND

(8) MSRP: 200 OK

(4) TCP connection setup

(9) SIP: BYE

(10) SIP: 200 OK

From The 3G IP Multimedia Subsystem (IMS), Third EditionGonzalo Camarillo and Miguel A. García-Martín

© 2008 John Wiley and Sons, Ltd.

Establishment of a session of instant messages

Page 15: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

Figure above shows a high-level flow of the interleaving Figure above shows a high-level flow of the interleaving that takes places between SIP and MSRP when the session that takes places between SIP and MSRP when the session is established. is established.

1.1. Alice, sends a SIP INVITE request(1) which contains SDP Alice, sends a SIP INVITE request(1) which contains SDP offer indicating the message media. Followed by a offer indicating the message media. Followed by a response(2) from Bob and a acknowledge(3). response(2) from Bob and a acknowledge(3).

2.2. Once the session is established, the SDP offerer(Alice), Once the session is established, the SDP offerer(Alice), establishes a TCP connection(4) to answerer.establishes a TCP connection(4) to answerer.

3.3. Then Alice sends an immediate SEND request (5).Then Alice sends an immediate SEND request (5).

4.4. Then Bob replies with an MSRP 200 response(6) to Then Bob replies with an MSRP 200 response(6) to conform that the message is received.conform that the message is received.

5.5. Any of the endpoints is able to close the session at any Any of the endpoints is able to close the session at any time. SIP BYE(9).time. SIP BYE(9).

D.V. Kranthi Kiran 15

Page 16: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

MSRP Core Functionality:MSRP Core Functionality: Any MIME-encoded body of any arbitrary length, for instance, a Any MIME-encoded body of any arbitrary length, for instance, a

pure text message, a large video file, or an image can be pure text message, a large video file, or an image can be transported in MSRP. Because of the users’ requirement to be transported in MSRP. Because of the users’ requirement to be able to share a single TCP connection to simultaneously send able to share a single TCP connection to simultaneously send large instant message without disturbing other existing text large instant message without disturbing other existing text conversations, MSRP provides a conversations, MSRP provides a chunking and rechunking chunking and rechunking mechanismmechanism. .

In this case where a message is chunked, the endpoint splits the In this case where a message is chunked, the endpoint splits the payload into several chunks and sends each chunk in a SEND payload into several chunks and sends each chunk in a SEND request. Both endpoints and relays are able to split the request. Both endpoints and relays are able to split the contents of an IM into a number of chunks, of no longer than contents of an IM into a number of chunks, of no longer than 2048 octets2048 octets. The receiver endpoint can glue all of the received . The receiver endpoint can glue all of the received chunks to compose the original message. chunks to compose the original message.

D.V. Kranthi Kiran 16

Page 17: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

In different scenario, a user might want to send a message In different scenario, a user might want to send a message whose length is not known at the time the message whose length is not known at the time the message transmission starts. In order to support all of those transmission starts. In order to support all of those requirements, MSRP uses a requirements, MSRP uses a Boundary-Based Framing Boundary-Based Framing MechanismMechanism. .

MSRP bnsk1s SENDMSRP bnsk1s SEND

To-path: msrp://alice.example.com:4423/xodj2;tcpTo-path: msrp://alice.example.com:4423/xodj2;tcp

From-path: msrp://bob.example.com:15000/vnskq;tcpFrom-path: msrp://bob.example.com:15000/vnskq;tcp

Message-Id:003293Message-Id:003293

Byte-Range: 1-22/22Byte-Range: 1-22/22

Content-Type: text/plainContent-Type: text/plain

Hi, how are you today?Hi, how are you today?

------bnsk1s$------bnsk1s$D.V. Kranthi Kiran 17

Page 18: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

In the above example. In the above example.

1.1. First line consists of MSRP protocol followed by unique First line consists of MSRP protocol followed by unique boundary string “boundary string “bnsk 1 sbnsk 1 s” and the method SEND.” and the method SEND.

2.2. The SEND request also includes From-path and To-path The SEND request also includes From-path and To-path headers that contain the full MSRP URLs of the sender and the headers that contain the full MSRP URLs of the sender and the receiver, respectively.receiver, respectively.

3.3. Next, the message-ID header, which contains a unique Next, the message-ID header, which contains a unique message identifier within the session.message identifier within the session.

4.4. Byte-Range header that indicates the range of bytes of the Byte-Range header that indicates the range of bytes of the body transmitted.body transmitted.

5.5. The content-Type header indicates the MIME type that is The content-Type header indicates the MIME type that is encoded in the body data.encoded in the body data.

6.6. The flag at the end of the message indicates that it is the last The flag at the end of the message indicates that it is the last chunk($).chunk($).

D.V. Kranthi Kiran 18

Page 19: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

MSRP introduces few other concepts like.MSRP introduces few other concepts like.1.1. Status and Report in IMStatus and Report in IM: : The endpoint(Sender/Receiver) might be interested in the The endpoint(Sender/Receiver) might be interested in the

TRANSACTION status, which refers to the status of the delivery of an IM to next hop. TRANSACTION status, which refers to the status of the delivery of an IM to next hop. And, the report refers to the delivery of the IM at the other end, which is called And, the report refers to the delivery of the IM at the other end, which is called REQUEST status.REQUEST status.

D.V. Kranthi Kiran 19

Page 20: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

2.2. MSRP RelaysMSRP Relays: This is a : This is a specialized node in transiting specialized node in transiting MSRP messages between two MSRP messages between two other MSRP nodes. As shown in other MSRP nodes. As shown in the figure.the figure.

I.I. TLS connection(1)TLS connection(1)

II.II. AUTH request(2)AUTH request(2)

III.III. 401 response (3)- username/ 401 response (3)- username/ password.password.

IV.IV. AUTH (4)- A valid username AUTH (4)- A valid username and password.and password.

V.V. 200 OK(5)- Response.200 OK(5)- Response.

VI.VI. SIP INVITE(6)SIP INVITE(6)D.V. Kranthi Kiran 20

Page 21: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

3. The “isComposing” Indication3. The “isComposing” Indication: : Internet instant messaging Internet instant messaging systems have developed the isComposing indication. As the systems have developed the isComposing indication. As the name suggests, this is short piece of information that indicates name suggests, this is short piece of information that indicates to the remote party that there is a current ongoing process of to the remote party that there is a current ongoing process of composing an instant message.composing an instant message.

D.V. Kranthi Kiran 21

Page 22: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

4.4. Messaging Multiple PartiesMessaging Multiple Parties : : In order to send a page-mode IM to multiple In order to send a page-mode IM to multiple recipients, the terminal needs the support of a MESSAGE URI-list service, recipients, the terminal needs the support of a MESSAGE URI-list service, which is a network server that is able to receive a single MESSAGE request which is a network server that is able to receive a single MESSAGE request and send out multiple copies of the message. and send out multiple copies of the message.

• SAME mechanism is followed for SAME mechanism is followed for CHAT ROOMSCHAT ROOMS..

D.V. Kranthi Kiran 22

Page 23: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

5.5. File Transfer File Transfer: : SIP file transfer operations are modeled with the SIP file transfer operations are modeled with the description of the file in SDP, but actual transfer of the file description of the file in SDP, but actual transfer of the file takes place with MSRP. File transfer which is specified in the takes place with MSRP. File transfer which is specified in the draft “SDP” offers two modes of operation: draft “SDP” offers two modes of operation: push and pullpush and pull. In . In PUSHPUSH mode, a user suggests sending a file to other. In mode, a user suggests sending a file to other. In PULLPULL mode, a user requests the other user to send a file.mode, a user requests the other user to send a file.

D.V. Kranthi Kiran 23

Page 24: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

• Because of the real-time characteristics of Because of the real-time characteristics of instant messages, it will be no surprise that instant messages, it will be no surprise that such a popular service is already supported such a popular service is already supported in the IMS.in the IMS.

• IM is one of today’s most popular services.IM is one of today’s most popular services.

SUMMARYSUMMARY

D.V. Kranthi Kiran 24

Page 25: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

D.V. Kranthi Kiran 25

REFERENCES:

•The 3G Multimedia Subsystems (IMS) Third Edition Gonzalo Camarillo and Miguel A. Garefa-Martin•http://www.wiley.com//legacy/wileychi/camarillo/figures.html•http://docs.sun.com/source/819-0063/im-architecture.html#wp474627•http://en.wikipedia.org/wiki/Instant_messaging

Page 26: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

APPENDIXAPPENDIX

D.V. Kranthi Kiran 26

Page 27: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

Authentication ProcedureAuthentication Procedure

D.V. Kranthi Kiran 27

Figure 1.2 shows the Figure 1.2 shows the interaction of the software interaction of the software components in the components in the authentication process of a authentication process of a basic architecture of Instant basic architecture of Instant Messaging. The focus is on the Messaging. The focus is on the flow of authentication flow of authentication requests. An explanation of requests. An explanation of the steps in this process the steps in this process follows the figure.follows the figure.

Figure 1.2 Flow of Authentication Requests Figure 1.2 Flow of Authentication Requests

Page 28: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

The authentication process in a basic architecture The authentication process in a basic architecture works as followsworks as follows::

1.1. End user accesses the Instant Messenger applet URL from a browser and End user accesses the Instant Messenger applet URL from a browser and chooses a method to invoke the client.chooses a method to invoke the client.

2.2. The browser invokes Java Web Start or the Java plug-in.The browser invokes Java Web Start or the Java plug-in.

3.3. Java Web Start or the Java plug-in downloads the necessary Instant Messenger Java Web Start or the Java plug-in downloads the necessary Instant Messenger resource files and starts Instant Messenger.resource files and starts Instant Messenger.

4.4. The login window appears and the end user enters the login name and The login window appears and the end user enters the login name and password. The login data is sent to the Instant Messaging server through the password. The login data is sent to the Instant Messaging server through the multiplexor.multiplexor.

5.5. The Instant Messaging server communicates with the LDAP server to The Instant Messaging server communicates with the LDAP server to authenticate the end user and to request end-user information, such as contact authenticate the end user and to request end-user information, such as contact lists or subscriptionslists or subscriptions..

When the end-user authentication is complete, the Instant Messaging main When the end-user authentication is complete, the Instant Messaging main window appears, displaying the contact list for the end user. The end user window appears, displaying the contact list for the end user. The end user can now start and participate in Instant Messaging sessions with the other can now start and participate in Instant Messaging sessions with the other end users.end users.

D.V. Kranthi Kiran 28

Page 29: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

• Like presence, mail, or AAA functions, an instant Like presence, mail, or AAA functions, an instant messaging service can be identified by an im URI. Like pres messaging service can be identified by an im URI. Like pres URI the im URI does not define the protocol used to access URI the im URI does not define the protocol used to access an instant message resource. So, however SIP is the an instant message resource. So, however SIP is the protocol used to send the instant message it is protocol used to send the instant message it is recommended to use sip or sip URIs.recommended to use sip or sip URIs.

Syntax of the im URI:Syntax of the im URI: IM-URI = "im:" [to] [ header ]IM-URI = "im:" [to] [ header ]

to = maolboxto = maolbox

header = "?" header *( "&" header )header = "?" header *( "&" header )

header = hname "=" hvalueheader = hname "=" hvalue

hname = *urlchname = *urlc

hvalue = *urlchvalue = *urlc

Example for im URI is Example for im URI is

Im: [email protected]: [email protected]

The im URIThe im URI

D.V. Kranthi Kiran 29

Page 30: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

PAGER MODE operations:-

1.1. A UAC sends a MESSAGE request(1) to proxy. A UAC sends a MESSAGE request(1) to proxy.

2.2. The proxy forwards the MESSAGE request(2) like any The proxy forwards the MESSAGE request(2) like any other SIP request.other SIP request.

3.3. Though the proxy doesn’t understand the MESSAGE, Though the proxy doesn’t understand the MESSAGE, the UAS will receive it and answer with a 200(ok) the UAS will receive it and answer with a 200(ok) response (3) that is forwarded (4) to the UAC.response (3) that is forwarded (4) to the UAC.

However, If a UA send sends a large MESSAGE However, If a UA send sends a large MESSAGE over a transport protocol that does not offer over a transport protocol that does not offer congestion control, the network proxies can become congestion control, the network proxies can become congested and stop processing SIP requests.congested and stop processing SIP requests.

D.V. Kranthi Kiran 30

Page 31: Dande,Venkata Kranthi Kiran- Instant Messaging FINAL1

THANK YOU.THANK YOU.

D.V. Kranthi Kiran 31