gvrpad – GVRP Announcement Daemon

Introduction

This daemon makes GVRP announcements of all VLAN interfaces on a FreeBSD system.

GVRP is the GARP VLAN Registration Protocol, defined in IEEE 802.1Q (VLANS); GARP is the Generic Attribute Registration Protocol, defined in 802.1D (bridging). The protocol allows switches or trunked end stations to announce to the network what VLANs should be forwarded to that device. The effect is that VLANs only need to be configured on the member ports; the protocol figures out which trunk ports are effectively also members.

This daemon just announces the VLANs statically configured on each interface to that interface. It does not listen for inbound GVRP announcements.

Usage

 

	gvrpad [<options>] [<interface> ...]

Options are

 

  • -d: Write debug messages to stdout.
  • -f: Run in foreground; do not daemonise.
  • -i <pidfile>: Write the PID of the running process into <pidfile>. (Send a SIGINT to the process to terminate it).
  • -l <count>: Send LeaveAll actions every <count> updates. Use -l 1 to send LeaveAll with every update. The default is to send LeaveAll every 3 updates.
  • -t <seconds>: Set time in seconds to wait between updates. The default is 3.
  • -x: Exclude the listed interfaces.
  • -V: Display version, copyright and warranty information.

The handling of interface parameters is as follows:

 

  • If no parameters are provided, all interfaces that have VLANs configured on them will be sent GVRP announcements.
  • If interfaces are listed, and the -x switch is not specified, only interfaces that have VLANs configured on them AND are included in the parameter list will receive GVRP updates.
  • If interfaces are listed the -x switch is specified, all interfaces with VLANs configured, but are NOT included in the parameter list will received GVRP announcements.

The interface parameters are string matched on interfaces found on the system; a mis-spelled name will not generate an error,

Operation

gvrpad sends GVRP announcements regularly. Announcements are “full”, in that they announce every configured VLAN, every time. Some announcements start with a LeaveAll action to clear out current state, allowing deletion of VLANs to be reflected in the GVRP-learned configurations in the switched network.

If the last VLAN is removed from an interface that was receiving GVRP announcement, that interface will be sent a “last gasp” announcement containing a single LeaveAll action.

GVRP protocol

GVRP/GARP packets are in the form:

 

	dst-mac(6) src-mac(6) len(2) llc(3) prot(2) attribute ... end(1)

Attributes are in the form:

 

	att-type(1) attribute-value ... end(1)

Attribute-values are encoded

 

	val-len(1) action(1) data(len-2)

Fields are as follows:

 

  • dst-mac: Multicast address 01:80:c2:00:00:21
  • src-mac: Interface MAC address
  • len: Length of complete packet (including MAC)
  • llc: 802.2 Logical Link Control: DSAP 0×42 (STP); SSAP 0×42 (STP); Control 3 (un-numbered)
  • prot: GVRP protocol (1)
  • end: 0. Note that the packet ends in two END octets, the first to terminate the last attribute, the second to terminate the entire message
  • att-type: 1 for VLAN IDs (VIDs)
  • val-len: Length of attribute value, including val-len and action fields.
  • action: GVRP/GARP action to take:
    	0	LeaveAll
    	1	JoinEmpty operator
    	2	JoinIn operator
    	3	LeaveEmpty operator
    	4	LeaveIn operator
    	5	Empty operator

     

  • data: Data portion. For GVRP join and leave actions, this is a single 2-byte VID. For LeaveAll, the data portion is empty.

Note that 16-bit integers are sent MSB first.

GVRP updates sent out by this program take the form of an optional LeaveAll action followed by as many JoinIn actions as required to list all VLANs handled by the interface.

If there are too many VLANs to fit in one packet, additional packets may be sent containing just JoinIn actions. Note that the LeaveAll operator just starts a timer (default, 10s) on the receiving hosts; the VLANs are not actually removed from the upstream switch until the timer expires. Thus, sending a LeaveAll in one packet and a subsequent packet containing a JoinIn for a given VLAN doesn’t leave that VLAN out for the time between the two packets.

By default, LeaveAll actions are only sent every three updates, so a missed second packet after a LeaveAll will be re-transmitted without the preceding LeaveAll before the leave timer expires.

Credits / Copyright

Credit must go to Sebastian Zagrodzki <s.zagrodzki@net.icm.edu.pl> for gprpcd (http://sokrates.mimuw.edu.pl/~sebek/gvrpcd), which achieves a similar effect on Linux, albeit for only one interface at a time. While gvrpad is a ground-up implementation, it sure helped a lot to have a working implementation on hand while wading through the opaque prose of 802.1D & 802.1Q.

gvrpad is Copyright 2007 Knossos Networks Ltd.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

A copy of the GNU General Public License version 2 is available at http://www.knossos.net.nz/gpl.html or can be obtained from the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Source Code

gvrpad source code is located at http://www.knossos.net.nz/downloads/gvrpad-0.1.tgz