IMG 1010 - Feature - DNS Query using SRV Record

The IMG supports utilizing an A-Record, SRV or Service Record, or both to specify which sip server to route a call to. The determination of which record to use is configured in the object. DNS Queries on SRV records will be described below. SRV Records are defined in RFC 2782 and identifies the server(s) that will support a particular service. In this case the IMG will be looking for the best way to route a call to a server which employs the sip service. An IMG Channel Group can be configured so that a query is sent to a DNS server and the DNS response would be an SRV record including all the sip servers that match the initial DNS service request. From the SRV Record the IMG will handle load balancing from the priority/weight of each server using Random number method. The final result will be that the IMG will send the outbound INVITE message to the server with highest priority/weight and attempt to connect to that SIP server. If however after a few Re-INVITES the initial SIP Server cannot be reached, the IMG will then send an outbound INVITE to the SIP server with the next highest priority/weight. This will continue until all responses in the dns query has been exhausted at which time the call will fail. The IMG supports up to five DNS responses in each SRV Record.

Benefits:

The flexibility of the SRV record is not to have to assign a specific IP address to the INVITE and be able to route calls to different gateways by simply editing the DNS database. Other benefits would include flexibility on port numbers and priority.

Configuration:

Below are instructions on how to configure the IMG to route a call on an SRV Record. The procedure assumes that all initial steps such as Logical/Physical IMG, spans, profiles, Network Interfaces, etc have been configured. Once all initial steps such as spans, interfaces,translations, internal routing, IP and Bearer Profiles, etc the IMG can be configured to accept SRV records. Follow steps below:

Configure External Gateways:

  • Right Click on Dialogic IMG EMS object and select New External Network Elements.

  • Right Click on External Network Elements object and select New External Gateways.

  • Right Click on External Gateways object and select New External Gateway. Below is screen capture on how to configure it. Use the screen capture and the field

Name- Enter a name into the 'Name' field

Gateway Signaling Protocol- Select SIP from drop down menu in the Gateway Signaling Protocol field.

Gateway Address Type- Select Gateway host name from drop down menu.

Gateway IP Address- Enter the IP addess of the gateway.

Gateway Mask- Leave this field as 255.255.255.255

Gateway Host Name- Enter the external gateway name as a service identifier with the (_) in the prefix. See example below. By entering the Gateway Host Name in the format below, it will trigger the IMG to send the query to the DNS server.

SRV Record = _<service>._<protocol>.<domainname>

Gateway Transport Type - Select the transport type from the drop down menu. Transport type should be the same transport type that is displayed in the Gateway Host Name field.

Gateway Remote Port - Enter the port number that the inbound calls from the remote gateway will be coming from.

Gateway Registration Required (SIP Only) - This field tells IMG whether it must register with the gateway. Applies to SIP gateways only.

Registration Expiration Interval (sec) (SIP Only) - Use this field to control the registration refresh interval. Applies to SIP gateways only. Default = 3600 seconds, Range = 10-7200 seconds

SIP Profile - Select which SIP profile from the drop down menu which displays all SIP Profiles created.

Options Keep Alive - Use this field to enable the SIP Options Keep Alive (Busy Out) feature on a gateway. See External Gateway link.

Configure multiple gateways using the _sip._udp.jsmith.dialogic.com format in the Gateway Hostname field. For example: The 1st Gateway Host Name is _sip._udp.jsmith.dialogic.com the second gateway could be _sip._udp.jsmith1.dialogic.com and third gateway could be _sip._udp.jsmith2.dialogic.com and so on.

Configure Channel Groups:

  • Right Click on Dialogic IMG EMS object in object tree and select New Routing Configuration. See IMG 1010 - Routing Configuration Object link for more info.

  • Right Click on Routing Configuration Object just created and select New Channel Groups. See IMG 1010 - Channel Groups Link for more info.

  • Right Click on the Channel Groups Object just created and select New Channel Group. Verify that Signaling Type is SIP. See IMG 1010 - Channel Group Link for more information on how to configure Channel Groups. 

  • Right Click on the Channel Group created and select New IP Network Element and select which gateway will be associated with this Channel Group. See screen capture below

  • You can create multiple channel groups as needed and select a different IP Network Elements for each. As long as the Gateway Host Name field in the External Gateway of the IP Network Element selected is of the format _<service>._<protocol>.<Domainname> this channel group will initiate a DNS lookup with that format. For Example: A DNS Query formatted as _sip._udp.jsmith.dialogic.com would be sent to the DNS server if Channel Group named DNS_Config from above is being used.

Example:

Below is diagram and explanation of how the IMG would route a call if an SRV record was being utilized. Follow diagram below.

 

  • A Call comes into Channel Group SIP_CallerA. Through the use of routing tables and translation tables the call is then routed to Channel Group SIP_SRV_RR.

  • Internal to the IMG, the call gets to Channel Group SIP_SRV_RR. Channel Group SIP_SRV_RR is configured with an external IP Network Element as described in the configuration above. That External IP Network Element (Gateway) has a Gateway Host Name in the following format:

 _<service>._<transport type>.domain name = _sip._udp.jsmith.dialogic.com (See Ext. Gateway capture above.)  

  • Once the IMG sees the Gateway Host Name in this format it knows to send the Gateway Host Name to a DNS Server which handles SRV resource records. In this example _sip._udp.jsmith.dialogic.com was sent to DNS server.

  • The DNS server looks into its Database for all the A-Records associated with this Gateway Hostname and sends them down to the IMG in an SRV Record format. Below are all the records that were found in this example:

