Working Mechanism
A simple network is used to describe how GVRP registers and deregisters dynamic VLANs.
Two-way Registration of VLAN Attributes
Create static VLAN 2 on SwitchA and SwitchC, and enable interfaces on SwitchB to automatically join VLAN 2 through GVRP on each GVRP participant.
After static VLAN 2 is created on SwitchA and 10GE1/0/1 joins static VLAN 2, 10GE1/0/1 automatically starts Join and Hold timers. After the Hold timer expires, SwitchA sends a JoinEmpty message to SwitchB.
When 10GE1/0/2 on SwitchB receives the JoinEmpty message, SwitchB creates dynamic VLAN 2 and adds 10GE1/0/2 to dynamic VLAN 2. SwitchB requests 10GE1/0/3 to start the Join and Hold timers. When the Hold timer expires, SwitchB sends a JoinEmpty to SwitchC.
When 10GE1/0/4 on SwitchC receives the JoinEmpty message, SwitchC creates dynamic VLAN 2 and adds 10GE1/0/4 to dynamic VLAN 2.
After one-way registration of VLAN attributes is complete, 10GE1/0/1, 10GE1/0/2, and 10GE1/0/4 are added to VLAN 2 but 10GE1/0/3 is not added to VLAN 2. VLAN attribute registration from SwitchC to SwitchA is required so that traffic of VLAN 2 can be bidirectionally transmitted. The process is as follows:
Static VLAN 2 is created on SwitchC (the dynamic VLAN is replaced by the static VLAN). 10GE1/0/4 of SwitchC starts Join and Hold timers. When the Hold timer expires, SwitchC sends a JoinIn message to SwitchB.
After 10GE1/0/3 on SwitchB receives the JoinIn message, SwitchB adds 10GE1/0/3 to VLAN 2 and requests 10GE1/0/2 to start Join and Hold timers. When the Hold timer expires, SwitchB sends a JoinIn message to SwitchA.
During two-way registration, after the Join timer expires, the switch waits for the period of the Hold timer and sends a JoinEmpty or JoinIn message. (The switch sends the JoinEmpty or JoinIn message twice at most.) 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, the switch restarts the LeaveAll timer, Join timer, Hold timer, and Leave timer. 10GE1/0/1 on SwitchA sends a JoinIn message to SwitchB when the Hold timer expires. SwitchB sends a JoinIn message to SwitchC. After receiving the JoinIn message, SwitchC does not create dynamic VLAN 2 because static VLAN 2 has been created.
To facilitate the description, static VLAN 2 is first created on SwitchA, and then is created on SwitchC. In practice, static VLANs can be created on devices simultaneously to implement two-way registration.
Two-way Deregistration of VLAN Attributes
When static VLAN 2 is not required on SwitchA and SwitchC, VLAN 2 can be deleted through the VLAN attribute deregistration process.
After static VLAN 2 is manually deleted from SwitchA, 10GE1/0/1 on SwitchA starts the Hold timer. When the Hold timer expires, SwitchA sends a LeaveEmpty message to SwitchB.
After 10GE1/0/2 on SwitchB receives the LeaveEmpty message, 10GE1/0/2 starts the Leave timer. When the Leave timer expires, 10GE1/0/2 deregisters VLAN 2. Then 10GE1/0/2 is deleted from VLAN 2, but VLAN 2 is not deleted from SwitchB because 10GE1/0/3 3 is still in VLAN 2. SwitchB requests 10GE1/0/3 to start Hold and Leave timers. When the Hold timer expires, SwitchB sends a LeaveIn message to SwitchC.
After SwitchC receives the LeaveIn message, 10GE1/0/4 is not deleted from VLAN 2 because static VLAN 2 on SwitchC is not deleted. VLAN 2 is a static VLAN on SwitchC. 10GE1/0/3 can receive the JoinIn message sent from 10GE1/0/4 after the Leave timer expires. In this case, SwitchA and SwitchB can still learn dynamic VLAN 2. To delete VLAN 2 from all the switches, delete static VLAN 2 from SwitchC. After static VLAN 2 is deleted from SwitchC, 10GE1/0/4 on SwitchC starts the Hold timer. When the Hold timer expires, SwitchC sends a LeaveEmpty message to SwitchB.
After SwitchB receives the LeaveEmpty message, 10GE1/0/3 starts the Leave timer. When the Leave timer expires, 10GE1/0/3 deregisters VLAN 2. Then 10GE1/0/3 is deleted from VLAN 2, and dynamic VLAN 2 is deleted from SwitchB. At this time, SwitchB requests 10GE1/0/2 to start the Hold timer. When the Hold timer expires, 10GE1/0/2 sends a LeaveEmpty message to SwitchA. After 10GE1/0/1 on SwitchA receives the LeaveEmpty message, 10GE1/0/1 starts the Leave timer. When the Leave timer expires, 10GE1/0/1 deregisters VLAN 2. Then 10GE1/0/1 is deleted from VLAN 2, and dynamic VLAN 2 is deleted from SwitchA.
During two-way deregistration, after the Leave timer expires, the switch waits for the period of the Hold timer and sends a LeaveEmpty or LeaveIn message. (The switch sends the LeaveEmpty or LeaveIn message twice at most.)
To facilitate the description, static VLAN 2 is first deleted from SwitchA, and then is deleted from SwitchC. In practice, static VLANs can be deleted on devices simultaneously to implement two-way deregistration.