VLAN Trunking Protocol
To provide VLAN connectivity throughout the switched network, VLANs must be configured on each switch. If you are going to trunk VLAN10 from Switch A to Switch C through Switch B, as shown in Figure 3-11, VLAN10 must exist on Switch B even though none of the access ports on that switch are in VLAN10.
Figure 3-11 Purpose for VTP
To ensure that a VLAN exists between every pair of Trunked switches, an administrator must manually create all the needed VLANs on each of the switches individually. Cisco's VLAN Trunking Protocol (VTP) provides an easier method for maintaining consistent VLAN configuration throughout the switched network.
VTP is a protocol used to distribute and synchronize identifying information about VLANs configured throughout a switched network. Configurations made to a single VTP server are propagated across trunk links to all connected switches in the network. VTP enables switched network solutions to scale to large sizes by reducing the network's manual configuration needs.
VTP is a Layer 2 messaging protocol that maintains VLAN configuration consistency throughout a common administrative domain by managing the additions, deletions, and name changes of VLANs across networks. VTP minimizes misconfigurations and configuration inconsistencies that can cause problems, such as duplicate VLAN names or incorrect VLAN-type specifications.
A VTP domain is one switch or several interconnected switches sharing the same VTP environment. A switch can be configured only in one VTP domain.
By default, a Catalyst switch is in the no-management-domain (or null domain) state until it is configured with a domain or receives an advertisement for a domain over a trunk link. Configuration changes made to the VLANs on a single VTP server switch are propagated across Trunk links to all trunk-connected switches in the network.
Figure 3-12 illustrates how VLAN configuration information is propagated from switch to switch.
Figure 3-12 VTP Operation
Figure 3-12 shows a VLAN added to the switched network. The steps illustrated in the figure are as follows:
A new VLAN is added. At this point, VTP makes your job easier.
The VTP advertisement is sent to the other switches in the VTP domain.
The new VLAN is added to the other switch configurations. The result is consistent VLAN configuration.
VTP Modes
VTP operates in one of three modes:
Server mode
Client mode
Transparent mode
The default VTP mode is server mode, but VLANs are not propagated over the network until a management domain name is specified or learned and trunking has been established. A Catalyst switch operating in the VTP server mode can create, modify, and delete VLANs and other configuration parameters for the entire VTP domain. In server mode, VLAN configurations are saved in the Catalyst nonvolatile random-access memory (NVRAM). When you make a change to the VLAN configuration on a VTP server, the change is propagated to all switches in the VTP domain. VTP messages are transmitted out all trunk connections, such as ISL.
A device operating as a VTP client cannot create, change, or delete VLANs. A switch in client mode does send VTP messages, however. A VTP client does not save VLAN configurations in nonvolatile memory.
In both client and server mode, the switches synchronize their VLAN configuration to that of the switch with the highest revision number in the VTP domain.
A switch operating in VTP transparent mode does not create VTP advertisements or synchronize its VLAN configuration with information received from other switches in the management domain. A switch in transparent mode forwards VTP advertisements received from other switches that are part of the same management domain. A switch configured in VTP transparent mode can create, delete, and modify VLANs, but the changes are not transmitted to other switches in the domain; they affect only the local switch. Table 3-1 offers a comparative overview of the three VTP modes.
Table 3-1 VTP Modes
Server Mode |
Client Mode |
Transparent Mode |
Sends/forwards VTP advertisements. |
Sends/forwards VTP advertisements. |
Forwards VTP advertisements. |
Synchronizes VLAN configuration information with other switches. |
Synchronizes VLAN configuration information with other switches. |
Does not synchronize VLAN configuration information with other switches. |
VLAN configurations are saved in NVRAM. |
VLAN configurations are not saved in NVRAM. |
VLAN configurations are saved in NVRAM. |
Catalyst switch can create VLANs. |
Catalyst switch cannot create VLANs. |
Catalyst switch can create VLANs. |
Catalyst switch can modify VLANs. |
Catalyst switch cannot modify VLANs. |
Catalyst switch can modify VLANs. |
Catalyst switch can delete VLANs. |
Catalyst switch cannot delete VLANs. |
Catalyst switch can delete VLANs. |
When setting up VTP on a switch, choosing the appropriate mode is important. Because VTP is a simple and dangerous tool, it can overwrite VLAN configurations on some switches and create network problems. The next section further explains this phenomenon. Nevertheless, you must be aware that the mode you choose can eliminate the chance of these problems:
Choose server mode for the switch that you will use to create, change, or delete VLANs. The server will propagate this information to other switches that are configured as servers or clients.
Set client mode on any switch where you do not want to create, change, or delete VLANS.
Use transparent mode on a switch that needs to pass VTP advertisements to other switches but also needs the capability to have its VLANs independently administered.
How VTP Works
VTP advertisements are flooded throughout the management domain every five minutes or whenever a change occurs in VLAN configurations. VTP advertisements are sent over a factory default VLAN (VLAN 1) using multicast frames. Included in a VTP advertisement is a configuration revision number. A higher configuration revision number indicates that the VLAN information being advertised is more current than the stored information.
A device that receives VTP advertisements must check various parameters before incorporating the received VLAN information.
First, the management domain name and the password, which can be configured to prevent unauthorized switches from altering the VTP domain, must match those configured in the local switch before information can be used.
Next, if the configuration revision number indicates that the message was created after the configuration currently in use, the switch overwrites its VLAN database with the advertised VLAN information. To reset the configuration revision number on a Catalyst switch, you must either change the switch mode to transparent then back to server or client with the command vtp mode [server | client | transparent] in global configuration mode, or change the VTP domain name and then set it back using the command vtp domain name in global configuration mode. Example 3-1 demonstrates changing the mode and then setting it back to reset the configuration revision number. The command show vtp status is executed before and after the change to show the configuration number being reset.
Example 3-1 Resetting a Switches VTP Configuration Revision Number
Switch#show vtp status VTP Version : 2 Configuration Revision : 5 Maximum VLANs supported locally : 250 Number of existing VLANs : 10 VTP Operating Mode : Server VTP Domain Name : switch_domain_1 VTP Pruning Mode : Disabled VTP V2 Mode : Disabled VTP Traps Generation : Disabled MD5 digest : 0x1E 0xED 0x19 0x49 0x0F 0x37 0x65 0x64 Configuration last modified by 192.168.255.21 at 3-1-93 00:02:39 Local updater ID is 192.168.255.21 on interface Vl1 (lowest numbered VLAN interface found) Switch#config t P2_2950(config)#vtp mode transparent Setting device to VTP TRANSPARENT mode. Switch(config)#vtp mode server Setting device to VTP SERVER mode Switch(config)#end Switch#show vtp status VTP Version : 2 Configuration Revision : 0 Maximum VLANs supported locally : 250 Number of existing VLANs : 10 VTP Operating Mode : Server VTP Domain Name : switch_domain_1 VTP Pruning Mode : Disabled VTP V2 Mode : Disabled VTP Traps Generation : Disabled MD5 digest : 0x1E 0xED 0x19 0x49 0x0F 0x37 0x65 0x64 Configuration last modified by 192.168.255.21 at 3-1-93 00:02:39 Local updater ID is 192.168.255.21 on interface Vl1 (lowest numbered VLAN interface found)
NOTE
Underscores are used in the VTP domain name because a domain name cannot contain spaces.
One of the most critical components of VTP is the configuration revision number. Each time a VTP server modifies its VLAN information, it increments the configuration revision number by one. The VTP server then sends out a VTP advertisement with the new configuration revision number. If the configuration revision number being advertised is higher than the number stored on the other switches in the VTP domain, the other switches will overwrite their VLAN configurations with the new information being advertised. The configuration revision number in VTP transparent mode is always 0. Figure 3-13 illustrates how VTP operates in a switched network.
CAUTION
The overwrite process would mean that the VTP server with the highest revision number determines the overall VLAN configuration for the domain. For example, if you deleted all VLANs on a VTP server and that server had the higher revision number, the other devices in the VTP domain would also delete their VLANs. This could create a loss of connectivity.
Figure 3-13 VTP Operation
VTP Pruning
Because ISL trunk lines carry VLAN traffic for all VLANs by default, some traffic might be needlessly flooded across links that do not need to carry that traffic. VTP pruning uses VLAN advertisements to determine when a trunk connection is flooding traffic needlessly.
By default, a trunk connection carries traffic for all VLANs in the VTP management domain. Often, some switches in an enterprise network do not have local ports configured in each VLAN. In Figure 3-14, Switches 1 and 4 support ports statically configured in VLAN10. As illustrated, with VTP pruning enabled, when Station A sends a broadcast, the broadcast is flooded only toward any switch with ports assigned to VLAN10. As a result, broadcast traffic from Station A is not forwarded to Switches 3, 5, and 6 because traffic for VLAN10 has been pruned on the links indicated on Switches 2 and 4. Pruning must be enabled on one VTP server, and it will be propagated to all other switches in the VTP domain.
VTP pruning increases available bandwidth by restricting flooded traffic to those trunk links that the traffic must use to access the appropriate network devices.
NOTE
Because VLAN1 is the management VLAN and is used for administrative functions such as VTP advertisements, it will not be pruned from a trunk line by VTP pruning.
Figure 3-14 VTP Pruning