Вы находитесь на странице: 1из 11

Overview

• What is VoIP?
• Toll ByPass
Voice over IP - VoIP • RTP
• Control Protocols
• MGCP
SMD151
• H323
Peter.Parnes@ltu.se
• SIP in detail

1/66 2/66

What is Voice over IP Categories of VoIP


• The packetisation and transport of classic • Private and Desktop: Skype, Microsoft Netmeeting,
ohphone, gphone, Asterisk*, Marratech, etc.
public switched telephone system audio
over an IP network. • Enterprise : Small IP phone deployments, IP PBX,
Cisco Callmanager.

• The analog audio stream is encoding in a • ISP/Carrier : Toll Bypass services, VOIP wholesale,
using equipment by vendors such as Cisco, Lucent,
digital format, with possible compression, Avaya, etc.
and encapsulating it in IP for transport
over your LAN/WAN or the public internet • Telco Grade : Local service, Last mile delivery, total
phone services, high dependability and availability.

3/66 4/66

Toll ByPass How does it work?


• VoIP is not a protocol.
• VoIP is a collection of protocols and devices that
allow for the encoding, transport and routing of
audio calls over IP networks.

• PSTN  VoIP  PSTN

• Native VoIP  PSTN

• Native VoIP  Native VoIP


5/66 6/66

1
The Guts RTP
• RTP (Real-Time Transport Protocol) • RTP data packet header
• RTCP (Real-Time Control Protocol)
• RTP is a UDP stream with no intelligence
for QoS or resource reservation
• Contains a packet number for detection of
packet loss and re-sequencing of out of
order packets.
• Unidirectional : two streams in any call

7/66 8/66

RTCP Sender Report RTCP Receiver Report


• Real-time Transfer Control Protocol • Receiver report
Sender Report

9/66 10/66

Control Protocols - SIP Control Protocols – MGCP


• SIP : Session Initiation Protocol.

• SIP is a textual based client/server protocol. This • MGCP : Media Gateway Control Protocol.
makes debugging easy as it’s invite etc
messages are human readable.
INVITE sip:021326001@203.109.130.94:5060;user=phone SIP/2.0 • MGCP is a master/slave protocol where all
Via: SIP/2.0/UDP 10.30.60.20:5060
From: "Mr Anderson" <sip:099639951@10.30.60.20:5060>;tag=1ACC.8D00 the smarts resides in the gateway
To: <sip:021326001@203.109.130.94:5060>;tag=359870F0-16CD
Call-ID: 00C0.95C9.5818.4013.1ACC.8D00@10.30.60.20 controller and not the gateway.
CSeq: 5257 ACK
Content-Length: 0
Max-Forwards: 70
Contact: sip:099639951@10.30.60.20:5060

11/66 12/66

2
Control Protocols – H323 Control Protocols – H323
value H323_UserInformation ::=
{
h323-uu-pdu
{
h323-message-body releaseComplete :
{
protocolIdentifier { 0 0 8 2250 0 4 }
callIdentifier
{
guid '3E940C894E1311D8A33E919F0987C365'H
}
}
h245Tunneling TRUE
}
}

13/66 14/66

H323 H323 Call Setup Version 1


H.323 call setup consisted of:
• Q.931 call signaling (1st TCP connection)
• H.245 capability exchange (2nd TCP connection)
• H.225.0 establish logical channels (3rd TCP
connection)
• Now send RTP...
• Each TCP connection requires a SYN exchange
before data can be sent, plus the usual TCP
timeouts on packet loss.
• Connection setup was excessively slow.

15/66 16/66

H323 Evolution H323 FastStart


• H.323 has evolved so that many of the
original defects have been reduced.
• Unfortunately you still need to implement the
old mechanisms too to be compliant.
• Two new methods of setup:
• H.245 tunneling over the H.225.0 connection.
• H.323v2 FastStart

17/66 18/66

3
Control Protocols Summary
• SIP • What is VoIP?
• MGCP • Toll ByPass
• H323 • RTP
• Skinny : Cisco’s IP phone control protocol • Control Protocols
• H323
• MGCP
• SIP

