DTP( Dynamic Trunk Protocol) is a Cisco proprietary trunking protocol. Switches use it on trunk connections to form trunks dynamically. DTP supports five trunking modes: On or Trunk, Desirable, Auto, Off, and No-negotiate.
A trunk link carries traffic from multiple VLANs. It connects two trunk ports. A switch port can work in two modes: access mode and trunk mode. A switch port in access mode is called an access port. In trunk mode, it is called a trunk port.
A trunk port adds VLAN information to frames before forwarding them. Only another trunk port can understand these modified frames. A switch port in access mode does not understand modified frames. If you connect a trunk port to an access port, all communication between both ports will block.
Let us take an example.
You connect two switches. Both switches have VLANs. PC-1, PC-2, PC-5, and PC-6 are members of VLAN-10. PC-3, PC-4, PC-7, and PC-8 are members of VLAN-20.
You connect port-8 of the first switch to port-8 of the second switch. You change the default mode on port-8 to trunk mode on the first switch. You keep the default mode on port-8 of the second switch.
In this network, PC-1 and PC-2 do not have connectivity with PC-5 and Pc-6, even though they are members of the same VLAN. Similarly, PC-3 and PC-4 do not have connectivity with PC-7 and PC-8 even though they are members of the same VLAN.
The reason behind this issue is the wrong port configuration. The first switch is forwarding traffic from both VLANs to the second switch, but the second switch is dropping all traffic. The first switch's port-8 is a trunk port. It is adding VLAN information to each frame before forwarding it to the second switch. The second switch's port-8 is an access port.
In access mode, a port can not understand the tagged traffic.
You can fix this issue by changing the default mode to trunk mode on port-8 of the second switch. After this, PCs in the same VLAN will have connectivity.
DTP protocol
In a large network, manually managing trunk connections is a tedious task. Administrators may accidentally plug in a trunk link to an access port. DTP solves this problem. It dynamically manages trunk connections. Based on the remote port, it automatically updates the configuration of the local trunk port. For example, if the remote port is an access port, it configures the local trunk port to send the frames without VLAN information. If the remote port is a trunk port, it configures the local trunk port to send the frames with VLAN information.
To identify the remote port, it uses DTP messages. It supports five modes: On or Trunk, Desirable, Auto, Off, and No-negotiate.
On or trunk mode
In on or trunk mode, it always assumes the remote port is a trunk port. Since it assumes the remote port as a trunk port, it starts the local port in trunk mode and keeps it in this mode. It generates DTP messages and adds VLAN information to frames. If the remote port is an access port, this mode can block all communication between both ports.
Desirable mode
In desirable mode, it starts the local port in access mode. It generates DTP messages and sends them to the remote port. If the remote port reply to DTP messages, it assumes the remote port is a trunk port and changes the local port's mode to trunk mode. If the remote port does not reply to DTP messages, it assumes the remote port is an access port and keeps the local port in access mode.
Auto mode
In auto mode, it starts the local port in access mode and passively listens for DTP messages from the remote side. If it receives a DTP message from the remote port, it assumes the remote port is a trunk port and changes the local port's mode to trunk mode. This is the default mode on trunk-capable ports on Cisco switches.
No-negotiate
In no-negotiate mode, it starts the local port in trunk mode and adds VLAN information to frames. In this mode, it does not generate and send DTP messages. DTP is a Cisco proprietary protocol. It works only on Cisco switches. If you connect a Cisco switch to a non-Cisco switch, the non-Cisco switch will not understand DTP messages. In that situation, you can use this mode.
Off
In off mode, it starts the local port in access mode and keeps the port in it. In this mode, it neither generates DTP messages nor adds VLAN information to frames.
DTP configuration
The 'switchport mode' command configures the DTP mode. It runs in interface configuration mode. It uses the following syntax.
switch(config)# interface type slot_#/port_# switch(config-if)# switchport mode trunk|dynamic desirable|dynamic auto|nonegotiate
That's all for this tutorial. In this tutorial, we learned about the DTP protocol and its modes.
This tutorial is a part of the tutorial series on VLAN, VTP, and DTP Concepts and Configurations on Cisco Routers. Other parts of this series are the following.
Chapter 01 VLAN Basic Concepts Explained with Examples
Chapter 02 Advantages and Disadvantages of VLANs
Chapter 03 Static and Dynamic VLAN Membership Explained
Chapter 04 Access Link and Trunk Link Explained
Chapter 05 VLAN Tagging Explained with DTP Protocol
Chapter 06 DTP Modes and Protocol Explained
Chapter 07 802.1Q Native VLAN concept Explained
Chapter 08 Cisco Inter-Switch Link (ISL) Explained
Chapter 09 Trunk Tagging and Frame Tagging Explained
Chapter 10 VTP Modes and VTP Protocol Explained
Chapter 11 VTP Pruning on switches Explained
Chapter 12 VLAN Practice Lab Setup in Packet Tracer
Chapter 13 Configure VTP Server and Client in Switch
Chapter 14 VLAN Configuration Commands Step by Step Explained
Chapter 15 Router on Stick Configuration Explained