[babel] About mandatory bits

Juliusz Chroboczek <jch@irif.fr> Sun, 16 April 2017 00:52 UTC

Return-Path: <jch@irif.fr>
X-Original-To: babel@ietfa.amsl.com
Delivered-To: babel@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 281FF1270FC for <babel@ietfa.amsl.com>; Sat, 15 Apr 2017 17:52:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 kgZlUyBVOMlh for <babel@ietfa.amsl.com>; Sat, 15 Apr 2017 17:52:43 -0700 (PDT)
Received: from korolev.univ-paris7.fr (korolev.univ-paris7.fr [IPv6:2001:660:3301:8000::1:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B39FF1274D2 for <babel@ietf.org>; Sat, 15 Apr 2017 17:52:42 -0700 (PDT)
Received: from potemkin.univ-paris7.fr (potemkin.univ-paris7.fr [IPv6:2001:660:3301:8000::1:1]) by korolev.univ-paris7.fr (8.14.4/8.14.4/relay1/56228) with ESMTP id v3G0qeZl002050 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for <babel@ietf.org>; Sun, 16 Apr 2017 02:52:40 +0200
Received: from mailhub.math.univ-paris-diderot.fr (mailhub.math.univ-paris-diderot.fr [81.194.30.253]) by potemkin.univ-paris7.fr (8.14.4/8.14.4/relay2/56228) with ESMTP id v3G0qeqQ028848 for <babel@ietf.org>; Sun, 16 Apr 2017 02:52:40 +0200
Received: from mailhub.math.univ-paris-diderot.fr (localhost [127.0.0.1]) by mailhub.math.univ-paris-diderot.fr (Postfix) with ESMTP id 41217D79B3 for <babel@ietf.org>; Sun, 16 Apr 2017 02:52:40 +0200 (CEST)
X-Virus-Scanned: amavisd-new at math.univ-paris-diderot.fr
Received: from mailhub.math.univ-paris-diderot.fr ([127.0.0.1]) by mailhub.math.univ-paris-diderot.fr (mailhub.math.univ-paris-diderot.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id u8QUNEwfEc71 for <babel@ietf.org>; Sun, 16 Apr 2017 02:52:39 +0200 (CEST)
Received: from trurl.irif.fr (unknown [78.194.40.74]) (Authenticated sender: jch) by mailhub.math.univ-paris-diderot.fr (Postfix) with ESMTPSA id 252BED79B2 for <babel@ietf.org>; Sun, 16 Apr 2017 02:52:38 +0200 (CEST)
Date: Sun, 16 Apr 2017 02:52:43 +0200
Message-ID: <87pogduqas.wl-jch@irif.fr>
From: Juliusz Chroboczek <jch@irif.fr>
To: babel@ietf.org
User-Agent: Wanderlust/2.15.9
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: text/plain; charset="US-ASCII"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (korolev.univ-paris7.fr [IPv6:2001:660:3301:8000::1:2]); Sun, 16 Apr 2017 02:52:40 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (potemkin.univ-paris7.fr [194.254.61.141]); Sun, 16 Apr 2017 02:52:40 +0200 (CEST)
X-Miltered: at korolev with ID 58F2C058.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)!
X-Miltered: at potemkin with ID 58F2C058.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)!
X-j-chkmail-Enveloppe: 58F2C058.000 from potemkin.univ-paris7.fr/potemkin.univ-paris7.fr/null/potemkin.univ-paris7.fr/<jch@irif.fr>
X-j-chkmail-Enveloppe: 58F2C058.000 from mailhub.math.univ-paris-diderot.fr/mailhub.math.univ-paris-diderot.fr/null/mailhub.math.univ-paris-diderot.fr/<jch@irif.fr>
X-j-chkmail-Score: MSGID : 58F2C058.000 on korolev.univ-paris7.fr : j-chkmail score : . : R=. U=. O=. B=0.000 -> S=0.000
X-j-chkmail-Score: MSGID : 58F2C058.000 on potemkin.univ-paris7.fr : j-chkmail score : . : R=. U=. O=. B=0.000 -> S=0.000
X-j-chkmail-Status: Ham
X-j-chkmail-Status: Ham
Archived-At: <https://mailarchive.ietf.org/arch/msg/babel/P3LWbJFR_63ZdIZuUy7j-d3h39Q>
Subject: [babel] About mandatory bits
X-BeenThere: babel@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "A list for discussion of the Babel Routing Protocol." <babel.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/babel>, <mailto:babel-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/babel/>
List-Post: <mailto:babel@ietf.org>
List-Help: <mailto:babel-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/babel>, <mailto:babel-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 16 Apr 2017 00:52:45 -0000

Dear all,

As some of you have hinted (more or less rudely), there is an alternative
to the AE-based encoding of source-specific and TOS-sensitive routes that
I suggested: adding a mandatory bit to sub-TLVs.  The mandatory bit has
a number of advantages, and a number of cons when compared to the
multiplication of AEs.  Here are my thoughts on the subject -- I'm very
much interested in your opinions.

Encoding
********

The mandatory bit could be encoded as the top-order bit of the sub-TLV
type octet.  The sub-TLV format would then become:

     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |M|     Type    |    Length     |      Value
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

This reduces the sub-TLV type space, but that is not a problem since the
type space is extensible -- if we run out of sub-TLV numbers, 16-bit TLVs
can be encoded in a backwards compatible manner as follows:

     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |M|      127    |   Length + 2  |      Type                     |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Value...
    +-+-+-+-+-+-+-+-+-
    

Semantics
*********

Mandatory and non-mandatory sub-TLVs are allocated separately -- mandatory
sub-TLV 2 does not necessarily have any relation with non-mandatory
sub-TLV 2.  An implementation MUST parse all the sub-TLVs of any TLV it
does not ignore, and if a TLV contains an unknown mandatory sub-TLV, then
the whole TLV MUST be silently ignored.

There's an implementation cost here: every implementation, even if it
doesn't do any extensions, MUST learn to parse all sub-TLVs, and to drop
TLVs that contain unknown mandatory sub-TLVs.


Compatibility
*************

No existing extensions are broken by mandatory bits: since all currently
defined sub-TLVs have small type numbers, they appear as non-mandatory
sub-TLVs, which preserves their semantics.

On the other hand, mandatory sub-TLVs stretch the weak compatibility that
we decided on in London.  Legacy implementations will get confused by
mandatory TLVs, treating them as non-mandatory, and, by mis-interpreting
updates with mandatory TLVs, might create routing loops.  I am not sure
whether this is acceptable at that stage.


Encoding of exciging extensions
*******************************

Mandatory bits allow a very simple encoding of both source-specific and
TOS-specific updates: a source-specific update is just a normal update
with a mandatory source-prefix sub-TLV, while a TOS-specific update just
carries a mandatory TOS sub-TLV.

The extensions combine easily -- just put both mandatory sub-TLVs.


Cost for implementations
************************

All implementations -- even minimal ones such as sbabeld or pybabel --
MUST learn to parse sub-TLVs in order to detect mandatory ones.  This is
an implementation cost, but one that only applies to minimal
implementations, since full-fledged implementations most likely already
know how to parse sub-TLVs.

This implementation cost is not outrageous -- we're speaking of a dozen
lines of C code or so.


Other applications
******************

The Italian mesh communities have requested the ability to tag routes with
opaque tags.  They want to be able to filter routes without configuring
each router with a list of prefixes, e.g. to have all Roman routers
originate routes with a "Roma" tag, and just configure non-Roman routers
to filter out the Roman routes.  Mandatory bits encode this easily.

Mandatory bits on Hello TLVs prevent associating with routers that don't
implement a given extension.  This allows an easy way to perform feature
negotiation, with no new mechanism.


Cultural compatibility
**********************

Mandatory bits are familiar from BGP and OSPF.  That puts people at ease.


Elegance
********

Elegance is in the eye of the beholder, but to my eyes mandatory sub-TLVs
are more elegant than the multiplication of AEs.


Conclusion
**********

Unless I'm missing something, mandatory bits are a simple, elegant and
powerful mechanism that fits well in Babel.  However, they silently break
compatibility in a manner that might or might not be unacceptable to our
user base.

Opinions?

-- Juliusz