VTP Pruning is a feature that can be enabled when the switch is in the Server mode and will be applied to all switches in the same domain if VTP pruning is enabled on one server. The command for VTP pruning is “#vtp pruning” on the switch’s configuration mode. This feature can filter and block unnecessary information.
Take for example switch A that has VLAN 2-20 enabled on it, and switch B that has VLAN 15-25 enabled on it. Without VTP pruning, advertisements are being broadcasted from switch A to B and backwards for all the VLANS. This will result in useless traffic being sent, since switch B does not have VLAN 2-14 on it and does not need this “waste” of information/traffic. Switch B needs only information for VLAN 15-20. The same goes for switch A that receives broadcasts for VLAN 15-25, while it needs only information for VLAN 15-20.
By using VTP pruning, the problem above can be avoided. The receiving switch will automatically detect and prune unnecessary VLAN information (traffic) so that only usable information will be forwarded.
VTP (Virtual Trunking Protocol) is a Cisco layer 2 proprietary protocol that allows each switch in the network to have an overall view of the active VLANs. VTP can add, delete or modify VLANs and is distributed over the network thus reduce administration in every switch manually.
Without VTP, a switch configuration will not be forwarded to the other switches in the network. This can be a major problem when a switch creates a VLAN. With VTP, this problem can be prevented because VTP notify their neighbors by sending VTP advertisements originating from the switch that sends the advertisement. However, VTP advertisements can only happen in network with the same domain. These advertisements are multicast but are only send to switches trunking with the local switch.
In default, a cisco switch does not have a domain. To create a domain, type the command “vtp domain XXX” (with XXX is the domain name) in the switch’s configuration mode. Do the same on the other switches that needs to be put in the same domain. A cisco switch can only belong to 1 domain only.
There are also operating modes marked by VTP Operation Mode in the “show vtp status” command. The default setting of Cisco switches is in the “SERVER” mode. In this mode, a VTP switch can be used to add, delete or modify VLANs. Therefore, a VTP domain deployment needs to have at least 1 VTP set in the “Server” mode (make sure this switch is really secured physically). Another mode is the “CLIENT” mode. This mode cannot do anything except listen for VTP advertisement and change its settings if required by the advertisement. The last mode is the “TRANSPARENT” mode. This mode is used when the switch is set not to advertise its VLAN configuration and not to synchronize its VLAN configuration based on VTP received advertisements. VLANS can be created, changed or deleted when in transparent mode but are locally significant only. In VTP version 1, transparent switches forwards only VTP messages that they receive from VTP advertisements but do not synchronize or send its VTP configuration ONLY if the VTP version number and domain name on that switch is the same as on its downstream switches. In VTP version 2, transparent switches forwards only VTP messages that they receive from VTP advertisements but do not synchronize or send its VTP configuration even though the domain name doesn’t match. To switch between these modes type the “vtp mode client/server/transparent” in the switch configuration mode.
A VTP advertisement itself will be sent if the Configuration Revision on the switch (in the Server mode) is changed/added. The receiving switch (either in client or server mode) will inspect the value of the revision. If the value is higher than its own configuration revision number, then the receiving switch will revise its configuration according to the advertisement. If it receives a lower or the same value, it will not change its value. To reset a switch’s revision number change the VTP domain name to a nonexistent domain and change it back to the original name or a second way is to change the VTP mode to transparent and then back to the server mode.
A switch is a layer 2 device that can be used to forward data from one device to another device. It does that by comparing its database of MAC addresses with the incoming traffic MAC address and port, and where its destination MAC address and port. Although this data can be put in manually (static), it is easier to let the switch learn these MAC addresses automatically (dynamic). This is also useful when the end user devices such as PC connects and disconnects often on different ports.
Basically, a switch first time powered on switch has an empty table. When it received its first frame lets say from PC A, it will save the incoming packet’s MAC address and port on its table. Because it doesn’t know where to send the packets (since the table is empty), it will forward the packet to all ports except from the port it came from. It will then wait for the packet replied by one of the devices attached to it (e.g PC D that is the real destination) and save that MAC address and port. So, next time when another PC sends a packet to PC D it will then go directly to PC D because the switch knows already where to send the packet to based on its table. This goes so on with other packets until all the MAC table and ports are built completely.
In overall, there will be 4 possibilites for forwarding data in a switch. The first one is if there is unicast data from originating device to destination device. If the MAC address of the destination device is known, it will be forwarded to the specific port. Second one, if the data is unicast and the destination device is not known yet in the switch’s database, it will be sent out to every port except from where it came from. The third one is if the data is sent to a MAC address that is known to come from the same port it originates. In this case, this frame will be filtered by the switch and will not be forwarded by the switch to any port. The fourth and last one is multicast or broadcast (remember: broadcast uses ff:ff:ff:ff:ff:ff as destination address). In this case the switch will sent to the designated ports or every port except where it came from.