Tải bản đầy đủ (.pdf) (409 trang)

internet communications using sip delivering voip and multimedia services with session initiation protocol

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (11.15 MB, 409 trang )

Henry Sinnreich
Alan B. Johnston
Internet Communications
Using SIP
Delivering VoIP and Multimedia Services
with Session Initiation Protocol
Second Edition
01_776572 ffirs.qxp 6/5/06 9:34 PM Page iii
Internet Communications
Using SIP
Second Edition
01_776572 ffirs.qxp 6/5/06 9:34 PM Page i
l
n
y
.
d
6
4
y
,
r
e
)
e
)
s
-
-
d


-
-
e
t
f
e
e
n
01_776572 ffirs.qxp 6/5/06 9:34 PM Page ii
Henry Sinnreich
Alan B. Johnston
Internet Communications
Using SIP
Delivering VoIP and Multimedia Services
with Session Initiation Protocol
Second Edition
01_776572 ffirs.qxp 6/5/06 9:34 PM Page iii
Internet Communications Using SIP: Delivering VoIP and Multimedia Services with Session
Initiation Protocol, Second Edition
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2006 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN-13: 978-0-471-77657-4
ISBN-10: 0-471-77657-2
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1

2MA/QW/QX/QW/IN
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any
form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise,
except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without
either the prior written permission of the Publisher, or authorization through payment of the
appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA
01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be
addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis,
IN 46256, (317) 572-3447, fax (317) 572-4355, or online at />Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representa-
tions or warranties with respect to the accuracy or completeness of the contents of this work and
specifically disclaim all warranties, including without limitation warranties of fitness for a par-
ticular purpose. No warranty may be created or extended by sales or promotional materials. The
advice and strategies contained herein may not be suitable for every situation. This work is sold
with the understanding that the publisher is not engaged in rendering legal, accounting, or other
professional services. If professional assistance is required, the services of a competent profes-
sional person should be sought. Neither the publisher nor the author shall be liable for damages
arising herefrom. The fact that an organization or Website is referred to in this work as a citation
and/or a potential source of further information does not mean that the author or the publisher
endorses the information the organization or Website may provide or recommendations it may
make. Further, readers should be aware that Internet Websites listed in this work may have
changed or disappeared between when this work was written and when it is read.
For general information on our other products and services or to obtain technical support, please
contact our Customer Care Department within the U.S. at (800) 762-2974, outside the U.S. at (317)
572-3993 or fax (317) 572-4002.
Library of Congress Cataloging-in-Publication Data
Sinnreich, Henry.
Internet communications using SIP : delivering VoIP and multimedia services with Section Ini-
tiation Protocol / Henry Sinnreich, Alan B. Johnston. — 2nd ed.
p. cm.
Includes index.

ISBN-13: 978-0-471-77657-4 (cloth)
ISBN-10: 0-471-77657-2 (cloth)
1. Computer network protocols. 2. Internet telephony. 3. Multimedia systems. I. Title.
TK5105.55.S56 2006
621.3850285’4678—dc22
2006009325
Trademarks: Wiley, the Wiley logo, and related trade dress are trademarks or registered trade-
marks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries,
and may not be used without written permission. All other trademarks are the property of their
respective owners. Wiley Publishing, Inc., is not associated with any product or vendor men-
tioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in
print may not be available in electronic books.
01_776572 ffirs.qxp 6/5/06 9:34 PM Page iv
We could not have written this book without the support of our forgiving
spouses, Fabienne and Lisa, who held the fort while we were working on
SIP. And to both our family members shouting, “Your SIP phone is ringing.”
01_776572 ffirs.qxp 6/5/06 9:34 PM Page v
01_776572 ffirs.qxp 6/5/06 9:34 PM Page vi
Dr. Henry Sinnreich (Richardson, TX) is Chief Technology Officer at Pulver.com,
a leading media company for VoIP and Internet communication services. Dr.
Sinnreich has held engineering and executive positions at MCI where he was
an MCI fellow and has been involved in Internet and multimedia services for
more than 12 years, including the development of the flagship MCI Advantage
service based on SIP. Henry Sinnreich is also a contributor to IETF standards
for Internet communications in such areas as SIP telephony devices and using
RTP extensions for voice quality monitoring. He was awarded the title Pioneer
for VoIP in 2000 at the VON Europe conference. Henry Sinnreich has been a
cofounder and board member of the International SIP Forum based in Stock-
holm. He is a frequent speaker and is known as the leading evangelist, world-

