Top Banner
Fernando Lorge [email protected] Voz sobre IP (VoIP) - 2016 - Laboratorio de REDES Recuperación de Información y Estudios de la Web Administración y Gestión de Redes Lic. en Sistemas de Información
37

Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Apr 26, 2018

Download

Documents

dangthuan
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Fernando [email protected]

Voz sobre IP(VoIP)

- 2016 -

Laboratorio de REDESRecuperación de Informacióny Estudios de la Web

Administración y Gestión de RedesLic. en Sistemas de Información

Page 2: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Voz sobre IP

Comunicaciones Telefónicas:

● En telefonía tradicional:

– Señalamiento: SS7 (signaling system 7). (ITU-T)

● POTS – Tip&Ring, FXO, FXS, PBX, Líneas, Troncales, Central Office.

● Señalamiento en banda DTMF

Page 3: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Voz sobre IP

Comunicaciones Telefónicas:

● Transmisión:

– PCM (Pulse Code Modulation) ITU-T G.711

● Canal de transmisión tradicional:

– Por qué 64kbps? (Nyquist):

– 8 x bits/sample x 8000 samples/sec

Page 4: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Voz sobre IP

Comunicaciones Telefónicas sobre IP:

Arquitectura:

● Señalización (Signaling o call management)

● Transmisión de datos.

● Soporte

Page 5: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Voz sobre IP

Comunicaciones Telefónicas sobre IP:

● Señalización:– Localización– Establecimiento de llamadas (call setup)– Características de la sesión– Terminación de llamadas

● Transmisión:– Encapsulamiento de datos de audio (y vídeo)– Secuenciamiento, Marcas de tiempo, Identificación

● Soporte– Autoconfiguración, Calidad de Servicio– Autenticación, Autorización, Contabilidad entre dominios

Page 6: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Voz sobre IP

Comunicaciones Telefónicas sobre IP:

● Protocolos de Señalización:

– SIP (IETF)– H323 (ITU-T)– SCCP (Cisco)– AIX (Digium) ...

● Protocolos de Transmisión:

– RTP (IETF) mayormente. (junto con RTCP)

Page 7: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Voz sobre IP

Transmisión de audio

● DAC (Digital Audio Convertion)

● CODEC (Codificador Decodificador):

– Convertir señal analógica en una serie de muestras discretas.

– Frecuencia de muestreo

– Resolución

– Packet Rate

Page 8: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Voz sobre IP

Transmisión de audio

Page 9: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Voz sobre IP

Transmisión de audioCODECS mas utilizados

● G.711 (PCM): A-law o μ-Low.

● G.722 (SB-ADPCM) Subband Adaptive Differential PCM.

● G.723.1 Dual-Rate Speech Coder for Multimedia Communications

– 5.3Kbps—Algebraic Code Excited Linear Prediction (ACELP)

– 6.3 Kbps—Multipulse Maximum Likelihood Quantization (ML-MLQ)

● G.726 - Adaptive Differential PCM encoding. (ADPCM)

● G.729 - Conjugate Structure ACELP(Algebraic code-excited linear prediction)

● ILBC – Internet Low bitratw Codec (block-independent linear predictive coding)

● Speex – Code-Excited linear prediction (CELP)

● GSM - Linear predictive coding (LPC)

Page 10: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Voz sobre IP

Comparación de CODECS

http://www.speex.org/comparison/

Page 11: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Voz sobre IP

Tiempo de transcodificación en Servidor Asterisk

g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

g723 15 15 15 15 15 9 15 15 15 23 15 15 17,25

gsm 15 15 15 15 15 9 15 15 15 23 15 15 17,25

ulaw 15 15 9,15 15 15 9 15 15 15 23 15 15 17,25

alaw 15 15 9,15 15 15 9 15 15 15 23 15 15 17,25

g726 15 15 15 15 15 9 15 15 15 23 15 15 17,25

adpcm 15 15 15 15 15 9 15 15 15 23 15 15 17,25

slin 6 6 6 6 6 6 6 6 6 14 6 6 8,25

lpc10 15 15 15 15 15 15 9 15 15 23 15 15 17,25

g729 15 15 15 15 15 15 9 15 15 23 15 15 17,25

speex 15 15 15 15 15 15 9 15 15 23 15 15 17,25

speex16 23,5 23,5 23,5 23,5 23,5 23,5 17,5 23,5 23,5 23,5 23,5 23,5 15

ilbc 15 15 15 15 15 15 9 15 15 15 23 15 17,25

g726aal2 15 15 15 15 15 15 9 15 15 15 23 15 17,25

g722 15,6 15,6 15,6 15,6 15,6 15,6 9,6 15,6 15,6 15,6 15 15,6 15,6

Page 12: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

H.323

ITU-T Recommendation H.323

● Componentes:

