Cisco Discovery Protocol and verifying ports on Enterasys K-Series

Over the past several weeks, the university that I work for has been upgrading their residential network. This process has involved pulling out all of the old switching equipment and replacing it with the brand new Enterasys K10 switches. Many days had been spent pulling out patch cables in all of the residence hall’s network closets. After installing the new switching hardware, a lot of time was spent repatching the closets and documenting which ports on the switch were connected to which jacks in each of the dorm rooms.

Documentation is a very important step in any IT project and this particular project was no different. Our first step in the documentation process involved writing down what jack was connected to what port as they were being connected to the switches.  An easy enough process but definitely not a perfect one, so we added a second step to verify the documentation in the first step. To do this I wrote a script and web application that would utilize the Cisco Discovery Protocol that Enterasys so kindly includes in their switches.

The Cisco Discovery Protocol (CDP) is a Data Link Layer protocol developed by, you guessed it, Cisco. If enabled, the CDP packets can be transmitted on every port of the switch. These packets contain useful information including, but not limited to, Device ID, Port ID, IP address, and even Location. By default, the K-Series will transmit those packets once every minute.  For our project we set them to transmit every five seconds, so that the student employees that would be going room to room, would have to spend as little time as possible in each room.

I tried to find a decent Python module to capture the CDP packet but it proved to a major pain to find a module that would work with the version of Python I was using, so I decided to use Tshark, which is the command-line version of Wireshark.  It can be installed when you install Wireshark. I have the Python program open a tshark process with the display filters set to display only CDP packets and dies after 7 seconds.. The script captures the output of that process once it dies and parses it.  From the output, the script pulls out the Device ID, which is the base mac-address of the devices, and the port number. Once the script has collected that data, it opens a web browser and passes the data to the web application.

The web application is a simple set of php scripts with a MySQL back end. When the first page receives the data, it searches the MySQL database for the room where the jack is located for that particular port and chassis. If the room number is in correct, they can hit submit, if its wrong, they simply can change the room number in that field and click submit.  Any ports with incorrect locations were loaded in to a separate database table.

So far the other students have made it through two of the residence halls with no errors in the documentation, except for that of ports that were added after we had visited those closets.  Hopefully this verification process continues to go smoothly.

This entry was posted in Personal, Technology. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.