Example network protocol implementation
rwatson at FreeBSD.org
Mon Dec 11 06:23:10 PST 2006
On Sun, 10 Dec 2006, M. Warner Losh wrote:
> In message: <eb7c8e2e0612100705o199393c4r353b7ff6fb058ed8 at mail.gmail.com>
> "Vishal Patil" <bsd.devil at gmail.com> writes:
> : Would like to thank you all folks. These conversations are really good way
> : of learning things...Also it is good to know different perspectives for
> : solving the same problem....
> Yes. the ng_iscsi suggestion is also viable. It may be a little less work
> than going to the raw sockets. Careful performance measurements may be
> necessary, however, since there have been cases when the ng_foo
> implementation wasn't fast enough and going to a lower level was necessary.
> There have also been many cases where ng_bar was perfectly fast enough and
> there was no need to go to the lower leve. At the very least, the ng code
> will get you to layer your code well and provide a faster means of
> development than going to the raw socket layer.
As someone who doesn't consume Netgraph a lot, can you tell me what benefit
using Netgraph for something like iSCSI might have when compared with the
kernel socket API used to implement user sockets, NFS, SMB, etc? Are there
parsing/decapsulation parts of the protocol that lend themselves well to
netgraphs more modular approach vs. the more traditional approach of layering
RPC wrapping over the socket layer?
BTW, one of the things on my todo list is a socket(9) man page, which is well
overdue. I've been postponing writing it while finishing up the kernel socket
API cleanup in -CURRENT.
Robert N M Watson
University of Cambridge
More information about the freebsd-hackers