All Products
Search
Document Center

Principle

Last Updated: Sep 14, 2018

After you have activated a GTM instance, the system automatically allocates a CNAME record for this instance. When using GTM to route traffic, you must direct your service domain to the CNAME record of the GTM instance, for example:

    1. After you activate a GTM instance at www.example.com, the system automatically allocates a CNAME access domain name record gtm12345678.gtm-000.com for you.
    1. For the GTM instance gtm12345678.gtm-000.com, add three server IP addresses 1.1.1.1,2.2.2.2,3.3.3.3 and configure the health check.
    1. Change the CNAME of www.example.com to gtm12345678.gtm-000.com.

Schematic diagram

Schematic diagram

    1. The terminal queries the application service domain name www.example.com at a local recursive DNS server.
    1. The local recursive DNS server has not cached the IP address of www.example.com, and sends a DNS request to the DNS root server. The DNS root server responds the address of the .com DNS server to the local recursive DNS server according to the suffix of the domain name queried.
    1. After receiving the address, the local recursive DNS server sends a DNS request to query the IP address of www.example.com to the .com DNS server. After receiving the request, the .com DNS server returns the address of the DNS server where example.com resides to the local recursive DNS server. If Alibaba Cloud DNS is enabled for the domain name, the DNS server is the Alibaba Cloud DNS server.
    1. After receiving the Alibaba Cloud DNS server address responded by the .com DNS server, the local recursive DNS server initiates a www.example.com query request again to the Alibaba Cloud DNS server. After receiving the query request, the Alibaba Cloud DNS server finds in its library that www.example.com is directed to the domain name gtm12345678.gtm-000.com through CNAME, and then responds gtm12345678.gtm-000.com to the local recursive DNS server.
    1. After receiving the gtm12345678.gtm-000.com domain name, the local recursive DNS server initiates a gtm12345678.gtm-000.com query request to the GTM DNS server. After receiving the request, the GTM DNS server responds the final IP address of the application service to the local recursive DNS server based on the running mechanism and preset policy.
    1. The local recursive DNS server uses the IP address obtained through the last query request as the final address of www.example.com, returns it to the end user, and caches it at the memory for subsequent query.
    1. After receiving the IP address responded by the local recursive DNS server, the end user uses it to directly initiate a network connection to the application service to start business communication.

The running mechanism of GTM is described in detail in the product architecture.

Product architecture

Product architecture

The GTM architecture is shown in the above figure.

    1. The DNS resolves the service domain into the IP addresses in two address pools: A and B. Users in Mainland China are directed to Pool A while users outside Mainland China are directed to Pool B. Pool C is a backup address pool.
    1. The health check module initiates health detection for multiple application service IP addresses in the address pools from different regions. Health detection can be performed based on the ping, TCP, or HTTP(S) protocol.
    1. When an application service address in Pool A has a fault, the health check module accurately detects the exception and interacts with the DNS module. The DNS module deletes the abnormal IP address from the application service IP address list returned to the user.
    1. If both Pool A and Pool B crash at a time point, GTM switches the user access traffic to the backup address pool (Pool C) according to the preset Failover policy.
    1. In this way, the optimal application service is automatically provided for the end user through GTM to avoid interruption of user access.