Topology-Based GSLB Algorithm


Starting with Avi Vantage release 18.2.3, a topology-based algorithm is supported for GSLB, in addition to the other algorithms as mentioned below:

  • Round robin
  • Consistent Hash
  • Geo

Topology-based load balancing distributes DNS name resolution requests using the topology policies that are configured at DNS virtual service level. This is an extension to the Geo load balancing algorithm and works in a similar fashion. Using the topology-based algorithm, GSLB services can be excluded from the regular DNS policy execution.

A DNS virtual service now has an option to configure topology policies (similar to DNS policies). These policies are triggered for the services which are configured with the topology-based GSLB algorithm. For other algorithms, the topology policies are not consulted.

Use Case

The topology-based algorithm is used in a deployment where there are hundreds of GSLB services deployed across various tenants. The requirement is to use round robin algorithm for a few GSLB services and for others you need to define preferred site based on the client’s IP address, Geo Location, etc.

Prior to Avi Vantage 18.2.3, the above requirement is achieved using string groups. String groups are part of DNS policies to specify the GSLB services FQDN name. Using string groups, DNS policies are triggered to call out the preferred site. This approach is feasible for smaller environments, but not for the huge deployment.

For multiple GSLB services, using string groups is not feasible if you have the tenant-based access restriction where tenant users cannot modify DNS policies. This privilege to modify DNS policy is required to add the GSLB service’s FQDN in the string group.

The limitations mentioned above can be solved using the topology-based GSLB algorithm.

For this use case, a few GSLB services are configured with round robin method and the remaining services are configured with the topology-based algorithm. The topology policies are triggered only for the GSLB service that has topology-based algorithm as GSLB method. Using this method, there is no overhead of configuring string groups or making a change to DNS virtual service every time a new GSLB service is added in any tenant.


  • Topology policy consists of the same match targets and actions as that of DNS Policy. It is recommended to use the preferred site or the fallback site action for topology-based policies.

  • For non-topology-based algorithms, the topology policies are not considered.

  • A topology policy is applicable to all the GSLB services using topology-based GSLB algorithm. If the requirement is to have different topology policy for different GSLB services, then string groups for FQDNs are used.

  • If the action configured for the topology policy fails, for example, if the configured preferred site does not exist anymore, then Avi GSLB falls back to Geolocation algorithm. If Geolocation fails , then Avi GSLB falls back to round robin.

  • If a DNS virtual service has both the policies associated with it (DNS and Topology policies), then both the policies are triggered. The policies are triggered in the following order depending on the action configured within the policies:

    • If the DNS policy is configured to drop the request or send error response, then this takes precedence over the topology policy.

    • If the DNS policy has action configured as the site-selection, then the topology policy decision overrides the DNS policy.

It is recommended to configure drop or respond policies in the DNS policy and preferred or fallback site-selection policies in the topology policy.


Configuring Topology Algorithm using Avi UI

Starting with Avi Vantage release 18.2.3, Avi UI has the Topology Policy option to use when the GSLB algorithm is set as Topology. Use the following steps to configure the topology-based GSLB algorithm for selecting pool members. The configuration is divided into the following main points:

  • Associating a topology policy with the virtual service
  • Setting the GSLB algorithm for the GSLB Service as Topology
  1. Login to Avi UI and navigate to Applications > Virtual Services. Select the desired virtual services and click on the edit option.


  2. Navigate to the Policies > Topology Policy tab as shown below.


  3. Create a new topology policy by clicking on the plus icon as shown below.


  4. Provide the desired name, match criteria, and actions for the new rule. Once all the fields are configured, click on Submit.


  5. Navigate to Applications > GSLB Services and select the required GSLB service.


  6. Select the edit options available for the pool in the GSLB pools section as shown below.


  7. Select Topology from the drop-down available for the Pool Members Load Balancing Algorithm field.


Configuring Topology Algorithm using Avi CLI

  1. Login to the Avi CLI shell prompt and configure the topology policy with the required rules and action.

     [admin-cntrl]: configure dnspolicy <dnspolicy name>
     name          Name of the DNS Policy
     rule          (submode)
     save          Save and exit the current submode
  2. Configure or edit the virtual service and associate the topology policy created in the previous step.

     [admin-cntrl: configure virtualservice <virtual service name>
     [admin-cntrl:  virtualservice>  topology_policies dns_policy_ref foo
     [admin-cntrl:  virtualservice> :  save
  3. Configure GSLB service and set algorithm as gslb_algorithm_topology.

    [admin:ctlr-1]: > configure gslbservice gs1
    [admin:ctlr-1]: gslbservice> groups index 1
    [admin:ctlr-1]: gslbservice:groups> algorithm gslb_algorithm_topology
    [admin:ctlr-1]: gslbservice:groups> save
    [admin:ctlr-1]: gslbservice> save

Additional Information