IMS  

 

 

 

MSRP

MSRP stands for Message Session Relay Protocol.

It is originally designed for short message or media exchange over IP network. We normally call this kind of mode as IM (Instant Messaging). In terms of application point of view, it is very similar to SMS and MMS in celluar network. In recent cellular network, MSRP tend to be used as one of the applications in RCS.

There are two different modes in MSRP, Pager Mode and Session Mode. Pager Mode is mainly used for exchanging a short message which is similar to SMS and Session Mode is mainly used for exchanging multimedia contents which is similar to MMS.

Pager Mode

Pager Mode MSRP is mainly used for short message (usually Text Message) and has following properties.

  • Each message are unrelated to previous message
  • There is no "Start" or "Stop" (Single MESSAGE does completes the message transfer)
  • Each message is routed through proxies
  • Max Message size is 1200 bytes

Pager mode may look simple in terms of protocol, but it has many drawbacks as listed below.

  • Message size is limit to max 1200 bytes
  • It may cause performance issue since every message should go through each proxy
  • It is hard to guarantee end-to-end security
  • Message overhead may get very large
  • SIP features specified on INVITE message does not apply to Pager Mode
  • It is not easy to support multiple devices

 

Example >

The simplest usage of Pager Mode message transfer is just a single MESSAGE and 200 OK. In real application, the operator may require additional sequence for additional information (e.g, Delivery Report). See Standalone message example in RCS.

Step

Direction

Protocol

Message

Comments

(1)

UA1 --> Proxy/UA2

SIP

MESSAGE

Send a text '123456789abcdef'

(2)

UA1 <-- Proxy/UA2

SIP

200 OK  

 

(1) MESSAGE

    MESSAGE sip:+14448880011@sharetechnote.com;user=phone SIP/2.0

    P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.oma.cpm.msg

    Contribution-ID: 477b66ae9662e3ad18549bf5dabf9d26d5e707ca

    Conversation-ID: 1710887c7ca47dc2c1274c11673eb0df5a604fd3

    P-Preferred-Identity: <sip:310410123456789@sharetechnote.com>

    Request-Disposition: no-fork

    User-Agent: TEST IMS 5.0

    CSeq: 1 MESSAGE

    Max-Forwards: 70

    P-Access-Network-Info: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp=31041000010000000

    Route: <sip:[2001:0:0:1::2]:5060;lr>

    a: *;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.oma.cpm.msg"

    c: message/cpim

    f: <sip:310410123456789@sharetechnote.com>;tag=1384874566

    i: 3712948749@2001::1:88fe:fccf:2870:5dee

    l: 322

    m: <sip:310410123456789@[2001::1:88fe:fccf:2870:5dee]:5060>;

        +sip.instance="<urn:gsma:imei:35469106-056673-0>"

    t: <sip:+14448880011@sharetechnote.com;user=phone>

    v: SIP/2.0/TCP [2001::1:88fe:fccf:2870:5dee]:5060;branch=z9hG4bK2629405539smg;transport=TCP

     

    From: <sip:310410123456789@sharetechnote.com>

    To: <sip:+14448880011@sharetechnote.com;user=phone>

    DateTime: 2015-02-17T06:54:27Z

    NS: imdn <urn:ietf:params:imdn>

    imdn.Message-ID: PH7qAIV8cgH5

    imdn.Disposition-Notification: positive-delivery, display

     

    Content-type: text/plain;charset=UTF-8

    Content-Length: 15

     

    123456789abcdef

 

(2) 200 OK

    SIP/2.0 200 OK

    Max-Forwards: 70

    Via: SIP/2.0/TCP [2001::1:88fe:fccf:2870:5dee]:5060;branch=z9hG4bK2629405539smg;transport=TCP

    From: <sip:310410123456789@sharetechnote.com>;tag=1384874566

    To: <sip:+14448880011@sharetechnote.com;user=phone>;tag=73335cbb32b744baaaf5097a34431c92

    Call-ID: 3712948749@2001::1:88fe:fccf:2870:5dee

    CSeq: 1 MESSAGE

    Server: TEST-RCS-serv/OMA1.0

    Content-Length: 0

