• No results found

Introduction to SIP

2.6 Transport Protocol Selection

Since SIP supports multiple transport protocols, it must have a way of manag-ing them. The full SIP usage of DNS is defi ned in [10], but the basic steps for a client are listed here. There are two ways that this is acheived. The fi rst is through explicit indications in a SIP URI. The presence of a transport=tcp or

transport=sctp [9] indicates that the particular transport protocol should be used for this URI. Note that for TLS transport, the SIPS URI scheme should be used, although some implementations use the nonstandard transport=tls

parameter. UDP is used if transport=udp is included. When no transport pa-rameter is included, the following rules are followed:

If the URI has a numeric IP address, then UDP should be used for a 1.

SIP URI and TCP for a SIPS URI.

If the URI does not have a numeric address but has a numeric port 2.

number, then UDP should be used for a SIP URI and TCP for a SIPS URI.

If the URI does not have a numeric IP address or port, and NAPTR 3.

DNS queries are supported, then a DNS NAPTR query should be performed on the host part of the URI. The NAPTR service fi elds are

“SIP+D2U” for UDP, “SIP+D2T” for TCP, and “SIP+D2S” for SCTP transport. The result of the NAPTR regex replacement will be a URI, which is used for an SRV lookup described in the next step. The pref-erence fi eld indicates the relative prefpref-erence if multiple transports are supported. If no NAPTR records are returned, an SRV query should be performed.

The SIP usage of DNS SRV records uses “_sip” or “_sips” for the pro-4.

tocol and “_udp”, “_tcp”, and “_sctp” for UDP, TCP, and SCTP trans-ports. The results of the SRV query will be a target hostname and port number. The request should be sent to that address and port. Full de-tails on SRV record usage are in [11].

If no SRV records are found, then an address query for A or an AAAA 5.

DNS query should be performed, and UDP should be used for a SIP URI and TCP for a SIPS URI.

A slightly different set of rules are followed by proxy servers, as described in [10].

For example, consider the DNS lookup performed by Schroedinger in Fig-ure 2.2. The URI is sip:[email protected], which does not contain a numeric IP address or port, so steps 1 and 2 are not followed. Schroedinger then follows step 3 and performs a NAPTR query on munich.de which returns the following record:

munich.de. 360 IN NAPTR 100 50 “s” “SIPS+DTU” “” _sip._udp.munich.de

Since only UDP transport is supported, step 4 results in an SRV query on

_sip._udp.munich.de, which returns the following record:

_sip._udp.munich.de. 300 IN SRV 0 100 5060 proxy.munich.de

Finally, an A lookup is performed on proxy.munich.de which returns:

proxy.munich.de. 3600 IN A 100.101.102.105

As a result, Schroedinger sends the INVITE to 100.101.102.105:5060 as shown in Figure 2.2.

2.7 Conclusion

This chapter introduced the Session Initiation Protocol using some common call fl ow examples including a basic call, call through a proxy server, registration, and presence and instant messaging. The next chapter will explore further the details of SIP and the behavior or standard elements such as user agents, proxies, redirect servers, and registrars.

2.8 Questions

Q2.1 Defi ne a SIP dialog.

Q2.2 What SIP parameter carries the SIP transaction identifi er?

Q2.3 Compare proxy, registrar, and redirect servers.

Introduction to SIP 49

Q2.4 Which SIP methods create dialogs? Which SIP methods end dialogs?

Q2.5 Explain the purpose of the Contact header fi eld in an INVITE.

Q2.6 Is the Content-Length header fi eld mandatory for TCP transport? Why or why not?

Q2.7 What is the purpose of Via header fi elds?

Q2.8 The DNS application Dig has returned the following values. What are the three types of DNS Resource returned? Explain the meaning of each fi eld of the record for _sip._tcp.iptel.org. What IP address and port would a SIP request (Service = sip) be sent to at the

iptel.org domain, assuming TCP transport (Proto=tcp)?

$ dig _sip._tcp.iptel.org in srv

; <<>> DiG 9.3.4 <<>> _sip._tcp.iptel.org in srv

;; global options: printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id:

15807

;; WHEN: Wed Feb 6 09:56:07 2008

;; MSG SIZE rcvd: 248

Q2.9 Explain the difference between the Request-URI and the To URI in a SIP INVITE.

Q2.10 Explain the meaning of each of the parameters in the following

Via header fi eld:

Via: SIP/2.0/SCTP room42.lib.edu:4213 ;branch=z9hG4bK3423;received=13.34.3.1

References

Rosenberg, J., H. Schulzrinne, G. Camarillo, A. Johnston, J. Peterson, R. Sparks, M. [1]

ley, and E. Schooler, “SIP: Session Initiation Protocol,” RFC 3261, June 2002.

Schulzrinne, H., et al., “RTP: A Transport Protocol for Real-Time Applications,” STD 64, [2]

RFC 3550, July 2003.

Handley, M., V. Jacobson, and C. Perkins, “SDP: Session Description Protocol,” RFC [3]

4566, July 2006.

Roach, A., “Session Initiation Protocol (SIP)—Specific Event Notification,” RFC 3265, [4]

June 2002.

Campbell, B., et al., “Session Initiation Protocol (SIP) Extension for Instant Messaging,”

[5]

RFC 3428, December 2002.

Sugano, H., et al., “Presence Information Data Format (PIDF),” RFC 3863, August [6]

2004.

Dierks, T., and C. Allen, “The TLS Protocol Version 1.0,” RFC 2246, January 1999.

[7]

Stewart, R., et al., “Stream Control Transmission Protocol,” RFC 2960, October 2000.

[8]

Rosenberg, J., H. Schulzrinne, and G. Camarillo, “The Stream Control Transmission [9]

tocol (SCTP) as a Transport for the Session Initiation Protocol (SIP),” RFC 4168, October 2005.

Rosenberg, J., and H. Schulzrinne, “SIP: Session Initiation Protocol,” RFC 3263, June [10]

2002.

Gulbrandsen, A., P. Vixie, and L. Esibov, “A DNS RR for Specifying the Location of Services [11]

(DNS SRV),” RFC2782, February 2000.

51

3