Protocols/MSNP/MSNC/Transports

From NINA Wiki
Jump to navigation Jump to search
MSN Client Protocol

Transports

The P2P protocol is designed to work independently of the "transport" - the way a message is sent. There are three known transports: switchboard, direct connection and TURN

Switchboard

Initially, P2P messages are sent over the same switchboard used by conversations, inside MSG messages with the following:

  • Acknowledge type set to D
  • Header Content-Type: application/x-msnmsgrp2p
  • HeaderP2P-Dest set to the p2p message recipient passport address.

A sample P2P message with the message header can look like this:

MSG 1 D 143
MIME-Version: 1.0
Content-Type: application/x-msnmsgrp2p
P2P-Dest: buddy1@hotmail.com
[52 bytes binary data]

Implementation details:

  • You should be able to request another switchboard if the switchboard is closed and there is a p2p conversation alive before sending a message, and continue the conversation.
  • Never hardcode the MSG headers in the p2p code, it's a big design mistake and you won't be able to switch transports.

This transport allows up to 1202 bytes per chunk (with a payload size near 1343 bytes)

Direct connection

After a negotiation, based on INVITE MSNSLP messages, a direct connection may be established.

That negotiation is described in File transfer

This transport allows up to 1352 bytes per chunk.

TURN

The Traversal Using Relay NAT (TURN) transport was added in MSNP15.