19/66 20/66

Questions? SIP Overview


• SIP - Introduction
• SIP architecture and philosophy

?
• Methods Used in SIP
• SIP messages & responses
• Security
• Summary
• References
Nishita Vora Pandya
21/66 22/66

SIP is SIP Basic Functionality


• An Application-layer control (signaling) protocol Supports 5 facets of communication:
• creating, modifying and terminating sessions with one or more
participants. • User location: determination of the end system
• Sessions include: to be used for communication;
• Internet multimedia conferences, • User capabilities: determination of the media
• Internet telephone calls and media parameters to be used;
• multimedia distribution.
• User availability: determination of the
• Members in a session can communicate via:
• Multicast
willingness of the called party to engage in
• mesh of unicast relations communications;
• combination of these. • Call setup: "ringing", establishment of call
• Text based parameters at both called and calling party;
• Model similar to HTTP : uses client-server model
• Call handling: including transfer and termination
of calls.
23/66 24/66

4
SIP Functionality (cont.) Development of SIP

• SIP can also initiate multi-party calls • SIP developed by Handley, Schulzrinne, Schooler, and
Rosenberg
using a multipoint control unit (MCU) or - Submitted as Internet-Draft 7/97
fully-meshed interconnection instead of • Assigned RFC 2543 in 3/99
multicast. • Goals: Re-use of & Maximum Interoperability with
existing protocols
• You can try in Marratech…
• Internet telephony gateways that connect • Alternative to ITU’s H.323
Public Switched Telephone Network - H.323 used for IP Telephony since 1994
- Problems: No new services, addressing, features
(PSTN) parties can also use SIP to set up
- Concerns: scalability, extensibility
calls between them.

25/66 26/66

SIP Philosophy SIP Architecture


• Internet Standard • SIP uses client/server architecture
- IETF - http://www.ietf.org • Client - originates message
• Server - responds to or forwards message
• Reuse Internet addressing (URLs, DNS, proxies)
• Elements:
- Utilizes rich Internet feature set
• SIP User Agents (SIP Phones)
• Reuse HTTP coding • SIP Servers (Proxy or Redirect - used to locate SIP
- Text based users or to forward messages.)
• Makes no assumptions about underlying • Can be stateless or stateful

protocol: • SIP Gateways:


- TCP, UDP, X.25, frame, ATM, etc. • To PSTN for telephony interworking

- Support of multicast • To H.323 for IP Telephony interworking

27/66 28/66

SIP Entities – User Agents SIP Entities – Network Servers


• User Agents • Network Servers
• User Agent Client (UAC) • Proxy: Decides next hop and forwards
• Initiates SIP requests request, relays call signaling , operates in a
transactional manner, saves no session state
• User Agent Server (UAS)
• Redirect: Sends address of next hop back to
• Returns SIP responses client, redirects callers to other servers
• Registrar: Accepts REGISTER requests from
clients, maintains users’ whereabouts at a
location server
• Diff. types may be co-located.

29/66 30/66

5
SIP Operation Step 1:SIP Addressing

1. SIP Addressing Uses Internet URLs


• Uniform Resource Identifiers
2. Locating a SIP Server • Supports both Internet and PSTN addresses
3. Sending SIP Requests : SIP • General form is name@domain
• To complete a call, needs to be resolved down to User@Host
Transactions • Examples:
4. SIP Methods sip:peter@parnes.com
sip:J.T. Kirk <kirk@starfleet.gov>
5. SIP Responses
sip:+46-8-50555699@digisip.net;user=phone
6. Subsequent Requests and Responses sip:guest@10.64.1.1

31/66 32/66

Step 2: Locating a SIP server Locating (cont.)

• A caller first locates the appropriate server Client


1. Send the request to the server’s IP address if the host
• When client wants to send a request URI part of request URI is an IP address otherwise
2. Should try to contact a server at the port listed in
client will either send it to request URI. If no port specified then try port 5060
- Locally configured Proxy server 1. Use specified protocol if applicable
2. otherwise use UDP if supported,
- IP address & port corresponding to the 3. if UDP fails or otherwise use TCP
3. Find one or more address of server by querying DNS,
request URI [similar to the one in step 1] • NAPTR, SRV, CNAME, A
• Client must determine IP address, port of 4. Results MAY be cached.
server and the protocol to be used. 5. Capability to interpret ICMP messages must exist

