Message Session Relay Protocol (MSRP) : Jonathan Rosenberg Cisco Fellow
Message Session Relay Protocol (MSRP) : Jonathan Rosenberg Cisco Fellow
Protocol (MSRP)
Jonathan Rosenberg
Cisco Fellow
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 1
Historical Context
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 2
Drawbacks of Pager Mode IM
Message size limit at 1200 bytes due to UDP fragmentation issues
“Who will ever need more than 640k of memory?”
“No one will want to send large SMS”
Performance issues of every IM going through each proxy – the
lesson of SMS in the SS7 network
IM security end-to-end extremely hard in pager mode
Message overhead substantial
SIP features based on INVITE primitives don’t apply for pager
mode IM
Doesn’t easily support multiple devices
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 3
Session Mode IM
Session mode IM treats IM like an
RTP stream
Session starts and ends with an
Proxy Proxy INVITE and BYE
SIP/SDP used to negotiate an IM
channel directly between
SIP endpoints
INVITE/BYE – There are techniques for
intermediaries, just like for RTP
IETF protocol for the actual IM
UA 1 UA 2 session is Message Session
MSRP Relay Protocol (MSRP)
IM Session
Mode
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 4
MSRP: A Looooonnnnngggg Road
July 2001: first proposal. Actual IM protocol was RFC 3428 MESSAGE
method, signaled with SDP.
Pushback on using SIP. IM Transport Protocol (IMTP) proposed in
November 2001 – SIP minus unnecessary features.
IMTP perceived as a hack. Back to using MESSAGE, May 2002.
October 2002: send CPIM messages as the IM transport protocol
April 2003: CPIM alone doesn’t work; a shim protocol called MSRP is
introduced, built in relay support
November 2003: Adopted as a SIMPLE working item
October 2004: Relays split off as a separate specification
September 2007: MSRP published as RFC 4975, MSRP Relays as RFC
4976
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 5
MSRP Cliff Notes
Text based protocol, syntactically similar to SIP
TCP only
Defines a URI – MSRP URI – which are signaled in SDP
Provides chunking – the ability to split a message into smaller
pieces
Provides delivery reports
Responses can be optionally omitted
SDP negotiation primarily concerned with supported content types
Carries arbitrary MIME content
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 6
An Example Invitation
Indicates MSRP
Port and IP are IGNORED
MSRP URI indicates where messages should be sent
Allowed content types
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 7
Example MSRP Message
Request line has protocol MSRP a786hjs2 SEND
name, transaction ID and To-Path: msrp://biloxi.example.
method com:12763/kjhd37s2s20w2a;tcp
To-Path indicates series of From-Path: msrp://atlanta.exam
hops to recipient ple.com:7654/jshA7weztas;tcp
Message-ID: 87652491
From-Path has path from
Byte-Range: 1-25/25
sender
Content-Type: text/plain
Message ID unique per
message Hey Bob, are you there?
Byte-Range for chunking -------a786hjs2$
(later)
Content-Type but NO length
End of message indicator
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 8
Anatomy of an MSRP URI
msrp://atlanta.example.com:7654/jshA7weztas;tcp
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 9
Basic Flow INVITE
msrp://1.2.3.4/ffd2
INVITE and 183 contain
MSRP of each side 183
msrp://5.6.7.8/9876
Offerer opens a TCP
connection to answerer by
resolving answerer’s MSRP TCP connect
URI
Offerer sends IM to bind
connection to From-Path URI
– So that answerer sends IM SEND
back over same connection To-Path: msrp://5.6.7.8/9876
From-Path://1.2.3.4/ffd2
First IM can be empty or have You there?
real content
Alice Bob
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 10
Framing
MSRP uses boundary framing
No length up front MSRP a786hjs2 SEND
Each message ends with an end- To-Path: msrp://biloxi.example.
of-message marker com:12763/kjhd37s2s20w2a;tcp
Marker is equal to From-Path: msrp://atlanta.exam
– 7 dashes (-------) ple.com:7654/jshA7weztas;tcp
Message-ID: 87652491
– The transaction ID from the
request line Byte-Range: 1-25/25
Content-Type: text/plain
– A +, # or a $:
• +: more chunks coming
Hey Bob, are you there?
• #: aborted message -------a786hjs2$
• $: last chunk in message
Allows messages to be interrupted
Allows for messages whose
length is not known up front
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 11
Chunking
Message-ID: 87652491
Byte-Range: 1-1000/2100 1-1000
Message-ID: 87652491
Byte-Range: 1001-2020/2100 1001-2020
Message-ID: 87652491
Byte-Range: 2020-2100/2100 2020-2100
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 13
Purpose of Interruptability: HOL Blocking
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 15
Example Container
ABCD -------d93kswow+
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 16
Delivery Reports
Without a doubt the most complex part of MSRP – many options
Failure-Report header field indicates whether reports should be
sent on failures
– Yes (default)
– No
– Partial
Success-Report header field indicates whether reports should be
sent on successes
– Yes
– No (default)
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 17
Success Reports SEND 1-20
Sent if Failure-Report = yes in
SEND SEND 21-30
Include a Byte-Range header field
indicating range of bytes received
Carries same message-ID as SEND 31-50
message being reported
Byte-Ranges in REPORT and REPORT 1-50
SEND don’t have to match
– i.e., recipient can batch up reports
Status header includes response
code namespace (000 is only one
specified) and code MSRP dkei38sd REPORT
To-Path and From-Path like SEND To-Path: msrp://alicepc.e
Extremely useful for file-transfer – xample.com:7777/iau39soe
allows resumption when tcp 2843z;tcp
connections fail From-Path: msrp://bob
.example.com:8888/9di4ea
e923wzd;tcp
Message-ID: 12339sdqwer
Byte-Range: 1-50/*
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential Status: 000 200 OK 18
Failure Reports
MSRP dkei38sd REPORT
Sent if Failure-Report = yes, To-Path: msrp://alicepc.e
partial or absent xample.com:7777/iau39soe
If error known immediately at 2843z;tcp
From-Path: msrp://bob
receiver, send error response
.example.com:8888/9di4ea
If delivery results not known, e923wzd;tcp
send 200 OK response (only if Message-ID: 12339sdqwer
report=yes) and then send Byte-Range: 1-50/*
report later if failure Status: 000 408 Timeout
Example cases:
– Gateways to other protocols
– MSRP relays
Looks like success report
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 19
Transaction Responses
Only generated for SEND, not
REPORT
Only sent for SEND when
MSRP d93kswow 200 OK
– Failure-Report was yes
To-Path: msrp://alicepc.exampl
– Failure-Report was partial and e.com:7777/iau39soe2843z;tcp
the response is an error From-Path: msrp://bob.exampl
SEND error responses are e.com:8888/9di4eae923wzd;tcp
Hop-By-Hop -------d93kswow$
– To-Path contains a single URI
– that of previous hop
Response code and
transaction ID in start line
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 20
MSRP Security
Signaling links protected by TLS
Crypto-random MSRP URI
Msrps URI results in TLS connection for messages – but certs can
be ignored (clients often won’t have them)
Clients reject messages with MSRP URI not matching those of
signaling links
Provides message encryption only
Authenticity is not cryptographically assured; that requires SIP
Identity (RFC 4474) or stronger
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 21
MSRP Relays in Brief
Client configured with one or more relays
Connects to relay and authenticates with AUTH – digest
Relay
Relay provides an MSRP URI that client places 1.2.3.4
in its SDP
AUTH
Use-Path:
msrp://1.2.3.4/sd8
Client
8.7.6.5 INVITE
msrp://8.7.6.5/887
msrp://1.2.3.4/sd8
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 22
Presentation_ID © 2006 Cisco Systems, Inc. All rights reserved. Cisco Confidential 23