01-12 GVRP Configuration
01-12 GVRP Configuration
Switches
Configuration Guide - Ethernet Switching 12 GVRP Configuration
12 GVRP Configuration
This chapter describes how to configure the Generic VLAN Registration Protocol
(GVRP).
Definition
The Generic Attribute Registration Protocol (GARP) provides a mechanism for
propagating attributes so that a protocol entity can register and deregister
attributes. By filling different attributes into GARP packets, GARP supports various
upper-layer applications.
The GARP VLAN Registration Protocol (GVRP) is used to register and deregister
VLAN attributes.
GARP identifies applications through destination MAC addresses. IEEE Std 802.1Q
assigns 01-80-C2-00-00-21 to the VLAN application (GVRP).
Purpose
To deploy a VLAN on all devices on a network, a network administrator must
manually create it on each device. In Figure 12-1, three routers are connected
through trunk links. VLAN 2 is configured on SwitchA, and VLAN 1 is configured
on SwitchB and SwitchC. To forward packets of VLAN 2 from SwitchA to SwitchC,
the network administrator must manually create VLAN 2 on SwitchB and SwitchC.
SwitchB
When a network is complex and the network administrator is unfamiliar with the
network topology, or when many VLANs are configured on the network, the
manual configuration workload is enormous. In addition, configuration errors may
occur due to human error. GVRP can be configured on the network to implement
automatic registration of VLANs, reducing configuration workload and the
likelihood of configuration errors.
Benefits
GVRP is based on GARP. It dynamically maintains VLAN attributes on devices.
Using GVRP, VLAN attributes of one device can be propagated throughout the
entire switching network. GVRP enables network devices to dynamically deliver,
register, and propagate VLAN attributes, reducing the workload of the network
administrator and helping to ensure correct configuration.
Participant
On a device, each interface running a protocol is a participant. On a device
running GVRP, each GVRP-enabled interface is treated as a GVRP participant, as
shown in Figure 12-2.
SwitchA SwitchC
SwitchB
GARP Messages
GARP participants exchange VLAN information through GARP messages. Major
GARP messages are Join messages, Leave messages, and LeaveAll messages.
● Join message
When a GARP participant expects other devices to register its attributes, it
sends Join messages to other devices. When the GARP participant receives a
GARP Timers
GARP defines four timers:
● Join timer
The Join timer controls the sending of Join messages including JoinIn
messages and JoinEmpty messages.
After sending the first Join message, a participant starts the Join timer. If the
participant receives a JoinIn message before the Join timer expires, it does not
send a second Join message. If the participant does not receive any JoinIn
message, it sends a second Join message when the Join timer expires. This
ensures that Join messages can be sent to other participants. Each interface
maintains an independent Join timer.
● Hold timer
The Hold timer controls the sending of Join messages (JoinIn messages and
JoinEmpty messages) and Leave messages (LeaveIn messages and
LeaveEmpty messages).
After a participant is configured with an attribute or receives a message, it
sends the message to other participants only after the Hold timer expires. The
participant encapsulates messages received within the hold time into a
minimum number of packets, reducing the number of packets sent to other
participants. If the participant does not use the Hold timer but forwards a
message immediately after receiving it, a large number of packets are
transmitted on the network. This makes the network unstable and wastes
data fields of packets.
Each interface maintains an independent Hold timer. The Hold timer value
must be equal to or smaller than half of the Join timer value.
● Leave timer
The Leave timer controls attribute deregistration.
A participant starts the Leave timer after receiving a Leave or LeaveAll
message. If the participant does not receive any Join message of the
corresponding attribute before the Leave timer expires, the participant
deregisters the attribute.
A participant sends a Leave message if one of its attributes is deleted, but the
attribute may still exist on other participants. Therefore, the participant
receiving the Leave message cannot deregister the attribute immediately; it
must wait for messages from other participants.
For example, an attribute has two sources on the network: participant A and
participant B. Other participants register the attribute through GARP. If the
attribute is deleted from participant A, participant A sends a Leave message
to other participants. After receiving the Leave message, participant B sends a
Join message to other participants because the attribute still exists on
participant B. After receiving the Join message from participant B, other
participants retain the attribute. Other participants deregister the attribute
only if they do not receive any Join message of the attribute within a period
longer than two times the Join timer value. Therefore, the Leave timer value
must be greater than two times the Join timer value.
Each interface maintains an independent Leave timer.
● LeaveAll timer
When a GARP participant starts, it starts the LeaveAll timer. When the
LeaveAll timer expires, the participant sends a LeaveAll message and restarts
the LeaveAll timer.
After receiving a LeaveAll message, a participant restarts all GARP timers.
When its LeaveAll timer expires, the participant sends another LeaveAll
message. This reduces the number of LeaveAll messages sent within a period
of time.
If the LeaveAll timers of multiple devices expire simultaneously, they send
LeaveAll messages simultaneously, leading to an unnecessary generation of
LeaveAll messages. To solve this problem, each device uses a random value
between the LeaveAll timer value and 1.5 times the LeaveAll timer value as
its LeaveAll timer value. When a LeaveAll event occurs, all attributes on the
entire network are deregistered. The LeaveAll event affects the entire
network; therefore, the LeaveAll timer must be set to a value which is greater
than the Leave timer value.
Each device maintains a global LeaveAll timer.
Registration Modes
A manually configured VLAN is a static VLAN, and a VLAN created through GVRP
is a dynamic VLAN. GVRP provides three registration modes. Static VLANs and
dynamic VLANs are processed differently in each registration mode:
● In normal mode, dynamic VLANs can be registered on interfaces, and
interfaces can send declarations of static VLANs and dynamic VLANs.
GARP packets are encapsulated in the IEEE 802.3 Ethernet format, as shown in
Figure 12-4.
1 3 N
1 2 N
1 N
1 2 3 N
One-Way Registration
Port 2 Port 3
SwitchB
Static VLAN 2 is created on SwitchA. Ports on SwitchB and SwitchC can join VLAN
2 automatically through one-way registration. The process is as follows:
1. After VLAN 2 is created on SwitchA, Port 1 of SwitchA starts the Join timer
and Hold timer. When the Hold timer expires, Port 1 sends the first JoinEmpty
message to SwitchB. When the Join timer expires, Port 1 restarts the Hold
timer. When the Hold timer expires again, Port 1 sends the second JoinEmpty
message.
2. After Port 2 of SwitchB receives the first JoinEmpty message, SwitchB creates
dynamic VLAN 2 and adds Port 2 to VLAN 2. In addition, SwitchB requests
Port 3 to start the Join timer and Hold timer. When the Hold timer expires,
Port 3 sends the first JoinEmpty message to SwitchC. When the Join timer
expires, Port 3 restarts the Hold timer. When the Hold timer expires again,
Port 3 sends the second JoinEmpty message. After Port 2 receives the second
JoinEmpty message, SwitchB does not take any action because Port 2 has
been added to VLAN 2.
3. After Port 4 of SwitchC receives the first JoinEmpty message, SwitchC creates
dynamic VLAN 2 and adds Port 4 to VLAN 2. After Port 4 receives the second
JoinEmpty message, SwitchC does not take any action because Port 4 has
been added to VLAN 2.
4. Every time the LeaveAll timer expires or a LeaveAll message is received, each
switch restarts the LeaveAll, Join, Hold, and Leave timers. Port 1 then repeats
step 1 and sends JoinEmpty messages. In the same way, Port 3 of SwitchB
sends JoinEmpty messages to SwitchC.
Two-Way Registration
SwitchB
After one-way registration is complete, Port 1, Port 2, and Port 4 are added to
VLAN 2 but Port 3 is not added to VLAN 2 because only interfaces receiving a
JoinEmpty or JoinIn message can be added to dynamic VLANs. To transmit traffic
of VLAN 2 in both directions, VLAN registration from SwitchC to SwitchA is
required. The process is as follows:
1. After one-way registration is complete, static VLAN 2 is created on SwitchC
(the dynamic VLAN is replaced by the static VLAN). Port 4 of SwitchC starts
the Join timer and Hold timer. When the Hold timer expires, Port 4 sends the
first JoinIn message (because it has registered VLAN 2) to SwitchB. When the
Join timer expires, Port 4 restarts the Hold timer. When the Hold timer
expires, Port 4 sends the second JoinIn message.
2. After Port 3 of SwitchB receives the first JoinIn message, SwitchB adds Port 3
to VLAN 2 and requests Port 2 to start the Join timer and Hold timer. When
the Hold timer expires, Port 2 sends the first JoinIn message to SwitchA. When
the Join timer expires, Port 2 restarts the Hold timer. When the Hold timer
expires again, Port 2 sends the second JoinIn message. After Port 3 receives
the second JoinIn message, SwitchB does not take any action because Port 3
has been added to VLAN 2.
3. When SwitchA receives the JoinIn message, it stops sending JoinEmpty
messages to SwitchB. Every time the LeaveAll timer expires or a LeaveAll
message is received, each switch restarts the LeaveAll timer, Join timer, Hold
timer, and Leave timer. Port 1 of SwitchA sends a JoinIn message to SwitchB
when the Hold timer expires.
4. SwitchB sends a JoinIn message to SwitchC.
5. After receiving the JoinIn message, SwitchC does not create dynamic VLAN 2
because static VLAN 2 has been created.
One-Way Deregistration
LeaveIn
Port 2 Port 3
SwitchB
When VLAN 2 is not required on the switches, the switches can deregister VLAN 2.
The process is as follows:
1. After static VLAN 2 is manually deleted from SwitchA, Port 1 of SwitchA starts
the Hold timer. When the Hold timer expires, Port 1 sends a LeaveEmpty
message to SwitchB. Port 1 needs to send only one LeaveEmpty message.
2. After Port 2 of SwitchB receives the LeaveEmpty message, it starts the Leave
timer. When the Leave timer expires, Port 2 deregisters VLAN 2. Then Port 2 is
deleted from VLAN 2, but VLAN 2 is not deleted from SwitchB because Port 3
is still in VLAN 2. At this time, SwitchB requests Port 3 to start the Hold timer
and Leave timer. When the Hold timer expires, Port 3 sends a LeaveIn
message to SwitchC. Static VLAN 2 is not deleted from SwitchC; therefore,
Port 3 can receive the JoinIn message sent from Port 4 after the Leave timer
expires. In this case, SwitchA and SwitchB can still learn dynamic VLAN 2.
3. After SwitchC receives the LeaveIn message, Port 4 is not deleted from VLAN
2 because VLAN 2 is a static VLAN on SwitchC.
Two-Way Deregistration
LeaveEmpty Port 4
LeaveEmpty
Port 1
LeaveEmpty LeaveIn
Port 2 Port 3
SwitchB
To delete VLAN 2 from all the switches, two-way deregistration is required. The
process is as follows:
1. After static VLAN 2 is manually deleted from SwitchC, Port 4 of SwitchC starts
the Hold timer. When the Hold timer expires, Port 4 sends a LeaveEmpty
message to SwitchB.
2. After Port 3 of SwitchB receives the LeaveEmpty message, it starts the Leave
timer. When the Leave timer expires, Port 3 deregisters VLAN 2. Then Port 3 is
deleted from dynamic VLAN 2, and dynamic VLAN 2 is deleted from SwitchB.
At this time, SwitchB requests Port 2 to start the Hold timer. When the Hold
timer expires, Port 2 sends a LeaveEmpty message to SwitchA.
3. After Port 1 of SwitchA receives the LeaveEmpty message, it starts the Leave
timer. When the Leave timer expires, Port 1 deregisters VLAN 2. Then Port 1 is
deleted from dynamic VLAN 2, and dynamic VLAN 2 is deleted from SwitchA.
SwitchA SwitchC
VLAN 100~1000 VLAN 100~1000
Licensing Requirements
GVRP configuration commands are available only after the S1720GW, S1720GWR,
and S1720X have the license (WEB management to full management Electronic
RTU License) loaded and activated and the switches are restarted. GVRP
configuration commands on other models are not under license control.
For details about how to apply for a license, see S Series Switch License Use
Guide.
Version Requirements
S5710-C-LI V200R001C00
S5730SI V200R011C10
S5730S-EI V200R011C10
NOTE
To know details about software mappings, see Hardware Query Tool.
Feature Limitations
● When many dynamic VLANs need to be registered or the network radius is
large, using default values of timers may cause VLAN flapping and high CPU
usage. In this case, increase values of the timers. The following values are
recommended depending on the number of VLANs.
Table 12-2 Relationship between GARP timer values and number of dynamic
VLANs that need to be registered
Context
Before enabling GVRP on an interface, you must enable GVRP globally. GVRP can
be enabled only on trunk interfaces. You must perform related configurations to
ensure that all dynamically registered VLANs can pass the trunk interfaces.
NOTE
If the VCMP role is the client or server, GVRP cannot be enabled. In this case, run the vcmp role
command to configure the VCMP role as silent or transparent. If GVRP has been enabled, do
not switch the VCMP role to client or server.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run gvrp
GVRP is enabled globally.
Step 3 Run interface interface-type interface-number
The interface view is displayed.
Step 4 Run port link-type trunk
The link type of the interface is set to trunk.
Step 5 Run port trunk allow-pass vlan { { vlan-id1 [ to vlan-id2 ] }&<1-10> | all }
The interface is added to the specified VLANs.
Step 6 Run gvrp
GVRP is enabled on the interface.
By default, GVRP is disabled globally and on each interface.
NOTE
● VLAN configuration will trigger GVRP messages. If too many VLANs are configured, you
are advised to configure VLANs on devices one by one and configure the timer.
Otherwise, dynamic VLANs may flap.
● When many dynamically registered VLANs such as 4094 VLANs are configured, run the
car packet-type gvrp cir cir-value command to increase the CPCAR value. To prevent a
high load on the CPU, the CPCAR cannot be increased infinitely. If the CPCAR values are
adjusted improperly, network services are affected. To adjust the CPCAR values, contact
technical support personnel.
● If an interface is changed to another link type, such as access, hybrid, negotiation-
desirable, or negotiation-auto, the GVRP configuration on the interface is automatically
deleted.
● The blocked interface in instance 0 of STP/RSTP/MSTP can block GVRP packets. The
blocked interfaces of other MSTIs and other ring network protocols such as ERPS, SEP,
RRPP, Smart Link, and VBST cannot block GVRP packets. To ensure that GVRP runs
normally and to prevent GVRP loops, do not enable GVRP on the blocked interface of a
ring network protocol.
● The blocked ports of LBDT cannot block GVRP packets. To ensure that GVRP runs
normally and prevent GVRP loops, do not enable GVRP on the blocked port of LBDT.
----End
Context
A GVRP interface supports three registration modes:
● Normal: In this mode, the GVRP interface can dynamically register and
deregister VLANs, as well as transmit dynamic VLAN registration information
and static VLAN registration information.
● Fixed: In this mode, the GVRP interface is disabled from dynamically
registering and deregistering VLANs and can only transmit the static VLAN
registration information. If the registration mode is set to fixed for a trunk
interface, the interface allows only the manually configured VLANs to pass,
even if the interface is configured to allow all the VLANs to pass.
● Forbidden: In this mode, the GVRP interface is disabled from dynamically
registering and deregistering VLANs and can transmit only information about
VLAN 1. If the registration mode is set to forbidden for a trunk interface, the
interface allows only VLAN 1 to pass even if the interface is configured to
allow all the VLANs to pass.
Procedure
Step 1 Run system-view
NOTE
Before setting the registration mode for an interface, enable GVRP on the interface.
----End
Context
When a GARP participant is enabled, the LeaveAll timer starts. When the LeaveAll
timer expires, the GARP participant sends LeaveAll messages to request that other
GARP participants re-register all of their attributes. The LeaveAll timer then
restarts.
Devices on a network may have different LeaveAll timer settings. In this case, all
the devices use the smallest LeaveAll timer value on the network. When the
LeaveAll timer of a device expires, the device sends LeaveAll messages to other
devices. After other devices receive the LeaveAll messages, they reset their
LeaveAll timers. Therefore, only the LeaveAll timer with the smallest value takes
effect, even if devices have different LeaveAll timer settings.
When using the garp timer command to set GARP timers, pay attention to the
following points:
● The undo garp timer command restores the default values of GARP timers. If
the default value of a timer is out of the valid range, the undo garp timer
command does not take effect.
● The value range of each timer changes along with the values of the other
timers. If a value you set for a timer is not in the allowed range, you can
change the value of the timer that determines the value range of this timer.
● To restore the default values of all the GARP timers, restore the Hold timer to
the default value, and then sequentially restore the Join timer, Leave timer,
and LeaveAll timer to the default values.
When many dynamic VLANs need to be registered or the network radius is large,
using default values of timers may cause VLAN flapping and high CPU usage. In
this case, increase values of the timers. The following values are recommended
depending on the number of VLANs.
Table 12-3 Relationship between GARP timer values and number of dynamic
VLANs that need to be registered
Procedure
Step 1 Run system-view
The default value of the LeaveAll timer is 1000 centiseconds (10 seconds).
The Leave timer length on an interface is restricted by the global LeaveAll timer
length. When configuring the global LeaveAll timer, ensure that all the interfaces
configured with a GARP Leave timer are working properly.
The value of the Hold timer, Join timer, or Leave timer is set.
By default, the value of the Hold timer is 10 centiseconds, the value of the Join
timer is 20 centiseconds, and the value of the Leave timer is 60 centiseconds.
----End
Procedure
● Run the display gvrp status command to view the status of global GVRP.
● Run the display gvrp statistics [ interface { interface-type interface-number
[ to interface-type interface-number ] }&<1-10> ] command to view the
GVRP statistics on an interface.
● Run the display garp timer [ interface { interface-type interface-number [ to
interface-type interface-number ] }&<1-10> ] command to view the values of
the GARP timers.
----End
Context
NOTICE
Cleared GVRP statistics cannot be restored. Exercise caution when you run this
command.
Procedure
Step 1 Run the reset garp statistics [ interface { interface-type interface-number [ to
interface-type interface-number ] }&<1-10> ] command in the user view to clear
GARP statistics on the specified interfaces.
----End
Networking Requirements
In Figure 12-10, company A's headquarters, a branch of company A, and company
B are connected using switches. GVRP is enabled to implement dynamic VLAN
registration.
Branch of
Company B
company A
Configuration Roadmap
The configuration roadmap is as follows:
NOTE
Before enabling GVRP, you must configure the VCMP role as transparent or silent.
Procedure
Step 1 Configure SwitchA.
# Set the link type of GE 0/0/1 and GE 0/0/2 to trunk and configure the interfaces
to allow all VLANs to pass through.
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan all
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type trunk
# Set the link type of GE 0/0/1 and GE 0/0/2 to trunk and configure the interfaces
to allow all VLANs to pass through.
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] port link-type trunk
[SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan all
[SwitchB-GigabitEthernet0/0/1] quit
[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] port link-type trunk
[SwitchB-GigabitEthernet0/0/2] port trunk allow-pass vlan all
[SwitchB-GigabitEthernet0/0/2] quit
# Set the link type of GE 0/0/1 and GE 0/0/2 to trunk and configure the interfaces
to allow all VLANs to pass through.
[SwitchC] interface gigabitethernet 0/0/1
[SwitchC-GigabitEthernet0/0/1] port link-type trunk
[SwitchC-GigabitEthernet0/0/1] port trunk allow-pass vlan all
[SwitchC-GigabitEthernet0/0/1] quit
----End
Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vcmp role silent
#
gvrp
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
gvrp
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
gvrp
#
return
12.9.1 Why Is the CPU Usage High When VLANs Are Created
or Deleted Through GVRP in Default Configuration?
The switch supports VLAN configuration on devices at both ends. When GVRP is
enabled on the network, it advertises information about dynamic VLANs in two
directions. Then the intermediate devices dynamically create and delete VLANs
based on the information. Dynamic maintenance of VLANs can greatly reduce
manual configurations.
The maximum 4 K dynamic VLANs are frequently created and deleted, which
triggers larger amount of packet communication. Receiving packets and delivering
dynamic VLANs occupy large amount of CPU resources.
In actual networking, you need to adjust GARP timers to the recommended values.
NOTE
The recommended values of the GARP timers are as follows:
GARP Hold timer: 100 centiseconds (1 second)
GARP Join timer: 600 centiseconds (6 seconds)
GARP Leave timer: 3000 centiseconds (30 seconds)
GARP LeaveAll timer: 12,000 centiseconds (2 minutes)
When more than 100 dynamic VLANs are created, use the preceding recommended values.
When the number of dynamic VLANs increases, lengths of the GARP timers need to be
increased.