Vous êtes sur la page 1sur 64

Introduction to

Voice Over IP (VOIP) Protocols


By J K Ramachandra

Background
Currently, two Independent networks (voice and
data)
Circuit Switched and packet switched
Both undergone tremendous enhancements over
the years
Packet network is relatively a later entry, but more
aggressive
Convergence combining both into one network
talked quite often from early eighties
ISDN/SS7 was the first instance of convergence

Voice network
Fixed (assured) bandwidth, optimally matched for
Poisson voice traffic
High reliability
Five 9s Availability (5 min/ year downtime)

Disadvantages:
Inefficient usage of bandwidth
Closed architecture, single vendor
Long turn-around time for new features (18 months)

Data network
Rapid growth of data traffic
Data traffic has overtaken US voice traffic in 1998, UK
in 1999 (voice 8% total US traffic by 2004)
US Internet users increased from 10 to 50 million in 4
years

Truly global infrastructure with minimum barriers


Disadvantage:
best effort and not suitable for real time
Not designed for voice traffic (short duration, high call
rate)

Need for VOIP protocols

Use the advantages of IP


QOS still to be addressed
Still large PSTN network base
User the POTS the Black phone - continue to
be used
Co-existence of both networks for quite some time
Address multi-media (audio, video, data) session
instead of just plain voice calls
Protocols defined for complete IP based as well as
inter-working solutions

VOIP protocols
Media Gateway Control Protocols
MGCP, MEGACO (H.248)

H.323
the first VOIP protocol defined by ITU-T

SIGTRAN suite of protocols


To carry signaling (ISDN/SS7) over IP

Session Initiation Protocol (SIP)


Text based (like HTTP); simple and extendable; Likely
to be the protocol of the future

Real Time Transmission Protocol (RTP)


for voice (media) transmission

Basic Switching functions


Call setup

Call Origination (off-hook)


Feed dial tone
Collect digits
Translate digits and route selection
Terminate the call
Called alert and ring back
Answer and connect

Conversation
Speech transmission between users

Call Tear Down


Disconnect from one of the user
Disconnect both parties

SIGNALLING

Media transmission

SIGNALLING

Conventional SWITCH MODEL


Control
SERVICES/
FEATURES

SIGNALLING

voice
Signaling

CALL
CONTROL

Users

User
Access

SWITCH/Matrix

RESOURCES

Co-located (Normally), single integrated system


PSTN/SCN (Switched Circuit Network)

Next Generation Network SWITCH


MODEL
CALL
SIGNALLING

CONTROL

SERVICES/
FEATURES

IP

User
Access

RESOURCES

Physically decomposed, distributed Architecture


Proposed by ETSI (TIPHON) - MG, SG, MGC
Standards generated by ITU-T, IETF

NGN ELEMENTS
SIGNALLING
GATEWAY

FEATURE
SERVER

Call Agent/MGC

Announcement Server

MEDIA
GATEWAY

IP

CO/IXC
Trunks

H.323

MEDIA
GATEWAY

Trunking
Gateway

SIP
MEDIA
GATEWAY
POTS ISDN

RESIDENTIAL/ACCESS GATEWAY

Media Refers to traffic (Voice, video, data)


Media Gateway Media converter between different
networks (SCN to IP)

Media Gateway Control Protocols


MEGACO (RFC 3015)
MGCP (RFC2705)

Media Gateways (MG)


An interface between PSTN and IP network
Converts and passes Speech samples between the
two networks
PCM on PSTN === RTP (different codecs) on IP

Communicates with MGC for call handling using


MEGACO/MGCP
Responsible for feeding tones/digit collection/off
hook/on hook detection, voice compression etc..
Highly hardware intensive (DSP, embedded
systems)

Media Gateways Controllers (MGC)

Also called as Call agent or Soft switch


Call controlling agent for next generation
Controls MGs using MEGACO/MGCP
Highly software intensive and mostly uses
standard computing hardware platform like
sun servers

Gateway Control Protocols


RTP/RTCP

RTP/RTCP

IP Network
MG

MG

MGCP/MEGACO

Application
MEGACO/MGCP
TCP/UDP
IP
Data Link
Physical

MGCP/MEGACO

MGC

Application
RTP/RTCP
UDP
IP
Data Link
Physical

Types of Media Gateways


Access Gateway
ISDN user to Network Interface
E.g. ISDN PBX

Residential gateway
Analogue Lines (RJ11) (typically One or two)

Trunking Gateway
SCN to IP Network, T1/E1 lines,
Normally uses SS7 for signalling

Network Deployment Options

SCP
STP

LEC

PBX

IXC

LEC

ACC GW
TRK GW

MGC
TRK GW

RES GW

IP Network

MEGACO
Assumptions:
Call Processing intelligence with MGC
MGs are as dumb as possible
MGC instructs MG for every possible stage of
the call

MEGACO-Connection model
PSTN
Network

DS0 Ch
Physical

Context C1

RTP Stream,
Ephemeral

IP
Network

Connection model consists of Terminations and context


Physical terminations - equivalent to circuit#
Ephemeral termination - RTP streams, exists only for the
duration of their usage
Context is an association between a set of terminations
Context is created and maintained by MG
A termination exist in one context at a time

Packages
Package identifies the type of termination
Each Termination is associated with a
package:

e.g. Analog Line,


DS0,
Tone Gen.,
DTMF Gen.,
DTMF detection ,
etc..

Signals
MGC orders MG to apply a signal
Signals are applied to terminations
e.g. Dial tone, Ring, DTMF tones (O/G side)

Can apply Set of signals in a sequence


Signal Type
on/off (e.g. Announcements)
Timeout (e.g. dial tone, ring)
Brief (e.g. DTMF tone)

Events
MGC orders MG to detect events
Events are detect by MG on termination
e.g. on/off hook, DTMF digits

MG notifies the requested events after detection


List of events can be requested
Embedding with another Event/Signal
e.g detect Off hook event and apply dial tone signal

Digit Map
Simple way to instruct MG to collect sequence of
digits as per dial plan
(0S|00S|[1-7]xLxx|8Lxxxxxxx|*xx|9L1xxx)

S short timer
L Long timer
x any digit
| or
[1-7] Any digit between 1 to 7

MG will look for the best match and report the


digits to MGC

Media Negotiation
Different types of codecs can be used for the call
Session Description Protocol (SDP) is used for
codec negotiation
Originator (MG) sends set of codec choices
MGC passes them to terminator
Terminator normally selects one of them and sends it
back
MGC sends the selected one to originator
Thus, selected codec will be used for the call
Typical codecs:
G.711 (u/a law, 64 KBPS), G.729 (8 KBPS). G.723.1 (5.3/6/3
KBPS)

MEGACO/MGCP-Commands
ADD (MGC to MG)
Add terminations to a context.
Add on first terminations creates Context.
Create connection (CRCX) in MGCP

Modify (MGC to MG)


Modifies the properties, events and signals of a
termination

Move (MGC to MG)


Moves a termination to another context

Commands- Continued
Subtract (MGC to MG)

Disconnects a termination from a context


Returns Statistics of that termination
If last termination, deletes the context
Delete connection (DLCX) in MGCP
Notify (MG to MGC)
MG to inform the occurrence of the requested
events

Commands- continued
Audit Value (MGC to MG)
Current state of properties, events and signals
of a termination

Audit Capabilities (MGC to MG)


All the possible values for the termination
properties, events, signals allowed by MG.

Commands - continued
Service Change (mainly from MG to MGC)
Need for REGISTRATION due to physically
distributed architecture
Registration with MGC (primary and list of secondary
MGCs)
Indicate termination state (OOS/INS) by MG
Hand over to another MGC by MGC
Request MG to take termination OOS (MEGACO
only).
Restart In Progress (RSIP) in MGCP

