Protocols/MSNP/MSNP11/Example Session

From NINA Wiki
Jump to navigation Jump to search
MSNP Protocol
Version 11
ChangesExample Session
Error ListCommandsRelying Party SuiteSpotlife
XMPPHTTP GatewayTabsActivities
Development ToolsMSNP Grid
PolygamyURLs used by MSN
Protocol Versions
Version 21
Version 18
Version 16
Version 15
Version 14
Version 13
Version 12
Version 11
Version 9
Version 8
Version 2
IntroductionP2PObject DescriptorDisplay PicturesFile Transfer
Microsoft Messenger for Mac


This page illustrates what an entire notification session might look like. This page does not (yet) exhaustively show every command that can be sent to a notification server. Copied from the msnp8 example session.

Conventions Used on This Page

Throughout this page, the protocol is displayed from the point of view of Alice's ( client.


Logging in -

The client ( connects to on TCP port 1863. The client understands protocol version 11 and 10. It also supports CVR0.

>>> VER 1 MSNP11 MSNP10 CVR0\r\n
<<< VER 1 MSNP11 MSNP10 CVR0\r\n

Having successfully negotiated a protocol version, the client gives its protocol version information.

>>> CVR 2 0x040c winnt 5.1 i386 MSNMSGR 7.0.0777 msmsgs\r\n
<<< CVR 2 7.0.0425 7.0.0425 7.0.0425\r\n

Alice's client attempts to authenticate itself. However, the server redirects it to (IP address, port 1863.

>>> USR 3 TWN I\r\n
<<< XFR 3 NS 0\r\n

Logging in -

The client ( connects to on TCP port 1863. The client understands protocol version 11 and 10, and supports CVR0.

>>> VER 4 MSNP11 MSNP10 CVR0\r\n
<<< VER 4 MSNP11 MSNP10 CVR0\r\n

The client gives its protocol version information again.

>>> CVR 5 0x0409 win 5.1 i386 MSNMSGR 7.0.0777 msmsgs\r\n
<<< CVR 5 7.0.0425 7.0.0425 7.0.0425\r\n

Alice's client attempts to authenticate itself, and the server returns a long string for use in Passport authentication.

>>> USR 6 TWN I\r\n
<<< USR 6 TWN S lc=1033,id=507,tw=40,fs=1,ru=http%3A%2F%2Fmessenger%2Emsn%2Ecom,ct=1062764229,kpp=1,kv=5,ver=2.1.0173.1,tpf=43f8a4c8ed940c04e3740be46c4d1619\r\n

Alice authenticates with MS Passport (see the authentication example page), then replies with her ticket.

>>> USR 7 TWN S t=53*1hAu8ADuD3TEwdXoOMi08sD*2!cMrntTwVMTjoB3p6stWTqzbkKZPVQzA5NOt19SLI60PY!b8K4YhC!Ooo5ug$$&p=5eKBBC!yBH6ex5mftp!a9DrSb0B3hU8aqAWpaPn07iCGBw5akemiWSd7t2ot!okPvIR!Wqk!MKvi1IMpxfhkao9wpxlMWYAZ!DqRfACmyQGG112Bp9xrk04!BVBUa9*H9mJLoWw39m63YQRE1yHnYNv08nyz43D3OnMcaCoeSaEHVM7LpR*LWDme29qq2X3j8N\r\n
<<< USR 7 OK Alice 1 0\r\n

Dont know what it is...

<<< SBS 0 null\r\n

Alice has now successfully logged into the notification server. Her client might remember to log straight into next time it connects to MSN Messenger, instead of going through The server takes this opportunity to send Alice's profile details.

<<< MSG Hotmail Hotmail 478\r\n
    MIME-Version: 1.0\r\n
    Content-Type: text/x-msmsgsprofile; charset=UTF-8\r\n
    LoginTime: 1115349389\r\n
    EmailEnabled: 1\r\n
    MemberIdHigh: 83936\r\n
    MemberIdLow: 1113138176\r\n
    lang_preference: 1036\r\n
    preferredEmail: \r\n
    country: CA\r\n
    PostalCode: \r\n
    Gender: \r\n
    Kid: 0\r\n
    Age: \r\n
    BDayPre: \r\n
    Birthday: \r\n
    Wallet: \r\n
    Flags: 69643\r\n
    sid: 507\r\n
    kv: 6\r\n
    MSPAuth: 6Z1iKIC0bBbNlgb87D2SA1w3PNeweF7DyrUCimEnMdj1hrPLLMlDq5Hm1z0y9Kst92*My3jsIxVZ4VDG8TgBtyfw$$\r\n
    ClientPort: 60712\r\n
    ABCHMigrated: 1\r\n


Alice's client now synchronises her local copy of her contact lists with the copy held on the server. Last time Alice's client logged on, the list was an older version.

>>> SYN 8 2005-04-23T18:57:44.8130000-07:00 2005-04-23T18:57:54.2070000-07:00\r\n
<<< SYN 8 2005-05-05T19:40:18.6400000-07:00 2005-03-20T11:19:02.7700000-08:00 5 4\r\n

Because the list versions don't match, the server sends all of Alice's of contact information (not just what's changed between the versions). At first, the server sends one message in every packet of data.

<<< GTC A\r\n
<<< BLP AL\r\n
<<< PRP MFN Alice\r\n
<<< PRP MBE N\r\n
<<< PRP WWE 0\r\n

Then, the server sends the entire group list in a single packet. Since Alice's client is written in a programming language that handles incoming data one packet at a time, it has to separate these lines out and handle them one at a time.

<<< LSG Other%20Contacts 124153dc-a695-4f6c-93e8-8e07c9775251\r\n
    LSG Coworkers b8e6ed33-7b1f-44c2-8ec1-9006c3673207\r\n
    LSG Friends 5e27fc51-adb8-46fb-83d6-c3d395685da1\r\n
    LSG Family 01eccd16-9f8a-425f-a36d-cbb73af6461e\r\n

Then the server sends Alice's contact list. The first person in her contact list is Bob, whose nickname is "Bob". He's on her forward, block, and reverse lists. He hasn't chosen to share any phone numbers, but does have an MSN mobile device we can use. His details are all sent in a single packet, which we have to separate out and handle individually.

<<< LST F=Bob C=6bd736b8-dc18-44c6-ad61-8cd12d641e79 13 124153dc-a695-4f6c-93e8-8e07c9775251\r\n
    BPR MOB Y\r\n

The second person in Alice's list is Carol, whose nickname is "Carol". She has a MSN Space. She has shared her work phone number (9876-54321), but no other information. Unfortunately, the server sends Carol's details in two packets, split in the middle of a command. Alice's client will have to reconstruct the lines of data before handling them.

<<< LST F=Carol C=8a99df6b-ae73-40bd-bdf7-05d0134be851 3 124153dc-a695-4f6c-93e8-8e07c9775251\r\n
    BPR PHM tel:9876
<<< -54321\r\n
    BPR HSB 1\r\n

Then, the server sends details for Dave. Dave is just on Alice's forward list. He's in her "Coworkers", "Friends", and "Family" groups. He's set his home phone number to "3.1415926535", his work phone number to "2.71841844", and his mobile number to "sqrt(-1)". The server has cut his details into several packets.

<<< LST 1 b8e6ed33-7b1f-44c2-8ec1-9006c3673207,5e27fc51-adb8-46fb-83d6-c3d395685da1
<<< ,01eccd16-9f8a-425f-a36d-cbb73af6461e\r\n
    BPR PHH tel:3.1415926535\r\n
    BPR PH
<<< W
<<< 2.71841844\r\n
    BPR PHM sqrt(-1)\r\n

Next, the server sends information about Eve (the evil eavesdropper), who has been blocked from seeing Alice's presence.

<<< LST F=Eavesdropper 12\r\n

Finally, the server sends details about Fred, who must have been recently added, as he is on Alice's reverse list but not her add or block list.

<<< LST F=Fred 8\r\n

Here is a summary of who will receive whose presence:

  • Alice wants to receive presence information from Bob, Carol, and Dave. However, she doesn't know whether they have allowed or blocked her.
  • Bob wants to receive Alice's presence information, and she has allowed him to.
  • Carol is allowed to receive Alice's presence information, but doesn't want to.
  • Dave wants to receive Alice's presence information, but is not allowed to.
  • Eve wants to receive Alice's presence information, but is not allowed to.
  • Fred wants to receive Alice's presence information, and is allowed to. He is neither in Alice's allow nor block list, but because Alice's BLP is set to AL, he is treated as if he was in Alice's allow list. Alice's client should ask Alice to add him to one or other list immediately.

<<< GCF 159 Shields.xml
    GCF 160 Shields.xml 159
    <?xml version= "1.0" encoding="utf-8" ?>
    ..<cli maj="7" min="0" minbld="0" maxbld="9999" deny=" " />

Initial presence

Now Alice has synchronised her contact lists, she sends her initial presence, and at the same time allows Fred to see her presence information. The presence command causes the server to send presence information for Alice's contacts that are currently online. Notice how the ADC reply comes in the middle of the ILNs, making it harder to elegantly handle them.

>>> CHG 9 NLN 1073791084\r\n
    UUX 162 53\r\n
>>> ADC 10 AL F=Fred\r\n
<<< CHG 9 NLN 1073791084\r\n
    ILN 9 NLN Bob 24\r\n
    UBX 53\r\n
    ILN 9 IDL Carol 268435492\r\n
    UBX 70\r\n
    <PSM>my msn all ducked</PSM><CurrentMedia></CurrentMedia>
<<< ADC 10 AL F=Fred C=f9ee61b2-89e8-425a-96f6-fabfc752c0a8\r\n
    ILN 9 BSY Emily 268435492\r\n
    UBX 53\r\n
    UUX 162 0\r\n


The server challenges Alice's client with the string "22940274951814684551"

<<< CHL 0 22940274951814684551\r\n

Check Protocols/MSNP/MSNP11/Challenges for more information on challenge.

>>> QRY 11 PROD0090YUAUV{2B 32\r\n
    ffeb4c3cf93db6a4b708b246baade0d9(no newline)

The server accepts Alice's response to this challenge.

<<< QRY 11

More presence changes

Alice walks away from her computer. After a few minutes, Alice's client sets her online state to "idle".

>>> CHG 12 IDL 1073791084\r\n
<<< CHG 12 IDL 1073791084\r\n

While Alice is away, Bob goes offline.

<<< FLN\r\n

When Alice returns, her client sets her online state to "online".

>>> CHG 13 NLN 1073791084\r\n
<<< CHG 13 NLN 1073791084\r\n

She decides to set a personal status message.

>>> UUX 14 53\r\n
    <PSM>Hello World !</PSM><CurrentMedia></CurrentMedia>
<<< UUX 14 0\r\n

Shortly afterwards, Carol changes her online state to "Busy", and changes her display name.

<<< NLN BSY Caroline 268435492\r\n

Nickname changes

Because Carol changed her display name with her last change of online state, Alice's client updates Carol's nickname to match.

>>> SBP 15 8a99df6b-ae73-40bd-bdf7-05d0134be851 MFN Caroline\r\n
<<< SBP 15 8a99df6b-ae73-40bd-bdf7-05d0134be851 MFN Caroline\r\n

Alice decides that she doesn't want Bob to see her presence information any longer, so her client removes him from her allow list, and adds him to her block list.

>>> REM 16 AL\r\n
    ADC 17 BL\r\n

Log out

Finally, Alice decides to log out of MSN Messenger.

>>> OUT\r\n
<o> Server closes connection