VLAN registration: adds interfaces to VLANs.
VLAN deregistration: removes interfaces from VLANs.
GVRP registers and deregisters VLAN attributes through attribute declarations and reclaim declarations as follows:
When an interface receives a VLAN attribute declaration, it registers the VLAN specified in the declaration. The interface is added to the VLAN.
When an interface receives a VLAN attribute reclaim declaration, it deregisters the VLAN specified in the declaration. The interface is removed from the VLAN.
Interface register or deregister VLANs only when they receive GVRP 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 Join message from another participant or when it is configured with attributes statically, it also sends Join messages to other devices for the devices to register the new attributes.
JoinEmpty message: declares an unregistered attribute.
JoinIn message: declares a registered attribute.
Leave message
When a GARP participant expects other devices to deregister its attributes, it sends Leave messages to other devices. When the GARP participant receives a Leave message from another participant or when some of its attributes are deregistered statically, it also sends Leave messages to other devices.
LeaveEmpty message: deregisters an unregistered attribute.
LeaveIn message: deregisters a registered attribute.
LeaveAll message
When a participant starts, it starts the LeaveAll timer. When the LeaveAll timer expires, the participant sends LeaveAll messages to other devices.
A participant sends LeaveAll messages to deregister all attributes so that other participants can re-register attributes of the local participant. LeaveAll messages are used to periodically delete useless attributes on the network.
For example, an attribute of a participant is deleted. Due to a sudden power failure, the participant does not send Leave messages to request other participants to deregister the attribute. In this case, the attribute becomes useless, necessitating the use of a LeaveAll message.
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.
In normal mode, dynamic VLANs can be registered on interfaces, and interfaces can send declarations of static VLANs and dynamic VLANs.
In fixed mode, dynamic VLANs cannot be registered on interfaces, and interfaces can send only declarations of static VLANs.
In forbidden mode, dynamic VLANs cannot be registered on interfaces. All VLANs except VLAN 1 are deleted from interfaces, and interfaces can send only the declaration of VLAN 1.