Showing posts with label VLAN. Show all posts
Showing posts with label VLAN. Show all posts

Wednesday, August 7, 2013

VLAN Trunking Protocol

VLAN Trunking Protocol, or VTP, is a Cisco-proprietary protocol that propagates VLAN information from one switch acting as a server to other switches in the same domain.  The information is multicast from the switch configured as the server to other switches in the domain using the MAC address 01-00-0C-CC-CC-CC, to which only Cisco devices respond.

The three modes for VTP are:

  1. Server - updates are made on any switch configured as a server and multicast to other participating members of the domain.  This is the default mode for Cisco switches
  2. Client - updates are not allowed to be made, but they receive updates from servers
  3. Transparent - updates are able to be made to the local vlan database only, although the switch will forward updates
 When a change is made on a VTP server, it updates its revision number and sends the update to other systems in the domain.  If a switch receives the update and the revision number is higher than the rev currently on that switch, it adds the update to its database and updates its own revision.  If the rev is lower than its current running revision, it sends a response to the sender to update.  If the rev is the same number, it ignores the update.

In client mode, switches simply get their vlan information from a VTP server.  Updates cannot be made on them, but the do forward VTP updates to keep the domain synchronized.  They do not store any VLAN information, so when they reboot there is no configuration retained.  Rather, they pull the latest revision from a server each boot.

Transparent mode in VTP will not accept revision changes in the VTP domain, but you are able to create and modify local VLANs on the switch.  Transparent mode switches will forward VTP updates to other downstream switches should there be any to keep the domain consistent.  Transparent mode switches store vlan information in the startup and running-config instead of in the vlan database, which is why they do not propagate VLAN info to other switches.  Also, when using VTP Transparent mode, you are able to use extended VLANs beyond the default 1-1005.  VTP transparent mode allows the use of 1006-4096 for local VLANs only.

Exercise caution when adding switches to your network in server mode.  If the revision number on the new switch is higher than the running configuration, and you have not added any VLANs to it when you introduce it to the network, all VTP members will overwrite their existing VLAN database with the empty database of the new switch.  (NOTE:  I have seen this happen in a large production environment.  It's what I call an "RGE" or "resume generating event.")  To avoid this trouble, configure new switches as client or transparent when introducing them to the domain.  To reset the revision number, change the domain to a bogus name and back again, or change the mode to client or transparent before introducing the new switch.

VLAN information is sent over trunk links to all other switches, whether or not the VLANs are in use on the downstream switches.  To conserve bandwidth on trunk links, a VTP server can enable VTP pruning.  Pruning essentially limits VTP updates to switches that have that VLAN active, or assigned to a port, in that VLAN.  If the VLAN doesn't exist on the receiving switch, it does not accept the update.

To configure VTP on a switch, enter config mode and use the vtp command.  The default domain is null, and you must match the case-sensitive domain and password on all switches to participate.  If a switch is in server or client mode, it will inherit the domain from a server's summary advertisement once introduced.

Use the command:

R1#show vtp status

to determine the VTP revisino number, the operating mode of the switch, the pruning status, domain and MD5 password hash.  This is the main troubleshooting tool for VTP.


Tuesday, August 6, 2013

VLAN trunking

OK, my last post said I was going to do some STP, but I think we're going to do some VLAN trunking before bed tonight.

VLAN trunks are links that carry multiple VLANs across them.  When a packet traverses a trunk, it is "tagged" with a VLAN number.

Cisco's default protocol for trunking is ISL - or Inter Switch Link.  ISL adds 26 bytes to the header with the VLAN info and 4 bytes to the end of the packet as a CRC.  Because the packet has these additional 30 bytes, it may exceed the default 1518 byte MTU on Cisco switches and drop the packet.  Because of this, an ISL trunk needs to be a point-to-point connection with no devices in between.

802.1q trunking is the IEEE's trunking protocol. Instead of adding to the header, it inserts the 4-byte VLAN information into frame after the source address.  Because the original size of the packet changes, a new CRC must be calculated and the frame's FCS modified.

A native VLAN is a feature of 802.1q trunks and not ISL.  Traffic reaching the switch on the VLAN defined as the native VLAN is not tagged as it goes across the trunk.  For this reason, it is important to make sure the native VLAN on both sides of a trunk is the same, or data will leak from one VLAN to another.

Cisco has a proprietary protocol called DTP, or Dynamic Trunking Protocol.  Depending on the port's condition, a trunk can be dynamically created when the switches are plugged in.  The trunk port types are:

  1. Access - no trunking will take place
  2. Trunk - the port trunks only
  3. Dynamic desireable - the port will turn itself into a trunk if the other end is dynamic desirable, dynamic auto or trunk
  4. Dynamic Auto - the port will become a trunk if the other end is dynamic desirable or trunk
  5. Nonegotiate - the port will trunk permanently, but will not negotiate DTP to accommodate non-Cisco switches
 To determine a port's trunk status, use the

R1#show interface trunk

command.  This will show the status of the port as well as its trunking protocol and default vlan.  If a port is not seen in the

R1#show vlan

command output, it is configured as a trunk port and will only appear in the show interface trunk output.


Monday, August 5, 2013

Some random Layer 2 thoughts

802.1q inserts 4 bytes into the frame header and recalculates the FCS, and this identifies the VLAN.  This is called a "tag."

VTP traffic is sent over VLAN1, so all trunks must be configured to send traffic on that VLAN.