Re: [tcpm] RFC 5925 SNE algorithm concern
juhamatk@gmail.com Thu, 07 May 2020 06:00 UTC
Return-Path: <juhamatk@gmail.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 72F9E3A093D for <tcpm@ietfa.amsl.com>; Wed, 6 May 2020 23:00:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 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, FREEMAIL_FROM=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=gmail.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 cflQLTdAsl13 for <tcpm@ietfa.amsl.com>; Wed, 6 May 2020 23:00:49 -0700 (PDT)
Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (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 040F33A0939 for <tcpm@ietf.org>; Wed, 6 May 2020 23:00:48 -0700 (PDT)
Received: by mail-wr1-x443.google.com with SMTP id s8so4804243wrt.9 for <tcpm@ietf.org>; Wed, 06 May 2020 23:00:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=THxoPjFvHiEJxFyDjs8YXFTmvudobQcwZsFSdbVFrw8=; b=Ev54sW9yfsWZOvSiwC7ArVHbVXQPTVmrxzReGl6wq2M4VOGM7GJs6d7CdauORXr2Yc N8MNlNbQ5A69aMl+mS2TwELVXpE8Qw+w8douAjU/DsWX9anBCfL5wny8xEUZBPaok/BS H3EU+GeYk5yy2V61qzz9UueU31/iVkMsGpTiPCBmiMbT1vcuzhOeqEeiynoyPtyFEMUk eRY+DqBcACh6oiQeK/MNbZ/1te94cPc5uYSsVg4nvVJdphkDvvBctmaihBxxPjxV6tls fIuSrRpRGGZrtzHxGLN/TrdAP9r6UF4JygHTeW6DrSU4i4sDB7a+GAnMoDJ8LuWNdzlF k1tw==
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:content-transfer-encoding; bh=THxoPjFvHiEJxFyDjs8YXFTmvudobQcwZsFSdbVFrw8=; b=X23Q5iV1DNp8HSLSKJW8nZ81E7SkD9ia2+aJ/ig/IQzmOapGZRRtqXvuRqy+++lhz2 ABgjCEN8bsp9ac7DNAUYZt3pqW6ZVE/5EyK4IPxvdT9TCr3kXPsrBAzzHSnJQI6x5CwQ p9yuN43UUsps0PNuuEUjJOvudqeVShwgOy0m1Gg+ULEOxkxs347leGfvA7LN+/1h2rqi Wz4oL0s28YL7E7AW1HNxC8UOpj6xxHvIc3IFDm/p8+S/GJoSzpxgz9M3UeNpxgGc+0CX TEzRrobXPEGrOncjWwFl/nfC1t77jVEvOI5Bdb1smZZpLb2Jq5ANyNenWAFFiU+2Q7rR adJg==
X-Gm-Message-State: AGi0PuZ3IeVbU/oRuga9LOO6479pdCj5hahTQhlBr2FrwZIeLzb2Ivr1 OoSOhn48pbgEnDGVxzemEVTNBGS0NXiQLfjfSejGGIsL
X-Google-Smtp-Source: APiQypLZ9bRsl6alz3a1wjSskYmVD//V8821nAaw6lDVLXRjInU8mB1NI9IK+UxsQHiwRxbX1S88MiApNiNTcTJqCPU=
X-Received: by 2002:adf:9447:: with SMTP id 65mr13730410wrq.331.1588831246431; Wed, 06 May 2020 23:00:46 -0700 (PDT)
MIME-Version: 1.0
References: <CACS3ZpBLAO2=O6Vf2Vx766qAGqmY2yD_yiLag-K7C3sYFjH9hw@mail.gmail.com> <EAE578C4-4C60-429A-9826-821B3075DA08@strayalpha.com> <CACS3ZpCjWb2+-v8MCjRJvMCARZ1YDLAr5HyRUTSTteMefu76qQ@mail.gmail.com> <CACS3ZpC3z-D8C=g90vuz-1n-w4oX8y2vOzJWrhouNqnKeuZ42w@mail.gmail.com> <26C2355F-AAF8-405B-BA38-8E7F50013D27@strayalpha.com> <85AAF68F-DB45-475C-996C-8F99EF66D198@strayalpha.com> <4E2DD376-438F-416E-9D1C-0934F517E2C2@strayalpha.com>
In-Reply-To: <4E2DD376-438F-416E-9D1C-0934F517E2C2@strayalpha.com>
From: juhamatk@gmail.com
Date: Thu, 07 May 2020 09:00:34 +0300
Message-ID: <CACS3ZpBtyt1fKoEN03_PBuBV6K=xYz=6mjo-QzriOS2KQDWwCA@mail.gmail.com>
To: tcpm IETF list <tcpm@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/tcpm/Hd8COLm5-7mqKCdX66KNbGu74n4>
Subject: Re: [tcpm] RFC 5925 SNE algorithm concern
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: Thu, 07 May 2020 06:00:55 -0000
Hello, +1 for below algorithm. The earlier improved algorithm I suggested did not handle middle-range retransmissions correctly, this one does. It also passes other tests I have (which found the original issues). Thank you, -- Juhamatti On Wed, 6 May 2020 at 22:36, Joseph Touch <touch@strayalpha.com> wrote: > > Here’s a full version, with everything including initialization and definitions. > > // compute the distance from x to y assuming they are in the same SNE > #define DIST(x,y) (((x)<(y))?((y)-(x)):((x)-(y))) > #define HALF (0x80000000) // shorthand used in the code below > > // variables, with inits where required > unsigned long RCV_SNE = 0; // high-watermark SNE, init per RFC5925 > int RCV_SNE_FLAG = 1; // set during first half of rollover > unsigned long RCV_PREV_SEQ; // high-watermark SEQ, init by ISN > unsigned long SEG_SEQ; // input - received SEQ > unsigned long SNE; // output - SNE corresponding to received SEQ > > if (SYN == 1) { // SYN or SYN-ACK initialization > RCV_PREV_SEQ = RECV_ISN; > } // after SYN or SYN-ACK > SNE = RCV_SNE; // use current SNE (as default) > if (DIST(SEG_SEQ,RCV_PREV_SEQ) < HALF) { // both in same SNE range? > if ((SEG_SEQ >= HALF) > && (RCV_PREV_SEQ < HALF)) { // jumps fwd over N/2? > RCV_SNE_FLAG = 0; // reset wrap increment flag > } > RCV_PREV_SEQ = MAX(SEG_SEQ,RCV_PREV_SEQ); // move prev forward if needed > } else { // both in diff SNE ranges > if (SEG_SEQ < HALF) { // jumps forward over zero? > RCV_PREV_SEQ = SEG_SEQ; // update prev > if (RCV_SNE_FLAG == 0) {. // first jump over zero? (wrap) > RCV_SNE_FLAG = 1; // set flag so we increment once > RCV_SNE = RCV_SNE + 1; // increment window > SNE = RCV_SNE; // use updated SNE value > } > } else { // jump backward over zero > SNE = RCV_SNE - 1; // use pre-rollover SNE value > } > } > > _______________________________________________ > tcpm mailing list > tcpm@ietf.org > https://www.ietf.org/mailman/listinfo/tcpm
- [tcpm] RFC 5925 SNE algorithm concern juhamatk
- Re: [tcpm] RFC 5925 SNE algorithm concern Joseph Touch
- Re: [tcpm] RFC 5925 SNE algorithm concern juhamatk
- Re: [tcpm] RFC 5925 SNE algorithm concern juhamatk
- Re: [tcpm] RFC 5925 SNE algorithm concern Joseph Touch
- Re: [tcpm] RFC 5925 SNE algorithm concern Joseph Touch
- Re: [tcpm] RFC 5925 SNE algorithm concern Joseph Touch
- Re: [tcpm] RFC 5925 SNE algorithm concern juhamatk