From owner-freebsd-net@FreeBSD.ORG Tue Mar 13 16:27:17 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9E3B3106566B for ; Tue, 13 Mar 2012 16:27:17 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) Received: from mail.ambrisko.com (mail.ambrisko.com [70.91.206.90]) by mx1.freebsd.org (Postfix) with ESMTP id 7E8098FC08 for ; Tue, 13 Mar 2012 16:27:17 +0000 (UTC) X-Ambrisko-Me: Yes Received: from server2.ambrisko.com (HELO internal.ambrisko.com) ([192.168.1.2]) by ironport.ambrisko.com with ESMTP; 13 Mar 2012 09:27:22 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by internal.ambrisko.com (8.14.4/8.14.4) with ESMTP id q2DGRG03056512; Tue, 13 Mar 2012 09:27:16 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.14.4/8.14.4/Submit) id q2DGRGlk056510; Tue, 13 Mar 2012 09:27:16 -0700 (PDT) (envelope-from ambrisko) From: Doug Ambrisko Message-Id: <201203131627.q2DGRGlk056510@ambrisko.com> In-Reply-To: To: saeedeh motlagh Date: Tue, 13 Mar 2012 09:27:16 -0700 (PDT) X-Mailer: ELM [version 2.4ME+ PL124d (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" Cc: h bagade , freebsd-net Subject: Re: problem with vlan interfaces tagging/untagging in a simulated switch box 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: Tue, 13 Mar 2012 16:27:17 -0000 saeedeh motlagh writes: | i think i have similar problem too. you want to have tagged and | untagged traffic at the same time on the trunk port, right? | in your topology the vlans and trunk port are bridged and the tagged | traffic is passed through the trunk port and every thing works fine. | then when you want to have the untagged traffic on the trunk port, | you bridge an interface with trunk port directly. after that all the | traffic which is received on the trunk port, are sent to this | interface and vlans receive no packet. | | eth0 -+ | | | eth1 -+ --- bridge1 --- vlan9 --+-- eth4 ----- | | | eth2 -+ --- bridge2 --- vlan8 --+ --------+ | | eth3 -+ ------------ bridge3 ----------------+ | | please let me know if i understand what you exactly mean. | yours, I think part of the problem with the standard code paths unless you use netgraph is that the vlan SW stack transmits directly to the NIC and skips the bridge. This code is in vlan_start of sys/net/if_vlan.c. There is a comment that says: Send it, precisely as ether_output() would have. Also this would only work with SW VLAN and not HW assist VLAN. So I have two changes, disable HW assist VLAN and to re-insert the VLAN packet into the ether_output just before the bridge. I ended up splitting ether_output into 2 function so I could call the end part of ether_output from vlan_start. I also had a trivial change to allow VLAN in VLAN. I don't really have to use this code now so I've dropped some of it. I did it for testing. Now I plan to create the same test environment using the vimage work since it is cleaner and easier to understand. My suggestion would be to create a netgraph solution since it shouldn't have these limitations. It's probably what I would have done if netgraph had this as the time. Doug A.