MSDN overview of SIP

Embed Size (px)

Citation preview

  • 8/13/2019 MSDN overview of SIP

    1/16

    Module 8: Overview ofSIP

    Contents

    Overview 1Lesson: Introducing SIP 2Lesson: Structure of a SIP Message 5Review 13

  • 8/13/2019 MSDN overview of SIP

    2/16

  • 8/13/2019 MSDN overview of SIP

    3/16

    Module 8: Overview of SIP 1

    Overview

    Introduction This module provides an overview of SIP. It does not cover all the aspects ofSIP. The objective of this module is to make you familiar with the SIP protocoland the SIP message structure. This knowledge will help you use some of thetroubleshooting tools in Live Communications Server 2003 to diagnose clientand server communication problems. For complete understanding of SIP, it isrecommended that you read the document, SIP Request for Comment (RFC)3261.

    Objectives After completing this module, you will be able to:

    Describe SIP and explain how the basic SIP session is established.

    Describe the structure of a SIP message.

  • 8/13/2019 MSDN overview of SIP

    4/16

    2 Module 8: Overview of SIP

    Lesson: Introducing SIP

    Introduction This lesson provides an overview of SIP and explains how SIP establishes a basic communication session.

    Lesson objectives After completing this lesson, you will be able to:

    Describe SIP.

    Explain how a basic SIP session is established.

  • 8/13/2019 MSDN overview of SIP

    5/16

  • 8/13/2019 MSDN overview of SIP

    6/16

    4 Module 8: Overview of SIP

    Basic SIP Session Establishment

    Introduction The process to establish a session starts with an INVITE message, which is sentfrom a calling user to a called user, inviting the called user to participate in asession. The caller might receive a number of interim responses before thecalled user accepts the call. For example, the caller might be informed that thecalled user is being alerted (the phone is ringing). When the called user answersthe call, an OK response is generated and sent to the calling client. The callingclient sends an ACK message after which media, such as voice, video, or text,is exchanged. After one of the users hangs up, a BYE message is generated andsent to the other client. The other client confirms that the session is over, after

    which the call ends.

  • 8/13/2019 MSDN overview of SIP

    7/16

    Module 8: Overview of SIP 5

    Lesson: Structure of a SIP Message

    Introduction This lesson explains the basic structure of a SIP message. It describes thedifferent methods that are used in a SIP request and the different classes thatspecify the status of a SIP response. It also describes the various types ofheaders that can be part of a SIP message. In addition, the lesson covers thetools, SIPLogger and SIPParser, which can be used to read a SIP message.

    Lesson objectives After completing this lesson, you will be able to:

    Identify the structure of a SIP message.

    Describe the methods used in a SIP message.

    Identify the classes that are included in a SIP response to describe its status.

    Describe the different types of SIP headers.

    Describe the tools that are used to read a SIP message.

  • 8/13/2019 MSDN overview of SIP

    8/16

    6 Module 8: Overview of SIP

    SIP Message Structure: An Overview

    Introduction SIP is a text-based protocol that is similar to HTTP, which makes it easy readand understand.

    Structure of a SIPmessage

    A SIP message is either a request from a client to a server or a response from aserver to a client. Both the request and the response contain a start-line followed

    by one or more headers and a message body. For example:

    message = start-line*message headerCRLF

    [message-body]

    The request line specifies the type of request being issued, while the responseline indicates the success or failure of a request. If a request is not executed, thestatus line indicates the type of failure or the reason for the failure.

  • 8/13/2019 MSDN overview of SIP

    9/16

    Module 8: Overview of SIP 7

    SIP Request

    Introduction A SIP request consists of a method token, a request URI, and the SIP version. Amethod token is used to identify the request. The request URI is the address ofthe device where the request is being sent.

    Methods for handlingdifferent types ofrequest

    The original SIP RFC 3261 defines six methods, which are used for differenttypes of requests. The following table describes these methods:

    Method Name Description

    INVITE Initiates a session. This method includes information about the

    calling and called users and the type of media that is to beexchanged.

    ACK Sent by the client who sends the INVITE. ACK is sent toconfirm that the session is established. Media can then beexchanged.

    BYE Terminates a session. This method can be sent by either user.

    CANCEL Terminates a pending request, such as an outstanding INVITE.After a session is established, a BYE method needs to be used toterminate the session.

    OPTIONS Queries the capabilities of the server or other devices. It can beused to check media capabilities before issuing an INVITE.

    REGISTER Used by a client to login and register its address with a SIPregistrar server.

  • 8/13/2019 MSDN overview of SIP

    10/16

    8 Module 8: Overview of SIP

    SIP method extensions A number of extensions and enhancements have been made to the original SIPRFC 2543. This includes the addition of the following new methods to SIP,which can be used for event notification, instant messaging and call control:

    SUBSCRIBE . The SUBSCRIBE method enables a user to subscribe to

    certain events. This means that the user should be informed when suchevents occur.

    NOTIFY . The NOTIFY method is used to inform the user that a subscribedevent has occurred. Windows Messenger uses the SUBSCRIBE method torequest contacts, groups, and allow and block lists from the server and to getthe presence of contacts in a group. Live Communications Server 2003 usesthe NOTIFY method to deliver the data obtained by the SUBSCRIBEmethod to the client.

    MESSAGE . SIP can also be used for Instant Messaging. A user sends aninstant message to another user by sending a request that includes theMESSAGE method. This request carries the actual text in a body of a SIP

    packet.

    INFO . The INFO method is used for transferring information during asession, such as user activity. For example, Windows Messenger 5.0 usesthe INFO method to inform the called user that Bob, the calling user, istyping on the keyboard. As a result, in the conversation UI, the called usersees a dialog, bob is typing.

    SERVICE . The SERVICE method can carry a Simple Object AccessProtocol (SOAP) message as its payload. Windows Messenger 5.0 uses theSERIVCE method to add contacts and groups on the server. This method isalso used to search for contacts in the SIP domain.

    NEGOTIATE . The NEGOTIATE method is used to negotiate variouskinds of parameters, such as security mechanisms and algorithms. Live

    Communications Server 2003 uses the NEGOTIATE method to providecompression between clients and servers.

    REFER . A REFER request enables the sender of the request to instruct thereceiver to contact a third party using the contact details provided in therequest. Call Transfer is a commonly used application of the REFERmethod.

  • 8/13/2019 MSDN overview of SIP

    11/16

    Module 8: Overview of SIP 9

    SIP Response

    Introduction A SIP response contains a status code, which is a three-digit number thatindicates the outcome of the request. The response also contains a reason

    phrase, which provides a textual description of the outcome of the request. Thereason code is interpreted and acted upon by the client software. The reason

    phrase helps the user understand the response.

    Status codes defined in SIP have values between 100 and 699 and the first digitof the reason code indicates the response class. For example, all the status codes

    between 100 and 199 belong to one class.

    Different classes of aresponse The following table describes the different classes in SIP:Class Name Description

    1xx: Provisional Request received, continuing to process the request. For example,180 indicates that the phone of the called user is ringing.

    2xx: Success Action was successfully received, understood, and accepted. Only200 OK and 202 ACCEPTED have been defined in this class.

    3xx:Redirection

    Further action needs to be taken to complete the request. Forexample, a front-end server sends 302 to redirect the client to ahome aerver.

    4xx: Client

    Error

    Request contains bad syntax or cannot be fulfilled at this server. For

    example, a Home Server sends a response, 401 Unauthorized, if theclient needs to provide credentials.

    5xx: ServerError

    Server failed to fulfill a valid request. For example, a server sends aresponse, 504 Timeout, if MTLS has not been configured betweenthe home servers.

    6xx: GlobalFailure

    Request cannot be fulfilled at any server. This is a new class definedfor SIP, but is not currently used with Live Communications Server2003.

  • 8/13/2019 MSDN overview of SIP

    12/16

    10 Module 8: Overview of SIP

    SIP Headers

    Introduction SIP includes a number of message headers in a SIP message. These headerscontain information that enables the receiver to understand the message betteror handle the message properly. Some headers make sense only in certainrequests or responses. In some cases, the presence of a particular headerdepends on the context. The presence of a particular header in a response might

    be reasonable only if the response is issued to a specific request.

    General headers Some headers can be used in both requests and responses. They are known asgeneral headers. Such headers contain basic information. For example, the To: header field indicates the recipient of the request, From: indicates the originatorof the request, and Call-ID: uniquely identifies a specific invitation to a session.

    Request headers Request headers apply only to SIP requests. They are used to provide additionalinformation to the server about the request or the client. For example, Subject: can be used to provide a textual description of the topic of the session. Priority: is used to indicate the urgency of the request, such as emergency, urgent,normal, or nonurgent.

    Response headers Response header fields apply only to response (status) messages. These headerfields are used to provide further information about the response that cannot beincluded in the status line. For example, Unsupported: is used to identify thosefeatures that are not supported by the server. Retry-After: indicates when acalled user will be available if the user is currently busy or unavailable.

  • 8/13/2019 MSDN overview of SIP

    13/16

    Module 8: Overview of SIP 11

    Sample SIP Messages

    Introduction This section provides an example of a SIP message.

    SIP request INVITE sip:[email protected] SIP/2.0Via: SIP/2.0/UDP pc1.example.comMax-Forward: 70To: "Bob" From: "Alice" ;tag=123Call-ID: [email protected]: 1 INVITEContact: Content-Type: application/sdpContent-Length: 200(Alices SDP not shown)

    SIP response SIP/2.0 200 OKVia: SIP/2.0/UDP pc1.example.comTo: "Bob" ;tag=987From: "Alice" ;tag=123Call-ID: [email protected]: 1 INVITEContact: 172.1.2.3Content-Type: application/sdpContent-Length: 200(Bobs SDP not shown)

  • 8/13/2019 MSDN overview of SIP

    14/16

    12 Module 8: Overview of SIP

    Tools to Read SIP Messages

    Introduction The SipLogger and SipParser tools can be used to read a SIP message.

    SipLogger SipLogger is an executable file with a readme file, LoggerReadme.htm thatcontains information about the installation and use of SipLogger.

    SipLogger allows the Live Communications Server administrator to log SIPtraffic on the server before it is encrypted. SipLogger helps the administratordebug communication issues between clients and servers and between multipleservers. Messages are sent to a text file that is selected during SipLoggerstartup. The default maximum size of the file is 100 MB. Note that SipLogger is

    not intended to replace the Live Communications Server IM Archiving Server.SipParser SipParser is a dynamic-link library (DLL) that works with Network Monitor to

    enable parsing of the SIP signaling information exchanged between clients andservers. SipParser captures only SIP messages sent over TCP or UDP. TLS isnot supported because of encryption. SipParser requires the installation of

    Network Monitor on the computer where SIP messages need to be parsed. Areadme file, SipParserReadme.html, contains information about the installationand use of SipParser.

  • 8/13/2019 MSDN overview of SIP

    15/16

    Module 8: Overview of SIP 13

    Review

    1. How is SIP a client-server protocol?

    Like HTTP, SIP uses a request-response format. A client makes arequest and the server sends a response. A server can forward a requestthus, will act as a client and another client can issue a response to arequest, thus will act like a server.

    2. What are the 6 original methods that were described in the first SIP RFC?

    INVITE, ACK, CANCEL, BYE, REGISTER, and OPTIONS.

    3. What is the function of the REGISTER method?

    It enables a client to register its address with a SIP registrar server.

    4. What is the difference between a BYE and a CANCEL method?

    BYE tears an existing session while CANCEL tears down a pending(non-established) session.

    5. What is the function of the MESSAGE method?

    It is used to send instant messages in a SIP message.

  • 8/13/2019 MSDN overview of SIP

    16/16

    14 Module 8: Overview of SIP

    6. What status code does a server respond with if there is a client error?

    4xx

    7. What are general headers?

    They are used in both a request and a response.