Top Banner
Sip Events and Presence Shadhin Rahman
32

Sip events presence

May 15, 2015

Download

Documents

Shadhin Rahman

presence allows multiple people to subscribe to same call. It works for a small group of people having sharedl line
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sip events presence

Sip Events and PresenceSip Events and PresenceShadhin RahmanShadhin Rahman

Page 2: Sip events presence

OverviewOverview

General introduction of Sip Sip transaction and dialog Presence architecture Sip Events architecture and behavior Security considerations

General introduction of Sip Sip transaction and dialog Presence architecture Sip Events architecture and behavior Security considerations

Page 3: Sip events presence

SIP IntroductionSIP Introduction

Sip user agent and sip network server Client initiates a call and server routes the

call Server is responsible for name resolution

and user location Sip proxy receives calls and send it to its

destination or next hop.

Sip user agent and sip network server Client initiates a call and server routes the

call Server is responsible for name resolution

and user location Sip proxy receives calls and send it to its

destination or next hop.

Page 4: Sip events presence

Image source http://www.cafesip.org/projects/jiplet/sip_registrar.jpg

Image source http://www.cafesip.org/projects/jiplet/sip_registrar.jpg

Page 5: Sip events presence

Sip MethodsSip Methods

Invite is for session request Ack confirms a request Cancel is to end a pending request Bye to end a session Register to keep track of user location

Invite is for session request Ack confirms a request Cancel is to end a pending request Bye to end a session Register to keep track of user location

Page 6: Sip events presence

Sip Return CodeSip Return Code

Sip has http like return code 100 trying 180 ringing 200 Ok 302 moved permanently 401 unauthorized 503 service unavailable 603 declined

Sip has http like return code 100 trying 180 ringing 200 Ok 302 moved permanently 401 unauthorized 503 service unavailable 603 declined

Page 7: Sip events presence

Sip Transaction and DialogSip Transaction and Dialog

Transaction occurs between a client and a server and comprises all messages from the first request sent from the client to the server up to a final response sent from the server to the client.

Dialog is a peer-to-peer SIP relationship between two UAs that persists for some time. A dialog is identified by a Call-ID, a local tag and a remote tag.

Transaction occurs between a client and a server and comprises all messages from the first request sent from the client to the server up to a final response sent from the server to the client.

Dialog is a peer-to-peer SIP relationship between two UAs that persists for some time. A dialog is identified by a Call-ID, a local tag and a remote tag.

Page 8: Sip events presence

Sip Transaction DialogSip Transaction Dialog

Image source http://www.informatik.uni-bremen.de/~prelle/terena/cookbook/Cookbook_D2/figures/chapter2/dialog.png

Image source http://www.informatik.uni-bremen.de/~prelle/terena/cookbook/Cookbook_D2/figures/chapter2/dialog.png

Page 9: Sip events presence

PresencePresence

Presence is user’s reachability and willingness to communicate its current status information

User subscribe to an event and receive notification Presence user agent Presence agent Presence server Watcher

Presence is user’s reachability and willingness to communicate its current status information

User subscribe to an event and receive notification Presence user agent Presence agent Presence server Watcher

Page 10: Sip events presence

Image source http://msdn.microsoft.com/en-us/library/bb896003.aspx

Image source http://msdn.microsoft.com/en-us/library/bb896003.aspx

Page 11: Sip events presence

Presence OverviewPresence Overview

Subscribe request Presence agent should authenticate and send

acknowledgement State changes should be notified to

subscriber Ability to refresh and terminate subscription Presence agent should be able to allow or

terminate subscription

Subscribe request Presence agent should authenticate and send

acknowledgement State changes should be notified to

subscriber Ability to refresh and terminate subscription Presence agent should be able to allow or

terminate subscription

Page 12: Sip events presence

Presence FlowPresence Flow

Image source http://download.oracle.com/docs/cd/B32110_01/ocms.1013/b31497/about_sdp.htm#BABDHHCJImage source http://download.oracle.com/docs/cd/B32110_01/ocms.1013/b31497/about_sdp.htm#BABDHHCJ

Page 13: Sip events presence

Sip Events IntroductionSip Events Introduction

Sip was initially introduced as a signaling protocol

Lack of method to emulate constant communication and update status between entity

Three more method was introduced namely Publish , Subscribe and Notify

Sip was initially introduced as a signaling protocol

Lack of method to emulate constant communication and update status between entity

Three more method was introduced namely Publish , Subscribe and Notify

Page 14: Sip events presence

Simple Sip EventsSimple Sip Events

Image source http://www.cisco.com/en/US/i/100001-200000/190001-200000/190001-191000/190463.jpgImage source http://www.cisco.com/en/US/i/100001-200000/190001-200000/190001-191000/190463.jpg

Page 15: Sip events presence

Sip Event definitionsSip Event definitions

Event Package Event Templates Notification Notifier State Agent Subscriber Subscription

Event Package Event Templates Notification Notifier State Agent Subscriber Subscription

Page 16: Sip events presence

Description of SubscribeDescription of Subscribe

Subscription Duration Identification of subscribe event or event

classes Optional accept header.

Subscription Duration Identification of subscribe event or event

classes Optional accept header.

Page 17: Sip events presence

Subscriber ActionsSubscriber Actions

Requesting a subscription. Refreshing subscription. Unsubscribing. Confirmation of subscription.

Requesting a subscription. Refreshing subscription. Unsubscribing. Confirmation of subscription.

Page 18: Sip events presence

Description of NotifyDescription of Notify

Event headers Message body Check for valid event type Ensure local authentication and

authorization. Notification should sent after removal of

