You are on page 1of 16

Module 8: Overview of SIP

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

Module 8: Overview of SIP

Overview

Introduction

This module provides an overview of SIP. It does not cover all the aspects of SIP. The objective of this module is to make you familiar with the SIP protocol and the SIP message structure. This knowledge will help you use some of the troubleshooting tools in Live Communications Server 2003 to diagnose client and server communication problems. For complete understanding of SIP, it is recommended that you read the document, SIP Request for Comment (RFC) 3261. After completing this module, you will be able to:

Objectives

Describe SIP and explain how the basic SIP session is established. Describe the structure of a SIP message.

Module 8: Overview of SIP

Lesson: Introducing SIP

Introduction Lesson objectives

This lesson provides an overview of SIP and explains how SIP establishes a basic communication session. After completing this lesson, you will be able to:

Describe SIP. Explain how a basic SIP session is established.

Module 8: Overview of SIP

What is SIP?

Introduction

SIP is an application-layer control protocol that handles the setup, modification, and tear-down of multimedia sessions. SIP is used in combination with other protocols to describe the session characteristics to potential session participants. SIP is based on a request and response transaction model similar to HTTP. Each transaction consists of a request that invokes a particular method or a function on the server and at least one response. SIP is generally considered to be a clientserver protocol. It has two classes of entities:

SIP entities

Client. A client is an application program that sends a SIP request. The client can be a software program, such as Windows Messenger 5.0, or a hardware device, such as a SIP telephone. Server. A server generally responds to a request sent by a client. A server can be a software application, such as Live Communications Server 2003, or a hardware device.

Different roles of a SIP server

SIP servers have different roles, such as:


Proxy server. A SIP proxy works like an HTTP proxy server. When a client sends requests to the proxy, the proxy either handles them or forwards them to other servers. Redirect server. A SIP redirect server accepts a SIP request and conveys to the originating client the way to route the call. Registrar server. A SIP registrar server accepts registration requests and maps a clients address to a users sign-in name, or SIP URI. Typically, a registrar is combined with a proxy or redirect server.

Note With Live Communications Server 2003, a home server plays the role of both redirect and registrar SIP servers. A front-end server is a redirect server.

Module 8: Overview of SIP

Basic SIP Session Establishment

Introduction

The process to establish a session starts with an INVITE message, which is sent from a calling user to a called user, inviting the called user to participate in a session. The caller might receive a number of interim responses before the called user accepts the call. For example, the caller might be informed that the called user is being alerted (the phone is ringing). When the called user answers the call, an OK response is generated and sent to the calling client. The calling client 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 and sent to the other client. The other client confirms that the session is over, after which the call ends.

Module 8: Overview of SIP

Lesson: Structure of a SIP Message

Introduction

This lesson explains the basic structure of a SIP message. It describes the different methods that are used in a SIP request and the different classes that specify the status of a SIP response. It also describes the various types of headers that can be part of a SIP message. In addition, the lesson covers the tools, SIPLogger and SIPParser, which can be used to read a SIP message. After completing this lesson, you will be able to:

Lesson objectives

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.

Module 8: Overview of SIP

SIP Message Structure: An Overview

Introduction Structure of a SIP message

SIP is a text-based protocol that is similar to HTTP, which makes it easy read and understand. A SIP message is either a request from a client to a server or a response from a server 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 header CRLF [message-body]

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

Module 8: Overview of SIP

SIP Request

Introduction

A SIP request consists of a method token, a request URI, and the SIP version. A method token is used to identify the request. The request URI is the address of the device where the request is being sent. The original SIP RFC 3261 defines six methods, which are used for different types of requests. The following table describes these methods:
Method Name INVITE Description Initiates a session. This method includes information about the calling and called users and the type of media that is to be exchanged. Sent by the client who sends the INVITE. ACK is sent to confirm that the session is established. Media can then be exchanged. Terminates a session. This method can be sent by either user. Terminates a pending request, such as an outstanding INVITE. After a session is established, a BYE method needs to be used to terminate the session. Queries the capabilities of the server or other devices. It can be used to check media capabilities before issuing an INVITE. Used by a client to login and register its address with a SIP registrar server.

Methods for handling different types of request

ACK

BYE CANCEL

OPTIONS REGISTER

Module 8: Overview of SIP

SIP method extensions

