From owner-freebsd-net@FreeBSD.ORG Wed Nov 19 20:30:34 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB9B5106567A for ; Wed, 19 Nov 2008 20:30:34 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from lakerest.net (unknown [IPv6:2001:240:585:2:203:6dff:fe1a:4ddc]) by mx1.freebsd.org (Postfix) with ESMTP id 68A328FC1D for ; Wed, 19 Nov 2008 20:30:34 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from [130.129.95.183] ([130.129.95.183]) (authenticated bits=0) by lakerest.net (8.14.1/8.14.1) with ESMTP id mAJKUUPH021030 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 19 Nov 2008 15:30:31 -0500 (EST) (envelope-from rrs@lakerest.net) DKIM-Signature: a=rsa-sha1; c=simple/simple; d=lakerest.net; s=mail; t=1227126632; h=Cc:Message-Id:From:To:In-Reply-To:Content-Type: Content-Transfer-Encoding:Mime-Version:Subject:Date:References: X-Mailer; b=bvj6VjytAxLlRh80//zxvN8PdZ3j/15o++wXxjDzH8CGH2LNqLWTWI6 DXoJFu8v7fOjXGYlxLU/AFpDyVrwwQA== Message-Id: From: Randall Stewart To: Julian Elischer In-Reply-To: <49245EE3.2000700@elischer.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Wed, 19 Nov 2008 15:30:29 -0500 References: <49245EE3.2000700@elischer.org> X-Mailer: Apple Mail (2.929.2) Cc: freebsd-net Subject: Re: Thinking about UDP and tunneling X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2008 20:30:34 -0000 On Nov 19, 2008, at 1:45 PM, Julian Elischer wrote: > Randall Stewart wrote: >> Dear All: >> I have been contemplating UDP and tunneling. One of the >> things that is a nice feature in MacOS is the ability of >> a kernel module/extension to open a kernel level socket >> and have the mbuf chain that arrives for that port be passed >> in via a function. > > define "kernel level" and "mbuf chain that arrives [...] passed in > via a function" > > > >> We use this in our MacOS version of the SCTP stack to do the >> UDP de-tunneling of SCTP packets. This is becoming a more and >> more common thing i.e. having transport protocols like SCTP and DCCP >> be tunneled over UDP to get by NAT's.... this actually sucks that >> this is necessary .. but it is what it is.... > > I do that using netgraph.. > set a point ot point ng_iface and hook the other end to > a netgraph ksocket which is bound/connaected where you want. > > "just works" > >> So, I am contemplating adding a similar sort of feature... basically >> provide an interface in UDP that a consumer (such as SCTP or DCCP) >> could >> use to "bind" a port and get UDP packets directly. >> What do you all think of the idea? > > Well netgraph allows you to do it already Not sure what netgraph does... what is wanted is this in comes +-----+ | IP | +-----+ | UDP | +-----+ | Oth | | tra | | por | | t h | | ead | | er | | and | | dat | | a. | +-----+ Ideally it runs into UDP via ip_input() and comes down to where it would append() to the socket. What you want in this case is the whole mbuf chain to be sent to the transport_udp_input(m, offset) function This changes the above to +-----+ | IP | +-----+ | Oth | | tra | | por | | t h | | ead | | er | | and | | dat | | a. | +-----+ And sends it into the transport_input() (same one called by ip_input). This then makes a clean and easy way to have "tunneled UDP" transport protocols work in kernel. The input side looks the same. Output is pretty easy.. easy to drop a UDP header in out output... Netgraph would have to be watching every UDP packet always.. seems to me easier to bind a kernel level socket with some option to call an input function.... R > > >> That also reminds me.. who owns the ipfw code.. we actually >> have SCTP nat support that Jason But has done that we need to >> get in... >> I would be more than glad to shepherd this in if the owner >> of the code does not have the time... >> R >> ------------------------------ >> Randall Stewart >> 803-317-4952 (cell) >> 803-345-0391(direct) >> _______________________________________________ >> freebsd-net@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to "freebsd-net- >> unsubscribe@freebsd.org" > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > ------------------------------ Randall Stewart 803-317-4952 (cell) 803-345-0391(direct)