Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
02 Sip2
02 Sip2
SIP
Session Initiation Protocol
Ing. Pierluigi Gallo
2
Introduzione 1/2
Alternativa ad H.323
Flessibile e semplice
Livello applicazione
DHCP, HTTP, HTTPS , SMTP, POP3, IMAP, FTP, SFTP, DNS,
SSH, IRC, SNMP, SIP, RTSP, Rsync, Telnet, HSRP, RTP,
BGP, RIP, IGRP,...
Livello di trasporto
TCP, UDP, SCTP, DCCP ...
Livello di rete
IPv4, IPv6, ICMP, ICMPv6, IGMP, IPsec, OSPF ...
Data link
Ethernet, WiFi, PPP, Token ring, ARP, ATM, FDDI,
LLC, SLIP, WiMAX, HSDPA, MPLS ...
chiamate voce
videoconferenze
instant messaging
presence notification
trasferimento files
giochi online
mobilita’
segnalazione PSTN
INVITE INVITE
UAC UAS UAC UAS
SIP
CHIAMANTE PROXY UAC CHIAMATO
UAS UAC
BYE
Audio/Video Coding
RTP/RTCP
SIP
UDP o TCP (tipicamente su porta 5060)
IP
UA - User Agent
UAC - User Agent Client (per l’invio delle richieste)
UAS - User Agent Server (per ricevere i messaggi ed
inviare le risposte)
Network Server
Proxy
Redirect
user@host
Nome utente Nome Dominio
Oppure Oppure
Numero di telefono Indirizzo IP
Esempi:
nomeutente@191.200.23.46
091234567@unipa.it;user=phone
nomeutente:password@host:port;uri-parameters?headers
Ing. Pierluigi Gallo a.a. 2010/2011
15
Messaggi:
Metodi
Sono composte da:
Metodi
Request URI (Universal Resource Identifier)
Versione del protocollo SIP in uso
I metodi possibili sono:
Invite
Ack
Options
Bye
Cancel
Register
Info
Riga vuota
Richieste
• Permette lo scambio di
informazioni personali lungo
un percorso di segnalazione
• Consente lo scambio di
informazioni di sessioni in
corso
• DTMF
Risposte
Risposte
Sei classi di risposte:
Informational 1XX
Success 2XX
Redirection 3XX
Request Failure 4XX
Server Failure 5XX
Global Failure 6XX
Tutte le risposte eccetto le 1xx sono considerate
final e quindi vanno seguite da ACK
Ing. Pierluigi Gallo a.a. 2010/2011
27
Informational 1XX
Viene inviato quando il server sta contattando il
chiamato e il tempo risulta superiore a 200ms
Trying
Success 2XX
• Indica che la richiesta è stata accettata con
successo
• Esempio: 200 - messaggio di OK
Redirection 3XX
• Vengono passate informazioni riguardo alla nuova
posizione dell’utente cercato
Ing. Pierluigi Gallo a.a. 2010/2011
Request Failure 4XX 28
Richiesta fallita a causa del client
SIP Diagram
A ……. Proxy ……. Proxy ……. B
Invite
100 Trying Invite
100 Trying Invite
180 Ringing
180 Ringing
180 Ringing 200 Ok
200 Ok
200 Ok
Ack
Media Session
Bye
200 Ok
Ing. Pierluigi Gallo a.a. 2010/2011
30
Registrar server
SIP/2.0 200 OK
Via: SIP/2/0/UDP station1.work.com; branch=z9hG4bK123
From: sip:Collins@work.com
Call-ID: 123456@STATION1.WORK.COM
CSEQ: 1 REGISTER
Contact: sip:Collins@station1.work.com
Expires: 3600
Content-Length: 0
Prova a
chiamare lo
stesso utente su
più destinazioni
Il primo che
risponde va a
buon fine, gli altri
vengono chiusi
Consente di specificare:
Chiamante
Chiamato
Percorso
Tipo di messaggio
Ack
Ack
Call Setup
Bye
Bye
100 Trying
200 OK
200 OK
Teardown
Ing. Pierluigi Gallo a.a. 2010/2011
Dettaglio di un pacchetto 40
“Invite”
Transactions
Server transaction
Server transaction
Client transaction
Client transaction
Client transaction
Server transaction
response response response
INVITE transaction
A ……. Proxy ……. Proxy ……. B
Invite
100 Trying Invite
100 Trying Invite
3-way 180 Ringing
handshake 180 Ringing
180 Ringing 200 Ok
200 Ok
200 Ok
Ack
Media Session
Bye
200 Ok
Ing. Pierluigi Gallo a.a. 2010/2011
45
INVITE transaction
Proxy Impersonation
Message Tampering
Session Teardown
Spoofed BYEs
Denial of Service
Malformed packets
REGISTER and INVITE flooding
Registration Hijacking
SIP Security
Registration hijacking
Authenticate originators of requests
Proxy impersonation
Authenticate servers
Message tampering
Secure body and certain headers end-to-
end
Session teardown
Authenticate sender of BYE
Confidentiality so attacker can’t learn To,
From tags
Denial of Service
Authenticate and authorize registrations
Esercitazione
UA, Proxy, Java API e programmazione
Server:
Sip X
SER – Sip Express Router
Asterisk
User Agents:
X-Lite
SoftPhone
Windows Messenger
Dall’RFC 3261:
When receiving a REGISTER request, a
registrar follows these steps:
The registrar inspects the Request-URI to
determine whether it has access to
bindings for the domain identified in the
Request-URI.
The registrar extracts the address-of-record
from the To header field of the request. If
the address-of-record is not valid for the
domain in the Request-URI, the registrar
MUST send a 404 (Not Found) response and
skip the remaining steps.
Dall’RFC 3261:
For all new requests, including any with unknown
methods, an element intending to proxy the request
MUST:
1. Validate the request
2. Preprocess routing information
3. Determine target(s) for the request
4. Forward the request to each target
5. Process all responses
Dall’RFC 3261:
7. Determine the next-hop address, port, and
transport
8. Add a Via header field value
9. Add a Content-Length header field if necessary
10. Forward the new request
11. Set timer C
www.cs.columbia.edu/sip/servers.html
www.fsf.org/software/osip/