SIP (Session Initiation Protocol) is an Internet protocol for transferring signals in Internet telephony. Normally uses UDP port 5060, but also can work over TCP/5060. This protocol and other related things defined in RFC 3261 and are further modified by other RFC. Now we will not discuss this protocol directly but put it into context with domains and DNS.
If you want to make calls to someone over the Internet by using a VoIP (Voice over IP) technology, to identify the recipient are used SIP addresses (SIP URI) in format sip:name@domain. It’s like with e-mail, the address contains a domain that provides the necessary telephone service (this is such provider of telephone services), and a local name, which recognizes the appropriate VoIP server. Domain then contains the necessary DNS records, which are similar to the MX records for e-mails, from which we will know, which server will be used if you want to contact someone from this domain. This makes possible to separate the addresses provided by your VoIP service(during the change of provider it is enough to change DNS record). Specifically, the type of SRV records, which can be used not only for SIP _sip._udp.domain, eventualy _sip._tcp.domain. SRV record type is specified in RFC 2782.
SRV record type
SRV record type contains the following information:
- priority – similarly to the MX records, first connection is established to the server with the lowest priority and only after the impossibility of connection with the is trying next
- weight – record relative weight for records with the same priority
- port number
- target host (domain name)
The above data weight is used to determine how should be the relative load distributed for servers that have the same priority. If eg. The first record weight is 10 and the second recording weight is 90 then will be the second server contacted in approximately 90% of cases, and the other in the rest. The disadvantage of this layout is that it is static data that does not reflect the actual current load of those servers. In addition, this distribution is relative only in one contacting client because it can not know what is the frequency of communication from other clients.
To make it clear, in this example, you would be able to contact someone via SIP protocol on domain nic.cz. If you send the request for subdomain to the DNS server „_sip._udp“ and SRV record type, we get the following response:
;; QUESTION SECTION: ;_sip._udp.nic.cz. IN SRV ;; ANSWER SECTION: _sip._udp.nic.cz. 1800 IN SRV 100 100 5060 sip.nic.cz.
From the responses we will know that we have to contact the SIP server sip.nic.cz to the UDP port 5060. SRV records have many other uses. For example, Microsoft Windows used it to search for domain controllers and use it for other protocols (XMMP, Kerberos, LDAP aj.).