I apologize in advance if my questions is too simplistic as i am no expert in networking. I am working on a project and i need to know if it is possible to dynamically determine the type of device connected to a switch port. Switches connect end hosts using access ports and connect to other switches using Trunk ports. I want to know if its possible to programmatically track the type of devices connected to each switch port. One idea i came across was to monitor the type of traffic incoming from each port. For example incoming DNS requests could suggest that it is a host connected to the switch but since trunk connections carry all sorts of messages including DNS packets which makes it hard to be sure of the device type connected to the port. Any existing methods and references will be highly appreciated. Thank you.
On a Cisco environment it is possible to use Cisco Smartports.
Auto Smartports uses event triggers to map macros to the source port of the event. The most common triggers are based on Cisco Discovery Protocol (CDP) messages received from a connected device. A CDP event trigger occurs when these devices are detected:
• Cisco switch
• Cisco router
• Cisco IP Phone
• Cisco Wireless Access Point including autonomous and lightweight access points
• Cisco IP video surveillance camera
Additional event triggers for Cisco and third-party devices are user-defined MAC address groups, MAC authentication bypass (MAB) messages, IEEE 802.1x authentication messages, and Link Layer Discovery Protocol (LLDP) messages.
LLDP supports a set of attributes used to discover neighbor devices. These type, length, and value attributes and descriptions are referred to as TLVs. LLDP-supported devices use TLVs to receive and send information. This protocol advertises details such as device configuration information, capabilities, and identity. Auto Smartports uses the LLDP system capabilities TLV as the event trigger. Use the event trigger control feature to specify if the switch applies a macro based on the detection method, device type, or configured trigger.
For devices that do not support CDP, MAB, or 802.1x authentication, such as network printers, LLDP, or legacy Cisco Digital Media Players, you can configure a MAC address group with a MAC operationally unique identifier (OUI)-based trigger. You map the MAC address to a built-in or user-defined macro that has the desired configuration.