SlideShare a Scribd company logo
About SIP




   An introduction to
Transactions & Dialogs
       Jonas Borjesson




                         @borjessonjonas
NOTE
●   This version has been adapted to be viewed
    without transitions.
●   Go to aboutsip.com to download the original
    version.
●   Also be sure to check out vimeo.com/aboutsip
    for any recorded presentations.
●   Follow @borjessonjonas to receive updates.



                                          @borjessonjonas
re
                                       ca
                    SIP Messages            p

●   SIP – Request/Response model
    ●   UAC sends the request, UAS responds
●   Two types of responses
    ●   Provisional (1xx)
    ●   Final (2xx - 6xx)




                                                @borjessonjonas
Transactions
●   SIP is a transactional protocol.
●   Every request & response goes within a
    transaction.
●   Transactions are independent of each other.
●   SIP transaction:
    ●   1 request                    INVITE
    ●   0..* provisional responses   100 Trying
                                     180 Ringing
    ●   0..* final responses         200 OK




                                                   @borjessonjonas
Client Transactions
●   Responsible for:
    ●   Receiving request from the TU it and...
    ●   Deliver requests reliably to the server transaction
    ●   Processing responses:
        –   Filter out retransmissions
        –   Filter out disallowed responses
        –   Pass response to the TU
    ●   Generating ACK for non 2xx final responses to
        INVITE transactions


                                                     @borjessonjonas
Server Transactions
●   Responsible for:
    ●   Receive requests and pass them up the TU
    ●   Filter out any retransmissions
    ●   Accepts responses from the TU and sends them.
    ●   Absorbing the ACK request for non 2xx final
        responses on invite transactions




                                                      @borjessonjonas
Transaction Relationships




                           request                                              request                                              request
                                      server transaction




                                                                                           server transaction




                                                                                                                                                  server transaction
                                                                                                                client transaction
      client transaction




                                                           client transaction



                           response                                             response                                             response




UAC                                      Outbound                                                  Inbound                                                             UAS
                                          Proxy                                                     Proxy
                                                                                                                                                @borjessonjonas
Transaction Identifier
  ●   Each transaction is uniquely identified by:
      ●   the branch-id on the Via-header plus
      ●   the Cseq header
  ●   3261 branch-id starts with “z9hG4bK”

  INVITE sip:bob@aboutsip.com SIP/2.0
3 Via: SIP/2.0/UDP <ip_3>;branch=z9hG4bK-lkjsalkfjoijlkjlkj
2 Via: SIP/2.0/UDP <ip_2>;branch=z9hG4bK-8jijlk-asfk-iji0kj
1 Via: SIP/2.0/TCP <ip_1>;branch=z9hG4bK-llkowe-lkjko39d
  CSeq: 1 INVITE
  ...
                                                  @borjessonjonas
Transaction Lifecycle
●    Slightly different depending on:
      ●    Server or client transaction
      ●    Invite or non-invite transaction
      ●    Reliable vs. non-reliable transport (e.g. udp vs tcp)
●    To summarize them all*
      ●    Starts when request is sent or received
      ●    Final responses takes it to completed state
      ●    Timer fires and moves it to terminated state.

    *You can't really group them together like this. Please view this information as a very generic
    summary of the life cycle of a SIP transaction. In reality, it is much more complicated.
                                                                                                      @borjessonjonas
Dialogs

 ?

     !


          @borjessonjonas
Dialogs
●   Dialogs are extremely important within SIP
●   A dialog:
    ●   represent a p2p relation between two SIP
        endpoints.
    ●   exists for some time
    ●   contains important routing information
    ●   facilitates proper sequencing of messages
    ●   consists of a sequence of transactions



                                                    @borjessonjonas
Dialog establishing methods
●   Not all methods establish a dialog!
●   The ones that do are:
    ●   INVITE (RFC 3261)
        –   For establishing a dialog
    ●   SUBSCRIBE (RFC 3265)
        –   Creates a subscription. Used e.g. in presence scenarios
    ●   REFER (RFC 3515)
        –   Also a subscription but only for the refer event-package.
            Used e.g. for call transfer



                                                            @borjessonjonas
