Re: [Idr] TCP & BGP: Some don't send terminate BGP when holdtimer expired, because TCP recv window is 0

Enke Chen <enchen@paloaltonetworks.com> Tue, 22 December 2020 04:08 UTC

Return-Path: <enchen@paloaltonetworks.com>
X-Original-To: idr@ietfa.amsl.com
Delivered-To: idr@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E82373A0990 for <idr@ietfa.amsl.com>; Mon, 21 Dec 2020 20:08:25 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.096
X-Spam-Level:
X-Spam-Status: No, score=-2.096 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=paloaltonetworks.com header.b=a2GaEkil; dkim=pass (2048-bit key) header.d=paloaltonetworks-com.20150623.gappssmtp.com header.b=oUJEFz69
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8Gv2El9tEVGa for <idr@ietfa.amsl.com>; Mon, 21 Dec 2020 20:08:24 -0800 (PST)
Received: from mx0b-00169c01.pphosted.com (mx0b-00169c01.pphosted.com [67.231.156.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F26373A0888 for <idr@ietf.org>; Mon, 21 Dec 2020 20:08:23 -0800 (PST)
Received: from pps.filterd (m0048189.ppops.net [127.0.0.1]) by mx0b-00169c01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 0BM448I0004610 for <idr@ietf.org>; Mon, 21 Dec 2020 20:08:23 -0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paloaltonetworks.com; h=mime-version : references : in-reply-to : from : date : message-id : subject : to : cc : content-type; s=PPS12012017; bh=/5+W1uzFDTgErDixzvzg29hlXhv7osGp8tcfLCoPB0o=; b=a2GaEkil6B5RrDlnWCXeNg/BkM3+S9Pj0FdJR7/TpJi9/tISPb6ZOafkPeklmGAf+9sM ZTMfjVw10bTa9ziTvxGCdnv/wPN90dsmJk+cGOXzRtXcqYU1J5qoSZNngN+PyXkXyRZ/ 0L9NSgl3ovWI2hsRz36Yz8Bpmi2C7orI1PIbDmmAf2H5OZlrrhfk6HAVHgc9CBpcjSxH LSS9fgTgA0Q3plR5LByiEQQb06LshC/QwNfcQ4pbhbbAeL1H8lh8792VzKGQXoz4dFhj knzoJtEkzcOJgyQlg1Qa6JuQbEuoEPKQhvm7cx7c4ad2i4R28qUy/C1AdJx6LwR29yqe iw==
Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by mx0b-00169c01.pphosted.com with ESMTP id 35k0csucgr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for <idr@ietf.org>; Mon, 21 Dec 2020 20:08:22 -0800
Received: by mail-lf1-f71.google.com with SMTP id 1so14578737lfb.17 for <idr@ietf.org>; Mon, 21 Dec 2020 20:08:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paloaltonetworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/5+W1uzFDTgErDixzvzg29hlXhv7osGp8tcfLCoPB0o=; b=oUJEFz69eIGUImGHlgbOqOSG9nOk19ioSiHh85VIocGcgDdeFydemIWwnld+LSBL5/ qh+L1+7X96dAUNEq+PPssEmrKpJsL8qy99TKmciitkH1lJys7HA/99VMWYNEVQfPxeNm GoL2tyTDqJtox45ERPTJXUfbmPrN3xS/NLBnCMSUappU5LXP8H7pQ9BlIy5R9kJSYmLz j9aRNJ3chMHvMcC5qUnTEtjv2L33bVgIeyqMWakeR7q+DWNlmmB3W15sRZ/2fnbl3gTG mhhUW2k42qxWOA9wFhJneuTHbRN34phmR7qHvY/BEpB9HRU01MUAQzOWsxIvqxZUsUuk jfpw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/5+W1uzFDTgErDixzvzg29hlXhv7osGp8tcfLCoPB0o=; b=gnAZlOkbFcGQKWYldEEqhb3tneDZQFogQDW3mULJtbled/7EQUetKaVRGH8c9FJ5Fp DiD7E5dlX4o9cf01NjOX+D6cgiAvOQpiSi+O6KrHqg2dlQfUQ1gjM6jZMNS4Ig+wyYEx o4oWhCB+U+eBWm5Ayi2pcoUPcA0+sFTIojc7stjepH3PWwh21FqPp8P1HtnMm+k47VFL FYOSWr2QaCpsDUGnEBwkB6jJW+Rp32SYOIqYz1onyUeRLKmqTJZ99qEts/D++gBDv2G7 lh3MSQkW8wrknpnOV1haUquV/Q3i/s4q8Xy+5/EaeXWnBS2Aw+b86Mlxf2u89JZp9qd9 wuVQ==
X-Gm-Message-State: AOAM531/OmTE61tjcv7fCHjl3U6t+ITec190A/+/BksN/KUfNkr1PQc0 dr2f9wrFdJTZKg75e4WN4IrCxKQLHnDZya8/IYMEkmq0XuRxZOgwPLWXvuaeIgGgKNfF0Wd6QGs CDxdIBkXzj9q/8NEbW1I=
X-Received: by 2002:a05:651c:1341:: with SMTP id j1mr9310883ljb.216.1608610101298; Mon, 21 Dec 2020 20:08:21 -0800 (PST)
X-Google-Smtp-Source: ABdhPJxPlmQ9fXdqGwRuFxbOktgREJkpEk+N7xdOXhytXvjk9FelHCdY47kU1MTOkNgFKW45bRroYi76PfCX/YKzs2I=
X-Received: by 2002:a05:651c:1341:: with SMTP id j1mr9310864ljb.216.1608610100924; Mon, 21 Dec 2020 20:08:20 -0800 (PST)
MIME-Version: 1.0
References: <CANJ8pZ-WMDotkQvhN-NuP7ivZkPRR-9S2KJSar=6463U0VKkow@mail.gmail.com> <EFC56A31-1276-4DAB-9526-9C2F24814D2C@pfrc.org> <CANJ8pZ_LnDna_jtipcLJq9rrS3MM32rLdxRW8ntC2aEi9VvzMg@mail.gmail.com> <722A787A-5B83-4802-A9F4-AB2957BB3305@juniper.net> <CANJ8pZ-qZXMoOfnTnPmZFpqRDqJn+UvO7M2KSqv_VTE-d=9zMg@mail.gmail.com>
In-Reply-To: <CANJ8pZ-qZXMoOfnTnPmZFpqRDqJn+UvO7M2KSqv_VTE-d=9zMg@mail.gmail.com>
From: Enke Chen <enchen@paloaltonetworks.com>
Date: Mon, 21 Dec 2020 20:08:09 -0800
Message-ID: <CANJ8pZ9tv2JjJD=DM+c=V_1CfLC+rjgqYKKLvd8guHHk2qkXTQ@mail.gmail.com>
To: John Scudder <jgs@juniper.net>
Cc: Jeffrey Haas <jhaas@pfrc.org>, "idr@ietf. org" <idr@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000a5ec0705b705b9a5"
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2020-12-22_01:2020-12-21, 2020-12-22 signatures=0
X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 mlxlogscore=999 spamscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 mlxscore=0 adultscore=0 clxscore=1015 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012220028
Archived-At: <https://mailarchive.ietf.org/arch/msg/idr/KGZWbGK2_x-ljOZvNm6bWn0DyT4>
Subject: Re: [Idr] TCP & BGP: Some don't send terminate BGP when holdtimer expired, because TCP recv window is 0
X-BeenThere: idr@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Inter-Domain Routing <idr.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/idr>, <mailto:idr-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/idr/>
List-Post: <mailto:idr@ietf.org>
List-Help: <mailto:idr-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/idr>, <mailto:idr-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 22 Dec 2020 04:08:26 -0000

Correction to 2), it should be:

2)  tcp_probe_timer()
             For zero-window event: when there is buffered data, but no
