Re: statement regarding keepalives

Joe Touch <> Fri, 17 August 2018 23:06 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 24538130F43; Fri, 17 Aug 2018 16:06:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.988
X-Spam-Status: No, score=-1.988 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_SPF_PERMERROR=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id znTnsYaxuG0N; Fri, 17 Aug 2018 16:06:11 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 3D789130E02; Fri, 17 Aug 2018 16:06:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;; s=default; h=Message-ID:References:In-Reply-To:Subject:Cc: To:From:Date:Content-Type:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=s5/XUzjiXw3LZ6dBakG1uy4NYsTlFXHYuO7nqSJ7sWs=; b=0wkF7/NyzFBfgs8OrZHGWVIXg UIRlQS4k7pIj7kCMOjpcUlr6c8ObRWASwyhTtEzTx00pZBRtCsB68DuLeDXLT9RfFeeE7/Uof2L8P imKNHLQbK1gD6QP/ophN3Re4Ponf1NotnMfdsPMTVDvxmNyZNwZiV56+Fwm43FPE19HA5TSbMsuWE nlGYxZRzgwZJwRX1DghO6AIYa9vhcgk3L6gpxwk3I1VqNo77bKhxrvMLnOaXhJ084fuALtyUMOIiC MupIt6X1jAKVcrIepm2ptdvYh3PkXhF17lxoEUm3LzII9fveUMBzKqrnD9kQq39yEPv967h6UIymu OwHaOlVkA==;
Received: from [::1] (port=44410 by with esmtpa (Exim 4.91) (envelope-from <>) id 1fqnoi-001b5m-Rv; Fri, 17 Aug 2018 19:06:05 -0400
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="=_58afc36cb3ca70e74cdbd8ef73b02b42"
Date: Fri, 17 Aug 2018 16:06:04 -0700
From: Joe Touch <>
To: Tom Herbert <>
Cc: Benjamin Kaduk <>,,, " >>" <>,
Subject: Re: statement regarding keepalives
In-Reply-To: <>
References: <> <> <> <> <> <> <> <> <> <> <> <> <> <>
Message-ID: <>
User-Agent: Roundcube Webmail/1.3.3
X-OutGoing-Spam-Status: No, score=-1.0
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname -
X-AntiAbuse: Original Domain -
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain -
X-Get-Message-Sender-Via: authenticated_id:
X-From-Rewrite: unmodified, already matched
Archived-At: <>
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: IETF Transport and Services Area Mailing List <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 17 Aug 2018 23:06:13 -0000

On 2018-08-17 14:13, Tom Herbert wrote:

> On Fri, Aug 17, 2018 at 1:31 PM, Joe Touch <> wrote: 
>> If you KNOW that the app keepalive will cause the TCP transmission, sure -
>> but how do you KNOW that? You don't and can't. Even if you write to the TCP
>> socket, all you know when the socket returns is that the data was copied to
>> the kernel. You don't know for sure that you've triggered a TCP packet.
> Actually, you do know that information. Application keepalives are
> request/response messages sent in TCP data. When a response is
> received to keepalive request over the TCP connection that is proof
> that the keepalive was sent.

Yes, but the keepalive itself is a guarantee of nothing. It is the
keepalive ACK that matters. 

> If the application keepalive was sent on
> the socket, and no response is received before the application timer
> expires, then the application declares the the connection dead and
> most likely will just close the socket and try to reconnect. The fact
> that an application keepalive request, or its response, might be stuck
> in a TCP send buffer (e.g. peer rcv window is zero) versus the peer
> host completely disappeared is irrelevant. To the application it's all
> the same, a connection to a peer application has failed and action
> needs to be taken.

In that case it never mattered whether TCP had a keepalive or whether
the app action interacted with that TCP keepalive. 

What mattered was that the app-app communication was maintained. 

Again, this reiterates my point - run keepalives at the layer that
matter to you. Ignore how they affect other layers; they will (and
should) take care of themselves.