370 likes | 512 Views
454-319/1: Vo ice over IP. Lecture No. 9 SIP - requests and responses, header fields and extensions. Miroslav Voz ňák VŠB - Technical University of Ostrava Department of Telecommunications Faculty of Electrical Engineering and Computer Science 17. listopadu 15, 708 33 Ostrava – Poruba
E N D
454-319/1: Voice over IP Lecture No.9 SIP - requests and responses, header fields and extensions Miroslav Vozňák VŠB - Technical University of Ostrava Department of Telecommunications Faculty of Electrical Engineering and Computer Science 17. listopadu 15, 708 33 Ostrava – Poruba mailto:miroslav.voznak@vsb.cz http://homel.vsb.cz/~voz29 Miroslav Voznak, lecture on SIP
Methods • INVITE : Establishes a session • ACK : Confirms an INVITE request, „3-way hand-shaking“ • BYE : Ends a established session • CANCEL : Cancels establishing of a session • REGISTER : Communicates user location (host name, IP) • OPTIONS : Communicates information about the capabilities of the calling and receiving SIP phones Miroslav Voznak, lecture on SIP
Methods – extension Miroslav Voznak, lecture on SIP
Responses • 1xx informational responses, such as 180, which means ringing • 200 - 699 final response • 2xx success responses, such as 200 OK • 3xxredirection responses Miroslav Voznak, lecture on SIP
Responses • 4xx request failures • 5xx server errors • 6xxglobal failures Miroslav Voznak, lecture on SIP
Transaction • Transaction • a request and all responses • old type – hash To, From,RURI, CSeq • new – parameter branch in Via • z9hG4bK is beginning of a string branch (new way of transaction determination) Miroslav Voznak, lecture on SIP
Dialog • Dialog • Call-ID, From tag, To tag • CSeq identifies a transaction in dialog Miroslav Voznak, lecture on SIP
Registration Miroslav Voznak, lecture on SIP
Registration • bundling of user URI and device URI (From and Contact) • Expires is a time period of registration (Expires=0 , cancellation) Miroslav Voznak, lecture on SIP
Redirection Miroslav Voznak, lecture on SIP
SIP message Miroslav Voznak, lecture on SIP
Session Description Protocol v=0 o=ja 987504994 987504994 IN IP4 1.2.3.4 s=Hovor 1 c=IN IP4 1.2.3.4 t=3196493794 3196497394 m=audio 10000 RTP/AVP 0 22 a=rtpmap:0aplication/g711 a=rtpmap:22 aplication/g723.1 SDP v = Version number (ignored by SIP)o = Session Origin used by SIPs = Subjectc = Connection Data (IN =internet, IP4 = IPv4, IP Address)t = Time (ignored by SIP)m = Media (type, port, RTP/AVP Profile)a = Attribute (profile, codec, sampling rate) Miroslav Voznak, lecture on SIP
INVITE INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142 (SDP part) the first line contains : • method name: INVITE • Request-URI (next hope is sip:bob@biloxi.com) • SIP version number: SIP/2.0 Miroslav Voznak, lecture on SIP
SIP via INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP proxy.stockholm.se:5060;branch=82.1 Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142 (SDP part) Via field: • insterted records point to the used route, Proxy servers insert next records • response should use the same route as a request • „branch“ enables to detect the loops Miroslav Voznak, lecture on SIP
Dialog (Call-leg) INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142 (SDP part) Dialog – the same information during the same call-leg are in the records: • To , From a Call-ID • To a From – specifies logical addressof endpoints of connection • Call-ID – unique identifier during the dialog Miroslav Voznak, lecture on SIP
CSeq INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142 (SDP part) CSeq • every new request increments CSeq • repeated request has the sameCSeq • all responses regarding the one request has the same CSeq Miroslav Voznak, lecture on SIP
Contact INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142 Contact • contains SIP URI for direct communication, if SIP Proxy doesn’t insertRecord-Routefield than next transctions can be routed directly • field Contact is also stated in response 200 OK Miroslav Voznak, lecture on SIP
Content type, Length INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142 Content-Type describes the type of body (SDP) Content-Length includes the size of content (in bytes), the value “0”means “without content” Miroslav Voznak, lecture on SIP
Max Forwards INVITE sip:bob@biloxi.com SIP/2.0 Via: SIP/2.0/UDP pc33.atlanta.com:5060;branch=z9hG4bK776asdhds Max-Forwards: 30 To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com>;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142 Max-Forwards • decreases with every forwarded request at the Proxy • if its value is 0 than is sent 483 Too ManyHops • stateless Proxy detects a loop by field Max-Forwards Miroslav Voznak, lecture on SIP
INVITE and response 200 OK Miroslav Voznak, lecture on SIP
Tagging • in the case of forking there would be difficult to resolve who answered • UAS adds a „tag“ into the response To: sip:bob@macrosoft.com;tag=a48s • next request contains „tag“ inserted into field To Miroslav Voznak, lecture on SIP
Response routing • the reguests are routed according to Request URI (RURI) • and the responses according to field Via Miroslav Voznak, lecture on SIP
Forkingthe first 200 OK confirmed by ACK the rest obtains 487 Cancelled INVITE Miroslav Voznak, lecture on SIP
Record Routing- Record route field is inserted by SIP Proxy not only into the header of method (request) but into the final response as well- a next transaction is routed via the elements stated in the record route Miroslav Voznak, lecture on SIP
SIP trapezoid- Outbound Proxy has to find a SIP Proxy which is able to serve the request- SIP Proxy serves one or more domains (multidomain Proxy)- destination SIP Proxy can be find via DNS (SRV record in DNS resolves serving SIP Proxy) or by static mapping Miroslav Voznak, lecture on SIP
ENUM- SIP addressing is based on SIP URI- the number (E.164) can be resolved via DNS wherein NAPTR record contains a regular expression which is applied to ENUM query and the result of this operation is SIP URI (or a list of URI’s)- SIP URI contains a “host” (user’s domain), via SRV record is resolved serving SIP Proxy- IP address of SIP proxy is resolved via A record in DNS Miroslav Voznak, lecture on SIP
Call Setup Miroslav Voznak, lecture on SIP
Termination of established session - Bye Miroslav Voznak, lecture on SIP
and establishing session– Cancel- two requests INVITE and CANCEL open two transactions Miroslav Voznak, lecture on SIP
SIP and PSTN Interworking Miroslav Voznak, lecture on SIP
Presence UA gets status and presence information which corresponds to users of server Users are subscribed to user’s presence NOTIFY is sent on an event (a change of the state) SUBCRIBE creates a dialog wherein the NOTIFYis sent on a change of the state Miroslav Voznak, lecture on SIP
Subscribe a Notify Miroslav Voznak, lecture on SIP
Instant Messaging • Method MESSAGEis used for IM • text is in body of message • request Messagedoesn’t create a dialog Miroslav Voznak, lecture on SIP
NAT • Issue: clients behind NATinsert private IP into signaling in SIP fieldsVia, From, ContactandSDP c-line (contact) Miroslav Voznak, lecture on SIP
NAT • Solution: an intervention on application layerALG (Application Layer Gateway), ALG works together with NAT and makes rewriting in application layer Miroslav Voznak, lecture on SIP
NAT support • STUN, TURN, ICE – help on the Client Side (these protocols help to find out public IP) • Session Border Controller (SBC) – help on the Provider Side, clients behind NAT communicate through a border device • SIP Proxy with s Media Relay support (RTP Proxy) in order to ensure signaling and media routing on the same IP Miroslav Voznak, lecture on SIP
Thank you for your attentionmiroslav.voznak@vsb.cz Miroslav Voznak, lecture on SIP