Aboutsip - intro to transactions and dialogs

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
1 of 22

Recommended

Aboutsip - SIP Routing by
Aboutsip - SIP RoutingAboutsip - SIP Routing
Aboutsip - SIP RoutingJonas Borjesson
8.9K views26 slides
Neighbor Discovery Deep Dive – IPv6-Networking-Referat by
Neighbor Discovery Deep Dive – IPv6-Networking-ReferatNeighbor Discovery Deep Dive – IPv6-Networking-Referat
Neighbor Discovery Deep Dive – IPv6-Networking-ReferatDigicomp Academy AG
1.4K views41 slides
Kamailio - Secure Communication by
Kamailio - Secure CommunicationKamailio - Secure Communication
Kamailio - Secure CommunicationDaniel-Constantin Mierla
3.6K views49 slides
Ultra fast DDoS Detection with FastNetMon at Coloclue (AS 8283) by
Ultra	fast	DDoS Detection	with	FastNetMon at	 Coloclue	(AS	8283)Ultra	fast	DDoS Detection	with	FastNetMon at	 Coloclue	(AS	8283)
Ultra fast DDoS Detection with FastNetMon at Coloclue (AS 8283)Pavel Odintsov
7.9K views16 slides
Kolla talk at OpenStack Summit 2017 in Sydney by
Kolla talk at OpenStack Summit 2017 in SydneyKolla talk at OpenStack Summit 2017 in Sydney
Kolla talk at OpenStack Summit 2017 in SydneyVikram G Hosakote
1.4K views39 slides
Juniper mpls best practice part 2 by
Juniper mpls best practice   part 2Juniper mpls best practice   part 2
Juniper mpls best practice part 2Febrian ‎
15.7K views41 slides

More Related Content

What's hot

MENOG-Segment Routing Introduction by
MENOG-Segment Routing IntroductionMENOG-Segment Routing Introduction
MENOG-Segment Routing IntroductionRasoul Mesghali, CCIE RS
395 views90 slides
9534715 by
95347159534715
9534715Pavel Odintsov
10.3K views41 slides
SIP: Call Id, Cseq, Via-branch, From & To-tag role play by
SIP: Call Id, Cseq, Via-branch, From & To-tag role playSIP: Call Id, Cseq, Via-branch, From & To-tag role play
SIP: Call Id, Cseq, Via-branch, From & To-tag role playSridhar Kumar N
705 views14 slides
Bgp tutorial for ISP by
Bgp tutorial for ISPBgp tutorial for ISP
Bgp tutorial for ISPWahyu Nasution
5.2K views213 slides
NGINX: Basics and Best Practices by
NGINX: Basics and Best PracticesNGINX: Basics and Best Practices
NGINX: Basics and Best PracticesNGINX, Inc.
6.7K views32 slides
Kamailio - Load Balancing Load Balancers by
Kamailio - Load Balancing Load BalancersKamailio - Load Balancing Load Balancers
Kamailio - Load Balancing Load BalancersDaniel-Constantin Mierla
4K views28 slides

What's hot(20)

