From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 11 04:06:21 2006 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.ORG Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A75A416A415 for ; Mon, 11 Dec 2006 04:06:21 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F08C43CA4 for ; Mon, 11 Dec 2006 04:05:07 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id kBB44buj082995; Sun, 10 Dec 2006 21:04:37 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 10 Dec 2006 21:05:33 -0700 (MST) Message-Id: <20061210.210533.-1632631349.imp@bsdimp.com> To: bsd.devil@gmail.com From: "M. Warner Losh" In-Reply-To: References: <457BBCC3.9040605@mersin.edu.tr> <457BC490.30904@elischer.org> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Sun, 10 Dec 2006 21:04:39 -0700 (MST) Cc: ozkan@mersin.edu.tr, freebsd-hackers@FreeBSD.ORG, julian@elischer.org Subject: Re: Example network protocol implementation X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Dec 2006 04:06:21 -0000 In message: "Vishal Patil" writes: : Would like to thank you all folks. These conversations are really goo= d way : of learning things...Also it is good to know different perspectives f= or : 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. Warner : On 12/10/06, Julian Elischer wrote: : > : > =D6zkan KIRIK wrote: : > > I think netgraph subsystem provides this infrastructure for imple= menting : > > new protocols. : > > : > > according to netgraph (4) man page: : > > : > > The aim of *netgraph* is to supplement rather than replace the= : > existing : > > kernel networking infrastructure. It provides: : > > : > > *=B7* A flexible way of combining protocol and link level= drivers. : > > *=B7* A modular way to implement new protocols. : > > *=B7* A common framework for kernel entities to inter-com= municate. : > > *=B7* A reasonably fast, kernel-based implementation. : > > : > > There are many examples and applications at this address: : > > http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netgraph/ : > : > also look it up in the daemon news archives at: : > http://ezine.daemonnews.org/200003/netgraph.html : > : > a little out of date but the basic ideas are still right. : > : > : > > : > > : > > you implementation may be "ng_iscsi" :) : > : > I thought of this but the trick is to do with the locking.. : > You would need to get a transfer of control from the : > netgraph locking domain to the geom or scsi universe's locking doma= in. : > : > There are all the components needed if you consider using the ksock= et : > netgraph node to open a TCP socket within the kernel, and you could= hook : > that to a scsi device netgraph node almost directly if you wrote it= , : > but the hardest part will be to create a method of crossing that lo= cking : > divide. : > : > Still it's possibly worth looking at. Of course the method suggeste= d by : > Warner is also very valid and may be about the same amount of work.= : > : > : > > : > > I hope this helps, : > > : > > =D6zkan KIRIK : > > EnderUNIX SDT @ Turkey : > > Software Developer : > > : > _______________________________________________ : > freebsd-hackers@freebsd.org mailing list : > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers : > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freeb= sd.org" : > : _______________________________________________ : freebsd-hackers@freebsd.org mailing list : http://lists.freebsd.org/mailman/listinfo/freebsd-hackers : To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd= .org" : =