netfilter project logo people.netfilter.org developer blogs

Patrick McHardy's blog

Thu, 03 Jul 2008

GARP/GVRP


Just finished the GARP/GVRP patches and sent them out. I love the feeling when you can finally delete a tree that has been lieing around for ages :) Unfortunately I have way too many of these.

A few words on GARP/GVRP for those not familiar with it. GARP is the Generic Attribute Registration Protocol and is specified in IEEE 802.1D. It is used to register and propagate attributes through the active spanning tree topology. Examples of these attributes include multicast link layer addresses and VLAN IDs. A bridge can use the attributes to configure filtering, a host can perform source pruning, meaning it can avoid sending f.i. multicast frames noone is interested in. Source pruning requires the host to be a full participant however, my implementation is only of the applicant-only participant model, meaning it supports only the client side. The full participant belongs in userspace since it may have to create network devices etc.

GVRP is the GARP VLAN Registration Protocol, specified in IEEE 802.1Q. As the name implies, it is used to register VLANs. This is supported by many switches, even the really cheap ones. The current implementation doesn't enable GVRP by default since we're missing a way to disable it when a VLAN device gets added to a bridge. I'll probably fix that shortly, for now it has to be enabled manually using iproute (ip link set eth0.1000 type vlan gvrp on).

Dynamically sized qdisc class hashes


Just sent out the second version of my dynamically sized qdisc class hash patches . They are intended to solve scalability problems when using large number of classes with CBQ/HTB/HFSC (and soon DRR). Currently, all of these use a fixed hash size of 16. There are mainly two cases where this matters:

  • Classifiers that point to classes that don't exist at the time the classifier is created are "unbound", meaning they don't return a pointer to the class but the classid. This classid is then resolved by a hash lookup. With only 4096 classes this means walking 128 classes on average - for each packet.
  • The flow classifier never returns class pointers since it calculates the classid at runtime. This means the class always has to be looked up in the hash.
The patches introduce some common hash helpers and a struct Qdisc_class_common, which currently only contains the hlist_node and the classid. I'm hoping we can stuff some more things in there and do some further consolidation. Child qdisc, classifier lists etc. come to mind.

Now I'm off to do some final cleanups of the GARP/GVRP patches so I can hopefully send them out today as well.

Copyright (C) 2001-2005 Patrick McHardy