INVITE Scenario

               INVITE sip:bob@aboutsip.com

                       100 Trying
transaction           180 Ringing

                        200 OK

                         ACK
transaction                                  dialog



                          BYE

transaction             200 OK




                                                      @borjessonjonas
Dialog Id
●   A dialog is uniquely identified by:
    ●   The Call-ID header
    ●   The remote-tag
    ●   The local-tag
●   My remote tag is your local tag and vice versa
●   Therefore, the dialog id is different for both
    ends (a very common thing SIP stacks mess up)
SIP/2.0 200 OK
To: <sip:bob@aboutsip.com>;tag=e103a059-a9ca-4bc2-96d1-779636810bfe
From: <sip:alice@aboutsip.com>;tag=f7389c89-ee9f-4802-af3e-636ce53883cb
Call-ID: 9d8eccee-02f2-4952-a1bf-01fe1bae45d6
CSeq: 2 INVITE
Contact: <sip:127.0.0.1:1557;transport=TCP>
                                                                   @borjessonjonas
Establishing a dialog
●   UAC                                     ●   UAS
                                                ●   establishes the dialog
    ●   creates the initial
                                                    through a 2xx final
        request.
                                                    response
    ●   Fills in “half” of the                  ●   fills in the other “half” of
        dialog-id.                                  the dialog-id.


    INVITE sip:bob@aboutsip.com
    From: alice@aboutsip.com ;tag=kjlkjoilkjlkjasdflkj
    To: sip:bob@aboutsip.com
    Call-ID: lkjasdlfkjasldkfjla

                             200 OK
                             From: alice@aboutsip.com;tag=kjlkjoilkjlkjasdflkj
                             To: sip:bob@aboutsip.com;tag=abckjo219898df
                             Call-ID: lkjasdlfkjasldkfjla
                                                                         @borjessonjonas
Subsequent Requests
●   Requests that goes within an established dialog
    are called subsequent requests
●   Subsequent requests follow the established
    route




       INVITE
       BYE                                  @borjessonjonas
To Complicate things...
●   There is such a thing as early-dialogs.
●   One INVITE request can be forked and create
    multiple dialogs.
                                              e
                                           bil
                                         mo
                                        @
                                     bob
                                 E
                            V IT
                          IN
         INVITE bob
                               INV
                                  ITE
                                         bob
                                               @w
                                                  or   k




                                                           @borjessonjonas
Tearing down a dialog
●   Depends on the method
    ●   BYE request for INVITE dialogs
    ●   Un-subscribe request for SUBSCRIBE dialogs
    ●   REFER dialogs typically die when the reference to
        which the subscription is referring to goes away.
●   Of course, lots of corner cases that can lead to
    the destruction of a dialog...




                                                  @borjessonjonas
Summary




          @borjessonjonas
Transactions
●   Consists of 1 request and 0..* responses
●   Two types of transactions:
    ●   Invite transactions
    ●   Non-Invite transactions
●   The branch-id on the Via uniquely identifies the
    transaction (plus the Cseq)




                                               @borjessonjonas
Dialogs
●   Consists of a sequence of transactions
●   Not all methods establish dialogs.
●   Represent a p2p relation between two SIP
    endpoints.
●   Contains routing information.
●   The dialog-id is different for the two parties.




                                                @borjessonjonas
More presentations and material
        at aboutsip.com

           Thanks!




                                  @borjessonjonas

More Related Content

