Protocols/MSNP/MSNP11/Example Session

From NINA Wiki
Jump to navigation Jump to search
MSNP Protocol
Version 11
OverviewChallenges
ChangesExample Session
Overview
IntroductionTermsClients
Reference
Error ListCommandsRelying Party SuiteSpotlife
Services
XMPPHTTP GatewayTabsActivities
Documentation
Development ToolsMSNP Grid
PolygamyURLs used by MSN
Documents
Protocol Versions
Version 21
Version 18
Version 16
Version 15
Version 14
Version 13
Version 12
Version 11
Version 9
Version 8
Version 2
MSNC
IntroductionP2PObject DescriptorDisplay PicturesFile Transfer
Scenarios
Microsoft Messenger for Mac
MSNP on WebTV (MSNTV)


Overview

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 (alice@hotmail.com) client.

Example

Logging in - messenger.hotmail.com

The client (alice@passport.com) connects to messenger.hotmail.com 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 alice@hotmail.com\r\n
<<< CVR 2 7.0.0425 7.0.0425 7.0.0425 http://download.microsoft.com/download/D/F/B/DFB59A5D-92DF-4405-9767-43E3DF10D25B/fr/Install_MSN_Messenger.exe http://messenger.msn.com/fr\r\n

Alice's client attempts to authenticate itself. However, the server redirects it to baym-cs118.msgr.hotmail.com (IP address 207.46.107.95), port 1863.

>>> USR 3 TWN I alice@passport.com\r\n
<<< XFR 3 NS 207.46.107.95:1863 0 207.46.104.20:1863\r\n

Logging in - baym-cs295.msgr.hotmail.com

The client (alice@passport.com) connects to baym-cs295.msgr.hotmail.com 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 alice@hotmail.com\r\n
<<< CVR 5 7.0.0425 7.0.0425 7.0.0425 http://download.microsoft.com/download/D/F/B/DFB59A5D-92DF-4405-9767-43E3DF10D25B/fr/Install_MSN_Messenger.exe http://messenger.msn.com/fr\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 alice@hotmail.com\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@passport.com 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 baym-cs295.msgr.hotmail.com next time it connects to MSN Messenger, instead of going through messenger.hotmail.com. 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
    ClientIP: 24.111.111.111\r\n
    ClientPort: 60712\r\n
    ABCHMigrated: 1\r\n
    \r\n

Synchronising

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 N=bob@passport.com 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 N=carol@passport.com 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 N=dave@passport.com 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 N=eve@passport.com 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 N=fred@passport.com 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" ?>
    <config>
    .<shield>
    ..<cli maj="7" min="0" minbld="0" maxbld="9999" deny=" " />
    .</shield>
    .<block>
    .</block>
    </config>

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
    <PSM></PSM><CurrentMedia></CurrentMedia>
>>> ADC 10 AL N=fred@passport.com F=Fred\r\n
<<< CHG 9 NLN 1073791084\r\n
    ILN 9 NLN bob@passport.com Bob 24\r\n
    UBX bob@passport.com 53\r\n
    <PSM></PSM><CurrentMedia></CurrentMedia>
    ILN 9 IDL carol@passport.com Carol 268435492\r\n
    UBX carol@passport.com 70\r\n
    <PSM>my msn all ducked</PSM><CurrentMedia></CurrentMedia>
<<< ADC 10 AL N=fred@passport.com F=Fred C=f9ee61b2-89e8-425a-96f6-fabfc752c0a8\r\n
    ILN 9 BSY emily@passport.com Emily 268435492\r\n
    UBX bob@passport.com 53\r\n
    <PSM></PSM><CurrentMedia></CurrentMedia>
    UUX 162 0\r\n

Challenge

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 bob@passport.com\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 carol@passport.com 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 bob@passport.com\r\n
    ADC 17 BL N=bob@passport.com\r\n

Log out

Finally, Alice decides to log out of MSN Messenger.

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