World Library  
Flag as Inappropriate
Email this Article

Message Session Relay Protocol

Article Id: WHEBN0021308058
Reproduction Date:

Title: Message Session Relay Protocol  
Author: World Heritage Encyclopedia
Language: English
Subject: Instant messaging, Chat log, VoIP protocols, Profanity (instant messaging client), Kik Messenger
Publisher: World Heritage Encyclopedia

Message Session Relay Protocol

In computer networking, the Message Session Relay Protocol (MSRP) is a protocol for transmitting a series of related instant messages in the context of a communications session. An application instantiates the session with the Session Description Protocol (SDP) over Session Initiation Protocol (SIP) or other rendezvous methods.

The MSRP protocol is defined in RFC 4975.[1] MSRP messages can also be transmitted by using intermediaries peers, by using the relay extensions defined in RFC 4976.[2]

MSRP is used in the RCS context, especially for the instant messaging, file transfer and photo sharing features.

Protocol design

MSRP has similar syntax as other IETF text based protocol such as SIP, HTTP and RTSP. Each message is either a request or a response, uses URIs, a message contains headers and a body that can carry any type of data, including binary information. Unlike SIP, MSRP is much simpler. The first 2 headers must be To-Path and From-Path and the last must be Content-Type, this significantly reduces the complexity of parsers. Messages must also end with 7 dash ('-') characters, followed by a transaction identifier which appears in the first line, these are followed by a continuation flag, which is a single character and end of line (CRLF). This last line at the end of messages makes it rather simple to find and detect the message boundaries. MSRP is not defined for connection-less protocols, such as UDP, thus one be certain that a response to a request would arrive on the same connection. MSRP also relies on a reliable transport layer, that is, guarantees delivery and maintains the order of the messages, which further simplifies the protocol design.

An MSRP URI has a scheme (which is "msrp" or "msrps"), authority, as defined by RFC 3986, which holds the IP/domain name and possibly the port, an optional session identifier, the transport and additional optional parameters. For example:


  • msrp is the scheme
  • is the authority
  • jshA7weztas is the session identifier
  • tcp is the transport

Usage in SIP

MSRP can be used within a SIP session:

MSRP session is set up through SIP's offer-answer[3] model. The SDP m-line media type is message and the proto is either TCP/MSRP for MSRP over TCP and TCP/TLS/MSRP for MSRP over secure TLS. Furthermore, the MSRP URI is specified in a path attribute.

A full SDP example, as provided by the RFC:

   o=alice 2890844526 2890844527 IN IP4
   s= -
   c=IN IP4
   t=0 0
   m=message 7394 TCP/MSRP *

The fact that MSRP contains the address and port and at the same time the c-line holds the address and m-line contain the port is a cause for ambiguity. Generally, other media types use the c-line and m-line to describe the address, but the MSRP RFC 4975 states this information is actually specified by the MSRP path. This may cause some devices to improperly set up the session, in particular, a B2BUA may require to alter the path per each MSRP message between the different devices. To overcome this, RFC 6714 "CEMA for MSRP" [4] changes the way CEMA-aware devices use SDP, which makes CEMA-aware MSRP B2BUA implementations much simpler and more efficient.


A generic and open source peer library is implemented in the following programming languages:


  • Java's MSRP Peer library, which sprung[5] the following ports:
  • C#/.Net version
  • Java ME
  • Python MSRPlib


  • Blink is a cross platform SIP client with MSRP protocol support.


  • MSRP relay has an open source implementation written in Python, here.
  • MSRP switch has an open source implementation written in Python, here.


  1. ^ RFC 4975, The Message Session Relay Protocol (MSRP), B. Campbell (Ed.), R. Mahy (Ed.), C. Jennings (Ed.), The Internet Society (September 2007)
  2. ^ RFC 4976, Relay Extensions for the Message Session Relay Protocol (MSRP), C. Jennings (Ed.), R. Mahy (Ed.), A. B. Roach (Ed.), The Internet Society (September 2007)
  3. ^ RFC 3264, An Offer/Answer Model with the Session Description Protocol (SDP), IETF, The Internet Society (2002)
  4. ^ RFC 6714, Connection Establishment for Media Anchoring (CEMA) For MSRP, C. Holmberg (Ed.), S. Blau (Ed.), Ericsson (Ed.), E. Burger (Ed.), The Internet Society (August 2012)
  5. ^ [1] MSRP Java peer library webpage

See also

This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.