● Terminal● Gatekeeper● Gateway● Multipoint Control Unit

● Protocolos de señalización:

● H.225 (Call setup)● H.245 (Capabilities negotiation)

● Protocolos de trasmisión de medios:

● RTP/RTCP

Page 13: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

H.323

Modo de operación

H.245 puede ser incluido en los mensajes H.225

Page 14: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

H.323

Modo de operación

Señalización a través de gatekeeper

Page 15: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

H.323

Modo de operación

Interacción con PSTN

Page 16: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session InitiationProtocol

Session Initiation Protocol (SIP)RFC 3261

● Componentes:

● User Agent (Terminal)● Registrar Server● Proxy Server● Redirect Server

● Protocolos de señalización:

● SIP (Call setup)● SDP (Capabilities negotiation)

● Protocolos de trasmisión de medios:

● RTP/RTCP

Page 17: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session InitiationProtocol

Escenario inicial básico

Page 18: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session InitiationProtocol

Session Initiation Protocol (SIP)RFC 3261

● SIP es un protocolo basado en texto que utiliza el juego de caracteres UTF-8.

● Un mensaje SIP es un requerimiento de un cliente a un servidor o una respuesta de un servidor a un cliente.

User Agent Client (UAC) ↔ User Agent Server (UAS)

● Los mensajes de peticiones y respuestas (Request and Response messages) utilizan el formato básico definido en RFC 2822.

Page 19: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session InitiationProtocol

Protocolo SIPEstructura de Mensajes:

start-line, one or more header fields, an empty line indicating the end of the header fields, and an optional message-body

generic-message = start-line *message-header CRLF [ message-body ] start-line = Request-Line / Status-Line

Page 20: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session InitiationProtocol

Estructura de Mensajes (Request)

Request-Line = Method SP Request-URI SP SIP-Version CRLF

● Métodos:● REGISTER for registering contact information● INVITE, ACK, and CANCEL for setting up sessions● BYE for terminating sessions● OPTIONS for querying servers about their capabilities

● Request-URI:● The Request-URI is a SIP or SIPS URI. It indicates the user or service

to which this request is being addressed

● SIP-Version: "SIP/2.0"

Page 21: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session InitiationProtocol

Estructura de Mensajes (Response)

Status-Line = SIP-Version SP Status-Code SP Reason-Phrase CRLF

● Status code:● 1xx: Provisional -- request received, continuing to process the request;● 2xx: Success -- the action was successfully received, understood,and

accepted;● 3xx: Redirection -- further action needs to be taken in order to

complete the request;● 4xx: Client Error -- the request contains bad syntax or cannot be

fulfilled at this server;● 5xx: Server Error -- the server failed to fulfill an apparently valid

request;● 6xx: Global Failure -- the request cannot be

fulfilled at any server.

Page 22: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session InitiationProtocol

Estructura de Mensajes:

● Header Fields:

● header = "header-name" HCOLON header-value *(COMMA header-value)

● field-name: field-value

● Ej.: Route: <sip:[email protected]>,<sip:[email protected]>

● field-name: field-value *(;parameter-name=parameter-value)● Ej.: Contact: <sip:[email protected]>;expires=3600

Page 23: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session InitiationProtocol

Estructura de Mensajes:

● Bodies (opcional):

● Media type of the message body MUST be given by the Content-Type header field

● Content-Encoding (si se utiliza compresión)● Content-Length

Page 24: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session InitiationProtocol

Establecimiento de llamada VOIP

Page 25: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session InitiationProtocol

Request Message

● Headers mínimos:● To

● To: Carol <sip:[email protected]>● From

● From: "Bob" <sips:[email protected]> ;tag=a48s● Cseq

● CSeq: 4711 INVITE● Call-Id

● Call­ID: f81d4fae­7dec­11d0­a765­[email protected]● Max-Forwards

● Max­Forwards: 70● Via

● Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds● Contact (Invite request)

● <sip:[email protected]>

Page 26: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session DescriptionProtocol

Session Description Protocol - SDP(RFC 4566)

“El objetivo de SDP es transmitir información acerca de los flujos en sesiones multimedia para permitir a los destinatarios participar en la sesión”

● Una descripción de sesión SDP incluye:– Nombre de Sesión y propósito– Tiempo(s) en que la sesión es activa– Los medios que componen la sesión– Información para recibir esos medios (direcciones, puertos, formatos, etc.)

● Adicionalmente:– Información acerca del bandwidth a utilizar por la sesión– Información de contacto de la persona responsable de la sesión

Page 27: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session DescriptionProtocol

Session Description Protocol - SDP(RFC 4566)

● Media Information:– El tipo de contenido (video, audio, etc.)– El protocolo de transporte (RTP/UDP/IP, H.320, etc.)– El formato del contenido (H.261 video, MPEG video, etc.)

