From owner-freebsd-net Mon Feb 19 4:17:58 2001 Delivered-To: freebsd-net@freebsd.org Received: from samar.sasi.com (samar.sasken.com [164.164.56.2]) by hub.freebsd.org (Postfix) with ESMTP id F413337B491 for ; Mon, 19 Feb 2001 04:17:46 -0800 (PST) Received: from samar (samar.sasi.com [164.164.56.2]) by samar.sasi.com (8.9.3/8.9.3) with SMTP id RAA25706; Mon, 19 Feb 2001 17:47:38 +0530 (IST) Received: from suns3.sasi.com ([10.0.36.3]) by samar.sasi.com; Mon, 19 Feb 2001 17:47:37 +0000 (IST) Received: from localhost (sseth@localhost) by suns3.sasi.com (8.9.3/8.9.3) with ESMTP id RAA06295; Mon, 19 Feb 2001 17:47:37 +0530 (IST) Date: Mon, 19 Feb 2001 17:47:37 +0530 (IST) From: Satyajeet Seth To: Julian Elischer Cc: Subject: Re: Using netgraph to implement pseudo interfaces In-Reply-To: <3A910856.CE68FEAC@elischer.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi A node of type ng_bpf uses BPF. How is a packet passed onto the BPF? I believe a copy of the packet is sent. Is this correct? Once a packet is sent to the BPF, will the driver process the packet further and queue it to the IP layer? If so, in our case, there will be duplication of packets. Here the BPF will pass the packets onto pseudo ethernet interfaces. These interfaces will in turn queue the packets to the IP layer. Thanks Satya > > I wished to implement pseudo interfaces with the following requirements: > > > > 1. There is a ethernet interface fxp0 having MAC address MAC0. It also > > receives packets with destination MAC address MAC1 and MAC2. > > > > 2. The packets with destination MAC address MAC1 are sent to a pseudo > > interface 1 and packets with destination MAC address MAC2 are sent to > > pseudo interface 2. > > > > 3. The packets addressed to MAC0 should be sent to sent to fxp0. > > > > I plan to design a netgraph as follows: > > > > iface1 > > / > > fxp0 <-> bpf > > \ > > iface2 > > I forgot to add in my previous response that you'd have to do this like: > > fxp0: <--> bpf <--> bpf <--> interface0 > \ \ > \ ------>interface1 > \ > \------------>interface2 > > as each bpfnode hook only selects between a > "match" and "no match" hook. > > you could do it with one node as follows: > > > +----------------------------+ > | | > +->(hook2)[ ] | > fxp0:(lower)<->(hook1)[bpf](nomatch1)----+ > [ ](match1)<-------->(upper)fxp0: > [ ](nomatch2)<------>(hook)iface1: > [ ](match2)<-------->(hook)iface2: > > i.e. loop the data back through the same node twice to effect two rules on > the same data. > > > > > > fxp0, iface1, iface2, bpf are nodes of type ng_ether, ng_iface, ng_iface > > and ng_bpf respectively. > > > > The packets with destination addresses MAC1 and MAC2 are sent to > > interfaces iface1 and iface2 respectively by bpf. Remaining are sent to > > fxp0. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message