33/66 34/66

Step 3:Send a SIP request Order of Operation

• Once the host part has been resolved to a SIP server, - • Step 1: Caller Issues Initial INVITE Request
client sends 1 / more SIP requests to that server
• receives 1 / more responses from the server. • Step 2: Callee Issues Response
• SIP Request-line (Messages) defined as: • Step 3: Caller Receives Response to Initial
<Method> <SP> Request-URI <SP>SIP-Version
<CRLF> request
(SP=Space, CRLF=Carriage Return and Line Feed) • Step 4: Caller or Callee Generate Subsequent
(Method = “INVITE” | “ACK” | “OPTIONS” | requests
“BYE” | “CANCEL” | “REGISTER”)
• Example: • Step 5: Receive Subsequent Requests
INVITE sip:peter@parnes.com SIP/2.0 • Step 6: BYE to end session
• Step x: CANCEL may be issued

35/66 36/66

6
Simple Example Methods (cont.)
• INVITE: Initiates sessions
- Session description included in message body
INVITE
• Re-INVITEs used to change session state
200 OK
• ACK confirms session establishment, can only
ACK be used with INVITE
• BYE terminates a session (hanging up)
Audio, video, ...
• CANCEL cancels a pending invite
• REGISTER: binds a permanent address to
BYE
current location, may convey user data
• OPTIONS: capability inquiry
200 OK

37/66 38/66

Redirect Example Redirect Example

INVITE
200 OK



REGISTER
INVITE
302 Redirect
200 OK

39/66 40/66

Relaying a Call Relay Example

41/66 42/66

7
Relay and Topology Hiding SIP Negotiation
• Optimistic Call

43/66 44/66

SIP Negotiation Multi-register Example


• Pessimistic Call
REGISTER

REGISTER

45/66 46/66

Proxy Server Example Redirect Server Example

47/66 48/66

8
SIP Responses SIP Responses (cont.)

• 1xy – Informational
• SIP Responses defined as (HTTP-style):
request received , continuing to process request
SIP-Version SP Status-Code SP Reason-Phrase • 2xy – Success
CRLF action successfully recvd., understood & accepted
(SP=Space, CRLF=Carriage Return and Line Feed) • 3xy – Redirection
Further action to be taken to complete the request
• Example: • 4xy – Client error
SIP/2.0 404 Not Found request contains syntax error or cant be completed at this
server
• First digit gives Class of response • 5xy – Server error
server fails to fulfill an apparently valid request
• 6xy – global failure,
request is invalid at any server

49/66 50/66

Step 4 Generate Subsequent Requests SIP Requests Example


• Once the call has been established Required Headers (fields):
• either the caller or callee may generate INVITE or BYE
requests to change or terminate the call. INVITE sip:picard@wcom.com SIP/2.0
Via: SIP/2.0/UDP host.wcom.com:5060
• For the desired call leg the headers are set as From: Alan Johnston <sip:alan.johnston@wcom.com>
follows (both including any tags): To: Jean Luc Picard <sip:picard@wcom.com>
- the To header field is set to the remote address, Call-ID: 314159@host.wcom.com
CSeq: 1 INVITE
and
- the From header field is set to the local address. • Via: Shows route taken by request.
• The Contact header field may be different than the • Call-ID: unique identifier generated by client.
Contact header field sent in a previous response or • CSeq: Command Sequence number
request. • generated by client
• The Request-URI may be set to the value of the Contact
• Incremented for each successive request
header field received in a previous request or response
from the remote party, or to the value of the remote
address. [supports mobility]
51/66 52/66

Via Field in Header Via Headers and Routing

