Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
understanding-SIP.pdf
Скачиваний:
118
Добавлен:
01.03.2016
Размер:
4 Мб
Скачать
☆

Introduction to SIP

47

agent to proxy TCP connection, this is usually not a problem unless the two have many simultaneous dialogs established.

SCTP also supports multihoming, so if one of a pair of load balancing SIP proxies fails, the other can immediately begin receiving the messages without even requiring a DNS or other database lookup. The SIP usage of SCTP is described in [9].

2.6 Transport Protocol Selection

Since SIP supports multiple transport protocols, it must have a way of managing them. The full SIP usage of DNS is defined in [10], but the basic steps for a client are listed here. There are two ways that this is acheived. The first 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 parameter is included, the following rules are followed:

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

2.If the URI does not have a numeric address but has a numeric port number, then UDP should be used for a SIP URI and TCP for a SIPS URI.

3.If the URI does not have a numeric IP address or port, and NAPTR DNS queries are supported, then a DNS NAPTR query should be performed on the host part of the URI. The NAPTR service fields 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 preference field indicates the relative preference if multiple transports are supported. If no NAPTR records are returned, an SRV query should be performed.

4.The SIP usage of DNS SRV records uses “_sip” or “_sips” for the protocol and “_udp”, “_tcp”, and “_sctp” for UDP, TCP, and SCTP transports. 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 details on SRV record usage are in [11].

48

SIP: Understanding the Session Initiation Protocol

5.If no SRV records are found, then an address query for A or an AAAA 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 Figure 2.2. The URI is sip:werner.heisenberg@munich.de, 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 flow 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.8Questions

Q2.1 Define a SIP dialog.

Q2.2 What SIP parameter carries the SIP transaction identifier? 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 field in an INVITE.

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

Q2.7 What is the purpose of Via header fields?

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 field 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

;;flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 5

;;QUESTION SECTION:

;_sip._tcp.iptel.org. IN SRV

;; ANSWER SECTION:

 

 

 

_sip._tcp.iptel.org. 86400 IN

SRV 0 0 15060 sip.

iptel.org.

 

 

 

 

;; AUTHORITY SECTION:

 

 

 

iptel.org.

51797

IN

NS

ns4.mydyndns.org.

iptel.org.

51797

IN

NS

ns5.mydyndns.org.

iptel.org.

51797

IN

NS

ns.iptel.org.

iptel.org.

51797

IN

NS

ns2.mydyndns.org.

iptel.org.

51797

IN

NS

ns3.mydyndns.org.

;; ADDITIONAL SECTION:

 

 

 

sip.iptel.org.

86400 IN

 

A

213.192.59.75

ns2.mydyndns.org.

41406

IN

A

204.13.249.76

ns3.mydyndns.org.

41406

IN

A

208.78.69.76

ns4.mydyndns.org.

41406

IN

A

91.198.22.76

ns5.mydyndns.org.

43021

IN

A

203.62.195.76

;;Query time: 178 msec

;;SERVER: 192.168.0.1#53(192.168.0.1)

;;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.

50

SIP: Understanding the Session Initiation Protocol

Q2.10 Explain the meaning of each of the parameters in the following Via header field:

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

References

[1]Rosenberg, J., H. Schulzrinne, G. Camarillo, A. Johnston, J. Peterson, R. Sparks, M. Handley, and E. Schooler, “SIP: Session Initiation Protocol,” RFC 3261, June 2002.

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

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

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

[5]Campbell, B., et al., “Session Initiation Protocol (SIP) Extension for Instant Messaging,” RFC 3428, December 2002.

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

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

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

[9]Rosenberg, J., H. Schulzrinne, and G. Camarillo, “The Stream Control Transmission Protocol (SCTP) as a Transport for the Session Initiation Protocol (SIP),” RFC 4168, October 2005.

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

[11]Gulbrandsen, A., P. Vixie, and L. Esibov, “A DNS RR for Specifying the Location of Services (DNS SRV),” RFC2782, February 2000.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]