Location SIP Servers –RFC 3261 2006. 5. 24 유비쿼터스 네트워크 연구센터 이 영 석(youngsuk@dcn.ssu.ac.kr)
Contents Introduction Problem of DNS is Needed to Solve DNS Records for SIP Client Usage Server Usage Conclusion
Introduction(1) Location Server in SIP
Introduction(2) Location Server in SIP
Introduction(3) Location and Presence
Introduction(4) SIP Basic Flow
Introduction(5) SIP Basic Flow - Failed
Introduction(6) Load balancing
Problem of DNS is Needed to Solve Determine the available address tuple for SIP server of the next hop Client : Resolve address tuple of the next hop Server : If the primary response has failed Provide a scalability and high availability Scale up through clustering Priority and Weights
Contents Introduction Problem of DNS is Needed to Solve DNS Records for SIP Client Usage Server Usage Conclusion
DNS Records for SIP(1) DNS lookup procedure for SIP
DNS Records for SIP(2) – NAPTR Record(RFC 2915) Format sip:yhkim@dcn.com NAPTR query for dcn.com NAPTR records are returned Rules If SIPS URI, MUST select only “SIPS+D2T” If SIP URI, select “SIPS+D2T” or “SIP+D2D” Flag value Replacement Result Select the Transport Protocol Indexing the SRV Record class type order pref flags service regexp replacement IN NAPTR 70 50 “s” “ftp+I2R” “ ” _ftp._tcp.dcn.com 80 “SIPS+D2T” _sips._tcp.dcn.com 90 “SIP+D2T” _sip._tcp.dcn.com 100 “SIP+D2U” _sip._udp.dcn.com 110 “http+I2R” _http._tcp.dcn.com
DNS Records for SIP(3) – SRV Record(RFC 2782) Format SRV query for _sip._tcp.dcn.com SRV records are returned Result Determine the port of SIP server Provide the Load Balancing Mechanism and Fault Tolerance functions for SIP Server(Proxy Server) class type priority weight port Target (A record) IN SRV 2 10 5060 server3.dcn.com 1 5063 server2.dcn.com
DNS Records for SIP(4) – SRV Record(RFC 2782) SRV Record Load Balancing & Fault Tolerant Mechanism Example Sort Multiple SRV Record based on RFC 2782 The same Priority Arrange in any order, except weight 0 The Running-sum Random number(nRandom) Next Target select (nRandom <= R-sum) Remove the selected RR Until there are no unordered SRV RRs. Repeat for each Priority Address record lookup for the Target in the order class type priority weight port Target (A record) R-Sum IN SRV 2 10 5060 sip3.dcn.com 1 5063 sip2.dcn.com 11 20 5064 sip5.dcn.com 31 100 5061 sip6.dcn.com 131 _sip._tcp.dcn.com
DNS Records for SIP(5) – A Record Format A query for server2.dcn.com A Record are returned server2.dcn.com IN A 220.149.49.78 Result Determine only IP Address for SIP Server Regardless of Service (FTP, SIP, HTTP), target resolution is one
Contents Introduction Problem of DNS is Needed to Solve DNS Records for SIP Client Usage Server Usage Conclusion
Client Usage(1) Procedure NAPTR Record SRV Record A Record Select TARGET Select a Transport Protocol Determine Port and IP Address sip(s):yhkim@host[:port][;transport=xxx] via:SIP/2.0/xxx host[:port][received=host];branch=…… Case by case, DNS Lookup Step by step, DNS Lookup Numeric IP Address Port Transport Protocol DCN Query Yes / Not Using DNS No A Record Lookup SRV Record Lookup NAPTR Record Lookup NAPTR Record SRV Record A Record
Client Usage(2) If the TARGET is a Numeric IP Address Transport If transport protocol is designated in TARGET, the transport protocol is used If not, UDP for SIP URI and TCP for SIPS URI is Default Port If port is designated in TARGET, the port is used 5060 for UDP or TCP, 5061 for TLS is default port IP Address Use the Numeric IP Address designated in TARGET Numeric IP Address Port Transport Protocol DCN Query Yes / Not Using DNS No A Record Lookup SRV Record Lookup NAPTR Record Lookup
Client Usage(3) If a port is provided, but the TARGET is not Numeric IP Address Transport If Transport protocol is designated in TARGET, the transport protocol is used If not, UDP for SIP URI and TCP for SIPS URI is Default Port Use the port designated in TARGET IP Address A record lookup or AAAA record(IPv6) with hostname designated in TARGET Numeric IP Address Port Transport Protocol DCN Query Yes / Not Using DNS No A Record Lookup SRV Record Lookup NAPTR Record Lookup
Client Usage(4) If no Transport protocol and port, not Numeric IP Address Transport If Transport protocol is designated in TARGET pass 1 Attempt to NAPTR Query pass 2 If NAPTR record is failed, SRV Record Lookup pass 3 (_sips._tcp.dcn.com, _sip._tcp(_udp).dcn.com) If SRV Record Lookup is failed, SIP URI(UDP) and SIPS URI(TCP) is Default pass 4 Numeric IP Address Port Transport Protocol DCN Query Yes / Not Using DNS No A Record Lookup SRV Record Lookup NAPTR Record Lookup
Client Usage(4) IP Address Case pass 1: SRV Record Lookup A Record Lookup Case pass 2: Selected NAPTR Record SRV Record A Record Lookup Case pass 3: Selected SRV Record A Record Lookup Case pass 4: TARGET host A Record Lookup Port If SRV Record Lookup is successful, use the port designated in SRV Record If not, 5060 for UDP or TCP, 5061 for TLS is default port Numeric IP Address Port Transport Protocol DCN Query Yes / Not Using DNS No A Record Lookup SRV Record Lookup NAPTR Record Lookup
Client Usage(5) - Consideration for stateless proxies Stateless Proxy: Not keep up transaction state Problem 1 Possible that retransmission go to a different server every time Solution - Not adopt SRV Record Sorting algorithm of RFC 2782 - using any algorithm to be sorted by the same order every time (example : alphabets) Problem 2 Not contacted to the first server successfully, send to the next server, retransmit go to different server if the failed first server recovers between retransmissions Solution - If the first server is not contacted successfully, should act as a stateful proxy.
Contents Introduction Problem of DNS is Needed to Solve DNS Records for SIP Client Usage Server Usage Conclusion
Server Usage Response Mechanism TCP : Sent over the connection the request arrived on UDP : the source IP Address, the port contained in the Via header Problem Response fails “fails”: Any closure of the transport connection or fatal error from the transport layer Solution - examines the value of the sent-by construction in the topmost Via header - A Record Lookup or SRV Record Lookup - It is possible that response sent to a different client - If only Client Group share transaction state, this model is worthy
Conclusion Determine the available transport protocol, port, IP Address for SIP server of the next hop through DNS lookup Provide the load balancing mechanism and fault tolerance functions for SIP server(proxy server) through DNS lookup Requirement UA and Proxy server should have the ability to lookup DNS and analyze DNS RRs Administrator should have the ability To load balancing of SIP Servers through control of DNS Server Record To manage Back-up Server