Session Mode

In Session Mode, the message is treated like RTP and it goes through session establishment process (i.e, INVITE, SDP) and the session end by BYE process. Message transfer is based on SEND method.

 

< SDP for Session Mode >

: SDP for MSRP has components as shown below.

    v=0

    o=TEST-IMS-UE 1234562 0 IN IP6 2001::1:4c16:9c0f:4986:9e6d

    s=SS VOIP

    c=IN IP6 2001::1:4c16:9c0f:4986:9e6d

    t=0 0

    m=message 8880 TCP/MSRP *   // Indicate this is for MSRP

    a=accept-types:message/cpim application/im-iscomposing+xml // allowed content type

    a=accept-wrapped-types:text/plain message/imdn+xml  // allowed content type

    a=setup:active

    a=path:msrp://[2001::1:4c16:9c0f:4986:9e6d]:8880/FmnP;tcp //MSRP URI. It indicates where message should be sent

    a=msrp-cema

    a=sendrecv

 

< SEND Method >

: SEND method has following structure

    MSRP RgGcYXJW2nHr SEND

    // To-Path indicates series of hopts to recipient

    To-Path: msrp://[2001:0000:0000:0001:0000:0000:0000:0002]:16000/558f02b9d0;tcp

    // From-Path indicates path from the sender

    From-Path: msrp://[2001::1:4c16:9c0f:4986:9e6d]:8880/FmnP;tcp

    // Message ID is unique per message

    Message-ID: ZNsPlykpMApIABRrejarbO37ADMMae

    Success-Report: no

    Failure-Report: yes

    // This for chucking the big data into multiple blocks

    Byte-Range: 1-430/430

    // contents type. It can be text/plain or cpim or any other.

    Content-Type: message/cpim  

 

< Example >

Step

Direction

Protocol

Message

Comments

(1)

UA1 --> Proxy/UA2

SIP/SDP

INVITE  

(2)

UA1 <-- Proxy/UA2

SIP

100 Trying  

(3)

UA1 <-- Proxy/UA2

SIP

183 Session Progress  

(4)

UA1 <-- Proxy/UA2

SIP/SDP

200 OK  

(5)

UA1 --> Proxy/UA2

SIP

ACK  

(6)

UA1 --> Proxy/UA2

MSRP

SEND  

(7)

UA1 <-- Proxy/UA2

MSRP

200 OK  

(8)

UA1 --> Proxy/UA2

MSRP

SEND Send Text 'Hello'

(9)

UA1 <-- Proxy/UA2

MSRP

200 OK  

(10)

UA1 <-- Proxy/UA2

MSRP

SEND Delivery Notification

(11)

UA1 --> Proxy/UA2

MSRP

200 OK  

 

(1) INVITE

    INVITE sip:+14448880000@sharetechnote.com;user=phone SIP/2.0

    Conversation-ID: 6b79b8bc937e4985b1dffd062b687bd7

    Contribution-ID: d5e4121aeec2cc59546ebaef8966ef185a2f37f0

    P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.oma.cpm.session

    P-Preferred-Identity: <sip:310410123456789@sharetechnote.com>

    P-Early-Media: supported

    Allow: INVITE,ACK,OPTIONS,CANCEL,BYE,UPDATE,INFO,REFER,NOTIFY,MESSAGE,PRACK

    User-Agent: Samsung IMS 5.0

    CSeq: 1 INVITE

    Max-Forwards: 70

    P-Access-Network-Info: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp=31041000010000000

    Route: <sip:[2001:0:0:1::2]:5060;lr>

    a: *;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.oma.cpm.session"

    c: application/sdp

    f: <sip:310410123456789@sharetechnote.com>;tag=284849603

    i: 508868544@2001::1:4c16:9c0f:4986:9e6d

    k: timer

    l: 363

    m: <sip:310410123456789@[2001::1:4c16:9c0f:4986:9e6d]:5060;transport=UDP>;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.oma.cpm.session"

    t: <sip:+14448880000@sharetechnote.com;user=phone>

    v: SIP/2.0/TCP [2001::1:4c16:9c0f:4986:9e6d]:5060;branch=z9hG4bK2563646430smg;transport=TCP

     

    v=0

    o=TEST-IMS-UE 1234562 0 IN IP6 2001::1:4c16:9c0f:4986:9e6d

    s=SS VOIP

    c=IN IP6 2001::1:4c16:9c0f:4986:9e6d

    t=0 0

    m=message 8880 TCP/MSRP *

    a=accept-types:message/cpim application/im-iscomposing+xml

    a=accept-wrapped-types:text/plain message/imdn+xml

    a=setup:active

    a=path:msrp://[2001::1:4c16:9c0f:4986:9e6d]:8880/FmnP;tcp

    a=msrp-cema

    a=sendrecv

 