A number of extensions and enhancements have been made to the original SIP RFC 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 such events occur. NOTIFY. The NOTIFY method is used to inform the user that a subscribed event has occurred. Windows Messenger uses the SUBSCRIBE method to request contacts, groups, and allow and block lists from the server and to get the presence of contacts in a group. Live Communications Server 2003 uses the NOTIFY method to deliver the data obtained by the SUBSCRIBE method to the client. MESSAGE. SIP can also be used for Instant Messaging. A user sends an instant message to another user by sending a request that includes the MESSAGE method. This request carries the actual text in a body of a SIP packet. INFO. The INFO method is used for transferring information during a session, such as user activity. For example, Windows Messenger 5.0 uses the INFO method to inform the called user that Bob, the calling user, is typing on the keyboard. As a result, in the conversation UI, the called user sees a dialog, bob is typing. SERVICE. The SERVICE method can carry a Simple Object Access Protocol (SOAP) message as its payload. Windows Messenger 5.0 uses the SERIVCE method to add contacts and groups on the server. This method is also used to search for contacts in the SIP domain. NEGOTIATE. The NEGOTIATE method is used to negotiate various kinds of parameters, such as security mechanisms and algorithms. Live Communications Server 2003 uses the NEGOTIATE method to provide compression between clients and servers. REFER. A REFER request enables the sender of the request to instruct the receiver to contact a third party using the contact details provided in the request. Call Transfer is a commonly used application of the REFER method.

Module 8: Overview of SIP

SIP Response

Introduction

A SIP response contains a status code, which is a three-digit number that indicates the outcome of the request. The response also contains a reason phrase, which provides a textual description of the outcome of the request. The reason 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 digit of the reason code indicates the response class. For example, all the status codes between 100 and 199 belong to one class.

Different classes of a response

The following table describes the different classes in SIP:


Class Name 1xx: Provisional 2xx: Success 3xx: Redirection 4xx: Client Error 5xx: Server Error 6xx: Global Failure Description Request received, continuing to process the request. For example, 180 indicates that the phone of the called user is ringing. Action was successfully received, understood, and accepted. Only 200 OK and 202 ACCEPTED have been defined in this class. Further action needs to be taken to complete the request. For example, a front-end server sends 302 to redirect the client to a home aerver. Request contains bad syntax or cannot be fulfilled at this server. For example, a Home Server sends a response, 401 Unauthorized, if the client needs to provide credentials. Server failed to fulfill a valid request. For example, a server sends a response, 504 Timeout, if MTLS has not been configured between the home servers. Request cannot be fulfilled at any server. This is a new class defined for SIP, but is not currently used with Live Communications Server 2003.

10

Module 8: Overview of SIP

SIP Headers

Introduction

SIP includes a number of message headers in a SIP message. These headers contain information that enables the receiver to understand the message better or handle the message properly. Some headers make sense only in certain requests or responses. In some cases, the presence of a particular header depends 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. Some headers can be used in both requests and responses. They are known as general headers. Such headers contain basic information. For example, the To: header field indicates the recipient of the request, From: indicates the originator of the request, and Call-ID: uniquely identifies a specific invitation to a session. Request headers apply only to SIP requests. They are used to provide additional information 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 header fields apply only to response (status) messages. These header fields are used to provide further information about the response that cannot be included in the status line. For example, Unsupported: is used to identify those features that are not supported by the server. Retry-After: indicates when a called user will be available if the user is currently busy or unavailable.

General headers

Request headers

Response headers

Module 8: Overview of SIP

11

Sample SIP Messages

Introduction SIP request

This section provides an example of a SIP message.


INVITE sip:bob@example.com SIP/2.0 Via: SIP/2.0/UDP pc1.example.com Max-Forward: 70 To: "Bob" <sip:bob@example.com> From: "Alice" <sip:alice@example.com>;tag=123 Call-ID: 1234567890@172.1.2.2 CSeq: 1 INVITE Contact: <sip:alice@pc1.example.com> Content-Type: application/sdp Content-Length: 200 (Alices SDP not shown) SIP/2.0 200 OK Via: SIP/2.0/UDP pc1.example.com To: "Bob" <sip:bob@example.com>;tag=987 From: "Alice" <sip:alice@example.com>;tag=123 Call-ID: 1234567890@172.1.2.2 CSeq: 1 INVITE Contact: <sip:bob@>172.1.2.3 Content-Type: application/sdp Content-Length: 200 (Bobs SDP not shown)

SIP response

12

Module 8: Overview of SIP

Tools to Read SIP Messages

Introduction SipLogger

The SipLogger and SipParser tools can be used to read a SIP message. SipLogger is an executable file with a readme file, LoggerReadme.htm that contains information about the installation and use of SipLogger. SipLogger allows the Live Communications Server administrator to log SIP traffic on the server before it is encrypted. SipLogger helps the administrator debug communication issues between clients and servers and between multiple servers. Messages are sent to a text file that is selected during SipLogger startup. 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 and servers. SipParser captures only SIP messages sent over TCP or UDP. TLS is not supported because of encryption. SipParser requires the installation of Network Monitor on the computer where SIP messages need to be parsed. A readme file, SipParserReadme.html, contains information about the installation and use of SipParser.

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 a request and the server sends a response. A server can forward a request thus, will act as a client and another client can issue a response to a request, 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.

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.

You might also like