Overview

Last updated: 2020-07-28 16:58:25

    After a Cloud Load Balancer (CLB) instance is created, you must configure a listener for it. The listener listens to incoming requests to the CLB instance and then routes them to Cloud Virtual Machine (CVM) instances according to the configured load balancing policy.

    You must configure the following items when configuring a listener for a CLB instance:

    1. Listening protocol and listening port. A listening port, also known as a frontend port, is used to receive and route requests to CVM instances.
    2. Listening policies, such as load balancing and session persistence policies.
    3. Health check policies.
    4. CVM instances. Specify the IP address and service port for each CVM instance. A service port, also known as a backend port, is used by a CVM instance to receive and process requests.

    Supported protocol types

    A CLB listener listens to incoming layer-4 and layer-7 requests to a CLB instance and routes them to CVM instances for processing. You can configure a layer-4 or layer-7 listener depending on whether you route requests for load balancing over a layer-4 or layer-7 protocol.

    • Layer-4 protocols: transport layer protocols that receive and route requests to CVM instances by using a virtual IP (VIP) and port.
    • Layer-7 protocols: application layer protocols that route requests based on application layer information such as the URL and HTTP header.

    Tencent Cloud CLB supports request forwarding over the following protocols:

    • TCP (transport layer)
    • UDP (transport layer)
    • TCP SSL (transport layer)
    • HTTP (application layer)
    • HTTPS (application layer)

      Note:

      • The TCP SSL listener feature is currently in beta test. To try it out, please submit a ticket for application.
      • The TCP SSL listener feature is only available to public network CLB but not private network CLB or classic CLB.

    Layer-4 listener

    Protocol Description Scenario
    TCP Connection-oriented and reliable transport layer protocol
  • The source and destination ends must perform a three-way handshake to establish a connection before data can be sent and received between them.
  • Session persistence based on the client IP (source IP) is supported.
  • The client IP can be read at the network layer.
  • The server can directly obtain the client IP.
  • TCP is suitable for scenarios where high transfer reliability and data accuracy are required with a slight compromise on transfer speed. Typical scenarios include file transfer, sending and receiving emails, and remote logins.
    For more information, please see Configuring a TCP Listener.
    UDP Connectionless transport layer protocol
  • The source and destination ends do not establish a connection nor maintain the connection status.
  • Each UDP connection is point-to-point.
  • One-to-one, one-to-many, many-to-one, and many-to-many communication are supported.
  • Session persistence based on the client IP (source IP) is supported.
  • The server can directly obtain the client IP.
  • UDP is suitable for scenarios where a high transfer speed is preferred over accuracy. Typical scenarios include instant messaging and online videos.
    For more information, please see Configuring a UDP Listener.
    TCP SSL Secure TCP protocol
  • TCP SSL listeners support configuring certificates to prevent unauthorized access requests.
  • Unified certificate management is provided for CLB to decrypt certificates.
  • One-way and mutual authentication are supported.
  • The server can directly obtain the client IP.
  • TCP SSL is suitable for scenarios where high security is required for TCP and TCP-based custom protocols are supported.
    For more information, please see Configuring a TCP SSL Listener.

    If you configure a layer-4 listener, the CLB instance establishes a TCP connection with each CVM instance on the listening port and routes requests to CVM instances. During this process, the CLB instance forwards data in passthrough mode in an efficient manner without modifying any data packets.

    Layer-7 listener

    Protocol Description Scenario
    HTTP Application layer protocol
  • Forwarding based on the requested domain name and URL is supported.
  • Cookie-based session persistence is supported.
  • HTTP is suitable for apps that need to identify request content, such as web apps and app services.
    For more information, please see Configuring an HTTP Listener.
    HTTPS Encrypted application layer protocol
  • Forwarding based on the requested domain name and URL is supported.
  • Cookie-based session persistence is supported.
  • Unified certificate management is provided for CLB to decrypt certificates.
  • One-way and mutual authentication are supported.
  • HTTPS is suitable for HTTP apps that require encrypted transmission.
    For more information, please see Configuring an HTTPS Listener.

    Port configuration

    Listening port (frontend port) Service port (backend port) Description
    Through the listening port, a CLB instance receives and routes requests to CVM instances for processing.

    You can configure a listening port on ports 1–65535, such as port 21 (FTP), port 25 (SMTP), port 80 (HTTP), and port 443 (HTTPS).
    Through the service port, a CVM instance receives and processes requests from a CLB instance.

    On a CLB instance, one listening port can route requests to multiple ports of multiple CVM instances.
    Note the following points when configuring a listening port on a CLB instance:
  • You can configure the same listening port for TCP and UDP. For example, listeners `TCP:80` and `UDP:80` can co-exist.
  • You cannot configure the same listening port for protocols of the same type. For example, TCP, TCP SSL, HTTP, and HTTPS are all TCP protocols. You cannot configure listeners `TCP:80` and `HTTP:80` at the same time.

  • On a CLB instance, you can configure the same service port for different CVM instances. You can also bind different listeners, for example, `HTTP:80` and `HTTPS:443` to the same port of a CVM instance.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help