SIP: Call Id, Cseq, Via-branch, From & To-tag role play by Sridhar Kumar N
SIP: Call Id, Cseq, Via-branch, From & To-tag role playSIP: Call Id, Cseq, Via-branch, From & To-tag role play
SIP: Call Id, Cseq, Via-branch, From & To-tag role play
Sridhar Kumar N705 views
NGINX: Basics and Best Practices by NGINX, Inc.
NGINX: Basics and Best PracticesNGINX: Basics and Best Practices
NGINX: Basics and Best Practices
NGINX, Inc.6.7K views
DDoS Mitigation Tools and Techniques by Babak Farrokhi
DDoS Mitigation Tools and TechniquesDDoS Mitigation Tools and Techniques
DDoS Mitigation Tools and Techniques
Babak Farrokhi2.2K views
Implementing BGP Flowspec at IP transit network by Pavel Odintsov
Implementing BGP Flowspec at IP transit networkImplementing BGP Flowspec at IP transit network
Implementing BGP Flowspec at IP transit network
Pavel Odintsov2K views
MPLS Traffic Engineering by APNIC
MPLS Traffic EngineeringMPLS Traffic Engineering
MPLS Traffic Engineering
APNIC1.8K views
Deploy MPLS Traffic Engineering by APNIC
Deploy MPLS Traffic EngineeringDeploy MPLS Traffic Engineering
Deploy MPLS Traffic Engineering
APNIC5.8K views
ICE basic by Vu Nguyen
ICE basicICE basic
ICE basic
Vu Nguyen1.4K views
DDoS Mitigation using BGP Flowspec by APNIC
DDoS Mitigation using BGP Flowspec DDoS Mitigation using BGP Flowspec
DDoS Mitigation using BGP Flowspec
APNIC2.8K views
Cisco Live Milan 2015 - BGP advance by Bertrand Duvivier
Cisco Live Milan 2015 - BGP advanceCisco Live Milan 2015 - BGP advance
Cisco Live Milan 2015 - BGP advance
Bertrand Duvivier14.6K views
Introduction to Segment Routing by MyNOG
Introduction to Segment RoutingIntroduction to Segment Routing
Introduction to Segment Routing
MyNOG2.6K views
FastNetMon - ENOG9 speech about DDoS mitigation by Pavel Odintsov
FastNetMon - ENOG9 speech about DDoS mitigationFastNetMon - ENOG9 speech about DDoS mitigation
FastNetMon - ENOG9 speech about DDoS mitigation
Pavel Odintsov8.4K views
Expanding Asterisk with Kamailio by Fred Posner
Expanding Asterisk with KamailioExpanding Asterisk with Kamailio
Expanding Asterisk with Kamailio
Fred Posner5.8K views
Open vSwitch - Stateful Connection Tracking & Stateful NAT by Thomas Graf
Open vSwitch - Stateful Connection Tracking & Stateful NATOpen vSwitch - Stateful Connection Tracking & Stateful NAT
Open vSwitch - Stateful Connection Tracking & Stateful NAT
Thomas Graf4.3K views
Segment Routing: A Tutorial by APNIC
Segment Routing: A TutorialSegment Routing: A Tutorial
Segment Routing: A Tutorial
APNIC17K views
Eigrp by firey
EigrpEigrp
Eigrp
firey8.6K views

Similar to Aboutsip - intro to transactions and dialogs

Sip2012 :: outbound by
Sip2012 :: outboundSip2012 :: outbound
Sip2012 :: outboundOlle E Johansson
2.2K views12 slides
IEEE latincom2012 by
IEEE latincom2012IEEE latincom2012
IEEE latincom2012jmillan_slideshare
1.6K views62 slides
Defcon 21-ozavci-vo ip-wars-return-of-the-sip by pseudor00t by
Defcon 21-ozavci-vo ip-wars-return-of-the-sip by pseudor00tDefcon 21-ozavci-vo ip-wars-return-of-the-sip by pseudor00t
Defcon 21-ozavci-vo ip-wars-return-of-the-sip by pseudor00tpseudor00t overflow
72 views35 slides
Mysql Relay log - the unsung hero by
Mysql Relay log - the unsung heroMysql Relay log - the unsung hero
Mysql Relay log - the unsung herovishnu rao
83 views17 slides
Switcheo Network - Advanced NEO Smart Contracts by
Switcheo Network - Advanced NEO Smart ContractsSwitcheo Network - Advanced NEO Smart Contracts
Switcheo Network - Advanced NEO Smart ContractsSwitcheo
407 views29 slides
Bitcoin Blockchain - Under the Hood by
Bitcoin Blockchain - Under the HoodBitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodGalin Dinkov
2.8K views60 slides

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

