eTutorials.org
Custom Search

VLAN Pruning

One of the major problems with extending Layer 2 architecture is excessive unwanted traffic on the network. A pruning method can be implemented on Cisco switches to prune VLANs from going to switches that do not have any hosts for that VLAN. It is important to note that although pruning can prevent some unnecessary traffic from being circulated across the network, pruning VLANs does not simplify the spanning-tree topologies.

By default, a trunk port allows all VLANs through the trunk as shown in Example 4-8. Trunk 10/27 goes from Switch1 to Switch4.

Example 4-8. Output of show trunk Command Connected to Switch4

Switch1 (enable) show trunk 10/27

* - indicates vtp domain mismatch

Port      Mode         Encapsulation  Status        Native vlan

--------  -----------  -------------  ------------  -----------

10/27     auto         n-dot1q        trunking      1



Port      Vlans allowed on trunk

--------  ---------------------------------------------------------------------

10/27     1-1005,1025-4094



Port      Vlans allowed and active in management domain

--------  ---------------------------------------------------------------------

10/27     1-3



Port      Vlans in spanning tree forwarding state and not pruned

--------  ---------------------------------------------------------------------

10/27     1-3


An example helps clarify this material. Looking back at Figure 4-8, the trunk ports are permitting all VLAN traffic across the Layer 2 network. Host1 and Host2 are part of VLAN 3. Host3 and Host4 are in VLAN 2. Any broadcast, multicast, or unicast traffic generated by Host2 is received by all the switches. There is absolutely no need for Switch3 and Switch4 to receive these packets because these switches do not have any hosts that are part of VLAN 3. Switch3 and Switch4 will simply drop these packets upon receiving them. Therefore, this exercise is going to demonstrate how to filter or prune the unnecessary traffic from ever hitting Switch3 and Switch4.

Pruning VLAN 3 from Switch3 and Switch4 can happen in one of two ways. The first method discussed is VTP pruning, which is a dynamic process that VTP handles. The second method involved is manually pruning VLANs. Enterprise customers have used both methods to prune VLANs. However, manual pruning is preferred because VTP pruning requires VTP client/server mode operation.

VTP pruning is a global command and affects all the switches in the VTP domain. It only needs to be configured on one switch. All VLANs by default are prune eligible, which means that all VLANs can be pruned. To block specific VLANs from the pruning mechanism, use the clear vtp pruneeligible command. Example 4-9 demonstrates how to configure Switch1 so that it does not forward VLAN 3 traffic to switches that do not have hosts that are part of VLAN 3.

Example 4-9. Enabling VTP Pruning on Switch1

Switch1 (enable) set vtp pruning enable

This command will enable the pruning function in the entire management domain.

All devices in the management domain should be pruning-capable before enabling.

Do you want to continue (y/n) [n]? y

VTP domain Cisco modified


After turning pruning on, port 10/27, which is connected to Switch4, now only receives traffic from VLANs 1 and 2 from Switch1 as the output from Example 4-10 shows. Furthermore, because VTP pruning is a global command, Switch1 sends only VLAN 1 and 3 traffic to Switch2.

Example 4-10. Output of show trunk Command to Switch4 After Pruning Is Enabled

Switch1 (enable) show trunk 10/27

* - indicates vtp domain mismatch

Port      Mode         Encapsulation  Status        Native vlan

--------  -----------  -------------  ------------  -----------

10/27     auto         n-dot1q        trunking      1



Port      Vlans allowed on trunk

--------  ---------------------------------------------------------------------

10/27     1-1005,1025-4094



Port      Vlans allowed and active in management domain

--------  ---------------------------------------------------------------------

10/27     1-3



Port      Vlans in spanning tree forwarding state and not pruned

--------  ---------------------------------------------------------------------

10/27     1-2


Now, consider a situation where Host4 on Switch4 is now part of VLAN 3. Switch4 will be forced to send VTP Join messages back to Switch1 for VLAN 3. As a result, Switch1 will once again start sending VLAN 3 traffic toward Switch4. VTP pruning is a dynamic process that allows or blocks VLAN traffic from the directly connected switches. VTP statistics can be gathered through the show vtp statistics command as shown in Example 4-11. The command shows the number of VTP Join messages transmitted and received. The command can also be used for troubleshooting if any VTP pruning errors occur.

Example 4-11. Output of show vtp statistics Command on Switch2

Switch4 (enable) show vtp statistics VTP pruning statistics:

Trunk    Join Transmitted Join Received Summary advts received from GVRP PDU

                                        non-pruning-capable device  Received

-------- ---------------- ------------- --------------------------- ----------

 10/27     777              780           0                           0

!output omitted for brevity


The second method of pruning involves manually filtering VLANs from trunks. Manual pruning explicitly requires configuring the switch to filter specific VLANs on a trunk. In Figure 4-8, Switch1 must clear the VLAN 3 off the trunk to prevent VLAN 3 traffic from hitting Switch4. In VTP pruning, trunks dynamically allow and prune VLANs based on VTP Join messages. In the manual process, this is not the case. Typically, manual pruning is configured on trunks that will not have any hosts associated with the filtered VLAN. Pruning also affects spanning-tree topology. Using the clear trunk command, manual pruning removes the VLAN from the spanning-tree topology on that switch. Example 4-12 demonstrates removing VLAN 3 from trunk 10/27.

Example 4-12. Removing VLAN 3 from Trunk 10/27

Switch1 (enable) clear trunk 10/27 3

Removing Vlan(s) 3 from allowed list.

Port 10/27 allowed vlans modified to 1-2,4-1005,1025-4094.


The output from Example 4-13 shows the changes after manually pruning VLAN 3. The only active VLANs now on port 10/27 are VLANs 1 and 3.

Example 4-13. VLAN 3 Is Removed from Trunk 10/27

Switch1 (enable) show trunk 10/27

* - indicates vtp domain mismatch

Port      Mode         Encapsulation  Status        Native vlan

--------  -----------  -------------  ------------  -----------

10/27     desirable    dot1q          trunking      2



Port      Vlans allowed on trunk

--------  ---------------------------------------------------------------------

10/27     1-2,4-1005,1025-4094



Port      Vlans allowed and active in management domain

--------  ---------------------------------------------------------------------

10/27     1-2



Port      Vlans in spanning tree forwarding state and not pruned

--------  ---------------------------------------------------------------------

10/27     1-2


Traffic from VLANs 1, 2, and 3 are now going through a single connection, as shown earlier in Figure 4-8. At some point, more bandwidth is needed to help deal with the volume of traffic passing through these switches. Assuming that altering the design of the network is not an option, you can either upgrade to a faster port such as Gigabit or bundle the existing ports into one, thereby, creating a bigger bandwidth connection.