SIP Outbound
Letting the client open the connection
           and keep it open.



                                OUTBOUND



                            http://edvina.net/sip2012
The problem                          OUTBOUND




                  SIP
                                                             •        SIP is bidirectional. Every device is a client and
                                                                      a server that accepts incoming connections.


                                                             •        If the client is behind a NAT device, the server
               NAT                                                    may not be able reach it for incoming calls (or
                                                                      other messages)


                 TLS                                         •        With TLS, the client needs to connect to the
                                                                      server (unless the client has a TLS certificate)


                                                             •        TCP (and thus TLS) sessions takes a lot of
                TCP                                                   setup time and time to discover a failure.



©   C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d .   The SIP Master Class
The solution                         OUTBOUND



                   • Let the client be responsible for
                            opening one primary and one backup
                            connection
                          •        Opening connections take time, realizing that they’re down takes even longer



                   • Use the connection for communication
                            both ways


                   • Do quick failover if a connection dies
                                                                                                                       RFC 5626

©   C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d .   The SIP Master Class
SIP Outbound                                                            OUTBOUND




                  • Open connections at registration to two
                           separate servers
                  •        Keep them open.
                  •        If needed, use NAT keepalives


                                                  NATted network

                                                                                                                         SIP
                                                                                                                                             SIP
                                                                                                                         SIP
                                                                                                                                       Location server/Registrar
                                                                                                                       Ingres proxys

                                                                                                                                                 RFC 5626

©   C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d .                              The SIP Master Class
TCP connections                                                                OUTBOUND



                   • Opening a new connection
                    • In windows, takes 19 seconds to fail to setup. In Unix, around
                      70 seconds. Linux 190 seconds. (Source Geoff Houston)
                   • Discovering a broken connection
                    • To discover a failure can take a very long time.
                                          NATted network

                                                                                                                         SIP
                                                                                                                                             SIP
                                                                                            X                            SIP
                                                                                                                                       Location server/Registrar
                                                                                                                       Ingres proxys




©   C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d .                                  The SIP Master Class
Quoting the RFC                                                     OUTBOUND



                                                         ”The key idea of this specification is that
                                                         when a UA sends a REGISTER request or a
                                                         dialog-forming request, the proxy can later
                                                         use this same network "flow" -- whether this
                                                         is a bidirectional stream of UDP datagrams, a
                                                         TCP connection, or an analogous concept in
                                                         another transport protocol -- to forward any
                                                         incoming requests that need to go to this UA
                                                         in the context of the registration or dialog.”



                                                 Bidirectional flow
                                                                                                                   SIP
                                                                                                                               SIP
                                                                                                                   SIP
                                                                                                                         Location server/Registrar



©   C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d .                        The SIP Master Class
OUTBOUND



                                             NATted network

                                                                                                                         SIP
                                                                                                                                             SIP
                                               Client initiated connections
                                                                                                                         SIP
                                                                                                                                       Location server/Registrar
                                                                                                                       Ingres proxys

        • The client is responsible for keeping the connection open
        • Clients has a UUID, device identifier that stays the same - ALWAYS!
        • The SIP proxy understand (by the UUID and the reg.IDs) that one device
            has multiple registrations and will use only one at a time
        • The Registrar or Ingres proxy assigns a flow ID that is unique for each
            flow
        • A dialog stays on one connection until it fails

©   C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d .                                 The SIP Master Class
OUTBOUND




                 REGISTER sip:example.com SIP/2.0
                 Via: SIP/2.0/TCP 192.0.2.2;branch=z9hG4bK-bad0ce-11-1036
                 Max-Forwards: 70
                 From: Bob <sip:bob@example.com>;tag=d879h76
                 To: Bob <sip:bob@example.com>
                 Call-ID: 8921348ju72je840.204
                 CSeq: 1 REGISTER
                 Supported: path, outbound
                 Contact: <sip:line1@192.0.2.2;transport=tcp>; reg-id=1;
                     ;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000A95A0E128>"
                 Content-Length: 0




                                                                                                              Notice the Contact: header
                                                                                                                     parameters.

©   C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d .                The SIP Master Class
Finding proxys                                         OUTBOUND



           The UA may use DNS SRV discovery or
           provisioning to discover the proxys.

                  One SRV set for edge                                                                                 One SRV set for core
                        proxys                                                                                               proxys




©   C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d .                 The SIP Master Class
Dependencies                                     OUTBOUND



                   • RFC 3263 - finding edge and core proxys with
                            SRV/NAPTR records


                   • RFC 3327 - SIP PATH header
                            Used for communication between edge proxy
                            and location server/registrar




