16.11.2014 Views

SIP Protocol Agent Overview

SIP Protocol Agent Overview

SIP Protocol Agent Overview

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

StoneGate Firewall/VPN<br />

<strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> <strong>Overview</strong><br />

Created: October 6, 2008


Table of Contents<br />

<strong>Protocol</strong> <strong>Overview</strong> ............................................................................................................................ 2<br />

Communication Model ..................................................................................................................... 2<br />

<strong>Protocol</strong> <strong>Agent</strong> Description ............................................................................................................... 3<br />

Operation .......................................................................................................................... 3<br />

Supported <strong>SIP</strong> Methods ...................................................................................................... 3<br />

Supported <strong>SIP</strong> Message Body Types .................................................................................... 4<br />

Supported SDP Offer/Answer Exchanges .............................................................................. 4<br />

<strong>SIP</strong> Header Fields and SDP Fields Modified for NAT Traversal ................................................ 4<br />

Limitations ...................................................................................................................................... 5<br />

Only UDP and TCP Transports Are Supported ........................................................................ 5<br />

SDP Offer/Answer Exchanges with PRACK or UPDATE Methods Are Not Supported .................. 5<br />

Limited Support for <strong>SIP</strong> Instant Messaging and Presence ...................................................... 5<br />

Complex <strong>SIP</strong> Call Scenarios Might Not Be Handled Correctly .................................................. 5<br />

Configuration .................................................................................................................................. 6


<strong>Protocol</strong> <strong>Overview</strong><br />

<strong>SIP</strong> (Session Initiation <strong>Protocol</strong>) is an application-layer control protocol that can establish, modify and terminate<br />

multimedia sessions such as Internet telephony calls. <strong>SIP</strong> is designed and standardized by the IETF, and its base<br />

protocol is specified in RFC 3261. Various extensions to the base protocol are defined in other RFC documents.<br />

<strong>SIP</strong> is a text-based protocol, in which the protocol messages have a set of header fields followed by an optional<br />

message body like in, for example, HTTP and SMTP protocols. The message body can contain various kinds of<br />

application payloads. For real-time voice or multimedia communication management the <strong>SIP</strong> messages typically<br />

contain SDP (Session Description <strong>Protocol</strong>, RFC 4566) payloads.<br />

Communication Model<br />

The communication model of <strong>SIP</strong> is more complex than the ordinary client-server paradigm used for typical<br />

Internet protocols such as HTTP. The <strong>SIP</strong> elements such as User <strong>Agent</strong>s and Proxies have both client and server<br />

capabilities, and act in one or both of those roles depending on the particular call case in question.<br />

The <strong>SIP</strong> message exchange can use various transport protocols, most typically TCP or UDP over IPv4 or IPv6. The<br />

real-time multimedia sessions managed by <strong>SIP</strong> use RTP (Real Time <strong>Protocol</strong>) packets over UDP. The parameters<br />

of the RTP packet streams are negotiated between the call end-points by using SDP payloads within <strong>SIP</strong> message<br />

bodies. These RTP/UDP connections take different route through the IP network than the <strong>SIP</strong> message exchange;<br />

most typically the RTP/UDP streams are routed directly between the call end-points (<strong>SIP</strong> User <strong>Agent</strong>s). The<br />

negotiated RTP/UDP connections are called related connections in this document.<br />

<strong>SIP</strong><br />

<strong>SIP</strong> Proxy<br />

<strong>SIP</strong><br />

<strong>SIP</strong> Proxy<br />

<strong>SIP</strong><br />

<strong>SIP</strong> User <strong>Agent</strong><br />

RTP<br />

<strong>SIP</strong> User <strong>Agent</strong><br />

The related connections do not use any well known port numbers, and therefore it is difficult to allow them<br />

through a firewall without opening a wide range of UDP ports in the security policy. The <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> in the<br />

StoneGate Firewall can be used to dynamically open the related connections through the Firewall without using<br />

static Access Rules for them.<br />

2 StoneGate Firewall/VPN <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> <strong>Overview</strong>


<strong>Protocol</strong> <strong>Agent</strong> Description<br />

This document refers to the <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> delivered with StoneGate Engine versions 4.3 and later.<br />

Operation<br />

The purpose of the <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> is to allow <strong>SIP</strong> calls to pass through the firewall. The <strong>Protocol</strong> <strong>Agent</strong> has to<br />

be attached to the <strong>SIP</strong> connection of the new call. The <strong>Protocol</strong> <strong>Agent</strong> interprets the <strong>SIP</strong> message exchange and<br />

