Subject: [babel] Mandatory bits and compression

From: Juliusz Chroboczek <[email-masked]>
Date: Sat, 22 Apr 2017 14:19:53 +0200

Hi,

I've received a few worried mails about the interaction of compression and
mandatory bits, please let me describe my thoughts on the subject.

There's a slight contradiction between mandatory bits and compression.  On
the one hand, the effect of mandatory bits is to ignore a subset of TLVs,
a subset that depends on the implementation.  On the other hand, the
compression state must be the same on all implementations, no matter which
TLVs are ignored.  Hence, there are three possibilities:

  1. Deprecate compression.  An implementation MUST NOT send compressed
     TLVs, although of course it MAY implement decompression for
     compatibility with RFC 6126.  An effect is that compression and
     mandatory bits will never appear in the same packet.

  2. Limit compression.  A TLV with a mandatory bit MUST NOT change the
     compression state.

  3. Put compression "below" mandatory bits, in the sense that a TLV does
     change the compression state even if it gets ignored due to
     a mandatory bit.

Now it turns out that (2) is very difficult to specify -- the conditions
that ensure that an Update gets parsed identically no matter which TLVs
get ignored are not easy to write up, so unless somebody has a smart idea,
we're left with (1) and (3).

(3) is surprising at first, but it's actually very easy to implement.  In
order to find the first sub-TLV, you must parse the compressed prefix.  So
what you do is:

  - parse the compressed prefix and update compression state;
  - parse all sub-TLVs;
  - use the prefix or drop it, depending on the mandatory bits.

That's only a slight change from what happens without mandatory bits:

  - parse the compressed prefix and update compression state;
  - parse all sub-TLVs;
  - use the prefix.

Because it's so natural from an implementation point of view, my current
plan is to try to specify (3) precisely, and see how it goes.  However,
I've been known to change my mind before (I used to be strongly opposed to
mandatory bits until last week-end, for one), so please don't hesitate to
tell me if you hold a different opinion.

-- Juliusz

---

From: David Schinazi <[email-masked]>
Date: Mon, 24 Apr 2017 10:27:56 -0700

I agree, option 3 feels natural, powerful, and easy to implement.

David

> On Apr 22, 2017, at 05:19, Juliusz Chroboczek <[email-masked]> wrote:
> 
> Hi,
> 
> _______________________________________________
> babel mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/babel