[VLAN] Fwd: Newbiew question: Need some clarifications in 802.1q and bridging code interaction in linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
      Inline with my earlier mail below, I am able to extract some
info on the interaction with bridging and vlan module through
eb_tables...the module ebt_vlan.c
But still I have no clue about the earlier 2 points that I had
expalined below. Any pointers will be of great help.

Thanks,
Pranjal

---------- Forwarded message ----------
From: Pranjal Kumar Dutta <pranjalkumardutta@xxxxxxxxx>
Date: May 19, 2006 12:49 PM
Subject: Newbiew question: Need some clarifications in 802.1q and
bridging code interaction in linux
To: vlan@xxxxxxxxxxxx


Hi,
           I have some problems in understanding some parts of the
(802.1q)vlan module in linux kernel and its interaction with linux
bridging code.

I have the following problems in understanding the codes.

1. In linux 802.1q code a vlan is characterised as a generic
net_device. Every real net_device (Ethernet NICs e.g) has a vlan_group
attached to it to identify the port's membership of vlans. A
vlan_group contains an array of pointers to all vlan_devices (in the
form of net_devices) to which the real device is member of. As per my
understanding goes here whenever a vlan is attached to an interface
the following is called.

static struct net_device *register_vlan_device(const char *eth_IF_name,

unsigned short VLAN_ID)
Inside this function I could see that a new net_device is created for
the corresponding vlan attched to it. So that means a VLAN domain in
the box is NOT represented by a single net_device, rather it is
interface specific. For the same vlan X every interface will be having
its own net_device for X in its vlan_group. Then how the vlan layer
glues all the vlan_devices
(in the form of net_devices) for a particular vlan X into a domain?
Because theoretically speaking while bridging ethernet flows MAC
Learning and forwarding should be based on vlan domains.

2. My second question is the forwarding path in vlan module, that is
the following function

int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
                      struct packet_type* ptype)
To me this function seems to be disconnected to the bridging module, because
there is another handler handle_bridge called by netif_receive_skb
that handles bridging. And in the brdging code the bridge handler
(br_handle_frame)has no consideration of vlan_devices. I am utterly
confused here on the issue that how both the brdging and vlan modules
interacts in MAC learning. Because the
br_fdb (MAC database per bridge) should have vlan specific learning
and br_fdb_entry doesn't have any reference to vlans.

let's say I am making my Linux machine a Layer 2 switch with multiple
interfaces
as follows:

eth0 in vlan 10
eth1 in vlan 20
eth3 in vlan 10
eth4 in vlan 20

In the above configuration the box needs to bridge the packets
between eth0 and eth3. Similiarly between eth1 and eth4.

By looking at the code I am not able to find out how linux achives
this. I am sure I am missing something and need help/explanation on
how the bridging module and vlan modules interacts in linux. My kernel
is 2.6.15.6

Any other pointers of info will be very helpful.

Thanks in advance,

Pranjal


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux