17.11.2014 Views

VoIP_H323_RTP - 08.pdf - Phare - LIP6

VoIP_H323_RTP - 08.pdf - Phare - LIP6

VoIP_H323_RTP - 08.pdf - Phare - LIP6

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.

Master Réseaux – PTEL 2008/2009<br />

Voice over IP:<br />

<strong>H323</strong> & <strong>RTP</strong>/RTCP<br />

Rami Langar<br />

PHARE research Team<br />

rami.langar@lip6.fr<br />

15 Décembre, 2008<br />

1


Plan<br />

H.323<br />

• Overview : <strong>VoIP</strong><br />

• H.323 Entities<br />

• H.323 Signaling models<br />

• H.323 Call processing steps<br />

<strong>RTP</strong>/RTCP<br />

• Overview : UDP, TCP<br />

• <strong>RTP</strong> & Multimedia applications<br />

• RTCP objectives<br />

2


What is <strong>VoIP</strong>?<br />

<br />

<strong>VoIP</strong> (Voice over Internet Protocol), sometimes<br />

referred to as Internet telephony, is a method of<br />

digitizing voice, encapsulating the digitized voice into<br />

packets and transmitting those packets over a<br />

packet switched IP network.<br />

Categories of <strong>VoIP</strong> :<br />

• Private and Desktop: Skype, Microsoft Netmeeting,<br />

gphone, Marratech, etc.<br />

• Enterprise : Small IP phone deployments, IP PBX,<br />

Cisco Callmanager.<br />

• ISP/Carrier : Toll Bypass services, VOIP wholesale,<br />

using equipment by vendors such as Cisco, Lucent,<br />

Avaya, etc.<br />

3


Voice over IP - the basics<br />

Most implementations use H.323 protocol<br />

• An ITU-T standard for bi-directional<br />

exchange of voice, video, and data<br />

• Applies to an IP network<br />

• H.323 is a set of standards for group<br />

communication<br />

• Uses TCP for call setup & control<br />

• Traffic is actually carried on <strong>RTP</strong> (Real Time<br />

Protocol) which runs on top of UDP.<br />

4


<strong>VoIP</strong> Protocols<br />

H.323 Multimedia Standard<br />

• H.225 RAS - Registration, Admission,<br />

Status<br />

• Q.931 - Call Signaling (Setup &<br />

Termination)<br />

• H.245 – Media flow Control (Preferences,<br />

Capability exchange, etc.)<br />

• Lots of G.7XX CODECS for audio<br />

SIP – Session Initialization Protocol<br />

• Covered in earlier course<br />

5


Here’s how it stacks up:<br />

H.323 Multimedia Protocol<br />

H.225 Call setup & control – RAS (Q.931)<br />

H.235 Security & Authentication<br />

H.245 Call negotiation, capability exchange<br />

H.450 Other supplemental Services<br />

H.246 Circuit Switched Network Interop.<br />

H.332 Conferencing<br />

H.26X Video CODECS<br />

G.7XX Audio CODECS<br />

6


How they fit in: The ISO Model<br />

ISO Model<br />

Layer<br />

Presentation<br />

Session<br />

Transport<br />

Network<br />

Data Link<br />

Protocol or Standard<br />

Applications / CODECS<br />

H.323 & SIP<br />

<strong>RTP</strong> / UDP / TCP<br />

IP – Non QOS<br />

ATM, FR, PPP, Ethernet<br />

7


<strong>H323</strong> – Protocol Stack<br />

8


Comparison of Packet vs. Circuit Switching<br />

Circuit<br />

Call Setup Database /<br />

Communications<br />

Channel<br />

SS 7 Overlay<br />

Dedicated<br />

Packet<br />

H.323 & SIP<br />

Shared<br />

Addressing NANP IPv4 & IPv6<br />

9


H.323 Entities<br />

Terminal<br />

Terminal<br />

Gatekeeper<br />

Réseaux IP<br />

MCU<br />

Gateway<br />

RTC<br />

RNIS<br />

10


H.323 Equipment<br />

Gateway<br />

• Device that connects H.323 voice network to<br />

non-H.323 voice network (SIP or PSTN)<br />

• Allows H.323 terminals to communication with<br />

non-H.323 terminals<br />

Gatekeeper<br />

• Provides address translation (H.323 & E.164 to<br />

IP)<br />

• Admission control for H.323 terminals and<br />

gateways<br />

• Manage bandwidth allocation<br />

• Other optional services<br />

11


H.323 Equipment<br />

MCU - Multipoint Control Unit<br />

• Endpoint that supports conferences between 3 or more<br />

endpoints<br />

• Can be stand-alone device (e.g., PC) or integrated into a<br />

gateway, gatekeeper or terminal<br />

• Typically consists of multi-point controller (MC) and<br />

multi-point processor (MP)<br />

MC : Multipoint Controller - handles control and<br />

signalling for conference support<br />

MP : Multipoint Processor - receives streams from<br />

endpoints, processes them, and returns them to the<br />

endpoints in the conference<br />

12


H.323 Equipment<br />

<br />

<br />

<br />

An endpoint that<br />

supports 2-way<br />

streaming with<br />

another H.323<br />

terminal or gateway<br />

Originates and<br />

terminates calls<br />

Includes<br />

videoconferencing<br />

stations, hard<br />

phones, & soft<br />

phones<br />

13


Signaling Models<br />

Determines which protocol messages pass<br />

through the gatekeeper, and which pass directly<br />

between the two endpoints<br />

The more messages that are routed between the<br />

gatekeeper, the more the load and responsibility<br />

(more information and more control)<br />

The gatekeeper ultimately decides on the<br />

signalling model<br />

Media stream (<strong>RTP</strong>) never passes through the<br />

gatekeeper function


Direct Endpoint Call Signalling


Gatekeeper Routed Call Signalling (Q.931/H.245)<br />

16


H.225 RAS - Discovery<br />

Registration, Admission and Status (RAS), defined<br />

in ITU-T H.225<br />

RAS is responsible for registration, admission, and<br />

disengaging procedures between H.323 endpoint<br />

and the Gatekeeper of H.323 zone they are<br />

assigned to.<br />

Gatekeeper Discovery: GRQ, GCF, GRJ.<br />

• Unicast Discovery. Endpoint knows GK IP<br />

address & register directly using UDP port 1719<br />

• Multicast using UDP multicast address<br />

224.0.1.41 with UDP port 1718<br />

17


Automatic Gatekeeper Discovery<br />

18


H.225 RAS - Registration<br />

Registration with Gatekeeper using its<br />

alias or E.164 address<br />

• RRQ Registration Request using UDP port<br />

1719 : contains transport address to be<br />

used for the call setup.<br />

• RCF Registration Confirm : includes<br />

terminal ID.<br />

• RRJ Registration Reject<br />

• URQ Un-registration Request<br />

• URF Un-registration Confirm<br />

19


Endpoint Registration<br />

20


H.225 RAS – Call admission<br />

ARQ – admission request<br />

• Terminal A requests admission to make a call.<br />

• Message sent to Gatekeeper :<br />

Seq. num, Terminal ID, Dest. Info, CRV, BW<br />

estimation.<br />

ACF – admission confirm<br />

• Mode used for the call (routed/direct).<br />

• Gatekeeper responds with IP address of the<br />

destination terminal or the destination gateway<br />

(if terminal is analog).<br />

• Authorized BW.<br />

21


Endpoint Admission To Network<br />

22


H.323 – Call setup (Q.931)<br />

First TCP connection: Established between<br />

the caller and called user using the port<br />

1720 : Call signaling channel.<br />

• Setup<br />

Indicates H.323 party wants to setup a<br />

connection to called party<br />

• Alerting<br />

Called user has been alerted, (phone is ringing)<br />

• Connect<br />

Acceptance of call by called party specifying the<br />

H.245 call control channel for capabilities<br />

exchange<br />

• Release complete<br />

H.225 (Q.931) call has been released, signaling<br />

channel is now closed.<br />

23


H.323 – H.245 channel control<br />

Caller establishes logical channels for<br />

transmission of H.323 data using a second<br />

TCP connection<br />

Negotiates:<br />

• channel usage<br />

• master/slave configuration<br />

• flow control<br />

• Codec used.<br />

Messages follow the recommendation H.245<br />

using TCP ports:<br />

• 1024-5000 ports in Cisco implementation<br />

24


H.323 – H.245 Messages<br />

Terminal Capability Set message<br />

• Contains information on a terminal’s ability to send<br />

and receive multimedia streams<br />

• If conferencing, determination of MCU is<br />

negotiated during this phase<br />

• After capabilities exchange, clients have a<br />

compatible method for transmitting media<br />

streams; multimedia communication channels can<br />

be opened<br />

Master/Slave Determination<br />

• Determines which terminal will be master which<br />

will be slave in the call<br />

25


H.323 – H.245 Channel Control<br />

Terminal A<br />

Alias:<br />

A@domain1.com<br />

Canal de Controle<br />

H.245<br />

TCP<br />

H.245: Terminal Capability Set<br />

Multiplex capability<br />

Capability Table:<br />

H.261 video<br />

G.711, G.729<br />

Terminal Capability Set<br />

Terminal Capability Set Ack<br />

Terminal Capability Set<br />

…Ack<br />

Terminal B<br />

Alias:<br />

B@domain2.com<br />

Canal de Controle<br />

H.245<br />

TCP 8741<br />

H.245: Terminal Capability Set<br />

Multiplex capability<br />

Capability Table:<br />

H.261 video<br />

G.711, Alaw64k<br />

26


H.323 – H.245 Channel Control<br />

Terminal A<br />

Alias:<br />

A@domain1.com<br />

H.245: OpenLogicalChannel<br />

LogicalChannel 1,<br />

RTCP RR port 7771<br />

Session number, <strong>RTP</strong> PT, …<br />

OpenLogicalChannel<br />

Terminal B<br />

Alias:<br />

B@domain2.com<br />

Canal de Controle<br />

H.245<br />

TCP<br />

OpenLogicalChannel<br />

…Ack<br />

…Ack<br />

Canal de Controle<br />

H.245<br />

TCP 8741<br />

H.245: OpenLogicalChannelAck<br />

LogicalChannel 1,<br />

RTCP SR port 9345,<br />

<strong>RTP</strong> port 9344<br />

27


H.323 – Conversation<br />

Terminal A<br />

Alias:<br />

A@domain1.com<br />

Terminal B<br />

Alias:<br />

B@domain2.com<br />

Canaux audio<br />

<strong>RTP</strong> : UDP<br />

RTCP : UDP 7771<br />

RTCP : UDP<br />

Flux <strong>RTP</strong> de A vers B<br />

RTCP RR<br />

RTCP SR<br />

Canaux audio<br />

<strong>RTP</strong> : UDP 9344<br />

RTCP : UDP<br />

RTCP : UDP 9345<br />

28


Call termination<br />

Client A completes transmission of media and<br />

closes logical channels used to transmit media<br />

• Close Logical Channel message initiated (H.245).<br />

• Client A transmits End Session Command (H.245)<br />

• Client B closes media logical channels and transmits<br />

End Session Command<br />

• Client A closes H.245 control channel<br />

• If call signaling channel is still open, a Release<br />

Complete message (H.225) is sent between clients<br />

to close this channel<br />

• Disengage Request (DRQ) and disengage confirm<br />

(DCF) between terminal – GK, and Gateway – GK.<br />

29


Call termination<br />

Terminal GK Gateway<br />

2<br />

3<br />

1<br />

2<br />

3<br />

1 : Release Complete<br />

2 : DRQ<br />

3 : DCF<br />

30


H.323 Model<br />

31


<strong>RTP</strong>/RTCP details<br />

32


Application taxonomy<br />

<br />

<br />

<br />

<br />

<br />

Elastic applications<br />

A user waits for info from a<br />

server.<br />

Small end-to-end delay<br />

preferred (non<br />

fundamental)<br />

Instantaneous bit rate<br />

required: low<br />

Packet losses recovered by<br />

the transport protocol<br />

through retransmission<br />

• End-to-end delay<br />

increases<br />

Multimedia applications<br />

Two users interact (in real<br />

time)<br />

Low delay fundamental (a<br />

delayed packet is<br />

equivalent to a lost packet)<br />

Required bit-rate may be<br />

significant<br />

May be robust to (limited)<br />

packet losses<br />

33


Applications and protocol stack<br />

34


UDP protocol<br />

UDP (User Datagram Protocol ) permits application to<br />

application (host to host) communication through<br />

datagram transmission<br />

UDP provides a layer 4 service:<br />

• Connectionless (out of sequence packets)<br />

• Unreliable (packet lost)<br />

• Low overhead<br />

• Optional checksum<br />

Application identification through :<br />

• Source IP address, destination IP address, source UDP<br />

port, destination UDP port<br />

• No rate control<br />

<br />

<br />

No flow control (possible receiver saturation)<br />

No congestion control<br />

35


UDP packet format<br />

36


TCP protocol<br />

TCP (Transmission Control Protocol ) is the<br />

other Internet layer 4 protocol<br />

Main characteristics<br />

• Connection-oriented<br />

• Reliable and in sequence delivery<br />

Retransmission<br />

• Rate control<br />

Congestion control to avoid network saturation<br />

• unpredictable delay characteristics<br />

37


TCP packet header<br />

38


Using TCP for multimedia?<br />

TCP is reliable, but<br />

• Retransmissions cause delays<br />

TCP is rate controlled to avoid receiver and<br />

network congestion, but<br />

• The available bit rate for the multimedia application<br />

is highly variable<br />

TCP does not support multicast<br />

TCP cannot be used for real-time multimedia<br />

• Non real time multimedia can be treated as file<br />

transfer<br />

39


UDP for multimedia<br />

UDP supports multicast, is not rate<br />

controlled and does not use<br />

retransmissions, but<br />

• Does not guarantees in-order delivery<br />

• Does not detect and deals with packet<br />

losses<br />

• Does not compensate for delay fluctuations<br />

• Does not recognize multimedia contents<br />

IETF proposal: add <strong>RTP</strong> protocol over<br />

UDP<br />

40


Delay Fluctuation : TDM vs. statistical multiplex<br />

Multiplexeur<br />

statistique<br />

Optimisation de la<br />

bande passante<br />

Introduction de gigue<br />

et de délai<br />

41


Example of multimedia application<br />

42


<strong>RTP</strong> : Real Time Transport Protocol<br />

Defined in RFC 1889<br />

• a framework to build multimedia applications<br />

Provides some basic mechanisms for multimedia data<br />

transfer<br />

It is not and independent protocol, but must be included<br />

in the application<br />

Composed by two different (although related) protocols:<br />

• <strong>RTP</strong>: deals with multimedia data transport (even UDP<br />

ports)<br />

• RTCP: provides control and monitoring services (odd UDP<br />

ports)<br />

<br />

<br />

<br />

Feedback on packet delay and losses<br />

Request/response to coding modifications<br />

Helps in the management of the list of participants<br />

43


<strong>RTP</strong> + RTCP<br />

Functions available<br />

• Payload identification (coding)<br />

• Sequence number management<br />

• Timestamp management<br />

• Monitoring and performance analysis<br />

• Participants identification<br />

Functions NOT available<br />

• No QoS support<br />

No reliability, bit rate or delay guarantees<br />

• No guarantee on correct and in order delivery<br />

Exploits UDP checksum to detect errors<br />

44


<strong>RTP</strong> : example of voice transmission<br />

Consider a multi-user voice conference over <strong>RTP</strong><br />

Basic elements:<br />

• One IP multicast address<br />

• Two UDP ports<br />

One even port for <strong>RTP</strong>, the next one (odd) for RTCP<br />

<strong>RTP</strong> does not specify how to choose these numbers<br />

Voice is produced according to a proper coding<br />

technique<br />

Voice samples are grouped in packets<br />

• The number of samples in each packet depends on<br />

the <strong>RTP</strong> configuration<br />

45


<strong>RTP</strong> : example of voice transmission<br />

<br />

<br />

<br />

Packets size should be small to keep under control the<br />

packetization delay (should be smaller than few tens of ms)<br />

• Few samples in each packet<br />

Samples are encapsulated within an IP + UDP + <strong>RTP</strong><br />

headers<br />

Through RTCP, each participants sends (in multicast)<br />

statistical data<br />

• It is possible to analyze service performance Code rate<br />

adaptation may be envisioned to adapt the transmission<br />

to the measured quality<br />

IP Header<br />

UDP Header<br />

<strong>RTP</strong> Header<br />

Samples<br />

20 Bytes 8 Bytes 12 Bytes<br />

46


<strong>RTP</strong> : example of audio-video conference<br />

The standard suggests to use two<br />

independent <strong>RTP</strong> flows<br />

• Advantage: a user may access only one<br />

of the two services<br />

It is mandatory to synchronize the<br />

two flows:<br />

• The <strong>RTP</strong> timestamps of the two flows<br />

may be used with this goal<br />

47


<strong>RTP</strong> packet format<br />

48


RTCP Objectives<br />

Quality of service and congestion control<br />

• RTCP packets are used as “low frequency” ACKs to<br />

signal the reception quality<br />

• Control protocol for <strong>RTP</strong> data flow<br />

• On the basis of RTCP “report”, the server may adapt<br />

the coding to the communication status<br />

Estimate the number of participants to the<br />

multicast session<br />

• Needed to control the transmission bit rate required<br />

by RTCP control signals which would increase too<br />

much if the number of participants increases too<br />

much<br />

49


RTCP packet<br />

Several types of RTCP packets:<br />

• SR (Sender Report) sent by all active sources to all<br />

participants ; includes Amount of data sent from<br />

<strong>RTP</strong> session start-up<br />

Total number of <strong>RTP</strong> packets sent<br />

Total number of byte sent<br />

• RR (Receiver Report): sent by all receivers to all<br />

participants; sent to inform senders on the quality<br />

of the <strong>RTP</strong> session as seen by receivers<br />

• SDES (Source DEScriptor): source description<br />

through a unique identifier (to identify themselves)<br />

• BYE: session ends or one participant leaves the<br />

session<br />

• APP: application specific functions<br />

50


RTCP : Report transmission speed<br />

Four rules must be followed to generate<br />

RTCP packets<br />

• The RTCP traffic should be limited to a given<br />

percentage of the data traffic (5%)<br />

• 25% of the session bit rate is devoted to SR<br />

packets, the remaining part to other packets<br />

• An RTCP packet cannot be sent earlier than 5s<br />

after the previous RTCP packet transmission<br />

• A variable time P should be added to the<br />

waiting time<br />

51


RTCP : Report transmission speed<br />

52

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

Saved successfully!

Ooh no, something went wrong!