wide, for SIP based VoIP, presence, IM, multimedia, and integration of
applications with communications. Dr. Sinnreich is also a guest lecturer at the
Engineering School of the Southern Methodist University in Dallas, TX.
Alan B. Johnston (St. Louis, MO) is a Consulting Member of Technical Staff at
Avaya, Inc. He has coauthored the core Internet SIP standard RFC 3261 and four
other SIP related RFCs. He is the co-chair of the IETF Centralized Conferencing
Working Group and is on the board of directors of the International SIP Forum.
His current areas of interest include peer-to-peer SIP and security. Dr. Johnston
is a frequent speaker and lecturer on SIP and contributor to various publications,
and is an adjunct professor at Washington University in St. Louis, MO.
About the Authors
vii
01_776572 ffirs.qxp 6/5/06 9:34 PM Page vii
01_776572 ffirs.qxp 6/5/06 9:34 PM Page viii
Credits
ix
Executive Editor
Carol Long
Development Editor
Kevin Shafer
Production Editor
Pamela Hanley
Copy Editor
Foxxe Editorial Services
Editorial Manager
Mary Beth Wakefield
Production Manager
Tim Tate
Vice President and Executive
Group Publisher

Richard Swadley
Vice President and Executive
Publisher
Joseph B. Wikert
Project Coordinator
Ryan Steffen
Graphics and Production
Specialists
Stephanie D. Jumper
Heather Ryan
Alicia B. South
Quality Control Technician
Laura Albert
Proofreading and Indexing
Joe Niesen
Palmer Publishing Services
01_776572 ffirs.qxp 6/5/06 9:34 PM Page ix
01_776572 ffirs.qxp 6/5/06 9:34 PM Page x
Contents
xi
Foreword xxi
Acknowledgments xxiii
Introduction xxv
Chapter 1 Introduction 1
Problem: Too Many Public Networks 1
Incompatible Enterprise Communications 4
Network Consolidation: The Internet 4
Voice over IP 5
Presence—The Dial Tone for the Twenty-First Century? 6
The Value Proposition of SIP 6

SIP Is Not a Miracle Protocol 6
The Short History of SIP 7
References in This Book 8
SIP Open Source Code and SIP Products 9
References for Telephony 10
Summary 10
References 10
Chapter 2 Internet Communications Enabled by SIP 11
Internet Multimedia Protocols 12
The Value of Signaling 13
Protocols for Media Description, Media Transport, and other
Multimedia Delivery 14
Addressing 15
SIP in a Nutshell 15
SIP Capabilities 17
Overview of Services Provided by SIP Servers 18
Peer-to-Peer SIP (P2PSIP) 19
02_776572 ftoc.qxp 6/5/06 9:35 PM Page xi
Caller Preferences 19
Mobility in the Wider Concept 20
Global Telephone Number Portability 20
SIP Application-Level Mobility 20
Context-Aware Communications: Presence and IM 21
SIP Presence 21
Instant Messaging 23
The Integration of Communications with Applications 23
E-Commerce: Customer Relations Management 23
Conferencing and Collaboration 24
Telephony Call Control Services 25
Intelligent Network Services Using SIP: ITU Services CS-1

