[openbeosnetteam] Re: MBuf
- From: Zenja <zenja@xxxxxxxxxxxxxxxx>
- To: openbeosnetteam@xxxxxxxxxxxxx
- Date: Wed, 23 Apr 2003 08:28:31 +1000
Probably the best documentation is in the "Design and Implementation of the 4.4 BSD Operating System" (McKusick, Bostic, Karels, Quarterman), but Google may also help. mbufs are memory buffers in 2 flavours, small (128 bytes, usually for protocol overhead) and large (2-4K for data). Each buffer has a header, with info like pointer to next mbuf (so you can chain them), lenght, data type etc, so for a 128 byte mbuf, you'd loose 20-28 bytes on the header. The whole philosophy behind them is so allow a form of VM management - you can chain, mix and match mbuf's, so they're quite good for things like designing protocols. They facilitate zero-copying when assembling packets, since instead of moving the data around, you just add a mbuf pointer. This is probably why BSD uses them instead of the native VM implementation (plus its smaller and tailor made for protocols).
This is an old school implementation (when ANSI C ruled), if you had to reimplement it from scratch, you'd probably want to do it in a more OO way. Seeing that the OBOS netstack is derived from a OpenBSD variant, I guess thats why we're stuck with mbufs for now.
On Tue, 22 Apr 2003 18:26:28 +0200, Waldemar Kornewald <Waldemar.Kornewald@xxxxxx> wrote:
Hi,
is there a documentation about MBufs available? Reading source is a little
bit hard.
Thanks.
Waldemar
--
Zenja Solaja
- Follow-Ups:
- [openbeosnetteam] Re: MBuf
- From: Philippe Houdoin
- References:
- [openbeosnetteam] MBuf
- From: Waldemar Kornewald
Other related posts:
- » [openbeosnetteam] MBuf
- » [openbeosnetteam] Re: MBuf
- » [openbeosnetteam] Re: MBuf
- » [openbeosnetteam] Re: MBuf
Hi, is there a documentation about MBufs available? Reading source is a little bit hard.
Thanks.
Waldemar
-- Zenja Solaja
- [openbeosnetteam] Re: MBuf
- From: Philippe Houdoin
- [openbeosnetteam] MBuf
- From: Waldemar Kornewald