Protocols/MSNP/MSNC/Transports

From NINA Wiki
Revision as of 00:23, 29 May 2020 by AD (talk | contribs) (1 revision imported)
Jump to navigation Jump to search

| style="font-size: 95%; text-align:center; color:#000000; background-color:#499feb" | MSNC |- | OverviewMSNObject |- | Client Capabilities |- | style="font-size: 95%; color:#000000; background-color:#499feb; text-align:center;"|P2P protocol |- | TransportsMSNSLP |- | style="font-size: 95%; color:#000000; background-color:#499feb; text-align:center;"|Headers |- | P2Pv1 Binary headers |- | P2Pv2 Binary headers |- | style="font-size: 95%; color:#000000; background-color:#499feb; text-align:center;"|Transfers |- | Display Pictures |- | Custom Emoticons |- | File Transfer |-

| style="font-size: 120%; color:#000000; margin-top: 0.5em; background-color:#499feb; text-align:center;"|Overview |-

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.