©   C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d .   The SIP Master Class
OUTBOUND

                                                                                                          SIP outbound

                    • Makes TLS better                                                                                 • Adds a number of
                    • Better definition for                                                                               connections
                            NAT traversal
                            support                                                                                    • Not yet implemented
                                                                                                                         in many devices
                    •       Identifies devices in
                            a unique way
                    •       Makes TCP/TLS
                            failover much, much
                            quicker


                +                                                                                                      -
©   C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d .                        The SIP Master Class
This material is part
                                                                                                                           of the Edvina
                   Learn more about                                                                                     SIP Master Classes
                       SIP2012 at
               http://edvina.net/sip2012




©   C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d .             The SIP Master Class

Sip2012 :: outbound

  • 1.
    SIP Outbound Letting theclient open the connection and keep it open. OUTBOUND http://edvina.net/sip2012
  • 2.
    The problem OUTBOUND SIP • SIP is bidirectional. Every device is a client and a server that accepts incoming connections. • If the client is behind a NAT device, the server NAT may not be able reach it for incoming calls (or other messages) TLS • With TLS, the client needs to connect to the server (unless the client has a TLS certificate) • TCP (and thus TLS) sessions takes a lot of TCP setup time and time to discover a failure. © C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d . The SIP Master Class
  • 3.
    The solution OUTBOUND • Let the client be responsible for opening one primary and one backup connection • Opening connections take time, realizing that they’re down takes even longer • Use the connection for communication both ways • Do quick failover if a connection dies RFC 5626 © C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d . The SIP Master Class
  • 4.
    SIP Outbound OUTBOUND • Open connections at registration to two separate servers • Keep them open. • If needed, use NAT keepalives NATted network SIP SIP SIP Location server/Registrar Ingres proxys RFC 5626 © C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d . The SIP Master Class
  • 5.
    TCP connections OUTBOUND • Opening a new connection • In windows, takes 19 seconds to fail to setup. In Unix, around 70 seconds. Linux 190 seconds. (Source Geoff Houston) • Discovering a broken connection • To discover a failure can take a very long time. NATted network SIP SIP X SIP Location server/Registrar Ingres proxys © C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d . The SIP Master Class
  • 6.
    Quoting the RFC OUTBOUND ”The key idea of this specification is that when a UA sends a REGISTER request or a dialog-forming request, the proxy can later use this same network "flow" -- whether this is a bidirectional stream of UDP datagrams, a TCP connection, or an analogous concept in another transport protocol -- to forward any incoming requests that need to go to this UA in the context of the registration or dialog.” Bidirectional flow SIP SIP SIP Location server/Registrar © C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d . The SIP Master Class
  • 7.
    OUTBOUND NATted network SIP SIP Client initiated connections SIP Location server/Registrar Ingres proxys • The client is responsible for keeping the connection open • Clients has a UUID, device identifier that stays the same - ALWAYS! • The SIP proxy understand (by the UUID and the reg.IDs) that one device has multiple registrations and will use only one at a time • The Registrar or Ingres proxy assigns a flow ID that is unique for each flow • A dialog stays on one connection until it fails © C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d . The SIP Master Class
  • 8.
    OUTBOUND REGISTER sip:example.com SIP/2.0 Via: SIP/2.0/TCP 192.0.2.2;branch=z9hG4bK-bad0ce-11-1036 Max-Forwards: 70 From: Bob <sip:bob@example.com>;tag=d879h76 To: Bob <sip:bob@example.com> Call-ID: 8921348ju72je840.204 CSeq: 1 REGISTER Supported: path, outbound Contact: <sip:line1@192.0.2.2;transport=tcp>; reg-id=1; ;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000A95A0E128>" Content-Length: 0 Notice the Contact: header parameters. © C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d . The SIP Master Class
  • 9.
    Finding proxys OUTBOUND The UA may use DNS SRV discovery or provisioning to discover the proxys. One SRV set for edge One SRV set for core proxys proxys © C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d . The SIP Master Class
  • 10.
    Dependencies OUTBOUND • RFC 3263 - finding edge and core proxys with SRV/NAPTR records • RFC 3327 - SIP PATH header Used for communication between edge proxy and location server/registrar © C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d . The SIP Master Class
  • 11.
    OUTBOUND SIP outbound • Makes TLS better • Adds a number of • Better definition for connections NAT traversal support • Not yet implemented in many devices • Identifies devices in a unique way • Makes TCP/TLS failover much, much quicker + - © C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d . The SIP Master Class
  • 12.
    This material ispart of the Edvina Learn more about SIP Master Classes SIP2012 at http://edvina.net/sip2012 © C o p y ri g h t 2 0 1 2 E d v i n a A B , S o l l e n t u n a , S w e d e n . A l l ri g h t s re s e r v e d . The SIP Master Class

Editor's Notes