and CS-2 25
SIP Service Creation—Telephony-Style 26
ENUM 27
SIP Interworking with ITU-T Protocols 27
Mixed Internet-PSTN Services 29
PSTN and INTerworking (PINT) 29
SPIRITS 29
TRIP 29
SIP Security 31
SIP Accessibility to Communications for the Hearing and
Speech Disabled 31
SIP Orphans 32
Commercial SIP Products 32
What SIP Does Not Do 33
Divergent Views on the Network 34
Summary 35
References 35
Chapter 3 Architectural Principles of the Internet 39
Telecom Architecture 39
Internet Architecture 42
The Internet Backbone Architecture 44
The Internet Standards Process 48
Protocols and Application Programming Interfaces 49
Is XML the Presentation Layer of the Internet Protocol
Architecture? 50
Middle-Age Symptoms of the Internet 50
Fighting Complexity 51
Summary 52
References 52
Chapter 4 DNS and ENUM 53

Introduction 53
Addressing on the Internet 54
The Universal Resource Identifier (URI) 54
mailto: 55
xii Contents
02_776572 ftoc.qxp 6/5/06 9:35 PM Page xii
The Universal Resource Locator (URL) 55
Tel URI 56
The phone-context 56
SIP URI 57
IANA ENUM Service Registrations 58
The Domain Name System 58
Delegation 59
Caching 59
A Partial DNS Glossary 60
DNS and ENUM Usage Example 62
Finding an Outgoing SIP Server 63
Finding an Incoming SIP Server in the ENUM Case 64
Call Setup Delay 67
DNS-Based Routing Service Using SIP 67
SIP URI or Telephone Number? 67
The ENUM Functional Architecture 69
ENUM and Number Portability 71
Implementation Issues 71
DNS and SIP User Preferences 72
Application Scenarios for SIP Service Using ENUM 73
PBX Enterprise Voice Network 74
Enterprise System with IP Communications 74
Residential User with ENUM Service 76
Miscellaneous: ENUM Lookup of the Display Name 76

DNS and Security 77
Impersonation 77
Eavesdropping 77
Data Tampering 78
Malicious Redirection 78
Denial of Service 78
Summary 79
References 79
Chapter 5 Real-Time Internet Multimedia 81
Introduction 81
Freshening Up on IP 83
Multicast Protocols 85
Multicast Address Allocation 85
Application-Level Multicast 86
Transport Protocols 86
IP Network Layer Services 87
Differentiated Services 88
Resource Reservation 88
Integrated Services and DiffServ Networks 89
Multiprotocol Label Switching 89
Media and Data Formats 90
Media Transport Using RTP 91
RTP Payloads and Payload Format Specifications 92
Contents xiii
02_776572 ftoc.qxp 6/5/06 9:35 PM Page xiii
Multimedia Server Recording and Playback Control 93
Session Description 93
Session Announcements 93
Session Invitation 93
Authentication and Key Distribution 94

Summary 94
References 94
Chapter 6 SIP Overview 97
What Makes SIP Special 97
SIP Enabled Network 98
Watching How Sausages Are Being Made 101
What SIP Is Not 102
Introduction to SIP 102
Elements of a SIP Network 106
User Agents 106
Servers 106
Location Services 107
SIP Functions 107
Address Resolution 108
Session-Related Functions 110
Session Setup 110
Media Negotiation 111
Session Modification 114
Session Termination and Cancellation 116
Mid-Call Signaling 117
Call Control 118
Preconditions Call Setup 121
Nonsession-Related Functions 123
Mobility 124
Message Transport 126
Event Subscription and Notification 127
Presence Publication 128
Authentication Challenges 128
Extensibility 130
Summary 132

References 132
Chapter 7 SIP Service Creation 135
Services in SIP 135
Service Example 136
Server Implementation 136
Called User Agent Implementation 137
Calling User Agent Implementation 138
Comparison 140
New Methods and Headers 141
Service Creation Options 142
xiv Contents
02_776572 ftoc.qxp 6/5/06 9:35 PM Page xiv
Call Processing Language 142
Introduction to CPL 142
Example of CPL Scripts 146
SIP Common Gateway Interface 147
SIP Application Programming Interfaces 148
SIP Servlets 149
JAIN 149
SIP and VoiceXML 149
Summary 150
References 150
Chapter 8 User Preferences 153
Introduction 153
Preferences of Caller 154
Example for Contact 156
Example for Accept-Contact 156
Example for Reject-Contact 156
Preferences of the Called Party 157
Server Support for User Preferences and for Policies 157

