HP-UX C SIP Stack Programmer's Guide (Novembery 2007)

Working with the Transport Layer 285
14
WORKING WITH THE TRANSPORT
LAYER
INTRODUCTION The Transport layer is responsible for the actual transmission of requests and
responses over network transports. SIP permits the usage of unreliable
transports, such as UDP, and reliable transports, such as TCP and TLS (over
TCP), using both IPv4 and IPv6 addresses. TCP, TLS and UDP differ in many
ways. The most fundamental difference is that UDP is connection-less, while
TCP and TLS are connection-oriented and therefore create a reliable data
transfer service.
This chapter focuses on the connection-oriented reliable transport types. The
SIP Stack supports TCP and TLS connection-oriented transports. This chapter
explains how to maintain a persistent connection and how to use the TCP and
TLS transports with the SIP Stack API. In addition, this chapter describes the
abilities that the SIP Stack provides for monitoring row buffers that are sent or
received from the sockets, and the usage of IPv6 addresses.
PERSISTENT
C
ONNECTION
H
ANDLING
In many cases, a single connection (TCP or TLS) may be reused for different
messages, transactions or dialogs. Opening and closing TCP connections often
is not desirable because of the extra messaging overhead of the TCP handshake
and even more so in TLS connections. Therefore, RFC 3261 permits connection
persistency, which is the reuse of an open client connection. The Persistent
Connection feature of the SIP Stack adds the capability of identifying that a
message can be sent on an existing open connection. The message is then sent
using this connection.