Sip crash course


Published on

Short presentation that introduces the basic concepts of SIP.

Note, some of the slides requires animations and will therefore look strange when viewed without them (e.g., see slide 17). Email me if you want the full presentation and I'll send it to you...

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Proxy – forwards the request to the next hop. One type of proxy is a location based proxy, which will use the information found in the Location Service in order the final destination, to which it will forward the request. Note, the message will most likely not go directly the address found in the location service and has to do with a number of factors. One such factor are if there are any pre-loaded routes in the message, which we will talk more about later. Registrar – responsible for maintaining contact addresses associated with a particular AOR (aka a binding). This is accomplished through REGISTER requests. The bindings are stored in the Location Service. Location Service – more of a concept than anything else and is basically just a simple database storing mappings between AORs and contact addresses. Redirect Server – will actually not forward the request to the next hop but will simply suggest alternative locations where the intended target may be reached (sends back 3xx responses). Question:
  • 1xx: Provisional -- request received, continuing to process the request; 2xx: Success -- the action was successfully received, understood, and accepted; 3xx: Redirection -- further action needs to be taken in order to complete the request; 4xx: Client Error -- the request contains bad syntax or cannot be fulfilled at this server; 5xx: Server Error -- the server failed to fulfill an apparently valid request; 6xx: Global Failure -- the request cannot be fulfilled at any server. (rfc3261, section 7.2)
  • Session Establishment Three way handshake Questions: * Does 180 has any purpose? If so, what? Only for humans? * Any cool usage for 180? * How did the proxy know to contact Bob at the specified IP? * At what point is the session established? * Could you have multiple sessions being established due to this one INVITE? If so, how?
  • Identify the different parts of the message * What is the via header used for? * what is the Contact header used for? * To? From? Etc
  • Sip crash course

    1. 1. SIP Crash Course January 2011
    2. 2. Agenda <ul><li>Introduction </li><ul><li>What is SIP
    3. 3. What is it not </li></ul><li>Basic Architecture </li><ul><li>Proxy
    4. 4. Redirect
    5. 5. Location Server
    6. 6. Registrar </li></ul></ul><ul><li>SIP Protocol </li><ul><li>Request
    7. 7. Response
    8. 8. Addressing
    9. 9. Sending a request
    10. 10. Routing
    11. 11. Dialog </li></ul><li>Scenarios </li></ul>
    12. 12. What is SIP <ul><li>Provides infrastructure for routing messages.
    13. 13. Provides a way for end-points to register their current location.
    14. 14. SIP creates and manages sessions.
    15. 15. Allows parties to agree on a set of compatible media types.
    16. 16. Session can be anything: </li><ul><li>Voice/Video/Gaming/Chat </li></ul></ul>Introduction
    17. 17. What SIP is not <ul><li>SIP does not provide complete multimedia solution.
    18. 18. Since SIP is a signaling protocol, it cannot guarantee the QoS in the established session.
    19. 19. It is not a billing protocol </li></ul>Introduction
    20. 20. SIP Components <ul><li>Two main elements </li><ul><li>User Agents (UA) </li><ul><li>User Agent Client (UAC)
    21. 21. User Agent Server (UAS) </li></ul><li>Servers </li><ul><li>Proxy (stateful & stateless) forwards the request to the next hop
    22. 22. Registrar – accepts register requests
    23. 23. Redirect Server – finds alternative locations
    24. 24. Location Service – stores bindings* </li></ul></ul></ul>Basic Architecture
    25. 25. SIP Messages <ul><li>Like HTTP – Requests/Response model </li><ul><li>UAC sends the Request, UAS responds. </li></ul><li>Requests starts with a request line </li><ul><li>INVITE SIP/2.0 </li></ul><li>Methods </li><ul><li>INVITE, ACK, BYE, CANCEL, REGISTER, OPTION
    26. 26. More defined by extensions </li></ul></ul>SIP Protocol
    27. 27. SIP Messages <ul><li>Responses with a status line </li><ul><li>SIP/2.0 200 OK </li></ul><li>Response Codes: </li><ul><li>1xx – Provisional.
    28. 28. 2xx – Success.
    29. 29. 3xx – Redirection.
    30. 30. 4xx – Client Error.
    31. 31. 5xx – Server Error.
    32. 32. 6xx - Global Failures. </li></ul></ul>SIP Protocol
    33. 33. Basic User Scenario SIP Protocol Proxy Alice Bob INVITE INVITE sip:bob@ 180 Ringing 180 Ringing ACK ACK 200 OK 200 OK
    34. 34. INVITE Request INVITE SIP/2.0 To: <> From: <>;tag=987lkajsdf89au Call-ID: lkjasdf90989lkj CSeq: 1 INVITE Content-Type: application/sdp Content-Length: 450 Record-Route: <sip:;transport=tcp;lr> Record-Route: <sip:;transport=tcp;lr> Via: SIP/2.0/TCP;branch=xxx;rport ... Contact: <sip:;transport=TCP> SIP Protocol
    35. 35. 200 OK Response SIP/2.0 200 OK To: <sip: [email_address] >;tag=89uasdkfjoiu From: <sip: [email_address] >;tag=987lkajsdf89au Call-ID: lkjasdf90989lkj CSeq: 1 INVITE Via: SIP/2.0/TCP;branch=xxx;rport ... Contact: <sip:;transport=TCP> Record-Route: <sip:;transport=tcp;lr> Record-Route: <sip:;transport=tcp;lr> Content-Type: application/sdp Content-Length: 451 SIP Protocol
    36. 36. SIP Headers <ul><li>Headers carries important information about e.g. routing or request and responses.
    37. 37. Similar in syntax and meaning to HTTP
    38. 38. The more important headers: </li><ul><li>To & From
    39. 39. Via
    40. 40. Contact
    41. 41. Call-ID
    42. 42. Route & Record-Route
    43. 43. CSeq </li></ul></ul>SIP Protocol
    44. 44. Addressing <ul><li>SIP-address is used to locate and communicate with other users. </li><ul><li>
    45. 45. </li></ul><li>Each user typically have an Address of Record (AOR), through which that user can be contacted. </li></ul>SIP Protocol
    46. 46. Constructing a request <ul><li>Request line
    47. 47. Headers (the minimum) </li><ul><li>To
    48. 48. From
    49. 49. Call-ID
    50. 50. Via
    51. 51. Cseq
    52. 52. Max-Forwards </li></ul></ul>SIP Protocol
    53. 53. Sending the request <ul><li>Most compute the destination. </li><ul><li>Transport
    54. 54. Port
    55. 55. IP-address RFC 3263 describes how to compute these
    56. 56. The procedures of 3263 are applied to which URI? </li></ul></ul>SIP Protocol
    57. 57. Routing <ul><li>SIP uses DNS to resolve sip-addresses.
    58. 58. SIP:s routing capability is very strong.
    59. 59. Requests uses Route-headers and the request-uri to traverse the network.
    60. 60. Responses use Via-headers. </li></ul>SIP Protocol
    61. 61. Routing SIP Protocol To: <> From: <>;tag=987lkajsdf89au Call-ID: lkjasdf90989lkj CSeq: 1 INVITE Contact: <sip:;transport=TCP> Route: <;lr> Via: SIP/2.0/TCP;branch=xxx;rport Via: SIP/2.0/TCP;branch=yyy;rport Record-Route: <sip:;transport=tcp;lr> Via: SIP/2.0/TCP;branch=xyz;rport INVITE SIP/2.0 INVITE sip:alice@;transport=TCP SIP/2.0 ;tag=89uasdkfjoiu
    62. 62. Routing SIP Protocol SIP/2.0 200 OK To: <sip: [email_address] >;tag=89uasdkfjoiu From: <sip: [email_address] >;tag=987lkajsdf89au Call-ID: lkjasdf90989lkj CSeq: 1 INVITE Contact: <sip:;transport=TCP> Record-Route: <sip:;transport=tcp;lr> Via: SIP/2.0/TCP;branch=xxx;rport Via: SIP/2.0/TCP;branch=yyy;rport Via: SIP/2.0/TCP;branch=xyz;rport
    63. 63. Dialog <ul><li>A dialog is a peer-to-peer relationship between two end-points that lasts for some time.
    64. 64. Facilitates proper routing between the two end-points.
    65. 65. Maintains state
    66. 66. Identified through a Dialog id
    67. 67. Only a few messages are dialog creating.
    68. 68. When the dialog is established depends on the method. </li></ul>SIP Protocol
    69. 69. The End