tencent cloud

Feedback

Configuring a UDP Listener

Last updated: 2024-10-10 10:39:05
    You can create a UDP listener to a CLB instance to forward UDP requests from the client. UDP is suitable for scenarios that have high requirements for transfer speed but relatively low requirements for accuracy, such as instant messaging and online videos. For UDP listeners, the real server can directly get the real client IP address.

    Restrictions

    Port 4789 of the UDP listener is a system reserved port and unavailable yet.

    Prerequisites

    You have created a CLB instance. For more information, see Creating CLB Instances.

    Directions

    Step 1. Configure a listener

    1. Log in to the CLB console and click Instance management in the left sidebar.
    2. Select your region in the top-left corner of the CLB instance list and click Configure listener in the Operation column of the target instance.
    
    
    3. Under TCP/UDP/TCP SSL/QUIC listener, click Create and configure the UDP listener in the pop-up window.
    3.1 Configure basic parameters
    Parameter
    Description
    Example
    Name
    Listener name.
    test-udp-8000      
    Listening protocol and port
    Listening protocol: In this case, select UDP.
    Listening port: The port used to receive requests and forward them to real servers. The port number ranges from 1 to 65535. Port 4789 is reserved for the system and unavailable yet.
    A listening port must be unique in the same CLB instance.
    UDP:8000
    Balancing method
    CLB supports two scheduling algorithms for UDP listeners: weighted round robin (WRR) and weighted least connections (WLC).
    WRR: Requests are distributed to real servers in sequence based on their weights. This algorithm performs scheduling based on the number of new connections. Servers with higher weights are more likely to be scheduled and servers with the same weight process the same number of connections.
    WLC: Loads of servers are estimated based on the number of active connections to the servers. This algorithm performs scheduling based on server loads and weights. For servers with the same weight, those have less loads are more likely to be scheduled.
    Note: If WLC is selected, the listener does not support session persistence.
    WRR
    Schedule by QUIC ID
    Once this feature is enabled, CLB will schedule client requests by QUIC ID, so requests with the same QUIC Connection ID will be scheduled to the same real server. If a request doesn't have a QUIC Connection ID, it will be downgraded to normal WRR scheduling, i.e., scheduling according to the quadruple (source IP address + destination IP address + source port + destination port).
    Enabled
    3.2 Configure health check
    For more information about health check, see UDP Listener.
    3.3 Configure session persistence
    Parameter
    Description
    Example
    Session persistence
    After session persistence is enabled, a CLB listener will distribute access requests from the same client to the same real server.
    UDP session persistence is implemented based on the client IP address. The access requests from the same IP address are forwarded to the same real server.
    Session persistence can be enabled for WRR scheduling but not WLC scheduling.
    Enabled
    Hold Time
    Session persistence duration.
    Session persistence is terminated if there are no new requests in the connection within the specified duration.
    Value range: 30-3600 seconds
    30 seconds

    Step 2. Bind a real server

    1. On the Listener management page, click the created listener UDP:8000 to view the bound real servers on the right of the listener.
    2. Click Bind, select the target real server, and configure the server port and weight in the pop-up window.
    Note:
    If you set Default port first and then select real servers, the port of every real server is the default port.

    Step 3. Configure a security group (optional)

    You can configure a CLB security group to isolate public network traffic. For more information, see Configuring a CLB Security Group.

    Step 4. Modify or delete a listener (optional)

    If you need to modify or delete a created listener, click the listener on the Listener management page and click
    
    for modification or
    
    for deletion.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support