服务ece cwr

由于ac 上一个ssid只能配置一个portal服务器,

为了负载均衡,目前使用dns 解析,没有对某ip进行负载均衡

但是却出现了ece cwr

 

/* RFC3168 : 6.1.1 SYN packets must not have ECT/ECN bits set
 *
 * If we receive a SYN packet with these bits set, it means a
 * network is playing bad games with TOS bits. In order to
 * avoid possible false congestion notifications, we disable
 * TCP ECN negotiation.
 *
 * Exception: tcp_ca wants ECN. This is required for DCTCP
 * congestion control: Linux DCTCP asserts ECT on all packets,
 * including SYN, which is most optimal solution; however,
 * others, such as FreeBSD do not.
 *
 * Exception: At least one of the reserved bits of the TCP header (th->res1) is
 * set, indicating the use of a future TCP extension (such as AccECN). See
 * RFC8311 §4.3 which updates RFC3168 to allow the development of such
 * extensions.
 */
static void tcp_ecn_create_request(struct request_sock *req,
                   const struct sk_buff *skb,
                   const struct sock *listen_sk,
                   const struct dst_entry *dst)
{
    const struct tcphdr *th = tcp_hdr(skb);
    const struct net *net = sock_net(listen_sk);
    bool th_ecn = th->ece && th->cwr;
    bool ect, ecn_ok;
    u32 ecn_ok_dst;

    if (!th_ecn)
        return;

    ect = !INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield);
    ecn_ok_dst = dst_feature(dst, DST_FEATURE_ECN_MASK);
    ecn_ok = net->ipv4.sysctl_tcp_ecn || ecn_ok_dst;

    if (((!ect || th->res1) && ecn_ok) || tcp_ca_needs_ecn(listen_sk) ||
        (ecn_ok_dst & DST_FEATURE_ECN_CA) ||
        tcp_bpf_ca_needs_ecn((struct sock *)req))
        inet_rsk(req)->ecn_ok = 1;
}

 

posted @ 2024-08-12 20:46  codestacklinuxer  阅读(2)  评论(0编辑  收藏  举报