GVRP (GARP VLAN registration
protocol) is an application of GARP (generic attribute registration protocol).
GVRP is based on the mechanism of GARP; it maintains dynamic VLAN registration
information and propagates the information to other switches.
GARP is a generic attribute registration protocol. This protocol
provides a mechanism to register, distribute and propagate the information
about VLANs, multicast addresses, and so on, between the switching members in a
switching network.
After the GVRP feature is enabled on a
switch, the switch can receive the VLAN registration information from other
switches to dynamically update the local VLAN registration information
(including current VLAN members, which ports these VLAN members get to, and so
on), and propagate the local VLAN registration information to other switches so
that all the switching devices in the same switching network can have the same
VLAN information. The VLAN registration information includes not only the
static registration information configured locally, but also the dynamic
registration information from other switches.
I. GARP Timers
The information exchange between GARP
members is completed by messages. The messages performing important functions
for GARP fall into three types: Join, Leave and LeaveAll.
l
When a GARP entity expects other switches to
register certain attribute information of its own, it sends out a Join message.
l
When a GARP entity expects other switches to
unregister certain attribute information of its own, it sends out a Leave
message.
l
Once a GARP entity starts up, it starts the
LeaveAll timer. After the timer times out, the GARP entity sends out a LeaveAll
message.
The join message and the Leave message are
used together to complete the unregistration and re-registration of
information. Through message exchange, all the attribute information to be
registered can be propagated to all the switches in the same switching network.
GARP has the following timers:
l
Hold: When a GARP entity receives a piece of registration
information, it does not send out a Join message immediately. Instead, to save
the bandwidth resources, it starts the Hold timer, puts all registration
information it receives before the timer times out into one Join message and sends
out the message after the timer times out.
l
Join: To transmit the Join messages reliably to
other entities, a GARP entity sends each Join message two times. The Join timer
is used to define the interval between the two sending operations of each Join
message.
l
Leave: When a GARP entity expects to unregister
a piece of attribute information, it sends out a Leave message. Any GARP entity
receiving this message starts its Leave timer, and unregisters the attribute
information if it does not receives a Join message again before the timer times
out.
l
LeaveAll: Once a GARP entity starts up, it
starts the LeaveAll timer, and sends out a LeaveALL message after the timer
times out, so that other GARP entities can re-register all the attribute
information on this entity. After that, the entity restarts the LeaveAll timer
to begin a new cycle.
II. GVRP port registration mode
GVRP has the following port registration
modes:
l
Normal: In this mode, both dynamic and manual
creation, registration and unregistration of VLANs are allowed.
l
Fixed: In this mode, when you create a static
VLAN on a switch and the packets of this VLAN are allowed to pass through the
current port, the switch joins the current port to this VLAN and adds a VLAN
entry to the local GVRP database (a table maintained by GVRP). But GVRP cannot
learn dynamic VLAN through this port, and the dynamic VLANs learned through
other ports on this switch cannot be pronounced through this port.
l
Forbidden: In this mode, all the VLANs except
VLAN 1 are unregistered on the port, and no other VLANs can be created or
registered on the port.
III. GARP operation procedure
Through the mechanism
of GARP, the configuration information on a GARP member will be propagated to
the whole switching network. A GARP can be a terminal workstation or a bridge;
it instructs other GARP member to register/unregister its attribute information
by declaration/recant, and register/unregister other GARP member's attribute
information according to other member's declaration/recant.
The protocol packets of GARP entity use specific
multicast MAC addresses as their destination MAC addresses. When receiving
these packets, the switch distinguishes them by their destination MAC addresses
and delivers them to different GARP application (for example, GVRP) for further
processing.
The GVRP packets are in the following
format:




