[Click] VLAN and Click

Junhe Jian Junhe.Jian at hhi.fraunhofer.de
Tue Jan 31 07:49:08 EST 2006


Hi Frederic and other click user,

thank you for the fast answer @ frederic!
if i understand u mean only with the filter of classifier does it works!
so i have a little question:
what does it mean the number before "/" and after "/", is the bit
position of the complete ethernet frame with VLAN tag?
i found something in ehter.h:

struct click_arp {		/* Offsets relative to ARP (Ethernet) header */
    uint16_t	ar_hrd;		/* 0-1 (14-15)  hardware address format      */
#define ARPHRD_ETHER    1       /*		  Ethernet 10Mbps	     */
    uint16_t	ar_pro;		/* 2-3 (16-17)  protocol address format      */
    uint8_t	ar_hln;		/* 4   (18)     hardware address length      */
    uint8_t	ar_pln;		/* 5   (19)     protocol address length      */
    uint16_t	ar_op;		/* 6-7 (20-21)  opcode (command)	     */
#define ARPOP_REQUEST   1       /*		  ARP request		     */
#define ARPOP_REPLY	2       /*		  ARP reply		     */
};

struct click_ether_arp {
struct click_arp ea_hdr;	/* 0-7 (14-21) fixed-size ARP header	 */
    uint8_t	arp_sha[6];	/* 8-13  (22-27)  sender hardware address    */
    uint8_t	arp_spa[4];	/* 14-17 (28-31)  sender protocol address    */
    uint8_t	arp_tha[6];	/* 18-23 (32-37)  target hardware address    */
    uint8_t	arp_tpa[4];	/* 24-27 (38-41)  target protocol address    */
};


/* Ethernet with VLAN (802.1q) */

CLICK_SIZE_PACKED_STRUCTURE(
struct click_ether_vlan {,
uint8_t ether_dhost[6];		/* 0-5 Ethernet source address */
uint8_t ether_shost[6];		/* 6-11 Ethernet destination address */
    uint16_t    ether_vlan_proto;	/* 12-13 == ETHERTYPE_8021Q	      */
uint16_t ether_vlan_tci;		/* 14-15 tag control information */
uint16_t ether_vlan_encap_proto;	/* 16-17 Ethernet protocol	 */
does the number of offsets ar the number before "/" and what does the
number in "()" in ehter.h mean???

if i understand "14/" is the position where VLAN packet tag control are,
and "0002" mean the 3 priority bits of the VLAN Tag packet, but i dont
understand the number after "%"OFFF??


anyhelp welcome!

besr regards
jian


Am Sa 28.01.2006 09:06 schrieb Frederic Van Quickenborne
<frederic.vanquickenborne at intec2.ugent.be>:

> Hi Jian,
> 
> you can use smart filtering in the classifier to filter your packets:
> e.g. if you want to filter out the packets on VLAN 2 use this filer:  
> 14/0002%0FFF, if you want to map the priority, you can use one like  
> this: 14/40%D0 (this one is for priority class 2). The hex code after
> the '%' works as a mask for the bits you are looking for (hex code  
> between '/' and '%') in the packet on place (given by the number  
> before the '/'). (I'm not sure the place to look (14) is correct, it  
> could be 13 also, if the classifier starts searching from byte 0.)
> 
> Kind regards,
> Frederic.
> 
> Op 26-jan-06, om 15:33 heeft Junhe Jian het volgende geschreven:
> 
> > hi Click User!
> >
> > i need your help!
> > in a project i should to do Click with VLAN support!
> > example: a video stream server send a videostream over VLAN and use
> > User
> > Priority Bit from VLAN TAG for identification. and the user must
> > have
> > the same User Priority bit to receive the video-stream.
> >
> > my question:
> > how can i use Click to mapping the User Prority Bit from VLAN TAG
> > and
> > redirect the packet to the user!
> > i know i can use Classifier 12/8100 redirect the packet to a device
> > but
> > don't know how i can mapping the User-Priority! or i don't need to
> > mapping coz with the right MAC-address and VLAN ID the user get
> > their
> > packet?
> > any help welcome!
> >
> > regards
> > jian
> >
> 



More information about the click mailing list