Anycast elastic IP addresses (EIPs) serve as fixed entry points for users across the globe to access resources on Alibaba Cloud. This topic provides a quick start guide on how to improve user experience when accessing Alibaba Cloud by using Anycast EIPs.

Background information

A company has deployed applications on Alibaba Cloud in the Singapore (Singapore) region. The applications are hosted on Elastic Compute Service (ECS) instances that are connected to an internal-facing Classic Load Balancer (CLB) instance in a virtual private cloud (VPC). An EIP is associated with the CLB instance. The ECS instances use the EIP to provide Internet-facing services. Users in the UK (London) and China (Hong Kong) regions use the EIP to access the ECS instances over the Internet. However, due to the high network latency of Internet connections, network jitters and packet loss frequently occur. To reduce network latency, the company wants to associate an Anycast EIP with the CLB instance. Then, users in the access point locations of the Anycast EIP can use the same public IP address to access the ECS instances through the nearest access point. This reduces the network latency and improves user experience. The following figure shows the network architecture. Network architecture with Anycast EIPs used 4

Procedure

Quick start

Step 1: Create an Anycast EIP

To use the Anycast EIP service, you must create an Anycast EIP. After you create an Anycast EIP, the system automatically allocates a public IP address to the Anycast EIP. You can use the public IP address to access services on Alibaba Cloud.

  1. Log on to the Anycast EIP console.
  2. On the Anycast Elastic IP Addresses page, click Create Anycast EIP.
  3. On the buy page, set the following parameters.
    Parameter Description
    Region Select the area from which you want to access the Internet. Default value: Outside Mainland China.
    Instance Spec Select the specification of the Anycast EIP. Default value: Standard.
    Billing Method Select a billing method. Default value: Pay-By-Data-Transfer. For more information about the billing of Anycast EIP, see Overview.
    Name Enter a name for the Anycast EIP.

    The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.

    Quantity The number of the Anycast EIP instance.
  4. Click Activate Now.

Step 2: Associate the Anycast EIP with a CLB instance

After you create an Anycast EIP, you must associate the Anycast EIP with a CLB instance. Then, clients can use the Anycast EIP to access the CLB instance.

  1. Log on to the Anycast EIP console.
  2. On the Anycast Elastic IP Addresses page, find the Anycast EIP that you want to manage and click Bind in the Actions column.
  3. Set the parameters on the Bind Anycast EIP to a Resource page.
    Quick start-Bind Anycast EIP to a Resource
    Parameter Description
    Instance Type Select the type of cloud resource with which you want to associate the Anycast EIP. Default value: SLB Instance.
    Note The associated instance must be an internal-facing CLB instance that is deployed in a VPC. Anycast EIPs can be associated only with internal-facing CLB instances that are deployed in VPCs.
    Resource Group Select the resource group to which the CLB instance belongs.
    Region Select the region where the CLB instance is deployed.

    You can associate an Anycast EIP with a Classic Load Balancer (CLB) instance that is deployed in the Singapore (Singapore) or Germany (Frankfurt) region.

    Select the instance to bind Select the CLB instance with which you want to associate the Anycast EIP.
    Notice When you associate an Anycast EIP with an internal-facing CLB instance that is deployed in a VPC, your service may be temporarily interrupted. We recommend that you associate the Anycast EIP with the CLB instance during off-peak hours or switch your workloads to another CLB instance first.
  4. Click OK.

Step 3: Verify network connectivity

After you complete the preceding steps, you can verify the connectivity between the client and a backend server of the CLB instance.

Note The network conditions depend on the network of your ISP. In this example, the network latency is tested to evaluate the network condition between the client and a backend server of the CLB instance.
  1. Open the command prompt on your computer.
  2. Run the following command to test network latency:
    curl -o /dev/null -s -w "time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" "The IP address that you want to access"
    where:
    • time_connect: the connection time. The connection time refers to the amount of time that is consumed to establish a TCP connection. Unit: seconds.
    • time_starttransfer: the start time of data transfer. The start time refers to the amount of time from when the client sends a request to the backend server to when the first byte is sent to the client. Unit: seconds.
    • time_total: the total connection time. The total connection time refers to the amount of time from when the client sends a request to when the client receives the last byte from the backend server. Unit: seconds.
    The result shows that when you use an Anycast EIP to access a backend server in the Singapore (Singapore) region, the network latency is reduced. Network latency when an Anycast EIP is used