Re: statement regarding keepalives

Tom Herbert <tom@herbertland.com> Fri, 17 August 2018 18:43 UTC

Return-Path: <tom@herbertland.com>
X-Original-To: tsv-area@ietfa.amsl.com
Delivered-To: tsv-area@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3C285130F0E for <tsv-area@ietfa.amsl.com>; Fri, 17 Aug 2018 11:43:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Level:
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, T_DKIMWL_WL_MED=-0.01, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=herbertland-com.20150623.gappssmtp.com
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 eiJUTyujoHfY for <tsv-area@ietfa.amsl.com>; Fri, 17 Aug 2018 11:43:23 -0700 (PDT)
Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D25BE130F69 for <tsv-area@ietf.org>; Fri, 17 Aug 2018 11:43:22 -0700 (PDT)
Received: by mail-qk0-x22f.google.com with SMTP id 89-v6so1554757qkp.2 for <tsv-area@ietf.org>; Fri, 17 Aug 2018 11:43:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xzkoMOwNqd9rUf763eLrq4OjpbjvTz9q+TG2hrFTtFk=; b=N9QVvBhrNn0iaCq11eud9O3mca1hU2nFbwWbvYETatl/VpoFw7LHZAc1ZOTmqTKXjR 88ILn08b4D6BoPsmk8WHnlfo3ZVvc0be3rn0DMjgWY6ssB29+cxk334Qu1H+rwzJSVZz MHcgur/5dQmO5J2vtC+f/GMeCR9dLKY7levDm8aBK6o29wskeaod2O1qx5wU0oEhJc6I ONMTWvH1BoH/5joNXTiIiK2mZruwqzycdvI52LgZDOZoGaLegq8FuhulxkGwTXak3dQc 8JdJ7aM4WuM8ewWUco03q5yppvbQYare8hzSFXfc+E2FRq5Lx74QCIqHTA4A28OA3Coy wPCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xzkoMOwNqd9rUf763eLrq4OjpbjvTz9q+TG2hrFTtFk=; b=rMMiYGOtQyHuIvmL+QsBEXSH4TTOXsAa7CeCxjQzE+xsXyHQ9ey9ccSz92ZVxKhK63 a5QdiM0WwZveRTxV8yAG80Zj9ghWIWkWlRVtRn3YeMk4tceYpndwl+aqvJ/Fhy4XtJgd PzokjZJ3fKEFo/+xihr38cc5RkCQDY9vLrka6uuxLHCxC21kt/+JeM5EO1KgHhF/MDy1 D4WU9rmT13dmHFfTDHo8JdPZSnuupsjBnWR/qbnin1g8bZYPDRxOxyd5Cd+cxIelZUhh esC7eLherBOUQ8hoZhSXfZU6oNuE3ZRhs6avxYgWcBP7zBhZe5Pucfv1olvgwne0S9wG JdkA==
X-Gm-Message-State: AOUpUlEiz1pX2p/gjX7AiAgVeZXkKcfa/IvnFkLmu22Adh0xL902gAOR 1mHgzC6FOea4uNdadL0qKeRDtb99niLXLZsdWIynUXOi
X-Google-Smtp-Source: AA+uWPyVXDLq79Rwd1f9VeP0V1K27ZwAiNPs/FOf/e6Wgdn+VU3rckztK5D16ncg44x06vgi9kHhbVsgiBikEqzIxYQ=
X-Received: by 2002:a37:c946:: with SMTP id q67-v6mr34509826qki.148.1534531401841; Fri, 17 Aug 2018 11:43:21 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:ac8:3304:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 11:43:21 -0700 (PDT)
In-Reply-To: <c9c28764899d10647b7d79e5ab1361fb@strayalpha.com>
References: <D3326DE0-3F31-4045-B945-82B3F417BE4B@juniper.net> <alpine.DEB.2.20.1807201340240.14354@uplift.swm.pp.se> <B50DC954-CBB6-41C5-BE3A-F1DECD6046A5@juniper.net> <717202c9c6c6b3d083bfa4c8a9925e45@strayalpha.com> <6377766E-9A03-41BA-A4D4-8796F46278BD@juniper.net> <20180816221059.GG40887@kduck.kaduk.org> <B3FA514D-4082-4C36-B487-B9B6AB46BF9D@strayalpha.com> <20180816225715.GH40887@kduck.kaduk.org> <A0293639-EC0A-4559-9447-E58CDB8970FC@strayalpha.com> <CALx6S34o1DJ6Nmin23GSNF_o-ddVEHX0_5qMohnxJxmh-BqH9w@mail.gmail.com> <c9c28764899d10647b7d79e5ab1361fb@strayalpha.com>
From: Tom Herbert <tom@herbertland.com>
Date: Fri, 17 Aug 2018 11:43:21 -0700
Message-ID: <CALx6S355YtSkquMmtQ-su=mBqPYdH=17XsChUJLXEURxeY-jEA@mail.gmail.com>
Subject: Re: statement regarding keepalives
To: Joe Touch <touch@strayalpha.com>
Cc: Benjamin Kaduk <kaduk@mit.edu>, netconf-chairs@ietf.org, tls-ads@ietf.org, "tsv-area@ietf.org >> tsv-area@ietf.org" <tsv-area@ietf.org>, tsvwg-ads@tools.ietf.org
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tsv-area/vSKlgzX6gfbpQz5J1z0zG2uxg8I>
X-BeenThere: tsv-area@ietf.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: IETF Transport and Services Area Mailing List <tsv-area.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tsv-area>, <mailto:tsv-area-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tsv-area/>
List-Post: <mailto:tsv-area@ietf.org>
List-Help: <mailto:tsv-area-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tsv-area>, <mailto:tsv-area-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Aug 2018 18:43:25 -0000