allows dynamic RTP and RTCP connections to open based on port negotiations within the parent connection.<br />

When a NAT is applied to the <strong>SIP</strong> connection, the <strong>Protocol</strong> <strong>Agent</strong> tries to perform the same NAT operation to these<br />

related connections and modify payload data of the parent connection.<br />

The <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> also checks the <strong>SIP</strong> message syntax for protocol anomalies and looks for known attack<br />

vectors using <strong>SIP</strong> fingerprints delivered by Stonesoft in dynamic update packages.<br />

The <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> in StoneGate Firewall works transparently in the sense that the <strong>SIP</strong> elements such as User<br />

<strong>Agent</strong>s and Proxies are not aware of its presence. In particular, the Firewall’s IP address is never configured to<br />

the other <strong>SIP</strong> elements, that is, it does not act as a <strong>SIP</strong> proxy or registrar server. Instead, the <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong><br />

interprets the <strong>SIP</strong> protocol messages while they are being routed through the Firewall, maintains protocol state to<br />

the extent required, and modifies the messages slightly if necessary for NAT traversal. It does not add new <strong>SIP</strong><br />

Header Fields to the messages or create <strong>SIP</strong> messages of its own.<br />

Supported <strong>SIP</strong> Methods<br />

The following table shows which <strong>SIP</strong> request methods are recognized by the <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong>. Message<br />

modification for NAT is done to the requests with a recognized method, and to their responses. The table also<br />

shows the request methods and responses in which SDP bodies are interpreted by the PA. Note, that <strong>SIP</strong><br />

message exchanges where PRACK or UPDATE request or the corresponding response contains SDP are not<br />

currently supported.<br />

Method Reference Recognized<br />

SDP handled in<br />

the request<br />

SDP handled<br />

in responses<br />

ACK RFC 3261 Yes Yes<br />

BYE RFC 3261 Yes<br />

CANCEL RFC 3261 Yes<br />

INFO RFC 2976 Yes<br />

INVITE RFC 3261 Yes Yes 1xx, 2xx<br />

MESSAGE RFC 3428 Yes<br />

NOTIFY RFC 3265 Yes<br />

OPTIONS RFC 3261 Yes<br />

PRACK RFC 3262 Yes No No<br />

PUBLISH RFC 3903 Yes<br />

REFER RFC 3515 Yes<br />

3 StoneGate Firewall/VPN <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> <strong>Overview</strong>


REGISTER RFC 3261 Yes<br />

SUBSCRIBE RFC 3265 Yes<br />

UPDATE RFC 3311 Yes No No<br />

Supported <strong>SIP</strong> Message Body Types<br />

<strong>SIP</strong> messages can contain a message body of several different types, but the <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> only interprets<br />

message bodies whose Content-Type is application/sdp, which is defined in RFC 4566. The contents of such<br />

message bodies are used to open the related media connections, and the IP addresses and ports in the body are<br />

modified as necessary for NAT traversal.<br />

Other body types are passed without examination, and possible IP addresses in them are not modified. Also<br />

Multipart MIME bodies are not examined, even if there is a part with content type application/sdp.<br />

Supported SDP Offer/Answer Exchanges<br />

The parameters of the related connections are negotiated between the call end-points using the so-called SDP<br />

Offer/Answer model, which is specified in RFC 3264. The following table describes which <strong>SIP</strong> message exchanges<br />

are supported by the <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> for carrying the SDP Offer and Answer.<br />

Offer Answer Reference Supported<br />

INVITE request 2xx INVITE response RFC 3261 Yes<br />

2xx INVITE response ACK request RFC 3261 Yes<br />

INVITE request 1xx INVITE response RFC 3262 Yes<br />

1xx INVITE response PRACK request RFC 3262 No<br />

PRACK request 200 PRACK response RFC 3262 No<br />

UPDATE request 2xx UPDATE response RFC 3311 No<br />

<strong>SIP</strong> Header Fields and SDP Fields Modified for NAT Traversal<br />

<strong>SIP</strong> messages carry IP address and port numbers both in the message headers and in the message body. The <strong>SIP</strong><br />

<strong>Protocol</strong> <strong>Agent</strong> examines certain <strong>SIP</strong> Header Fields, as well as the SDP bodies in <strong>SIP</strong> protocol messages, and<br />

modifies the embedded IP address and port numbers using the same NAT rules that are applied to the transport<br />

connection (UDP or TCP) carrying the <strong>SIP</strong> protocol messages. These rules are configured in the NAT Rules tab of<br />

