Re: [tcpm] [EXTERNAL] Re: Linux TCP Stack and Zero Window Probe

Neal Cardwell <ncardwell@google.com> Fri, 23 November 2018 18:51 UTC

Return-Path: <ncardwell@google.com>
X-Original-To: tcpm@ietfa.amsl.com
Delivered-To: tcpm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4ADEF12DD85 for <tcpm@ietfa.amsl.com>; Fri, 23 Nov 2018 10:51:41 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -18.96
X-Spam-Level:
X-Spam-Status: No, score=-18.96 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-1.459, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.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 arUHyAgMuBTy for <tcpm@ietfa.amsl.com>; Fri, 23 Nov 2018 10:51:39 -0800 (PST)
Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) (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 6D6031288EB for <tcpm@ietf.org>; Fri, 23 Nov 2018 10:51:39 -0800 (PST)
Received: by mail-oi1-x22b.google.com with SMTP id x202so10662580oif.13 for <tcpm@ietf.org>; Fri, 23 Nov 2018 10:51:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RCOuvT6c6GRrYSaYOM7gNui/X/HodoRq8RrQ96RWYMw=; b=Mux3VO1H2Sf+Xfgjf+BzAKvFqHaxTUeJ/hvB9XLIkU+UyULwsHLyaTEjbwshkfpeYf xL3HHj62UPK0bt/Q1b/DqSYAqr80FiE937iJCCtkWYP6DQCpFCRR+Ph754/lYesIPUDW /HoAZWboy6D32Eo8TSBJt8ZpGSKvNeiameqP5iB1YIno5h3gi20JzpzjTRLTsJX0Iqgt A9Tv1DkrhZneX0jcq5fj3dboPxEz5iJgJV7wILx/4376HyGl5JcSE5Phh9TRlvOnxdNH HGY7Un/9pv5iwQZxPB5SRCifb0JDznj1BLA/t2/SmEUTE0eoMfLqb4uHZEknCbFXz5r9 rXsg==
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=RCOuvT6c6GRrYSaYOM7gNui/X/HodoRq8RrQ96RWYMw=; b=Y+dBD+XKFwFtEL6IRzOZ+BQQImYf05V5Fv28DTtScYsSfnE+VJSyByLP70k3VlMvWu 8X58i31GfytIfKA6iF2ulh/bd8Yv8G9D+kyYuoaKupi4HJU0rV5No4u9SFm5q35xMUMm fMD4yBGRr/bd9k0yqOvIH1mZP8sDdsKGWvZOraiue/vnyPL9K/xQZ/MMsFLzFDrSeKr0 7BeLn691NcCQ4ELPJtbWQpwMrmxmTIKYNWeMyZfb3YVICfWYK/KuitTHTm52XduT2Kc7 0W+rKKxHd22FY6SPvvdc2ygpn7CP1whIxsT+V3peem5GNg6pK26x9rYjrMQ/5yXbjlOl /1Kg==
X-Gm-Message-State: AGRZ1gIMfYaX+Szlkk7x2lWfaKpwhX9WnNWt4ltaSmfs+jqGI5vaVJGS h0VCYqZQ8GfLskTMD26f7VW/D8Be7aK4HofxwawfyC+lSoRlLg==
X-Google-Smtp-Source: AJdET5ecy6n5T5SucJVlFsOo5OkoQ7I5bJGvNUrUjhXIx3eeWQ0oecbQB0NkNFBNejEn8j1Wv4oOGfzollNJfHTkDAU=
X-Received: by 2002:aca:c43:: with SMTP id i3mr9655775oiy.157.1542999098455; Fri, 23 Nov 2018 10:51:38 -0800 (PST)
MIME-Version: 1.0
References: <246bdcf112bb4ebe875df662e3467ab5@HICGWSMB01.ad.harman.com> <CADVnQym0O1CRBTwvwQbMgisNirXRcX+j87XdoO4UDQKbZ9c+Cg@mail.gmail.com> <1ad46d5108314dadbf913919f2907872@HICGWSMB01.ad.harman.com>
In-Reply-To: <1ad46d5108314dadbf913919f2907872@HICGWSMB01.ad.harman.com>
From: Neal Cardwell <ncardwell@google.com>
Date: Fri, 23 Nov 2018 13:51:21 -0500
Message-ID: <CADVnQynGMyaik+UC3rtpb48ocUtv-yYc+1Eba2r9fXV7joouYQ@mail.gmail.com>
To: Kiruthika.Varadarajan@harman.com
Cc: "tcpm@ietf.org" <tcpm@ietf.org>, John Heffner <johnwheffner@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tcpm/UlBO4jOqrWztVNaQaKpACJ97CSY>
Subject: Re: [tcpm] [EXTERNAL] Re: Linux TCP Stack and Zero Window Probe
X-BeenThere: tcpm@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: TCP Maintenance and Minor Extensions Working Group <tcpm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tcpm>, <mailto:tcpm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tcpm/>
List-Post: <mailto:tcpm@ietf.org>
List-Help: <mailto:tcpm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tcpm>, <mailto:tcpm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 23 Nov 2018 18:51:41 -0000

On Fri, Nov 23, 2018 at 12:33 AM Varadarajan, Kiruthika
<Kiruthika.Varadarajan@harman.com> wrote:
>
> Hi Neal,
>  But RFC spec https://tools.ietf.org/html/rfc793#section-3.7  says after TCP-Zero Window from client, server must send
>  TCP Zero Window Probe,

>From the packet trace it seems like that is what happened.

> Hence in tcp_write_wakeup, tcp_xmit_probe_skb expect mib to be LINUX_MIB_TCPWINPROBE

Yes, indeed. Do you have snapshots of the SNMP counters from the
machine before and after that trace, to show that the wrong counter
was incremented?

>   Are we not violating the spec?

The on-the-wire behavior of the server looks fine to me.

However, if we are looking for spec violations, it looks like the
client is violating the spec by retracting the right edge of the
receive window (from "ack 936571642 win 65535" to "ack 936571643 win
0").

best,
neal

>
> Thanks & Regards
> Kiruthika
>
>
> -----Original Message-----
> From: Neal Cardwell <ncardwell@google.com>
> Sent: Thursday, November 22, 2018 11:52 PM
> To: Varadarajan, Kiruthika <Kiruthika.Varadarajan@harman.com>
> Cc: tcpm@ietf.org; John Heffner <johnwheffner@gmail.com>
> Subject: [EXTERNAL] Re: [tcpm] Linux TCP Stack and Zero Window Probe
>
> Hi,
>
> This is expected. Linux TCP uses the same code to generate keepalive probes and zero window probes. (Note that the comment for
> tcp_write_wakeup() is "Initiate keepalive or window probe from timer"). So, on the wire and divorced from context, the two kinds of packets can look the same.
>
> Given the context in your trace, with the receiver just having advertised a receive window of 0 bytes, and with the probes starting in the range of a plausible RTO, and exponentially backing off, those look like zero window probes to me.
>
> best,
> neal
>
> ps: this is a condensed version of the trace, with tcpdump -ttt relative timestamps:
>
> 00:00:00.025099 cli > srv: S 3878781099:3878781099(0) win 65535
> 00:00:00.000506 srv > cli: S. 936571641:936571641(0) ack 3878781100 win 29200 <mss 1460>
> 00:00:00.012473 cli > srv: . 3878781100:3878781100(0) ack 936571642 win 65535
> 00:00:01.003173 srv > cli: P. 936571642:936571643(1) ack 3878781100 win 29200
> 00:00:00.013407 cli > srv: . 3878781100:3878781100(0) ack 936571643 win 0
> 00:00:01.208250 srv > cli: . 936571642:936571642(0) ack 3878781100 win 29200
> 00:00:00.431995 srv > cli: . 936571642:936571642(0) ack 3878781100 win 29200
> 00:00:00.887970 srv > cli: . 936571642:936571642(0) ack 3878781100 win 29200
> 00:00:01.728002 srv > cli: . 936571642:936571642(0) ack 3878781100 win 29200
>
> On Wed, Nov 21, 2018 at 1:21 PM Varadarajan, Kiruthika <Kiruthika.Varadarajan@harman.com> wrote:
> >
> > Hi Team,
> >
> > I have a question in Zero Window Probe in TCP.
> >
> > If the client sends Zero Window, according to RFC spec is it mandatory for the Linux TCP stack to send Zero Window Probe.
> >
> > In my stack I am not getting Zero Window Probe instead I am getting Keep Alive.
> >
> > I have attached my wireshark traces. Can you please confirm if this is the expected behavior from TCP stack.
> >
> >
> >
> > Thanks & Regards
> >
> > Kiruthika
> >
> >
> >
> > _______________________________________________
> > tcpm mailing list
> > tcpm@ietf.org
> > https://clicktime.symantec.com/a/1/5s9OgpuGADG4-wNayiKCDaOjp4t8xEdNzIn
> > 2m0gIhbI=?d=qwuG2lD1HGyTkT6ITNv2T-IZTsKEDQELHhOKuO35Yk6DwAqCw1_maSu9uJ
> > i0SJ5OoL5hRXxKfFMVVdPrpH7NqZoiA2iC4_sW9S5DS8iXPcFtveFaRZZFaeZljCDHcVjl
> > xGLuxkxQiLkfINXKkyvEqaSjSfeVtRsTfQhI132DIcQK0oBZZDjznRwodB8-1z5IYJc117
> > 0EKN7vW6nIs6Ug8yblmgjnqohW8wj-qHIe60MRPZCTjCKuX75_GBdSeDqbClpyP2Uaczeg
> > V_iBHcfXZ169q2w-y4tw5aTb7k8GZGhL5GXn0fUoJI04PoL6ORc8y9k_WIifEzO2n3Cj5o
> > 6WglDXjpCXY8kutM0uPkzUW3wllvo3A2eUDgh2PcC28FpG8y2DIqRdWzm3iUZe8IWZsF-n
> > fmqH82BLc3gyCOk%3D&u=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2
> > Ftcpm