Re: [Bier] (Carsten) Benjamin Kaduk's Discuss on draft-ietf-bier-te-arch-10: (with DISCUSS and COMMENT)

Toerless Eckert <> Fri, 28 January 2022 17:04 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 39AB43A0863; Fri, 28 Jan 2022 09:04:33 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -0.869
X-Spam-Status: No, score=-0.869 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id LSTY4OU9Nc3e; Fri, 28 Jan 2022 09:04:29 -0800 (PST)
Received: from ( [IPv6:2001:638:a000:4134::ffff:40]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 06C033A084D; Fri, 28 Jan 2022 09:04:28 -0800 (PST)
Received: from ( []) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by (Postfix) with ESMTPS id CC74058C4B2; Fri, 28 Jan 2022 18:04:21 +0100 (CET)
Received: by (Postfix, from userid 10463) id C8AB54EA4BD; Fri, 28 Jan 2022 18:04:21 +0100 (CET)
Date: Fri, 28 Jan 2022 18:04:21 +0100
From: Toerless Eckert <>
To: Carsten Bormann <>
Cc:, The IESG <>,,, Alvaro Retana <>,, Benjamin Kaduk <>
Message-ID: <>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <>
Archived-At: <>
Subject: Re: [Bier] (Carsten) Benjamin Kaduk's Discuss on draft-ietf-bier-te-arch-10: (with DISCUSS and COMMENT)
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "\"Bit Indexed Explicit Replication discussion list\"" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 28 Jan 2022 17:04:33 -0000

Hi Carsten,

Thanks for the suggestion Detail replies below inline.

Changes for for just your feedback are together in the commit for Ben Kaduks feedback:

Full diff from -11 to -12:


On Wed, Dec 22, 2021 at 07:11:07PM +0100, Carsten Bormann wrote:
> On 2021-08-26, at 08:59, Benjamin Kaduk via Datatracker <> wrote:
> > 
> > pseudocode in Figure 6
> I’m sorry, I’m not an expert about BIER-TE, so take the below with a grain of salt.
> I ran into the pseudocode in a discussion we had about including pseudocode in an RFC.
> The code I find is “almost C”; I don’t understand why you didn’t go the last mile so you can check what you did.

The goal of pseudocode is to compress code down to the algorithmically
important part and avoid cluttering up an RFC with all the uninteresting
syntactic decorations of existing programming languages,
such as variable definitions. 

The check you mention would only be a syntax check, so without a lot more
comprehensive C-level PoC implementation, there would be IMHO no useful
functional checking. Admittedly, a C-level PoC implementation would be nice, but
not IMHO to be printed in the RFC itself. Unless we had some standard
reference library of a virtual router with send/receive packet functions
or the like, so we could stick to just new code... Certainly interesting
line of thoughts to think more about though.

Proof in point: the "~" operator that i put into the wrong one of two lines
would have only been found by actual PoC code running, not by syntax check.

To give an IMHO stronger argument against trying to limit onesself
to just C:

Check out the pseudo code in our follow-up work, draft-eckert-bier-cgm2-rbs,
section 5. For that code i am declaring that the pseudo code uses bit instead
of byte accurate pointer address calculations and dereferncing. Simple to
declare for pseudo-code and resulting in IMHO easy to read pseudocode. Now try to
convert it into C, and you end up in a Shift&Mask nightmare or another
layer of bitstring processing library code you'd first have to explain.

> An indicator that gives away the code might have problems is the different spacing for
>        SI=GetPacketSI(Packet);
>        Offset=SI*BitStringLength;
> (no spaces around operators) vs. much, but not all, of the rest.

I tried to minimize the amount of new pseudocode ideas i introduced, so
i simply cloned the style from RFC8279, section 6.5, which introduced
this inconsistency.

But agree, no need for this inconsistency, so i inserted spaces
in the new (second) pseudocode, but keeping the dense formatting in
the first pseudocode copied from rfc8279 for easier comparison.

> But more importantly, what does this pseudocode mean:
>            foreach adjacency BIFT[Index+Offset] {
> Is there an “in” missing?
> I learn from the explanation that the code "loops over the adjacencies because there may be more than one adjacency for a bit”, so maybe there is a mapping from a bit position (not the bit itself, which is 1 or 0) to a list of adjacencies?

Right. That is pseudocode i made up because i did not want the syntactic
C-overhead of array start/end syntax. I used perl syntax, but i guess nobody remembers 
that language.

I changed it to bash/python "for adjacency in BIFT[Index+Offset] and added "->Adjacencies"
to make it clearer what object we're looping over.

<t>BIFT entries may contain more than one adjacency in support of specific configurations such as <xref target="hubnspoke"/>. The code therefore includes a for loop over these adjacencies.</t>

> What is the difference between commas inside and outside the {}?
>                    case forward_routed({VRF},l3-neighbor):
>                        SendToL3(PacketCopy,{VRF,}l3-neighbor);

Typo on first second line. Fixed. Thanks.

You do score one point for a syntax checker here. Except that
it is really nice to be able to make up simple syntax as we go
(and admittedly, as long as it is easily understood by readers!).

> These are questions that an implementer who is tasked to look at this pseudocode will have in all likelihood, so I would expect that the WG wants this clarified.

Definitely. Thanks for the feedback. Hope the fixes make the pseudocode
still short but unambiguous to read.


> Grüße, Carsten