new routing protocol

Diomidis Spinellis dds at aueb.gr
Tue Aug 19 16:30:24 PDT 2003


Jerry Toung wrote:
> I am in the process of implementing a routing protocol under 5.0.
[...]
> My problem is dealing with debuging and portability. With this raw approach I
> guess I will have to run builkernel and installkernel all the time. How can I
> avoid that? I thought about kernel modules, but I don't know what kind to use
> (SYSCALL_MODULE or DEV_MODULE,etc..) and how about netgraph.? does that make
> sense?

[ I was about to ask why we need another networking protocol, but then
noticed the sender's domain :-) ]

I suggest you first build userland applications that emulate the
kernel's networking behavior that affects your protocol.  Build and test
your protocol in userland on top of that environment, and once you are
happy with it, plug it into the kernel.  You will thus gain:

- a very fast turnaround compile/test time 
- the ability to use better debugging and profiling tools
- the flexibility compile and run your code in the environment you
prefer

You might even want to keep your code buildable under the emulated
environment and the real kernel using suitable stubs or conditional
compilation.

I have used such techniques a number of times; you typically recoup your
initial investment very quickly.

Diomidis - dds at FreeBSD.org - http://www.spinellis.gr


More information about the freebsd-hackers mailing list