On Fri, Aug 17, 2018 at 10:27 AM, Joe Touch <touch@strayalpha.com> wrote:
>
>
>
>
> On 2018-08-17 09:05, Tom Herbert wrote:
>
> On Fri, Aug 17, 2018 at 7:40 AM, Joe Touch <touch@strayalpha.com> wrote:
>
>
> ...
> It's not subtle. There's no way to know whether keepalives at a higher level
> have any desired affect at the lower level at all - except using Wireshark
> to trace the packets sent.
>
> I don't think that's necessarily true. RFC1122 states:
>
> "Keep-alive packets MUST only be sent when no data or acknowledgement
> packets have been received for the connection within an interval."
>
>
>
> That's Sec 4.2.3.6. and it's talking about what TCP does inside TCP.
>
> It's not talking about actions by layers above TCP. For all TCP knows, a
> user might have tried to send data that's been hung up in the OS. There's
> simply no specific way to know that anything above TCP causes TCP to do
> anything per se; even if an upper layer protocol does a TCP_SEND() directly,
> TCP might stall that data because of other things going on.
>
>
> So if an application is performing keepalives by sending and receiving
> keepalive messages over the connection then that is enough to supress
> TCP keepalives.
>
>
>
> That may or may not be true, but it's for TCP to decide for itself. If the
> data isn't getting down to TCP in a way that causes TCP to send data before
> a TCP keepalive timer expires, TCP will - and should - send a keepalive. If
> the data does cause that timer to be reset, then that's for TCP to know.
>
>
> For instance, if the period of application sending
> keepalives on a connection is less then the one for TCP keepalives,
> then there should be no TCP keepalives ever sent on the connection (if
> Wireshark is showing otherwise then that might be a bug in the
> implementation).
>
>
> Consider an app that writes 1GB to TCP every day. If TCP sends that out
> slowly (for whatever reason), it's possible no TCP keepalives will ever be
> sent. An app that thinks it's doing TCP a favor by sending an app keepalive
> every 1.9 hrs (just under the 2 hour default config) would simply be causing
> TCP to do unnecessary work.
>
The purpose of an application keep alive is not to do favors for TCP,
it's to verify the end to end liveness between application end points.
This is at a much higher layer, verifying liveness of the TCP
connection is a side effect.

> However, if that 1GB goes out in 10 seconds, then TCP would have sent its
> own keepalives just fine. It didn't need the app's help.
>
> So the app didn't help at all; at best, it does nothing and at worst it
> hurts.

Consider that someone sets an application keepalive to 35 second
interval and the TCP keepalive timer is 30 seconds. When the
connection goes idle TCP keepalive will fire at thirty seconds, and
five seconds later the application keepalive fires. So every
thirty-five seconds two keepalives are done at two layers. This is not
good as it wastes network resources and power. In this case, the
application keepalive is sufficient and the TCP keepalive shouldn't be
used. This is an example of the problems in running two control loops
at different layers with overlapping functionality, if the
ramifications of doing aren't understood it can lead to undesirable
interactions and behavior.

Tom

>
> Joe
>
>