(2) 100 Trying

    SIP/2.0 100 Trying

    Via: SIP/2.0/TCP [2001::1:4c16:9c0f:4986:9e6d]:5060;branch=z9hG4bK2563646430smg;transport=TCP

    Max-Forwards: 70

    From: <sip:310410123456789@sharetechnote.com>;tag=284849603

    To: <sip:+14448880000@sharetechnote.com;user=phone>

    Call-ID: 508868544@2001::1:4c16:9c0f:4986:9e6d

    CSeq: 1 INVITE

    Content-Length: 0

 

(3) 183 Session Progress

    SIP/2.0 183 Session Progress

    Max-Forwards: 70

    Via: SIP/2.0/TCP [2001::1:4c16:9c0f:4986:9e6d]:5060;branch=z9hG4bK2563646430smg;transport=TCP

    From: <sip:310410123456789@sharetechnote.com>;tag=284849603

    To: <sip:+14448880000@sharetechnote.com;user=phone>;tag=b2fbe90a8c2e488ba04ad6d0c0956a6c

    Call-ID: 508868544@2001::1:4c16:9c0f:4986:9e6d

    CSeq: 1 INVITE

    Contact: <sip:+14448880000@sharetechnote.com>

    Record-Route: <sip:[2001:0:0:1::2]:5060;lr>

    Content-Length: 0

 

(4) 200 OK

    Via: SIP/2.0/TCP [2001::1:4c16:9c0f:4986:9e6d]:5060;branch=z9hG4bK2563646430smg;transport=TCP

    From: <sip:310410123456789@sharetechnote.com>;tag=284849603

    To: <sip:+14448880000@sharetechnote.com;user=phone>;tag=b2fbe90a8c2e488ba04ad6d0c0956a6c

    Call-ID: 508868544@2001::1:4c16:9c0f:4986:9e6d

    CSeq: 1 INVITE

    Allow: INVITE, ACK, CANCEL, BYE, MESSAGE

    Contact: <sip:[2001:0:0:1::2]:49466;transport=tcp>

    Content-Type: application/sdp

    Record-Route: <sip:[2001:0:0:1::2]:5060;lr>

    Content-Length: 292

     

    v=0

    o=- 1192 5963 IN IP6 2001:0:0:1::2

    s=-

    c=IN IP6 2001:0:0:1::2

    m=message 16000 TCP/MSRP *

    a=accept-types:message/cpim application/im-iscomposing+xml

    a=accept-wrapped-types:*

    a=path:msrp://[2001:0000:0000:0001:0000:0000:0000:0002]:16000/558f02b9d0;tcp

    a=msrp-cema

    a=setup:passive

 

(5) ACK

    SIP/2.0 200 OK

    Max-Forwards: 70

    ACK sip:[2001:0:0:1::2]:49466;transport=UDP SIP/2.0

    CSeq: 1 ACK

    Max-Forwards: 70

    Route: <sip:[2001:0:0:1::2]:5060;lr>

    f: <sip:310410123456789@sharetechnote.com>;tag=284849603

    i: 508868544@2001::1:4c16:9c0f:4986:9e6d

    l: 0

    m: <sip:310410123456789@[2001::1:4c16:9c0f:4986:9e6d]:5060;transport=UDP>

    t: <sip:+14448880000@sharetechnote.com;user=phone>;tag=b2fbe90a8c2e488ba04ad6d0c0956a6c

    v: SIP/2.0/UDP [2001::1:4c16:9c0f:4986:9e6d]:5060;branch=z9hG4bK1597981393smg;transport=UDP

 