Summary 157
References 158
Chapter 9 SIP Security 159
Threats 159
Session Setup 160
Presence and IM 161
Security Mechanisms 162
Authentication 162
Confidentiality 163
Secure SIP URI Scheme 164
Integrity 165
Identity 165
Media Security 166
SRTP 166
MIKEY 167
SDP Security Descriptions 167
New Directions 168
DTLS 169
ZRTP 169
Summary 169
References 170
Chapter 10 NAT and Firewall Traversal 173
Network Address Translators 174
Firewalls 177
STUN, TURN, and ICE 179
Application Layer Gateways 180
Privacy Considerations 183
Contents xv
02_776572 ftoc.qxp 6/5/06 9:35 PM Page xv
Summary 184

References 184
Chapter 11 SIP Telephony 185
Basic Telephony Services 185
SIP and PSTN Interworking 185
Gateway Location and Routing 186
SIP/PSTN Protocol Interworking 187
Types of Gateways 188
SIP and Early Media 188
SIP Telephony and ISUP Tunneling 190
Enhanced Telephony Services 196
Call Control Services and Third-Party Call Control 199
Problem Statement 199
The REFER Method 201
SIP Third-Party Call Control 202
Basic Third-Party Call Control 203
Security for Third-Party Call Control 203
Peer-to-Peer Third-Party Call Control 205
Summary 206
References 207
Chapter 12 Voicemail and Universal Messaging 209
Problem Statement for Unified Messaging 209
Architecture and Operation 211
RTSP-Enabled Voice Message Retrieval 212
Depositing of Voice Messages 214
Notification for Waiting Messages 217
Simple Message Notification Format 217
Rich Message Notification Format 220
Retrieval of Messages 221
Summary 221
References 221

Chapter 13 Presence and Instant Messaging 223
The Potential of SIP Presence, Events, and IM 224
The Evolution of IM and Presence 225
The IETF Model for Presence and IM 226
Client Server and Peer-to-Peer Presence and IM 228
SIP Event-Based Communications and Applications 229
Presence Event Package 231
Presence Information Data Format 233
The Data Model for Presence 235
Indication of Message Composition for IM 236
Rich Presence Information 236
SIP Extensions for Instant Messaging 239
Summary 241
References 242
xvi Contents
02_776572 ftoc.qxp 6/5/06 9:35 PM Page xvi
Chapter 14 SIP Conferencing 245
Introduction 245
SIP Conferencing Models 246
Ad Hoc and Scheduled Conferences 249
Changing the Nature of a Conference 249
Centralized Conferencing 251
Summary 251
References 251
Chapter 15 SIP Application Level Mobility 253
Mobility in Different Protocol Layers 254
Dimensions of Mobility 255
Examples of SIP Application-Layer Mobility 256
SIP Network-Based Fixed-Mobile Convergence 261
SIP Device-Based Fixed-Mobile Convergence 263

SIP Application-Layer Mobility and Mobile IP 263
Multimodal Mobile Device Technology and Issues 265
Network Control versus User Control of Mobility 266
IEEE 802.21 Media-Independent Handover (MIH) 267
Network Selection Issues 269
Summary 270
References 270
Chapter 16 Emergency and Preemption Communication Services 273
Requirements 274
Location Information 275
Types of Location Information 275
Sources of Location Information 275
DNS-Based Location Information 275
Internet-Based Emergency Calling 277
Identifying an Internet Emergency Call: The SOS URI 278
Internet Emergency Call Routing 278
Security for Emergency Call Services 279
Using the PSTN for VoIP Emergency Calls 280
Emergency Communication Services 281
Emergency Call Preemption Using SIP 282
Linking SIP Preemption to IP Network and Link Layer
Preemption 284
Summary 285
References 285
Chapter 17 Accessibility for the Disabled 287
About Accessibility 287
Accessibility on Legacy Networks and on the Internet 288
Requirements for Accessibility 289
Text over IP (ToIP) 290
Performance Metrics for ToIP 293