subscription.

Event headers Message body Check for valid event type Ensure local authentication and

authorization. Notification should sent after removal of

subscription.

Page 19: Sip events presence

Notifier RespondsNotifier Responds

Initial subscribe transaction processing. 489 bad event.• Confirmation of subscription

creation/refreshing.• Authentication/Authorization of subscribe

request. 403 forbidden, 603 declined.

Initial subscribe transaction processing. 489 bad event.• Confirmation of subscription

creation/refreshing.• Authentication/Authorization of subscribe

request. 403 forbidden, 603 declined.

Page 20: Sip events presence

Description of PublishDescription of Publish

Publishes event state Create, modify and remove state Event publication agent Event state compositor Duration of any event is well defined

Publishes event state Create, modify and remove state Event publication agent Event state compositor Duration of any event is well defined

Page 21: Sip events presence

Processing Publish RequestProcessing Publish Request

Event state compositor keeps track of state for each Address-of-record

Esc inspects request uri Esc examines event header Esc process expires header field Esc stores the event state in the body of the

message

Event state compositor keeps track of state for each Address-of-record

Esc inspects request uri Esc examines event header Esc process expires header field Esc stores the event state in the body of the

message

Page 22: Sip events presence

SUBSCRIBE sip:[email protected] SIP/2.0 Via: SIP/2.0/UDP host.example.com;branch=z9hG4bKnashds7 To: <sip:[email protected]> From: <sip:[email protected]>;tag=12341234 Call-ID: [email protected] CSeq: 1 SUBSCRIBE Max-Forwards: 70 Expires: 3600 Event: presence Contact: sip:[email protected] Content-Length: 0

Page 23: Sip events presence

SIP/2.0 200 OK Via: SIP/2.0/UDP host.example.com;branch=z9hG4bKnashds7 ;received=192.0.2.1 To: <sip:[email protected]>;tag=abcd1234 From: <sip:[email protected]>;tag=12341234 Call-ID: [email protected] CSeq: 1 SUBSCRIBE Contact: sip:pa.example.com Expires: 3600 Content-Length: 0

Page 24: Sip events presence

NOTIFY sip:[email protected] SIP/2.0 Via: SIP/2.0/UDP pa.example.com;branch=z9hG4bK8sdf2 To: <sip:[email protected]>;tag=12341234 From: <sip:[email protected]>;tag=abcd1234 Call-ID: [email protected] CSeq: 1 NOTIFY Max-Forwards: 70 Event: presence Subscription-State: active; expires=3599 Contact: sip:pa.example.com Content-Type: application/pidf+xml Content-Length: ...

Page 25: Sip events presence

SIP/2.0 200 OK Via: SIP/2.0/UDP pa.example.com;branch=z9hG4bK8sdf2 ;received=192.0.2.2 To: <sip:[email protected]>;tag=12341234 From: <sip:[email protected]>;tag=abcd1234 Call-ID: [email protected] CSeq: 1 NOTIFY

Page 26: Sip events presence

PUBLISH sip:[email protected] SIP/2.0 Via: SIP/2.0/UDP pua.example.com;branch=z9hG4bK652hsge To: <sip:[email protected]> From: <sip:[email protected]>;tag=1234wxyz Call-ID: [email protected] CSeq: 1 PUBLISH Max-Forwards: 70 Expires: 3600 Event: presence Content-Type: application/pidf+xml Content-Length: ...

Page 27: Sip events presence

SIP/2.0 200 OK Via: SIP/2.0/UDP pua.example.com;branch=z9hG4bK652hsge ;received=192.0.2.3 To: <sip:[email protected]>;tag=1a2b3c4d From: <sip:[email protected]>;tag=1234wxyz Call-ID: [email protected] CSeq: 1 PUBLISH SIP-ETag: dx200xyz Expires: 1800

Page 28: Sip events presence

Security ConsiderationSecurity Consideration

Access control. Notifier privacy mechanism. Denial of service attacks. Replay Attacks. Man-in-the-middle attacks. Confidentiality.

Access control. Notifier privacy mechanism. Denial of service attacks. Replay Attacks. Man-in-the-middle attacks. Confidentiality.

Page 29: Sip events presence

Implementation of SecurityImplementation of Security

Sip registration TLS Digest Authentication S/MIME

Sip registration TLS Digest Authentication S/MIME

Page 30: Sip events presence

ReferencesReferences

Rfc 3856 http://www.ietf.org/rfc/rfc3856.txt Rfc 3265 http://www.ietf.org/rfc/rfc3265.txt Rfc 2778 http://www.ietf.org/rfc/rfc2778.txt Rfc 3261 http://www.ietf.org/rfc/rfc3261.txt Rfc 3903 http://www.ietf.org/rfc/rfc3903.txt http://en.wikipedia.org/wiki/Session_Initiation_Pr

otocol

Rfc 3856 http://www.ietf.org/rfc/rfc3856.txt Rfc 3265 http://www.ietf.org/rfc/rfc3265.txt Rfc 2778 http://www.ietf.org/rfc/rfc2778.txt Rfc 3261 http://www.ietf.org/rfc/rfc3261.txt Rfc 3903 http://www.ietf.org/rfc/rfc3903.txt http://en.wikipedia.org/wiki/Session_Initiation_Pr

otocol

Page 31: Sip events presence

SummerySummery

Presence is a way to have sustained stateful communication

Sip serves well for presence requirements Sip presence deployment must confirm

security measurements

Presence is a way to have sustained stateful communication

Sip serves well for presence requirements Sip presence deployment must confirm

security measurements

Page 32: Sip events presence

Question ?Question ?