Figure 1-1
Format of GVRP packets
The following table describes the packet
fields in the above figure.
Table 1-1 Description of the packet fields
|
Field
|
Description
|
Value
|
|
Protocol ID
|
Protocol ID
|
1
|
|
Message
|
Each message consists of two parts:
Attribute Type and Attribute List.
|
—
|
|
Attribute Type
|
It is defined by specific GARP
application.
|
The attribute type of GVRP is 0x01.
|
|
Attribute List
|
It contains multiple attributes.
|
—
|
|
Attribute
|
Each general attribute consists of three
parts: Attribute Length, Attribute Event and Attribute Value.
Each LeaveAll attribute consists of two
parts: Attribute Length and LeaveAll Event.
|
—
|
|
Attribute Length
|
The length of the attribute
|
2 to 255
|
|
Attribute Event
|
The event described by the attribute
|
0: LeaveAll Event
1: JoinEmpty
2: JoinIn
3: LeaveEmpty
4: LeaveIn
5: Empty
|
|
Attribute Value
|
The value of the attribute
|
The attribute value of GVRP is the VID.
|
|
End Mark
|
End mark of the GVRP PDU.
|
—
|
GVRP is defined in IEEE 802.1Q standard.
The GVRP configuration tasks include
configuring the timers, enabling GVRP, and configuring the GVRP port
registration mode.
The port on which GVRP will be enabled must
be set to a Trunk port.
Table 1-2 Configuration procedure
|
Operation
|
Command
|
Description
|
|
Enter system view
|
system-view
|
—
|
|
Configure the LeaveAll timer
|
garp timer leaveall timer-value
|
Optional
By default, the LeaveAll timer is set to
1,000 centiseconds.
|
|
Enter Ethernet port view
|
interface interface-type interface-number
|
—
|
|
Configure the Hold, Join, and Leave
timers
|
garp timer { hold | join | leave } timer-value
|
Optional
By default, the Hold, Join, and Leave
timers are set to 10, 20, and 60 centiseconds respectively.
|
|
Exit and return to system view
|
quit
|
—
|
|
Enable GVRP globally
|
gvrp
|
Required
By default, GVRP is disabled globally.
|
|
Enter Ethernet port view
|
interface interface-type interface-number
|
—
|
|
Enable GVRP on the port
|
gvrp
|
Required
By default, GVRP is disabled on the port.
|
|
Configure GVRP port registration mode
|
gvrp registration { normal | fixed | forbidden }
|
Optional
You can choose one of the three modes.
By default, GVRP port registration mode
is normal.
|
The timeout ranges of the timers vary
depending on the timeout values you set for other timers. If you want to set the
timeout time of a timer to a value out of the current range, you can set the timeout
time of the associated timer to another value to change the timeout range of
this timer.
The following table describes the relations
between the timers:
Table 1-3 Relations between the timers
|
Timer
|
Lower threshold
|
Upper threshold
|
|
Hold
|
10 centiseconds
|
This upper threshold is less than or
equal to one-half of the timeout time of the Join timer. You can change the
threshold by changing the timeout time of the Join timer.
|
|
Join
|
This lower threshold is greater than or
equal to twice the timeout time of the Hold timer. You can change the
threshold by changing the timeout time of the Hold timer.
|
This upper threshold is less than
one-half of the timeout time of the Leave timer. You can change the threshold
by changing the timeout time of the Leave timer.
|
|
Leave
|
This lower threshold is greater than
twice the timeout time of the Join timer. You can change the threshold by
changing the timeout time of the Join timer.
|
This upper threshold is less than the timeout
time of the LeaveAll timer. You can change the threshold by changing the timeout
time of the LeaveAll timer.
|
|
LeaveAll
|
This lower threshold is greater than the timeout
time of the Leave timer. You can change threshold by changing the timeout time
of the Leave timer.
|
32,765 centiseconds
|
After the above configuration, you can use
the display commands in any view to display the configuration
information and working condition of GVRP, and thus verify your configuration.
You can use the reset garp statistics command in user view to clear the
GARP statistics.
Table 1-4 Display
GVRP
|
Operation
|
Command
|
|
Display the GARP statistics
|
display garp
statistics [ interface interface-list ]
|
|
Display the timeouts of the GARP timers
|
display garp
timer [ interface interface-list ]
|
|
Display the GVRP statistics
|
display gvrp statistics [ interface interface-list ]
|
|
Display the global GVRP status
|
display gvrp status
|
|
Clear the GARP statistics (in user view)
|
reset garp statistics [ interface interface-list ]
|
1.4 Configuration
Example
I. Network
requirements
You should enable GVRP on the switches to
implement the dynamic registration and update of VLAN information between the
switches.
II. Network diagram

Figure 1-2 Network diagram for GVRP
configuration
III. Configuration procedure
l
Configure switch A:
# Enable GVRP globally.
<H3C> system-view
[H3C] gvrp
# Set the port Ethernet1/0/1 to a Trunk
port, and allow all VLAN packets to pass through the port.
[H3C] interface Ethernet1/0/1
[H3C-Ethernet1/0/1] port link-type
trunk
[H3C-Ethernet1/0/1] port trunk permit
vlan all
# Enable GVRP on the Trunk port.
[H3C-Ethernet1/0/1] gvrp
l
Configure switch B:
# Enable GVRP globally.
<H3C> system-view
[H3C] gvrp
# Set the port Ethernet1/0/2 to a Trunk
port, and allow all VLAN packets to pass through the port.
[H3C] interface Ethernet1/0/2
[H3C-Ethernet1/0/2] port link-type
trunk
[H3C-Ethernet1/0/2] port trunk permit
vlan all
# Enable GVRP on the Trunk port.
[H3C-Ethernet1/0/2] gvrp