VLAN Tagging Explained with DTP Protocol

VLAN tagging is a switch feature. It allows switches to exchange VLAN information. DTP is a Cisco proprietary protocol. It works only on Cisco switches. It dynamically manages VLAN tagging.

By default, a switch forwards a broadcast message from all ports except the port on which it received the broadcast message. VLAN is a switch feature. It allows us to create a group of switch ports that share broadcast messages. VLAN configuration is a two steps process. First, we define a VLAN. Then, add switch ports to it. After VLAN configuration, a switch forward broadcast messages only between VLAN members.

Let us take an example.

The following image shows an 8-port switch before the VLAN configuration.

broadcast message out

Now, we create two VLANs: VLAN-10 and VLAN-20. We add switch ports 1, 2, 3, and 4 to VLAN-10 and switch ports 5, 6, 7, and 8 to VLAN-20.

The following image shows the switch after the VLAN configuration.

broadcast message in vlans

The following steps explain broadcast communication between VLAN-10 devices.

  • A device connected to port-1 generates a broadcast message.
  • The message reaches to switch on port-1.
  • Switch checks VLAN configuration on port-1.
  • Port-1 is a member of VLAN-10. Other members of this VLAN are ports 2, 3, and 4. Switch forwards the message from these ports.

The following steps explain broadcast communication between VLAN-20 devices.

  • A device connected to port-7 generates a broadcast message.
  • The message reaches to switch on port-7.
  • Switch checks VLAN configuration on port-7.
  • Port-7 is a member of VLAN-20. Other members of this VLAN are ports 5, 6, and 8. Switch forwards the message from these ports.

If all VLAN members are on the same switch, the switch can easily forwards broadcast messages between them. But if some VLAN members are on other switches, the switch can not forward broadcast messages to them directly.

The following image shows a network.

vlan on different switches

In this network, VLAN members are on different switches. Switches are connected through a link on port 8.

The following steps explain broadcast communication between Switch-A's devices.

  • PC-A generates a broadcast message.
  • The broadcast message reaches Switch-A on port-1.
  • Switch-A forwards the message from ports 2 and 3.
  • Since it has no information about the VLANs available on Switch-2, it does not forward the message from port -8.

broadcast communication

Even if Switch-A forwards the message from port-8, Switch-B will not forward it from ports belonging to its VLAN. Switch-B has no information about the message's VLAN.

VLAN tagging

VLAN tagging is a switch feature. It allows the switch to add VLAN information to frames. Switch-A adds VLAN information to each frame before forwarding it from the port connected to another switch. The process of adding information is called VLAN tagging.

Switch-B uses the attached information to identify frames' VLANs. Since end devices do not understand modified frames, it removes attached information from all frames before forwarding them to their ports.

The following image shows how switches use VLAN tagging to exchange VLAN information.

broadast on different switches

Not all switch ports can add and read VLAN information. A switch port adds and reads VLAN information only when you change its mode to tunk. A switch port can work in two modes: access and trunk. In access mode, it does not add and remove VLAN information to frames. In trunk mode, it adds and removes VLAN information to frames. Access mode is the default mode on all switch ports.

If you connect a switch port to another switch port, you need to change the default mode to trunk mode on both ports.

DTP protocol

A DTP protocol dynamically manages trunk connections. Based on the connected device, it automatically changes the switch port's mode. For example, if the connected device is a switch, it changes the port's mode to trunk mode. If the connected device is a PC or server, it changes the port's mode to access mode.

ComputerNetworkingNotes CCNA Study Guide VLAN Tagging Explained with DTP Protocol