Re: [Idr] Fwd: New Version Notification for draft-spaghetti-idr-bgp-sendholdtimer-05.txt

Jeffrey Haas <jhaas@pfrc.org> Wed, 03 August 2022 17:03 UTC

Return-Path: <jhaas@slice.pfrc.org>
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 5516EC14CF05 for <idr@ietfa.amsl.com>; Wed, 3 Aug 2022 10:03:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.91
X-Spam-Level:
X-Spam-Status: No, score=-6.91 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mpPLQaN9GyyF for <idr@ietfa.amsl.com>; Wed, 3 Aug 2022 10:03:18 -0700 (PDT)
Received: from slice.pfrc.org (slice.pfrc.org [67.207.130.108]) by ietfa.amsl.com (Postfix) with ESMTP id 743D7C14F74A for <idr@ietf.org>; Wed, 3 Aug 2022 10:03:18 -0700 (PDT)
Received: by slice.pfrc.org (Postfix, from userid 1001) id EBA5D1E358; Wed, 3 Aug 2022 13:03:17 -0400 (EDT)
Date: Wed, 03 Aug 2022 13:03:17 -0400
From: Jeffrey Haas <jhaas@pfrc.org>
To: Job Snijders <job=40fastly.com@dmarc.ietf.org>
Cc: Robert Raszuk <robert@raszuk.net>, heasley <heas@shrubbery.net>, "idr@ietf. org" <idr@ietf.org>
Message-ID: <20220803170317.GB16746@pfrc.org>
References: <CAOj+MME7XnW7kDXL4muh4Qp1UvabQ9amUoU0Sn3h2axqKzswzA@mail.gmail.com> <77F3E1F0-486F-47DF-ABE4-EFDB9C2FB6D8@gmail.com> <CAOj+MMGR4f3eLEDZY++1m4Lpo9joG4L9OrWbeF6kREn-9a9onA@mail.gmail.com> <c6e44213-7667-0f67-71a4-634411cd102b@foobar.org> <CAOj+MMFajL6E42WCzC0ZqrfSBZjU-0B=ZzmtvCRPkuMzU8z5QA@mail.gmail.com> <Yun6e5jSb0OYZGAX@shrubbery.net> <CAOj+MMFRJr=cs+5DVOp72BVn_j3NgANwNftyj=jRbdsvPpg-wA@mail.gmail.com> <Yupp6uYxNVsBlL07@snel>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <Yupp6uYxNVsBlL07@snel>
User-Agent: Mutt/1.5.21 (2010-09-15)
Archived-At: <https://mailarchive.ietf.org/arch/msg/idr/UQBfgUhfgVu_3INYbLfElhWLLMc>
Subject: Re: [Idr] Fwd: New Version Notification for draft-spaghetti-idr-bgp-sendholdtimer-05.txt
X-BeenThere: idr@ietf.org
X-Mailman-Version: 2.1.39
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: Wed, 03 Aug 2022 17:03:20 -0000

[Speaking as a BGP implementor.]

On Wed, Aug 03, 2022 at 02:28:26PM +0200, Job Snijders wrote:
> On Wed, Aug 03, 2022 at 11:42:53AM +0200, Robert Raszuk wrote:
> > So I am asking what exactly is the trigger to fire that timer when BGP
> > can not write to a TCP socket ? Is it Error 105: No buffer space
> > available ? Something else ?
> 
> Something else! A POSIX.1 function like send() normally *blocks* if no
> message space is available at the socket to hold the message to be
> transmitted. To prevent blocking the whole process, a developer
> generally will construct async loops using the select(2) or poll(2)
> system calls to determine when it is possible to send more data. As such
> it is fairly straight forward to set up (and reset) a timer event in the
> implementation's BGP FSM that aligns with whether data could be
> transmitted to the peer or not.

The above touches on some of the implementation considerations of this
feature.  It also helps to illustrate that coming up with normative text for
the draft will be challenging.


The underlying conditions we want from my perspective are:
- We have detected we are unable to write further data to the TCP connection
  and have more data to send.  Certainly EWOULDBLOCK would be a common
  example.  How about EAGAIN?  Depends on the stack.  Other conditions such as
  ENOBUFS, EINTR, ENOMEM, ENOSPC lead to questions as to whether this is a
  useful POSIX indication that you can't write vs. you can't write because TCP
  is not progressing.

  Once we figure out we have written and we can't write further (for the
  above vague definition), setting the sendholdtimer would be appropriate.
- That said, if the TCP session starts draining and data starts moving, and
  we become able to write, the timer should be canceled.  
 
  + How does that manifest vs. kevent/select/poll/etc.?

If your stack has the easy ability for the BGP stack to take a peek into the
TCP state and tell that this ties to zero-windowing, great!  It removes an
awful lot of ambiguities for that specific case.

There are a number of other messier edge cases where you're not at a zero
window, but still can't write to the socket.  Basically any case where you
can't write pending data to the socket for the sendholdtimer interval is
probably a Good Enough condition.


-- Jeff