Answers:

_sip._udp.jsmith.dialogic.com: type SRV, class IN, priority 10, weight 5, port 5060, target jsmith.dialogic.com

_sip._udp.jsmith1.dialogic.com: type SRV, class IN, priority 5, weight 250, port 5060, target jsmith1.dialogic.com

Additional Records:

jsmith1.dialogic.com: type A class IN, addr 10.10.10.10

jsmith.dialogic.com: type A class IN, addr 10.10.10.11

Once the IMG gets the SRV record in the DNS response the weights and priorities are assessed. The IMG will select the A-Record within the SRV Record that satisfies the Priority/Weight/Random Number Method and return the hostname (target) with the highest priority. (Highest Priority meaning a priority of 1 is higher than a priority of 10, a priority of 500 is higher than a priority of 1000). See information below on how the priority/weight/random number is assessed.

Note: If priorities of the two responses are equal then the weight parameter will be assessed. The IMG will use load balancing method to determine which result to use.

  • From the example above, after calculating the Priorities/Weights/Random Number method, the target host jsmith1.dialogic.com has a higher priority than jsmith.dialogic.com. In this instance, the call will first be sent to jsmith1.dialogic.com. If for some reason jsmith1.dialogic.com cannot be reached the IMG will then try and connect with SIP server that had the second highest priority. This will continue until all SIP Server entries in the DNS SRV Record have been exhausted.

  • Along with the hostnames jsmith.dialogic.com and jsmith1.dialogic.com the DNS server also sends any IP addresses configured as displayed above. This is done in the case where the hostname is not configured on the far end gateway.

  • The call is then routed to the gateway as shown in diagram above.

Load Balancing:

The IMG supports Load Balancing responses from a DNS request. The load balancing is built into the IMG and does not need to be configured. The load balancing technique used on the IMG is a priority/weight/Random Number technique which follows RFC 2782. Below explains the load balancing technique used on the IMG.

The IMG receives a call with the hostname _sip._udp_jsmith.dialogic.com. This triggers the IMG to initiate a DNS request to a DNS Server. The DNS server returns a response to the request. The response is displayed below as an unsorted list

SRV Record (Unsorted List):

Hostname:

Port:

Priority

Weight

jsmith1

5100

10

25

jsmith2

5300

10

50

jsmith6

5600

100

50

jsmith3

5200

10

25

jsmith5

5500

100

50

 The IMG accepts the list and does an initial sort which is done by priority. See table below

Hostname:

Port:

Priority

Weight

jsmith1

5100

10

25

jsmith2

5300

10

50

jsmith3

5600

10

25

jsmith5

5200

100

50

jsmith6

5500

100

50

For entries with same priority, create a separate list with weight 0 first in this list.

Hostname:

Port:

Priority

Weight

jsmith1

5100

10

25

jsmith2

5300

10

50

jsmith3

5600

10

25

The weights are added with the previous weight sum. The first weight does not have a previous record so weight for previous record is 0.

Hostname:

Port:

Priority

Weight

Sum (Weight + Prior weight sum)

Random Number Range

jsmith1

5100

10

25

25 + 0 = 25

0 - 25

jsmith2

5300

10

50

25 + 50 = 75

26 - 75

jsmith3

5600

10

25

75 + 25 = 100

76 - 100

At this point a random number is generated. In this example 45 was selected as the random number. Based on the Random Number Range from the previous table, jsmith2 would be the first SIP server selected. From here, if first SIP server is not reachable, another random number is generated and that would set the priority of the second SIP server. This would continue until all servers have been selected/exhausted.

Additional Information:

  • If an underscore (_) is in the prefix of the Gateway Host Name, the application will associate the hostname with a service instead of an address and a DNS query will be sent.

  • SRV record lookups are now available on a 302 Redirect Record Route.

    • DNS requests are now configurable from the DNS Servers pane. Below are rules to each selection from drop down menu.  

When A-Record is selected in DNS Servers pane, all DNS requests for that server will be A-Queries

When SRV type is selected in DNS Servers pane, all DNS requests for that server will be SRV-Queries

When Mixed Type is selected in DNS Servers Pane, DNS queries are based on hostname value. SRV Records are sent when hostname format begins with underscore (_). A-Record query is used otherwise.

  • When receiving multiple responses in the SRV records in the DNS response, the weight and priority fields are accessed for each SRV record. From here the Random Number Method is used to select the priority of which SIP server to send call to first.

  • IMG will store a maximum of 5 SRV record results per query.

  • The port number received in the SRV record will be provided to sip server. The SRV record will override any port numbers configured on each gateway.

  • The SRV target is to be used during SIP PDU encoding (Protocol Data Unit Logging), not the service name.

  • SIP is to handle a failure to resolve a service query in the same way as an existing query. A 480 response will be returned to the initiating gateway

  • CDR's are not affected by this feature. The resolved hostname will be used in the CDR record.

  • If an outbound proxy is enabled for an external gateway that uses a Service Name, the SRV query is resolved prior to determining the proxy parameters during a call. A SRV query will execute only on an external gateway and will not be executed on an outbound proxy hostname.

  • If user wants to assign an SRV record name to another IMG the user must create an external gateway equivalent to the IMG and select it from drop down list in the external network element object created under the SIP channel group.

Related Topics:

IMG 1010 - Fully Qualified Domain Name Support

IMG 1010 - DNS Client

IMG 1010 - DNS Server

IMG 1010 - Configuring DNS for SIP

Return to Documentation Home I Return to Sangoma Support