PDF
SIP - The Basics
PDF
rtpengine and kamailio - or how to simulate calls at scale
PDF
Kamailio :: A Quick Introduction
PDF
Aboutsip - SIP Routing
PDF
Neighbor Discovery Deep Dive – IPv6-Networking-Referat
PDF
Akka.NET 으로 만드는 온라인 게임 서버 (NDC2016)
PDF
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
ODP
Dpdk performance
SIP - The Basics
rtpengine and kamailio - or how to simulate calls at scale
Kamailio :: A Quick Introduction
Aboutsip - SIP Routing
Neighbor Discovery Deep Dive – IPv6-Networking-Referat
Akka.NET 으로 만드는 온라인 게임 서버 (NDC2016)
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
Dpdk performance

What's hot (20)

PDF
Linux Networking Explained
PPT
Juniper mpls best practice part 2
PDF
Sipwise rtpengine
PDF
Faster packet processing in Linux: XDP
PDF
Introduction to FreeSWITCH
PPT
Juniper mpls best practice part 1
PDF
Using GTP on Linux with libgtpnl
PDF
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
PDF
Fun with Network Interfaces
PPSX
LMAX Disruptor - High Performance Inter-Thread Messaging Library
PDF
Huawei Switch S5700 How To - Configuring single-tag vlan mapping
PDF
Gitlab ci e kubernetes, build test and deploy your projects like a pro
PDF
임태현, 게임 서버 디자인 가이드, NDC2013
PDF
LSFMM 2019 BPF Observability
PDF
TRex Traffic Generator - Hanoch Haim
PPTX
HTTP2 and gRPC
PDF
rtpengine - Media Relaying and Beyond
PPTX
FastNetMon Advanced DDoS detection tool
PPTX
Dataplane programming with eBPF: architecture and tools
ODP
Introduction to Nginx
Linux Networking Explained
Juniper mpls best practice part 2
Sipwise rtpengine
Faster packet processing in Linux: XDP
Introduction to FreeSWITCH
Juniper mpls best practice part 1
Using GTP on Linux with libgtpnl
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
Fun with Network Interfaces
LMAX Disruptor - High Performance Inter-Thread Messaging Library
Huawei Switch S5700 How To - Configuring single-tag vlan mapping
Gitlab ci e kubernetes, build test and deploy your projects like a pro
임태현, 게임 서버 디자인 가이드, NDC2013
LSFMM 2019 BPF Observability
TRex Traffic Generator - Hanoch Haim
HTTP2 and gRPC
rtpengine - Media Relaying and Beyond
FastNetMon Advanced DDoS detection tool
Dataplane programming with eBPF: architecture and tools
Introduction to Nginx
Ad

Similar to Aboutsip - intro to transactions and dialogs (19)

KEY
Sip2012 :: outbound
ODP
IEEE latincom2012
PDF
Defcon 21-ozavci-vo ip-wars-return-of-the-sip by pseudor00t
PDF
Mysql Relay log - the unsung hero
PDF
Switcheo Network - Advanced NEO Smart Contracts
PPT
NGN CALL FLO1qq11qqq1aqaqqqqqqqwwwwwW.ppt
PDF
Bitcoin Blockchain - Under the Hood
PPTX
What's up with SIP?
ODP
Let's Encrypt failures
ODP
Pettycoin: Losing Tiny Amounts of Bitcoin At Scale!
PDF
Kamailio - SIP Servers Everywhere
PDF
Twisted Introduction
PDF
Introduciendo Wombat 2.0`
PPTX
SIP security in IP telephony
PDF
JavaOne - A Sip Of Java - RJ Auburn
PDF
V2 d2013 emil ivov - jitsi
PDF
Offensive Security with Metasploit
PDF
Pushing a camel through the eye of a needle
PPTX
How We Test Audio Quality In VoIP Applications by Rihards Skrebelis from Test...
Sip2012 :: outbound
IEEE latincom2012
Defcon 21-ozavci-vo ip-wars-return-of-the-sip by pseudor00t
Mysql Relay log - the unsung hero
Switcheo Network - Advanced NEO Smart Contracts
NGN CALL FLO1qq11qqq1aqaqqqqqqqwwwwwW.ppt
Bitcoin Blockchain - Under the Hood
What's up with SIP?
Let's Encrypt failures
Pettycoin: Losing Tiny Amounts of Bitcoin At Scale!
Kamailio - SIP Servers Everywhere
Twisted Introduction
Introduciendo Wombat 2.0`
SIP security in IP telephony
JavaOne - A Sip Of Java - RJ Auburn
V2 d2013 emil ivov - jitsi
Offensive Security with Metasploit
Pushing a camel through the eye of a needle
How We Test Audio Quality In VoIP Applications by Rihards Skrebelis from Test...
Ad

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Empathic Computing: Creating Shared Understanding
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Approach and Philosophy of On baking technology
Dropbox Q2 2025 Financial Results & Investor Presentation
20250228 LYD VKU AI Blended-Learning.pptx
Network Security Unit 5.pdf for BCA BBA.
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation_ Review paper, used for researhc scholars
Advanced methodologies resolving dimensionality complications for autism neur...
Chapter 3 Spatial Domain Image Processing.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Review of recent advances in non-invasive hemoglobin estimation
The Rise and Fall of 3GPP – Time for a Sabbatical?
Understanding_Digital_Forensics_Presentation.pptx
Spectroscopy.pptx food analysis technology
Machine learning based COVID-19 study performance prediction
Building Integrated photovoltaic BIPV_UPV.pdf
MYSQL Presentation for SQL database connectivity
Empathic Computing: Creating Shared Understanding
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Approach and Philosophy of On baking technology

