VLAN Support needed

Brecht Vermeulen brecht.vermeulen at rug.ac.be
Thu Apr 3 00:08:12 EST 2003


So, if I understand it correctly: packets with a VLAN header come in and
you just want to change the VLAN number in it ?
(this is pure on ethernet level ? is it just in-out or is there also
switching functionality ?)

If is indeed packets coming in on one interface and going out on another
interface with just another VLAN number, then you should have a
configuration like this:

PollDevice -> VLAN_changer -> todevice;

where VLAN_changer (just a quickly chosen name :) ) just changes the
VLAN bits (as the source and destination MAC address would be the same).

So, you can indeed chose the new struct (it is already in the latest cvs
version) and do something as:


void
VLAN_changer::push(int source, Packet *p)
{
  click_ether_vlan* e = (click_ether_vlan*) p->data();

e->ether_vlan_tci will contain 3 priority bits, 1 canonical format
indicator and then 12 VLAN Id bits.
so just change with some bit arithmetic the 12 VLAN Id bits (to a VLAN
which can be set by a click handler e.g.)
and push the packet out


This would do it approximately I think.
(if you first strip the MAC header with strip e.g. and then encapsulate
it again in another element, you will need the MAC destination and
source which should be given along from element to element with an
annotation, so I think one element is much simpler).

I think you probably need more complex functionality, but this was how I
understood your mail. :)

regards,
Brecht

Shilpi Agarwal wrote:
> 
> I am receiving packets on a trunk.I just need to encapsulate packet in a
> different vlan number and i guess for that the only thing that i need is add the
> vlan structure posted on mailinglist  by you to ether.h file and write an
> element that can encapsulate the packet.
> 
> so what i want to do is,
> strip the mac addresses and vlan part from the packet and encapsulate it again
> in the mac address and vlan that i give in the element call.
> 
> Let me know if i am going in the right direction.
> 
> Thanks
> Shilpi
> 
> Quoting Brecht Vermeulen <brecht.vermeulen at rug.ac.be>:
> 
> >
> > Hi,
> >
> > well, we're actually busy at creating a VLAN aware version of the
> > ethernet switch elements.
> > Not sure when it will be exactly finished (not that much work, but there
> > are also some other projects running :-( ).
> >
> > What do you need exactly ?
> >
> > regards,
> > Brecht
> >
> > Shilpi Agarwal wrote:
> > >
> > > Hi!!
> > >
> > > Are there new extensions to click for VLAN Support.I need it for my
> > project.
> > > If there are new extensions then from where i can get these files??
> > >
> > > Thanks
> > > Shilpi
> > >
> > > Shilpi Agarwal
> > > Graduate Student
> > > Dept of Electrical Engineering
> > > University of Wisconsin
> > > Madison-53706
> > > phone:608-233-3714
> >
> 
> Shilpi Agarwal
> Graduate Student
> Dept of Electrical Engineering
> University of Wisconsin
> Madison-53706
> phone:608-233-3714




More information about the click mailing list