Contents xvii
02_776572 ftoc.qxp 6/5/06 9:35 PM Page xvii
Transcoding Services 294
Transcoding Scenarios 294
Call Control Models for Transcoding Services 296
Summary 298
References 299
Chapter 18 Quality of Service for Real-Time Internet Communications 301
Voice Quality Metrics 303
Delay Limits for Voice 303
Burst vs. Average Packet Loss 304
Acoustics and the Network 304
Internet Codecs 305
Codecs in Wireless Networks and Transcoding 307
Codec Bandwidth 307
The Endpoint Quality for Voice 308
The Internet Performance 308
Concerns Regarding Congestion Control 309
Internet Traffic Statistics: Voice Is Negligible 309
A Summary of Internet QoS Technologies 311
Best Effort Is for the Best Reasons 313
Monitoring QoS for Real-Time Communications 314
Summary 315
References 315
Chapter 19 SIP Component Services 317
Master/Slave VoIP Systems 318
IP Telephony Gateways 320
The Converged Applications Environment 323
The Control of Service Context 326
Voicemail 328

Collecting DTMF Digits 330
Interactive Voice Response System 333
Scheduled Conference Service 335
Summary 337
References 337
Chapter 20 Peer-to-Peer SIP 339
Definitions for P2P Networks 340
Overlay Networks 340
Peer-to-Peer Networks 341
Distributed Hash Tables (DHTs) 342
Characteristics of P2P Computing 344
Security of P2P Networks 344
The Chord Protocol 345
P2P SIP 346
CS SIP Model 347
P2P SIP Model 348
xviii Contents
02_776572 ftoc.qxp 6/5/06 9:35 PM Page xviii
Use Cases for P2P SIP 348
Disruption of the VoIP Infrastructure Model 349
Summary 350
References 351
Chapter 21 Conclusions and Future Directions 353
Short Term Challenges 355
Future Services: The Internet Is the Service 355
Still to Develop: Peer-to-Peer SIP Standards 355
Prediction: The Long Road Ahead 356
Summary 356
References 356
Index 357

Contents xix
02_776572 ftoc.qxp 6/5/06 9:35 PM Page xix
02_776572 ftoc.qxp 6/5/06 9:35 PM Page xx
About 10 years ago, the first drafts describing the Session Initiation Protocol
(1996) were published, with the rather modest ambition of setting up multicast
groups for multimedia conferences. In the intervening decade, a draft of about
20 pages has turned into an ecosystem of dozens of RFCs, hundreds of Inter-
net drafts—and several books, conferences, and a magazine. It has become dif-
ficult to get a feel for the overall landscape, to distinguish the important core
concepts from the niche applications. This book offers a detailed, technically
informed, yet accessible, introduction to the overall SIP ecosystem, suitable
both for someone who needs to understand the technology to make strategic
decisions and implementers who need to build new components.
SIP is part of the second wave of Internet application protocol. While the
first wave largely focused on asynchronous communications (such as e-mail,
and data transfer), this second wave introduces the notion of interactive,
human-to-human communication that allows integration with any media, not
just voice. As SIP and interactive communications have matured, the goal for
human-to-human communication has shifted. Initially, cell phones promised
voice communication at any time, at any place. Multimedia communications,
on PCs and maybe emerging cellular networks, allow us to add “any media.”
However, the “any time, any place, any media” can also turn us into slaves of
our communications devices, interrupting our ability to think, to eat in peace,
and to meet in person. Thus, our goal has to be to design communications
technology that offers the right media, at the right place, and at the right time.
With some of the advanced functionality of SIP, such as presence, location-
based services, user-created services, and caller preferences, we can get closer
to creating communication systems that support our work and enhance our
personal life.
Foreword