(6) SEND

    MSRP kePLNmnn6eCcn7lB9X SEND

    To-Path: msrp://[2001:0000:0000:0001:0000:0000:0000:0002]:16000/558f02b9d0;tcp

    From-Path: msrp://[2001::1:4c16:9c0f:4986:9e6d]:8880/FmnP;tcp

    Message-ID: IeGt4q5QsCmzD

    Success-Report: no

    Failure-Report: yes

    -------kePLNmnn6eCcn7lB9X$

 

(7) 200 OK

    MSRP kePLNmnn6eCcn7lB9X 200 OK

    To-Path: msrp://[2001::1:4c16:9c0f:4986:9e6d]:8880/FmnP;tcp

    From-Path: msrp://[2001:0000:0000:0001:0000:0000:0000:0002]:16000/558f02b9d0;tcp

    -------kePLNmnn6eCcn7lB9X$

 

(8) SEND

    MSRP RgGcYXJW2nHr SEND

    To-Path: msrp://[2001:0000:0000:0001:0000:0000:0000:0002]:16000/558f02b9d0;tcp

    From-Path: msrp://[2001::1:4c16:9c0f:4986:9e6d]:8880/FmnP;tcp

    Message-ID: ZNsPlykpMApIABRrejarbO37ADMMae

    Success-Report: no

    Failure-Report: yes

    Byte-Range: 1-430/430

    Content-Type: message/cpim

     

    From: <sip:anonymous@anonymous.invalid>

    To: <sip:anonymous@anonymous.invalid>

    DateTime: 2015-02-24T06:48:09Z

    NS: imdn <urn:ietf:params:imdn>

    NS: MyFeatures <mailto:RCSFeatures@test.com>

    MyFeatures.PANI: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp=31041000010000000

    imdn.Message-ID: wYcJuXBbGOfCtBqIPQqz0I

    imdn.Disposition-Notification: positive-delivery, display

     

    Content-type: text/plain;charset=UTF-8

    Content-Length: 5

     

    Hello

    -------RgGcYXJW2nHr$

 

(9) 200 OK

    MSRP RgGcYXJW2nHr 200

    To-Path: msrp://[2001::1:4c16:9c0f:4986:9e6d]:8880/FmnP;tcp

    From-Path: msrp://[2001:0000:0000:0001:0000:0000:0000:0002]:16000/558f02b9d0;tcp

    -------RgGcYXJW2nHr$

 

(10) SEND

    MSRP 69172e29 SEND

    To-Path: msrp://[2001:0000:0000:0001:4C16:9C0F:4986:9E6D]:8880/FmnP;tcp

    From-Path: msrp://[2001:0000:0000:0001:0000:0000:0000:0002]:16000/558f02b9d0;tcp

    Message-ID: fd2f8f3e7c

    Byte-Range: 1-500/500

    Content-Type: message/cpim

     

    From: <sip:anonymous@anonymous.invalid>

    To: <sip:anonymous@anonymous.invalid>

    DateTime: 2015-02-24T06:48:10.7749079Z

    NS: imdn <urn:ietf:params:imdn>

    imdn.Message-ID: 2252a2757d

     

    Content-Type: message/imdn+xml

    Content-Disposition: notification

     

    <?xml version="1.0" encoding="utf-8"?>

    <imdn xmlns="urn:ietf:params:xml:ns:imdn">

      <message-id>wYcJuXBbGOfCtBqIPQqz0I</message-id>

      <delivery-notification>

        <status>

          <delivered />

        </status>

      </delivery-notification>

    </imdn>

    -------69172e29$

 

(11) 200 OK

    MSRP 69172e29 200 OK

    To-Path: msrp://[2001:0000:0000:0001:0000:0000:0000:0002]:16000/558f02b9d0;tcp

    From-Path: msrp://[2001::1:4c16:9c0f:4986:9e6d]:8880/FmnP;tcp

    Message-ID: fd2f8f3e7c

    -------69172e29$