● Direcciones y puertos:– Unicast:

● La dirección remota● El número de puerto

– Multicast:● La dirección del grupo multicast● El número de puerto

Page 28: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session DescriptionProtocol

Session Description Protocol - SDP(RFC 4566)

● An SDP session description consists of a number of lines of text of the form:

<type>=<value>

● <type>: Un carácter

● <value>: Texto estructurado cuyo formato depende de <type>

● SDP field names and attribute names use only the US-ASCII subset of UTF-8

● Textual fields and attribute values MAY use the full ISO 10646 character set

Page 29: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session DescriptionProtocol

Session Description Protocol - SDP(RFC 4566)

● Session description:

– v= (protocol version)– o= (originator and session identifier)– s= (session name)– i=* (session information)– u=* (URI of description)– e=* (email address)– p=* (phone number)– c=* (connection information -- not required if included in all media)– b=* (zero or more bandwidth information lines)– One or more time descriptions– z=* (time zone adjustments)– k=* (encryption key)– a=* (zero or more session attribute lines)– Zero or more media descriptions

Page 30: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session DescriptionProtocol

Session Description Protocol - SDP(RFC 4566)

● Time description:

– t= (time the session is active)– r=* (zero or more repeat times)–

● Media description: (si existe)

– m= (media name and transport address)– i=* (media title)– c=* (connection information -- optional if included at session level)– b=* (zero or more bandwidth information lines)– k=* (encryption key)– a=* (zero or more media attribute lines)

Page 31: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Session DescriptionProtocol

Session Description Protocol - SDP(RFC 4566)

Ejemplo:

v=0o=jdoe 2890844526 2890842807 IN IP4 10.47.16.5s=SDP Seminari=A Seminar on the session description protocolu=http://www.example.com/seminars/[email protected] (Jane Doe)c=IN IP4 224.2.17.12/127t=2873397496 2873404696a=recvonlym=audio 49170 RTP/AVP 0m=video 51372 RTP/AVP 99a=rtpmap:99 h263­1998/90000

Page 32: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Real TimeProtocol

Real Time Protocol – (RTP)RTP Control Protocol (RTCP)

RFC 3550

“Proporciona servicio de entrega extremo-a-extremo para datos con características de tiempo real, como audio y video interactivo”

● Real-time transport protocol (RTP), para transportar datos con propiedades de tiempo real.

● RTP control protocol (RTCP), para monitorear la calidad del servicio.

Page 33: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Real TimeProtocol

Real Time Protocol (RTP) - RTP Control Protocol (RTCP)RFC 3550

● Provee:

● Identificación de tipo de carga

● Numeración de secuencia

● Marcas de tiempo

● Monitoreo de entrega

● Usualmente sobre UDP:

IPHeader

UDPHeader

Datos (audio, video..)RTPHeader

Page 34: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Real TimeProtocol

Encabezado RTP

    0                   1                   2                   3    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1   +­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+   |V=2|P|X|  CC   |M|     PT      |       sequence number         |   +­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+   |                           timestamp                           |   +­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+   |           synchronization source (SSRC) identifier            |   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+   |            contributing source (CSRC) identifiers             |   |                             ....                              |   +­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+­+

V=VersiónP=PaddingX=ExtensiónCC=Cantidad de CSCRM=MarkerPT=Payload Type (profiles definidos en RFC 3551)

Page 35: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Real TimeProtocol

RTCP

● RTCP intercambia información de control de manera periódica entre los participantes de una sesión:

● Provee feedback sobre la calidad de la distribución de datos. Permite controlar codificaciones adaptables.

● Provee nombres canónicos para las fuentes.

● Todos los participantes envían paquetes RTCP. La tasa a la que se envían es calculada acorde a la cantidad de participantes.

● Opcionalmente conducir información mínima de control de sesión.

Page 36: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Real TimeProtocol

RTCP

● Tipos de paquetes:

● SR, Sender Report: estadísticas de transmisión y recepción de los participantes que son emisores activos.

● RR, Receiver Report: estadísticas de recepción de los participantes que no son emisores activos.

● SDES, Source Description: descripción de emisores, incluyendo CNAME

● BYE: Indica el final de la participación

● APP: Funciones específicas de aplicación

Page 37: Voz sobre IP (VoIP) - labredes.unlu.edu.ar Dual-Rate Speech Coder for Multimedia Communications ... g723 gsm ulaw alaw g726 adpcm slin lpc10 g729 speex speex16 ilbc g726aal2 g722

Próxima: Práctica VoIP

Bibliografía:

Packet Guide to Voice over IP: A system administrator's guide to VoIP technologies. Bruce Hartpence. O'Reilly Media. 2013

Switching to VoIP. Ted Wallingford. O'Reilly Media. 2005

Bibliografía