outstanding un-acked data.

---
The case with outstanding un-acked data would be taken care of by
tcp_retransmit_timer().

Thanks.   -- Enke

On Mon, Dec 21, 2020 at 7:20 PM Enke Chen <enchen@paloaltonetworks.com>
wrote:

> Hi, John:
>
> I checked a recent Linux version (v5.10-rc7-149-g33dc961), and confirmed
> that the per-session USER_TIMEOUT value (icsk->icsk_user_timeout) is
> applied in all these cases:
>
>   1) tcp_retransmit_timer()
>               tcp_write_timeout()
>               tcp_clamp_rto_to_user_timeout()
>
>      2)  tcp_probe_timer()
>              For zero-window event: when there is outstanding un-acked
> data, or buffered data.
>
>      3)  tcp_keepalive_timer()
>
> So it seems that the implementation does provide the desired semantics
> described in RFC 793, but the man page is out-dated.
>
> Thanks.  -- Enke
>
>
> On Fri, Dec 18, 2020 at 2:32 PM John Scudder <jgs@juniper.net> wrote:
>
>> On Dec 18, 2020, at 1:09 PM, Enke Chen <enchen@paloaltonetworks.com>
>> wrote:
>> >
>> > No, I am not assuming that packets are getting somewhere. The
>> TCP_USER_TIMEOUT would work as long as there is "pending data" (either
>> unacked, or locally queued). The data can be from the local BGP Keepalives
>> or the TCP_KEEPALIVE.
>>
>> Apart from the other objections to relying on TCP_USER_TIMEOUT, which I
>> think are sufficient, it’s not clear to me that implementations will
>> provide the desired semantics. RFC 793 seems like it specifies the right
>> semantics (“get this data to the peer within N seconds or close”):
>>
>>         The timeout, if present, permits the caller to set up a timeout
>>         for all data submitted to TCP.  If data is not successfully
>>         delivered to the destination within the timeout period, the TCP
>>         will abort the connection.  The present global default is five
>>         minutes.
>>
>> However the Linux man page documents different semantics:
>>
>>        TCP_USER_TIMEOUT (since Linux 2.6.37)
>>               This option takes an unsigned int as an argument.  When the
>>               value is greater than 0, it specifies the maximum amount of
>>               time in milliseconds that transmitted data may remain
>>               unacknowledged before TCP will forcibly close the
>>               corresponding connection and return ETIMEDOUT to the
>>               application.  If the option value is specified as 0, TCP
>> will
>>               use the system default.
>>
>> The important difference being that whereas 793 implies data written to
>> the socket, the Linux man page says “transmitted” data, which seems like it
>> must mean data TCP has written to the network. These are two very different
>> things! If Linux (or another stack) implements what the man page seems to
>> say, it’s not useful for our purposes.
>>
>> —John
>
>