[homenet] T.M.S. proudly presents - Babel: the 2nd implementation

Markus Stenberg <markus.stenberg@iki.fi> Thu, 26 March 2015 14:38 UTC

Return-Path: <markus.stenberg@iki.fi>
X-Original-To: homenet@ietfa.amsl.com
Delivered-To: homenet@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6B8331A00DC for <homenet@ietfa.amsl.com>; Thu, 26 Mar 2015 07:38:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.778
X-Spam-Level:
X-Spam-Status: No, score=0.778 tagged_above=-999 required=5 tests=[BAYES_40=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_NEUTRAL=0.779] autolearn=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 U29F1eN-2CIl for <homenet@ietfa.amsl.com>; Thu, 26 Mar 2015 07:38:41 -0700 (PDT)
Received: from jenni2.inet.fi (mta-out1.inet.fi [62.71.2.195]) by ietfa.amsl.com (Postfix) with ESMTP id 11D6D1A020B for <homenet@ietf.org>; Thu, 26 Mar 2015 07:38:41 -0700 (PDT)
Received: from [192.168.43.129] (80.220.64.126) by jenni2.inet.fi (8.5.142.08) (authenticated as stenma-47) id 5511FF5D0036D156; Thu, 26 Mar 2015 16:38:39 +0200
From: Markus Stenberg <markus.stenberg@iki.fi>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Date: Thu, 26 Mar 2015 09:38:35 -0500
Message-Id: <F19A1551-2B63-4E45-9018-EDF6619D2DAF@iki.fi>
To: "homenet@ietf.org Group" <homenet@ietf.org>
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\))
X-Mailer: Apple Mail (2.2070.6)
Archived-At: <http://mailarchive.ietf.org/arch/msg/homenet/O5CtnkEt_2LiJ3nWDDdH0Bm6vKI>
Cc: Markus Stenberg <markus.stenberg@iki.fi>
Subject: [homenet] T.M.S. proudly presents - Babel: the 2nd implementation
X-BeenThere: homenet@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <homenet.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/homenet>, <mailto:homenet-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/homenet/>
List-Post: <mailto:homenet@ietf.org>
List-Help: <mailto:homenet-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/homenet>, <mailto:homenet-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 26 Mar 2015 14:38:43 -0000

On Tuesday, there was much whining about single Babel implementation. Luckily T.M.S.[1] to the rescue - ~15 hours after start, routes synchronized unidirectionally, and after fixing bug or two this morning they go both ways, loop-free, etc. So I would argue I have implemented RFC6126 (aka Babel).

Proof (with some github timestamps for amusement from commits): https://github.com/fingon/pybabel

Numbers:

mstenber@kosame ~/work/pybabel>ohcount pybabel/*.py babeld.py
Examining 3 file(s)

                          Ohloh Line Count Summary

Language          Files       Code    Comment  Comment %      Blank      Total
----------------  -----  ---------  ---------  ---------  ---------  ---------
python                3        766        112      12.8%         79        957
----------------  -----  ---------  ---------  ---------  ---------  ---------
Total                 3        766        112      12.8%         79        957

(+ some more in unit tests)

8430 byte flash footprint on a router (given Python 3.4 interpreter, + some rounding up for blocksize of course)

Caveats:

- I implemented it like ‘zeroconf IS-IS’ works, that is, without useful cost function. It fully interoperates with more comprehensive implemenations though.
- Linux only to deal with FIB (system interface for dealing with routes is ‘ip’ command from iproute2); core developed on OS X
- IPv6 only (who wants legacy IP?)
- No source routing (I am sure it would maybe add 100 LoC or so)
- officially Python 3.4+ required (likely any Python 3+ variant works, sub-3 probably would need some work)

Disclaimer:

- if you plan to use this for production use, don’t, unless you test it for yourself sufficiently; however, it _does_ work

- pull requests welcome as long as footprint does not increase much

- bucketloads of money to implement more features are welcome too.. *smirk*

Cheers,

-Markus

[1] My personal consulting company; I have been unable to find funding for weird hacks, I do not know why.