Since March 10, 2003 - Version 2
hypothetic.org

MSN Messenger Protocol

Home Page

Forum
Chat

About

Resources

Research

Documentation
 General
 Notification
 Switchboard
 Protocols
 Reference

Validate XHTML
Validate CSS
Switchboard - Authentication
Printable Version

Overview

There are two ways to connect to a switchboard: you can either request a new switchboard session or be invited to an existing one. Both of these events take place on the notification server. When connecting to the switchboard, a client will need to handle the creation of a session (XFR) and being invited (RNG) somewhat differently.

Requesting a Switchboard Session

Notification Server

To request a switchboard session, the client must send the XFR command to the NS with a TrID and a parameter of SB (for switchboard). The server will reply with another XFR with instructions on authenticating with the switchboard. Below is an example:

>>> XFR 15 SB\r\n

<<< XFR 10 SB 207.46.108.37:1863 CKI 17262740.1050826919.32308\r\n

  • The first parameter tells you that you are being transferred to a switchboard (this should always remain the same). Note that in the dispatch server, this parameter reads NS.
  • The second parameter is the colon-delimited string for the address and port (has always been 1863) of the switchboard server.
  • The third parameter specifies the type of authentication (should always be CKI for protocols up to and including MSNP7).
  • The fourth parameter is an authentication string that the client will need to send when connecting to the switchboard to prove its identity.

However, if you have not set your initial status, or you are set to HDN, you may not transfer to a switchboard. Instead of receiving an XFR in response to your XFR, you will receive error 913.

Switchboard Server

The client must now initiate a TCP connection to the given switchboard IP on the given port (without closing the NS connection). The connection details are as explained in the Connections page. The client can wait at least two minutes and still connect to the switchboard safely.

Once connected to the switchboard, the client must send the USR command. It must have a TrID, your account name as the first parameter, and the authentication string as the second parameter. This command must be sent within approximately one minute or else the switchboard will close the connection.

If successful, the server will respond with a USR with the same TrID, OK as the first parameter, your account name as the second parameter, and your friendly name as the third parameter.

  • If of either (or both) the account name or the authentication string were incorrect, the server will send error 911 and close the connection.
  • If the format was wrong, the server will immediately close the connection with no error.
  • If you try to authenticate with the correct information with the wrong switchboard server (different IP), you will be disconnected with no error.
  • If you have already logged into the switchboard server with the authentication information, and try to log in again with the same information, you will receive error error 911 and be disconnected. Note that you can still connect to multiple switchboards simultaneously, but you must send multiple XFRs and use each one separately.

Below is an example of logging in correctly:

<o> Client Connects to 207.46.108.37 1863 (Switchboard)

>>> USR 1 example@passport.com 17262740.1050826919.32308\r\n

<<< USR 1 OK example@passport.com Example%20Name\r\n

<o> Continue SB Session . . .

Below is an example of logging with the wrong authentication string:

<o> Client Connects to 207.46.108.37 1863 (Switchboard)

>>> USR 1 example@passport.com 17262740.1050826919.32307\r\n

<<< 911 1\r\n

<o> Switchboard Closes Connection

Now that you are properly authenticated with a switchboard server, you may invite users as described in the Participants page.

Getting Invited to a Switchboard Session

Notification Server

When a user invites you to a switchboard session, you will receive an RNG command over the notification server. Note that the official client does not notify the user when another user invites him or her to a switchboard session. The only time a new window opens is when the first messages of the session is sent. The RNG will look something like this:

<<< RNG 11752013 207.46.108.38:1863 CKI 849102291.520491113 example@passport.com Example%20Name\r\n

The client does not respond to this command. Instead, it is expected to open a new connection to the given IP and port in the second parameter. Note that there is no TrID: the first parameter comes right after the command code.

  • The first parameter is the session ID of the new switchboard session. Every switchboard session has a unique ID, and each user invited will use the same session ID. You will need this for authenticating with the switchboard.
  • The second parameter is the colon-delimited string for the address and port (has always been 1863) of the switchboard.
  • The third parameter specifies the type of authentication (should always be CKI for protocols up to and including MSNP7).
  • The fourth parameter is an authentication string that you will need when authenticating with the switchboard.
  • The fifth and sixth parameters are respectively the account name and the URL-encoded friendly name of the user that invited you to the switchboard session.

Switchboard Server

After receiving an RNG, the official client always automatically connects to the given IP and port. As a third party client, you can choose not to of course. Open the connection in the same way explained above for XFRs. The first thing you must send is the ANS command. It should look something like this:

<o> Client Connects to 207.46.108.38 1863 (Switchboard)

>>> ANS 1 name_123@hotmail.com 849102291.520491113 11752013\r\n

<o> Continue SB Session . . .

The ANS command starts with a TrID. The first parameter is your account name, the second parameter is the authentication string, and the third parameter is the switchboard session ID.

If successful, the server will respond with one or more IROs followed by an ANS as described in the Participants page. However, several things can go wrong.

  • If you connect but do not send ANS, the switchboard will close the connection with no error in about one minute.
  • If you don't connect within about one minute of receiving the RNG, the switchboard will close the connection with no error upon receiving the ANS.
  • No matter what, if your session ID is wrong, you will be disconnected with no error.
  • If you send a nonexistent or invalid account name and/or an incorrect authentication string, you will receive error 911 and the server will close the connection.
  • If the general syntax of the ANS is wrong, you will be disconnected with no error.
  • If you connect to the wrong switchboard address and try to authenticate, you will be disconnected with no error.
  • If you (or a cracker) has already connected and authenticated, and you authenticate with the correct information again, you will receive error 911 and the switchboard will close the connection.
  • If all of the participants in the switchboard session leave before you connect and send ANS, the switchboard session will be destroyed before you enter, and you will therefore be disconnected with no error after sending ANS.

Participants

You must now read the Participants page to learn what happens when users enter and leave a switchboard session.

For information on how to leave a switchboard session, read the section on Leaving a Switchboard Session.

Copyright ©2002-2003 to Mike Mintz.