netdev
[Top] [All Lists]

Re: Network protocols as modules

To: Andy <andy@xxxxxx>
Subject: Re: Network protocols as modules
From: Stefan Schlott <stefan.schlott@xxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Jun 2000 08:22:07 +0200
Cc: netdev@xxxxxxxxxxx
In-reply-to: <3958BED5.43FE6C27@xxxxxx>; from andy@xxxxxx on Tue, Jun 27, 2000 at 10:48:53AM -0400
References: <3958BED5.43FE6C27@xxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
User-agent: Mutt/1.2i
Hello Andy,

I think separating the basic protocols (icmp/igmp, tcp, udp) from the
ip module is not a good idea.

> Cleaner code
> Better maintainability
True. That would certainly be an advantage.

> Better extensibility
Even with tcp, ... included in the ip module, you can write new network
protocols as separate modules.

> Modularity
> Smaller initial kernel
Well... who would want ip without tcp or udp? :-)
icmp will be mandatory anyway, because otherwise you would break the
ip functionality (think of "no route to host", "packet too big", ...
error messages)

> Higher efficiency
I dare to doubt that.

> Problems of putting TCP on some other layer or sticking another layer
> between TCP and
> IP. If TCP would be independent from IP, then this would be trivial.
> IPV6 support is complicated because TCP has its tenticles inside IP
> implementation.
And imho there are some perfectly sound reasons to do so. Sure, the code
is (to put it mildly) a bit cryptic, but kernel code is not an "object d'art".
The only thing that counts is performance. I am absolutely sure the kernel
programmers could have done better than using ugly "goto" statements, inline
assembler code, ... The only reason they did so is to improve performance.
If you want a clean code, you will have to look at some "academic" OS
(minix might be an example, though I have never seen its network code).
If you want to write a "real world OS", you'll soon start counting the
number of times a network packet is copied in memory; and that's what the
current networking code tries to minimize.

Please don't get me wrong - there are certainly situations where I wished
the code would be a bit more modular, too (you should have heard me cursing
when I saw how fragmentation is done in the ipv6 module ;-). I am no kernel
hacker, but I think I figured out why the code is like it currently is.

Stefan.

-- 
*--- please cut here... -------------------------------------- thanks! ---*
|-> E-Mail: stefan.schlott@xxxxxxxxxxxxxxxxxx    DH-PGP-Key: 0x2F36F4FE <-|
| Mary had a crypto key, she kept it in escrow,                           |
| and everything that Mary said, the Feds were sure to know.              |
|   -- Sam Simpson, July 9, 1998                                          |
*-------------------------------------------------------------------------*

<Prev in Thread] Current Thread [Next in Thread>