Anycast Elastic IP Address (Anycast EIP) is a service that enhances Internet access to Alibaba Cloud on a global scale. This topic provides a quick start on how to use the Anycast EIP service to improve your Internet connections. The network architecture in the following figure is used as an example.

Background information

A company has applications deployed in the China (Hong Kong) region of Alibaba Cloud. Elastic Compute Service (ECS) instances are specified as backend servers of a Server Load Balancer (SLB) instance. An EIP is associated with the SLB instance. Therefore, the ECS instances can use the EIP to provide services over the Internet. Users in the UK (London) and Singapore (Singapore) regions use the EIP to access the ECS instances. However, because the users are located in different regions, network latency, network jitter, and packet loss frequently occur. The company now plans to associate an Anycast EIP with the SLB instance. This way, users in the access area can use the same public IP address to connect to Alibaba Cloud and access the ECS instances. This improves the quality of Internet connections. The following figure shows the architecture.Anycast EIP architecture 4

Configuration 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 from the Internet.

  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 Billing.
    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 backend server

After you create the Anycast EIP, you must associate the Anycast EIP with a backend server. Then, clients can use the allocated public IP address to access the backend server from the Internet.

  1. Log on to the Anycast EIP console.
  2. On the Anycast Elastic IP Addresses page, find the Anycast EIP that you created, and click Associate 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 backend server with which you want to associate the Anycast EIP. Default value: SLB instance:
    Note This value specifies an internal-facing SLB instance that is deployed in a VPC. Anycast EIPs can be associated with only internal-facing SLB instances that are deployed in VPCs.
    Resource Group Select the resource group to which the SLB instance belongs.
    Region Select the region where the SLB instance is created.

    You can associate an Anycast EIP with a SLB instance that is deployed in the China (Hong Kong), India (Mumbai), UK (London), Malaysia (Kuala Lumpur), US (Silicon Valley), or Singapore (Singapore) region.

    Select the instance to bind Select the SLB instance with which you want to associate the Anycast EIP.
    Notice When you associate an Anycast EIP with an internal-facing SLB instance that is deployed in a VPC, transient connection errors may occur when network traffic traverses within the VPC. Therefore, we recommend that you perform the operation during off-peak hours or switch the workloads to another instance first.
  4. Click OK.

Step 3: Test connectivity

After you complete the preceding operations, you can test the connectivity between a client and the backend server.

Note When you use the Anycast EIP service, the network performance of Internet connections varies based on the quality of the ISP network. In this example, the network latency is tested to evaluate the connectivity between the client and the backend server.
  1. Open the command prompt on a computer in your data center.
  2. Run the following command to test the 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 time that is required to establish a TCP connection. Unit: seconds.
    • time_starttransfer: The start time of the connection. The start time refers to the time from when the client sends a request to when the client receives the first byte from the backend server.
    • time_total: The total connection time. The total connection time refers to the time from when the client sends a request to when the client receives the last byte from the backend server.
    The test result shows that when you use the Anycast EIP service to access a backend server in the China (Hong Kong) region, the network latency is lower.
    Figure 1. Network latency before the Anycast EIP service is used
    Connection before the Anycast EIP service is used
    Figure 2. Network latency after the Anycast EIP service is used
    Connection after the Anycast EIP service is used