the Firewall’s security policy in the StoneGate Management Center.<br />

The IP address and port numbers within <strong>SIP</strong> Header Fields are primarily used for routing the responses back to<br />

where the request originated, and for announcing a contact address where further requests can be sent. The<br />

following <strong>SIP</strong> Header Field are examined and modified, if necessary:<br />

4 StoneGate Firewall/VPN <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> <strong>Overview</strong>


• Request URI<br />

• From:<br />

• To:<br />

• Via:<br />

• Contact:<br />

• Record-Route:<br />

The IP addresses and port numbers in SDP message bodies show where the <strong>SIP</strong> entity is prepared to receive<br />

media. The following SDP lines are examined and modified if necessary:<br />

• m=<br />

• c=<br />

Limitations<br />

Only UDP and TCP Transports Are Supported<br />

The <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> is not able to interpret <strong>SIP</strong> traffic over SSL or TLS transports since the messages are<br />

encrypted.<br />

The <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> does not support <strong>SIP</strong> over SCTP (Stream Control Transmission <strong>Protocol</strong>) transport.<br />

SDP Offer/Answer Exchanges with PRACK or UPDATE Methods Are Not Supported<br />

In some <strong>SIP</strong> environments the PRACK and/or UDPATE request methods are used to carry SDP offers or answers<br />

within a <strong>SIP</strong> dialog. However, the <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> does not examine the SDP body in those requests and their<br />

answers.<br />

The PRACK method is usually used without SDP body, and in that case there is no problem. The UPDATE method,<br />

on the other hand, is specifically used to update SDP information, and the call most likely fails in this case.<br />

Fortunately the use of the UPDATE method is quite rare. A so-called re-INVITE is more common for updating<br />

connection parameters and is supported by the <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong>.<br />

Limited Support for <strong>SIP</strong> Instant Messaging and Presence<br />

The <strong>SIP</strong> protocol can be used for instant messaging and presence applications with the <strong>SIP</strong>/SIMPLE protocol<br />

extensions (defined in multiple RFC documents). The <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> recognizes the <strong>SIP</strong> request methods<br />

MESSAGE, PUBLISH, SUBSCRIBE and NOTIFY, and supports NAT modifications to the message header fields in<br />

them.<br />

However, the various types of message bodies possibly contained in these messages are not interpreted and<br />

modified, even if the Content-Type is application/sdp. Also, no related connections are opened based on<br />

these <strong>SIP</strong> request methods.<br />

Complex <strong>SIP</strong> Call Scenarios Might Not Be Handled Correctly<br />

The <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> makes decisions about related connection management based on the <strong>SIP</strong> messages it<br />

sees. However, in certain complex call scenarios it may fail to make correct decisions, either because it does not<br />

have sufficient information, or because it’s internal logic is not intelligent enough.<br />

One case where the <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> may have trouble deciding correct actions is when the <strong>SIP</strong> signaling for a<br />

call crosses the Firewall more than once. For example, if there are two <strong>SIP</strong> phones in the internal network and one<br />

5 StoneGate Firewall/VPN <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> <strong>Overview</strong>


or both of them use a <strong>SIP</strong> proxy in an external network, the call signaling between the phones goes from internal<br />

to external network and then back to internal network, crossing the Firewall twice. The <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> is able<br />

to detect this if the signaling visits only one <strong>SIP</strong> entity in the external network, but fails to detect it if there are, for<br />

example, multiple <strong>SIP</strong> proxies visited in the external network. When the situation is detected, the <strong>SIP</strong> <strong>Protocol</strong><br />

<strong>Agent</strong> correctly creates just one call and does not do unnecessary NAT translations for the related connections.<br />

Configuration<br />

The following table describes the parameters of the <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong>. They can be configured in the <strong>Protocol</strong><br />

Parameters tab of a Service Element that defines <strong>SIP</strong> in its <strong>Protocol</strong> field.<br />

Parameter Values Description<br />

Allow Related Connections<br />

Enforce Client Side Media<br />

Enforce Server Side Media<br />

Maximum Number Of Calls<br />

On (default) / Off<br />

Yes (default) / No<br />

Yes (default) / No<br />

0 (default) /<br />

positive integer<br />

Allows the <strong>SIP</strong> media connections based on the signaling<br />

connection.<br />

Allows checking that the media stream used over <strong>SIP</strong> uses the<br />

same address as the <strong>SIP</strong> traffic on the host that is the ‘client’<br />

in <strong>SIP</strong> communications.<br />