• The Request headers include a Via field • Via headers are used for routing SIP messages
• The Via field indicates the path taken by the request • Requests
• Request initiator puts address in Via header
so far.
• Servers check Via with sender’s address, then add own address,
• Every proxy adds a Via Header with its address then forward. (if different, add “received” parameter)
to make sure that responses within a transaction • Responses
• Response initiator copies request Via headers.
take the same path (to avoid loops, or to make
• Servers check Via with own address, then forward to next Via
sure that same firewall will be hit on the way address
back) • All Via headers are copied from request to response in
• This prevents request looping and ensures replies order
take the same path as the requests, which assists in • Response is sent to address in top Via header
firewall traversal and other unusual routing situations.

53/66 54/66

9
Via Header (cont.) VIA Example

55/66 56/66

Via Example Response Step 5 Receiving Subsequent Requests

• Subsequent to receipt, the following checks are made:


1. If the Call-ID is new,
- the request is for a new call, regardless of the values
of the To and From header fields.
2. If the Call-ID exists,
- the request is for an existing call.
- If the To, From, Call-ID, and CSeq values exactly match (including
tags) those of any requests received previously,
- the request is a retransmission.
3. If there was no match to the previous step,
- To & From fields compared against existing call leg local and
remote addresses.
- If there is a match, & the CSeq in the request > last CSeq
received on that leg,
- the request is a new transaction for an existing call leg.

57/66 58/66

Reliability Authentication & Encryption


• If UDP is used: • SIP supports a variety of approaches:
-SIP client should retransmit a BYE, CANCEL, • end to end encryption
OPTIONS, or REGISTER request, exponential backoff, • hop by hop encryption
starting at a T1 second interval, doubling the interval for • Proxies can require authentication:
each packet, and capping off at a T2 second interval.
• Responds to INVITEs with 407 Proxy-
Authentication Required
-Retransmit a INVITE request with an interval that starts • Client INVITEs again with Proxy-Authorization
at T1 seconds, exponential back off, cease header.
retransmissions if a provisional or definitive response
recvd., or once it has sent a total of 7 request packets • Stacked!!
• SIP Users can require authentication:
• Clients using TCP do not need to retransmit requests • Responds to INVITEs with 401 Unauthorized
• Client INVITEs with Authorization header

59/66 60/66

10
Features and Benefits Features and Benefits(cont.)
Feature Benefits Feature Benefit
Internet SIP-based systems can take advantage of the
Distributed -De-centralized intelligence permits more
Enabled growth of the Internet. Translating gateways functionality functionality within each component.
permit SIP-based systems to contact parties on
-- Changes made to specific components have a
the Public Switched Telephone Network minor impact on the rest of the system. It is
(PSTN) without being encumbered by its legacy possible to connect one SIP phone to another
standards. with an Ethernet cable & make calls between the
Scalability Architecture permits inexpensive scaling. H/W sets without the aid of any other server modules.
& S/W requirements for adding new users to - The other system components become useful
SIP-based systems is greatly reduced. when the network requires more than two
phones.
Simplicity SIP stack is smaller. SIP can be considered as
a simple toolkit that enables smart endpoints,
gateways, processes & clients to be built and
implemented 61/66 62/66

SIP vs. H323 SIP Summary

• H.323 uses TCP for setup • SIP is:


• UDP gives better timing control • Relatively easy to implement
• UDP is critical for very large proxies that wish to be • Gaining vendor and carrier acceptance
stateless. • Very flexible in service creation
• H.323 uses ASN.1 Packed Encoding Rules • Extensible and scaleable
• For a long time only one company sold an ASN.1 • Appearing in products right now
compiler that could compile H.323's ASN.1 • SIP provides its own reliability mechanism & is
• SIP uses an HTTP-like syntax. therefore independent of the packet layer and
• Much easier to write and to debug. only requires an unreliable datagram service
• Much experience with HTTP

63/66 64/66

But … Questions?
• SIP is not:
•Going to make PSTN inter-working easy

?
•Going to solve all IP Telephony issues (QoS)
• Secure !?

• SIP is still evolving and being extended as


technology matures and SIP products are
socialized in the marketplace.
• Newer RFCs: #3261 through #3265

65/66 66/66

11

Вам также может понравиться