Aboutsip - intro to transactions and dialogs

  • 1. About SIP An introduction to Transactions & Dialogs Jonas Borjesson @borjessonjonas
  • 2. NOTE ● This version has been adapted to be viewed without transitions. ● Go to aboutsip.com to download the original version. ● Also be sure to check out vimeo.com/aboutsip for any recorded presentations. ● Follow @borjessonjonas to receive updates. @borjessonjonas
  • 3. re ca SIP Messages p ● SIP – Request/Response model ● UAC sends the request, UAS responds ● Two types of responses ● Provisional (1xx) ● Final (2xx - 6xx) @borjessonjonas
  • 4. Transactions ● SIP is a transactional protocol. ● Every request & response goes within a transaction. ● Transactions are independent of each other. ● SIP transaction: ● 1 request INVITE ● 0..* provisional responses 100 Trying 180 Ringing ● 0..* final responses 200 OK @borjessonjonas
  • 5. Client Transactions ● Responsible for: ● Receiving request from the TU it and... ● Deliver requests reliably to the server transaction ● Processing responses: – Filter out retransmissions – Filter out disallowed responses – Pass response to the TU ● Generating ACK for non 2xx final responses to INVITE transactions @borjessonjonas
  • 6. Server Transactions ● Responsible for: ● Receive requests and pass them up the TU ● Filter out any retransmissions ● Accepts responses from the TU and sends them. ● Absorbing the ACK request for non 2xx final responses on invite transactions @borjessonjonas
  • 7. Transaction Relationships request request request server transaction server transaction server transaction client transaction client transaction client transaction response response response UAC Outbound Inbound UAS Proxy Proxy @borjessonjonas
  • 8. Transaction Identifier ● Each transaction is uniquely identified by: ● the branch-id on the Via-header plus ● the Cseq header ● 3261 branch-id starts with “z9hG4bK” INVITE sip:bob@aboutsip.com SIP/2.0 3 Via: SIP/2.0/UDP <ip_3>;branch=z9hG4bK-lkjsalkfjoijlkjlkj 2 Via: SIP/2.0/UDP <ip_2>;branch=z9hG4bK-8jijlk-asfk-iji0kj 1 Via: SIP/2.0/TCP <ip_1>;branch=z9hG4bK-llkowe-lkjko39d CSeq: 1 INVITE ... @borjessonjonas
  • 9. Transaction Lifecycle ● Slightly different depending on: ● Server or client transaction ● Invite or non-invite transaction ● Reliable vs. non-reliable transport (e.g. udp vs tcp) ● To summarize them all* ● Starts when request is sent or received ● Final responses takes it to completed state ● Timer fires and moves it to terminated state. *You can't really group them together like this. Please view this information as a very generic summary of the life cycle of a SIP transaction. In reality, it is much more complicated. @borjessonjonas
  • 10. Dialogs ? ! @borjessonjonas
  • 11. Dialogs ● Dialogs are extremely important within SIP ● A dialog: ● represent a p2p relation between two SIP endpoints. ● exists for some time ● contains important routing information ● facilitates proper sequencing of messages ● consists of a sequence of transactions @borjessonjonas
  • 12. Dialog establishing methods ● Not all methods establish a dialog! ● The ones that do are: ● INVITE (RFC 3261) – For establishing a dialog ● SUBSCRIBE (RFC 3265) – Creates a subscription. Used e.g. in presence scenarios ● REFER (RFC 3515) – Also a subscription but only for the refer event-package. Used e.g. for call transfer @borjessonjonas
  • 13. INVITE Scenario INVITE sip:bob@aboutsip.com 100 Trying transaction 180 Ringing 200 OK ACK transaction dialog BYE transaction 200 OK @borjessonjonas
  • 14. Dialog Id ● A dialog is uniquely identified by: ● The Call-ID header ● The remote-tag ● The local-tag ● My remote tag is your local tag and vice versa ● Therefore, the dialog id is different for both ends (a very common thing SIP stacks mess up) SIP/2.0 200 OK To: <sip:bob@aboutsip.com>;tag=e103a059-a9ca-4bc2-96d1-779636810bfe From: <sip:alice@aboutsip.com>;tag=f7389c89-ee9f-4802-af3e-636ce53883cb Call-ID: 9d8eccee-02f2-4952-a1bf-01fe1bae45d6 CSeq: 2 INVITE Contact: <sip:127.0.0.1:1557;transport=TCP> @borjessonjonas
  • 15. Establishing a dialog ● UAC ● UAS ● establishes the dialog ● creates the initial through a 2xx final request. response ● Fills in “half” of the ● fills in the other “half” of dialog-id. the dialog-id. INVITE sip:bob@aboutsip.com From: alice@aboutsip.com ;tag=kjlkjoilkjlkjasdflkj To: sip:bob@aboutsip.com Call-ID: lkjasdlfkjasldkfjla 200 OK From: alice@aboutsip.com;tag=kjlkjoilkjlkjasdflkj To: sip:bob@aboutsip.com;tag=abckjo219898df Call-ID: lkjasdlfkjasldkfjla @borjessonjonas
  • 16. Subsequent Requests ● Requests that goes within an established dialog are called subsequent requests ● Subsequent requests follow the established route INVITE BYE @borjessonjonas
  • 17. To Complicate things... ● There is such a thing as early-dialogs. ● One INVITE request can be forked and create multiple dialogs. e bil mo @ bob E V IT IN INVITE bob INV ITE bob @w or k @borjessonjonas
  • 18. Tearing down a dialog ● Depends on the method ● BYE request for INVITE dialogs ● Un-subscribe request for SUBSCRIBE dialogs ● REFER dialogs typically die when the reference to which the subscription is referring to goes away. ● Of course, lots of corner cases that can lead to the destruction of a dialog... @borjessonjonas
  • 19. Summary @borjessonjonas
  • 20. Transactions ● Consists of 1 request and 0..* responses ● Two types of transactions: ● Invite transactions ● Non-Invite transactions ● The branch-id on the Via uniquely identifies the transaction (plus the Cseq) @borjessonjonas
  • 21. Dialogs ● Consists of a sequence of transactions ● Not all methods establish dialogs. ● Represent a p2p relation between two SIP endpoints. ● Contains routing information. ● The dialog-id is different for the two parties. @borjessonjonas
  • 22. More presentations and material at aboutsip.com Thanks! @borjessonjonas