Defcon 21-ozavci-vo ip-wars-return-of-the-sip by pseudor00t by pseudor00t overflow
Defcon 21-ozavci-vo ip-wars-return-of-the-sip by pseudor00tDefcon 21-ozavci-vo ip-wars-return-of-the-sip by pseudor00t
Defcon 21-ozavci-vo ip-wars-return-of-the-sip by pseudor00t
Mysql Relay log - the unsung hero by vishnu rao
Mysql Relay log - the unsung heroMysql Relay log - the unsung hero
Mysql Relay log - the unsung hero
vishnu rao83 views
Switcheo Network - Advanced NEO Smart Contracts by Switcheo
Switcheo Network - Advanced NEO Smart ContractsSwitcheo Network - Advanced NEO Smart Contracts
Switcheo Network - Advanced NEO Smart Contracts
Switcheo407 views
Bitcoin Blockchain - Under the Hood by Galin Dinkov
Bitcoin Blockchain - Under the HoodBitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the Hood
Galin Dinkov2.8K views
Pettycoin: Losing Tiny Amounts of Bitcoin At Scale! by RustyQRussell
Pettycoin: Losing Tiny Amounts of Bitcoin At Scale!Pettycoin: Losing Tiny Amounts of Bitcoin At Scale!
Pettycoin: Losing Tiny Amounts of Bitcoin At Scale!
RustyQRussell1.2K views
Twisted Introduction by cyli
Twisted IntroductionTwisted Introduction
Twisted Introduction
cyli673 views
Introduciendo Wombat 2.0` by OpenDireito
Introduciendo Wombat 2.0`Introduciendo Wombat 2.0`
Introduciendo Wombat 2.0`
OpenDireito18 views
JavaOne - A Sip Of Java - RJ Auburn by Voxeo Corp
JavaOne - A Sip Of Java - RJ AuburnJavaOne - A Sip Of Java - RJ Auburn
JavaOne - A Sip Of Java - RJ Auburn
Voxeo Corp4.3K views
V2 d2013 emil ivov - jitsi by VOIP2DAY
V2 d2013   emil ivov - jitsiV2 d2013   emil ivov - jitsi
V2 d2013 emil ivov - jitsi
VOIP2DAY328 views
Offensive Security with Metasploit by egypt
Offensive Security with MetasploitOffensive Security with Metasploit
Offensive Security with Metasploit
egypt1.1K views
Pushing a camel through the eye of a needle by SensePost
Pushing a camel through the eye of a needlePushing a camel through the eye of a needle
Pushing a camel through the eye of a needle
SensePost8.6K views
How We Test Audio Quality In VoIP Applications by Rihards Skrebelis from Test... by DevClub_lv
How We Test Audio Quality In VoIP Applications by Rihards Skrebelis from Test...How We Test Audio Quality In VoIP Applications by Rihards Skrebelis from Test...
How We Test Audio Quality In VoIP Applications by Rihards Skrebelis from Test...
DevClub_lv5.3K views

Recently uploaded

Voice Logger - Telephony Integration Solution at Aegis by
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at AegisNirmal Sharma
39 views1 slide
Network Source of Truth and Infrastructure as Code revisited by
Network Source of Truth and Infrastructure as Code revisitedNetwork Source of Truth and Infrastructure as Code revisited
Network Source of Truth and Infrastructure as Code revisitedNetwork Automation Forum
26 views45 slides
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...James Anderson
85 views32 slides
PharoJS - Zürich Smalltalk Group Meetup November 2023 by
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023Noury Bouraqadi
127 views17 slides
The details of description: Techniques, tips, and tangents on alternative tex... by
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...BookNet Canada
127 views24 slides
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors by
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensorssugiuralab
19 views15 slides

Recently uploaded(20)

Voice Logger - Telephony Integration Solution at Aegis by Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma39 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson85 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi127 views
The details of description: Techniques, tips, and tangents on alternative tex... by BookNet Canada
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...
BookNet Canada127 views
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors by sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab19 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker37 views
Serverless computing with Google Cloud (2023-24) by wesley chun
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)
wesley chun11 views
Transcript: The Details of Description Techniques tips and tangents on altern... by BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada136 views
Empathic Computing: Delivering the Potential of the Metaverse by Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst478 views
SAP Automation Using Bar Code and FIORI.pdf by Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb14 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely21 views

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