xxi
03_776572 flast.qxp 6/5/06 9:35 PM Page xxi
With new communications technologies, there is always the temptation to
mimic the old. E-mail inherited aspects of the interoffice memo and fax; web
pages attempted to look like newsprint and brochures. However, in VoIP, there
is the particular temptation to recreate old technology features, as interoper-
ability with the old PSTN will remain important for at least another decade.
Fax-to-email gateways were never quite as important as VoIP-to-PSTN gate-
ways. This emphasis on interoperability with 100-year-old technology has
provided a financial motivation—provide the same service more cheaply.
However, this may also hold back the promise offered by Internet-based mul-
timedia communications, such as the integration of presence, the ability not
just to communicate by voice and maybe video but also to share any applica-
tion, or the ability to customize the user experience and integrate interactive
communications with existing Internet tools and applications. Just as most
microprocessors are embedded in household appliances and cars, not desktop
PCs and laptops, we might find that Internet-based voice and multimedia
communications will be integrated into games, appliances, and cameras, or be
hidden behind a link on a web page, rather than dialed by name or number. As
for many of the most innovative applications, users will likely not even con-
sider them phone services at all, but extensions that make some other applica-
tion more productive or more fun.
This book is like a good tour guide to a foreign country. It doesn’t just
describe the major sites and tourist attractions; it lets the reader share in the
history, spirit, language, and culture of the place. Natives write the best tour
guides, and the authors have been living and working in SIP land since it was
a small outpost in one large country called the IETF. The authors have served
as ambassadors in lands near and far, but have also made major contributions
to the development of this part of the Internet landscape, always reminding
others of the original goals of the first inhabitants. After taking the tour, the

reader will be ready not just to show off a stamp on a passport or certificate but
also to contribute to new modes of communications. SIP land is still young and
needs lots of pioneers who can push the frontiers of Internet-enabled commu-
nications. There might not always be gold in those hills, but enriching human
communications will always be its own reward.
Henning Schulzrinne
Professor, Columbia University
xxii Foreword
03_776572 flast.qxp 6/5/06 9:35 PM Page xxii
Acknowledgments
xxiii
We have enjoyed the benefit of early and significant support from colleagues
and management in MCI. Vint Cerf was, as mentioned, one of the early sup-
porters, and so were Teresa Hastings, John Gallant, Bob Spry, and Robert
Oliver who first took the responsibility for developing and deploying SIP in
their respective engineering departments. John Truetken, Lance Lockhart, and
many other engineers in MCI also had critical contributions to the implemen-
tation of SIP. Fred Briggs, Patrice Carroll, Barry Zip, and Leo Cyr from MCI
helped with the challenge to develop marketable services based on SIP. We
were fortunate to work jointly in the development and deployment of SIP ser-
vices with Steve Donovan, Diana Rawlins, Dean Willis, Robert Sparks, Ben
Campbell, Chris Cunningham, Kevin Summers, and many other engineers
from MCI and elsewhere in the industry engaged in the development of SIP in
the Internet Engineering Task Force (IETF).
Most ideas and inspirations driving SIP are due to Prof. Henning
Schulzrinne from Columbia University and to Jonathan Rosenberg from
DynamicSoft and are reflected in this book. Among the many industry con-
tributors, we gratefully acknowledge discussions and guidance from Rohan
Mahy from Cisco Corporation, Gonzalo Camarillo and Adam Roach from
L.M. Ericsson. Jiri Kuthan from GMD Focus, Berlin, was helpful with SIP tuto-

rial charts and with discussions in transatlantic calls using SIP phones—again,
calls of crystal clear clarity to our surprise. The authors are grateful to Richard
Shockey from NeuStar, Inc. and Douglas Ranalli from NetNumber, Inc. for
numerous discussions regarding ENUM. Theodore Havinis has contributed to
the SIP-QoS-AAA aspect for mobile users.
03_776572 flast.qxp 6/5/06 9:35 PM Page xxiii

×