MEGACO-transactions
Transaction Request: Transaction ID1
Context1 (Command 11, Command 12, Command 13
Context2 (Command 21, Command 22)

Transaction Reply: Transaction ID1


Context1 (Response 11, Response 12, Response 13
Context2 (Response 21, Response 22)

MEGACO message -Example


MEGACO/1 [130.202.9.126]
Transaction = 10003 {
Context = - {
Modify = ds31/ds13/ds05 {
Events = 2223 {
al/on, dd/ce {DigitMap=DialPlan0}
Signals {cg/dt},
DigitMap = DialPlan0 {
(os|00s||8Lxxxx)}
}
}
}
---------------------------------------------------------------------------MEGACO/1 [130.202.9.121]:55555
Reply = 10003 {
Context = - {Modify = ds31/ds13/ds05 }
}

MGCP-Example
CRCX 24323 tg2@examles.net MGCP 1.0
C: A3C47F223456789F0
K: 6234-6237, 6888, 19045-19048
M: sendonly
N: Call-agent@ca.example.net:5234
L: p:10, a:PCMU, b:32-65, e:off
X: 0123456789B1
R: hd(E(R([0-9#T] (D),hu[N],s[dl],D[0-9].[#T])))
D: (0T| 00T| [1-7]xxx| 8xxxxxxx|#xxxxxxx)
------------------------------------------------------200 24323 OK
I: 234ABC432432
v=0
c=IN IP4 128.96.41.1
M=audio 3456 RTP/AVP 0 96

some highlights of the MGCP/MEGACO


Transaction 3 way handshake:
Transaction Request, Reply/Pending and
Response Ack.

Text/Binary format (only Text in MGCP)


TCP/UDP (only UDP in MGCP)
Retransmission timers, Long timer,
Suspicion/disconnect thresholds
Interim AH security (only in MEGACO)

Call flow-Registration
MG1

MGC

MG2

Service Change
ROOT term, Restart method

Service Change
ROOT term, Restart method

Reply
Self/other MGC Id to try

Reply
Self/other MGC Id to try

Call flow ResGW - origination


MG1

MGC
Modify, termId *,
Event=Offhook
Reply
Notify, termId x1

Observed Event=Offhook, time


Reply

MG2

Call flow-Digit collection


MG1

MGC
Modify, termId x1,

Event=dgt, onhook ,Digit map,


Reply
Notify, termId x1,
Observed Event=Digits, time
Reply

MG2

Call flow-Create Contexts


MG1

MGC
Add, Context $

ADD =termID x1, ADD =$ (ephemeral)


Media=Preferred SDP

Reply, Context C1

Add, Context $

termID x1, termID x2 (ephemeral)

ADD =$, ADD= $(Ephemeral)

Media=Selected SDP choices

Media=MG1 SDP choices, send/recv

Mode=Receive only

Reply, Context C2
termID y1, termID y2 (ephemeral)
Media=selected SDP

MG2

Call flow- Wait for Answer


MG1

MGC
Modify, Context C1

Modify, Context C2

Signals =Ring back


Media=MG2 selected SDP

Reply, Context C1

Signals=Ring, Event=OffHook

Reply, Context C2
Notify, Context C2

Modify, Context C1
Signals =Stop Tone, Event=OnHook
Mode=Send/Receive

Observed Event=OffHook (Answer)

Reply, Context C2

MG2

Call flow-disconnect
MG1

MGC

MG2

Notify, Context C1
Observed Event=onHook

Reply, Context C1
Subtract, Context C1
Audit statistics, termId x1, x2,,
Event=Offhook

Reply, Context C1
Statistics for termId x1, x2

Subtract, Context C2
Audit statistics, termId y1, y2,
Event=Offhook

Reply, Context C2
Statistics for termId y1, y2

H.323 Protocol

H.323 introduction
Standard for multimedia communication
over IP network
For Audio, video and data communications
Umbrella standard -pointer to many other
standards

H.323 Network

PSTN

H.323
Gateway

IP Network
IP/TCP/UDP/RTP/RTCP

Gate Keeper

H.323 Terminal

Multipoint Control Unit

H.323 Gateway

PSTN

H.323 terminal
Client endpoint on the network
Supports:

Audio (G.711, G.722, G.723, G.728, G.729)


Video (H.261, H.263)
Data terminal - T.120
H.225 (Subset of Q.931) Control functions
H.245, Negotiation & media channel setup
RTP -media packets

H.323 Gateways
Provides translation function between
H.323 and Circuit Switched network
Gateway are optional in H.323 network

H.323 Multipoint Control Unit


Supports conferencing between endpoints

H.323 Gate Keeper


Required Functions:

Admission control
Bandwidth control and management
Address translation (E.164 # to IP Address)
Registration/Admission/Status (RAS)
Manages all components of H.323
Optional, but must be consulted if present

H.323 Gate Keeper


Optional Functions:
Call Control Signalling
Call management (call screening, forwarding,
redirection, call routing etc..)

H.323 Protocol Stack


Audio
Call Control

Video

Data

A/V
Control

Control

RTCP

RAS

G.7xx H.26x
H.225 H.245 T.120
(Q.931)

RTP

TCP

UDP
IP

H.323 Call Stages

Discovery and Registration (Who I am)


Call Setup (whom to call)
Call Negotiation (Our Capabilities)
Media Channel Setup (Open audio channel)
Media transport (Send/Receive Audio)
Call Termination (call ends)

Discovery and Registration


Gate Keeper Request GRQ, Who is my GK?
Gate Keeper Confirm/Reject (GCF/GRJ), I am
H.323
Terminal

Registration Request, RRQ, Associate PSTN/IP #


Registration Confirm/Reject (GCF/GRJ), OK

Gate
Keeper

H.323 Call setup


Location Request LRQ, Where is NPANXX-XXXX?
Location Confirm LCF, At this IP Address
H.323
Terminal

Admission Request ARQ, May I call this IP Addr


Admission Confirm, ACF, Yes & use xx KBPS

Gate
Keeper

Call Setup - H.225 (Q.931)


ARQ
ACF
SETUP
Call Proceeding
ARQ
ACF
Alerting
Connect

Media Channel Setup - H.245


Open Logical Channel
Open Logical Channel Ack
Open Logical Channel
Open Logical Channel Ack
Logical Chl opened for each media stream
Logical Chl 0 - for H.245 Control
Media flows now. Possible Bandwidth negotiation during call

Call termination
End Session Command (H.245)
End Session Command
Release Complete (Q.931)
Disconnect Request (RAS)
Disconnect Confirm

Disconnect Request
Disconnect Confirm

Session Initiation Protocol


(SIP)

SIP introduction
SIP is an application layer control protocol that can
establish, modify and terminate multimedia
sessions or calls.
Direct competition with H.323. Microsoft migrated
from net-meeting (H.323) to MSN
messenger/windows XP(SIP)
Mainly addresses all IP network (end user on IP),
though gateways concept are used in real
implementation
SIP message format is based on the Hyper Text
Transport Protocol (HTTP) message format, which
uses a human-readable, text-based encoding.

SIP introduction..contd.
SIP is transport-layer independent protocol i.e. it can
be used with any datagram or stream protocol like
UDP, TCP, SCTP, ATM etc.
It uses the session description protocol (SDP) for
media negotiations (similar to MEGACO/MGCP)

Simple, Extendable and most promising


SIP is also the the most preferred protocol choice for
communication between MGCs (Call Agents).

Accepted as the core signaling protocol for 3rd


generation (3g) wireless

SIP Architecture
Consists of User Agent, Network server (proxy, redirect,
registrar and location server)

SIP User Agent


End system acting on behalf the user
User Agent Client (originator) and User Agent Server
(terminator)
Maintains call state

SIP Registrar
Registrar receives Registration from clients (UA)
regarding current location and stores in a location server
(non-SIP)
This information is used for routing (terminating) the call

SIP Proxy Server

Forwards client requests to another proxy or UA


Either maintain call state (stateful) or can be stateless
Can fork request to multiple servers (parallel search)
Softswitch/Gatekeeper function

SIP Redirect Server


Returns the next address to originator instead of
forwarding
Originator retries with the new address

SIP Messages
Request and Response messages
Request Messages:

REGISTER For registration


INVITE Session initiation
ACK Acknowledge Invite Response
BYE Successful session termination
CANCEL- Terminate the pending request

SIP Messages..Contd.
Response Messages:

1xx: information (100 trying, 180 ringing)


2xx: Successful (200 OK)
3xx: Redirection (301 Moved permanently )
4xx: Client error (400 Bad Request, 404 Not found)
5xx: Server error (503 Service unavailable)
6xx: Global error (603 Decline)

SIP Call flow


User A

Proxy 1
INVITE
100 Trying

Proxy 2

INVITE
100 Trying

180 Ringing

180 Ringing

User B

INVITE

180 Ringing

Alerting User B

200 OK

User B accepts call

200 OK
200 OK
ACK

ACK

ACK

established

Both Way RTP Media


BYE
BYE
200 OK

INVITE
BYE
200 OK

Media (voice) path

200 OK

Called party
hangs up
up first

Conclusion:

MGCP, MEGACO, H.323 or SIP


different ways to establish communication between
the users over IP

Vous aimerez peut-être aussi