Subject: [homenet] Stub-only implementation of Babel

From: Juliusz Chroboczek <[email-masked]>
Date: Mon, 17 Nov 2014 01:23:52 +0100

I'm still not entirely convinced that it's a useful thing to have, but it
was an interesting exercice.  I've put a stub-only implementation of Babel
on

  https://github.com/jech/sbabeld

Almost entirely untested.  IPv6-only.  Linux-only.  Easy to port, and
hopefully reasonably easy to understand.

I've cheated -- sbabeld doesn't speak to the kernel itself, it execs the
"ip" utility instead.  That makes error handling somewhat random, so
please use the full babeld in production.  (On the other hand, this might
be a good basis for integrating a Babel implementation in your code if you
alreay have the code needed to speak to the kernel.)

It's some 900 lines of code (not counting boilerplate), of which 400 are
support functions (wrappers around sockets functions, mostly).  It
compiles to 12 kB of code on AMD64.  It's possible to make it smaller, but
at the cost of clarity.

-- Juliusz

---

From: Michael Richardson <[email-masked]>
Date: Mon, 17 Nov 2014 12:45:27 -0500

Juliusz Chroboczek <[email-masked]> wrote:
    > It's some 900 lines of code (not counting boilerplate), of which 400
    > are support functions (wrappers around sockets functions, mostly).  It
    > compiles to 12 kB of code on AMD64.  It's possible to make it smaller,
    > but at the cost of clarity.

I just wanted to re-interate: 12K. I assume that is with a shared libc, so
you aren't counting that as part of the 12k.

Thank you for doing this.

-- 
Michael Richardson <[email-masked]>, Sandelman Software Works
 -= IPv6 IoT consulting =-

---

From: Dave Taht <[email-masked]>
Date: Mon, 17 Nov 2014 10:09:33 -0800

Statically linked on x86_64 it is 853k. :)

I am now intensely curious if I could get it to compile on a 16 bit
arch with a less bloated libc.

On Mon, Nov 17, 2014 at 9:45 AM, Michael Richardson
<[email-masked]> wrote:
> _______________________________________________
> homenet mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/homenet
>

-- 
Dave Täht

thttp://www.bufferbloat.net/projects/bloat/wiki/Upcoming_Talks

---

From: Steven Barth <[email-masked]>
Date: Mon, 17 Nov 2014 19:12:26 +0100

> Statically linked on x86_64 it is 853k. :)
40KB with musl (CC="musl-gcc -static -Os -s").

---

From: Dave Taht <[email-masked]>
Date: Mon, 17 Nov 2014 10:18:00 -0800

> 40KB with musl (CC="musl-gcc -static -Os -s").

I am not, repeat, not going to pull down the devkit for

http://www.tinyos.net/

And looking at RPL...

as I can easily see losing a week or more to playing with it. :)

-- 
Dave Täht

http://www.bufferbloat.net/projects/bloat/wiki/Upcoming_Talks

---

From: Juliusz Chroboczek <[email-masked]>
Date: Mon, 17 Nov 2014 19:53:12 +0100

> http://www.tinyos.net/

  http://blog.antoine.li/files/2011/09/babel_paper.pdf

I don't think they ever finished their implementation.  (But at least
I got to visit Lucerne.)

-- Juliusz

---

From: Juliusz Chroboczek <[email-masked]>
Date: Sun, 23 Nov 2014 22:53:36 +0100

> sbabeld doesn't speak to the kernel itself, it execs the "ip" utility
> instead.  That makes error handling somewhat random,

Steven has fixed that -- sbabeld's error handling should be reasonably
reliable now.  (And it's also slightly smaller.)

-- Juliusz

---

From: Dave Taht <[email-masked]>
Date: Sun, 23 Nov 2014 20:17:43 -0800

> reliable now.  (And it's also slightly smaller.)

adding

-fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables

shrinks it a bit. However it looks to me as though the disk size of
the object is a misleading indicator.
if you objdump -d it, take the end address and subtract the start,
what appears as 13k on disk,
is actually 7452 bytes in x86_64 assembly bytes. (and eminently
runnable via xip anyway).

Is there any particular 802.14 or 6lowpan device worth fiddling with?

64k of ram 512k of flash seems increasingly doable for babel at least.

Oh, cool, contiki comes with a whole vm with the dev environment ready to go...

http://www.contiki-os.org/start.html

and even better it has simulators for a variety
of interesting arches like the mcp430 with FRAM support....

http://www.contiki-os.org/hardware.html

Are we looking at 32 bit or 16 bit devices? I see a mix here...

And this has usb (I use beaglebones as babel gateways all the time
going from usb to ethernet. Going from usb to 802.14 seems sane)

http://rtn.sssup.it/index.php/hardware/seed-eye

-- 
Dave Täht