Two years ago I was studying about RIA and in order to test new technologies that were emerging as dwr ajax,dojo and prototype to construction of interfaces I decided to build a prototype of an application. I built a prototype of application of Remote Desktop and File Transfer service. And to make the communication between the web application and local application, I have developed a communication protocol that is transported into the communication protocol from the MSN. I found a api called Java MSN Messenger. This api allows to connect easily from the MSN network. I made a video of the application and i presented this video in my university when I studied, I thought it was cool to the application interface.
Developing this prototype I learned how to work the msn protocol.
MSN Protocol Operation
The MSN protocol is a protocol that implements the IM technology and was developed by Microsoft to serve as a communication protocol for its IM tool called MSN Messenger. The MSN protocol was based on RFC 2778. RFC 2778 defines an abstract model of an IM system, the various entities involved, defines terminology and outline what services will be offered by the system.
A MSN Messenger session involves a connection to a Notification Server (NS), which is a notification to the server to connect to the "switchboard servers (SBS) that provides the IM service.
Notification Server (NS)
Notification Server notifications are made to the server via MSN Messenger session. The main purpose of NS is to notify the information present in the meeting and their contacts and request a session to the switchboard. The Notification Server also has other services such as notification of new e-mail received from a Hotmail account (www.hotmail.com).
To request a session to the switchboard, the customer must send an XFR command with two parameters, the first with TrID (Transaction IDs) and the second command is a command SB.XFR the MSN Messenger protocol that makes some kind of notification to the server requesting a switchboard session. With this command sent, the server will respond to the command with another command XFR with the instructions to authenticate to the switchboard.
The first parameter of the response "SB" means you are starting a session on the switchboard. The second parameter of the response indicates the IP address and port of the server, 1863 is the default port Switchboard Server. The third parameter specifies the response type of authentication, which will always be CKI. The fourth parameter of the response "17262740.1050826919.32308" is an id of authentication which the client will need to submit when he sent his ID to the switchboard.
Switchboard (SB)
The switchboard is a manager of the sessions, that is, each person in chat corresponds to a shared connection in a switchboard session. That is, when two people are in conversation directly, the switchboard that manages the state of that conversation acts as a proxy.
Once connected to the switchboard, the customer must send a USR command with three parameters: the first is the TrID, the second the e-mail that is connected, and the third session Id. The USR command is used to connect to the switchboard. If he succeeds in sending the command, the server will send back an USR command with the same TrID, the OK command in the first parameter and your e-mail in the second parameter and the name of User in the third parameter.
One example of authentication messages
MSN Messenger Protocol
The MSN Messenger Protocol consists of a series of commands sent between the client and server. For example, when some contact is inactive in the list of contacts for a customer is sent a notification message from the server to the client with this information. The MSN Messenger protocol went through several revisions in recent years. The most current version at the present time is the version MSNP12.
MSN Client Protocol consists of messages sent between clients. These messages can be, for example, a message with the text "Hi, you alright?"

0 comentários:
Postar um comentário