A switch can learn of the capabilities of a device that has just been connected using CDP (Cisco Discovery Protocol). CDP is a Cisco proprietary protocol that allows networking devices to discover information about each other, such as device type, identity, IP address, and capabilities.
The other options do not serve this specific discovery purpose:
- RSTP (Rapid Spanning Tree Protocol) and STP (Spanning Tree Protocol) are used for preventing loops in network topologies.
- VTP (VLAN Trunking Protocol) is used for managing VLAN configurations across a network.
So, the correct answer is CDP.