Allows checking that the media stream used over <strong>SIP</strong> uses the<br />

same address as the <strong>SIP</strong> traffic on the host that is the ‘server’<br />

in <strong>SIP</strong> communications.<br />

Maximum number of concurrent <strong>SIP</strong> calls allowed by the<br />

Access Rule. Value 0 means unlimited.<br />

The following table describes the generic <strong>SIP</strong> situations. They can be used in the Inspection Rules to configure<br />

logging of <strong>SIP</strong> events and to define actions when protocol violations are detected.<br />

Situation<br />

Description<br />

<strong>SIP</strong>_Call-Established<br />

<strong>SIP</strong>_Call-Hangup<br />

<strong>SIP</strong>_Message-Handled<br />

<strong>SIP</strong>_Message-No-<br />

Transaction<br />

<strong>SIP</strong>_Message-Parse-Error<br />

<strong>SIP</strong>_Method-NNN<br />

<strong>SIP</strong>_Method-Unknow<br />

<strong>SIP</strong> phone call established.<br />

<strong>SIP</strong> phone call hang up.<br />

A <strong>SIP</strong> message successfully parsed and handled.<br />

A <strong>SIP</strong> message not belonging to any existing transaction was seen.<br />

<strong>SIP</strong> message processing failed because of a parse error.<br />

The <strong>SIP</strong> request method NNN was seen in a <strong>SIP</strong> request (one situation for each<br />

supported <strong>SIP</strong> request method NNN).<br />

The <strong>SIP</strong> request method seen in a <strong>SIP</strong> request was unknown.<br />

In addition to the generic <strong>SIP</strong> situations there are <strong>SIP</strong> fingerprint situations for detecting known attack vectors<br />

within <strong>SIP</strong> packets. Custom fingerprint situations can be created as well in the StoneGate Management Center.<br />

6 StoneGate Firewall/VPN <strong>SIP</strong> <strong>Protocol</strong> <strong>Agent</strong> <strong>Overview</strong>


Copyright and Disclaimer<br />

© 2000—2008 Stonesoft Corporation. All rights reserved.<br />

These materials, Stonesoft products, and related documentation are protected by copyright and other laws, international<br />

treaties and conventions. All rights, title and interest in the materials, Stonesoft products and related documentation shall<br />

remain with Stonesoft and its licensors. All registered or unregistered trademarks in these materials are the sole property of<br />

their respective owners. No part of this document or related Stonesoft products may be reproduced in any form, or by any<br />

means without written authorization of Stonesoft Corporation.<br />

Stonesoft provides these materials for informational purposes only. They are subject to change without notice and do not<br />

represent a commitment on the part of Stonesoft. Stonesoft assumes no liability for any errors or inaccuracies that may<br />

appear in these materials or for incompatibility between different hardware components, required BIOS settings, NIC drivers,<br />

or any NIC configuration issues. Use these materials at your own risk. Stonesoft does not warrant or endorse any third party<br />

products described herein.<br />

THESE MATERIALS ARE PROVIDED "AS-IS." STONESOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO, THE<br />

INFORMATION CONTAINED HEREIN. IN ADDITION, STONESOFT MAKES NO EXPRESS OR IMPLIED WARRANTIES OF<br />

MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE WITH RESPECT THE INFORMATION CONTAINED IN<br />

THESE MATERIALS. IN NO EVENT SHALL STONESOFT BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL OR<br />

INCIDENTAL DAMAGES, INCLUDING, BUT NOT LIMITED TO, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING FROM THE<br />

USE OF THESE MATERIALS, EVEN IF ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.<br />

Trademarks and Patents<br />

Stonesoft, the Stonesoft logo and StoneGate are all trademarks or registered trademarks of Stonesoft Corporation. Multi-link<br />

technology, multi-link VPN, and the StoneGate clustering technology-as well as other technologies included in StoneGate-are<br />

protected by patents or pending patent applications in the U.S. and other countries. All other trademarks or registered<br />

trademarks are property of their respective owners.<br />

Stonesoft Corporation<br />

Itälahdenkatu 22A<br />

FI-00210 Helsinki<br />

Finland<br />

Tel. +358 9 476 711<br />

Fax +358 9 4767 1234<br />

Stonesoft Inc.<br />

1050 Crown Pointe Parkway<br />

Suite 900<br />

Atlanta, GA 30338<br />

USA<br />

Tel. +1 770 668 1125<br />

Fax +1 770 668 1131<br />

Copyright 2008 Stonesoft Corporation. All rights Reserved. All specifications are subject to change.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!