Arduino CDP Revisited

During some down time I’ve decided to revisit the Arduino CDP sniffer and add extra features. This will be a running post and will be updated periodically.

As mentioned in the comments of the other post I will be looking at adding LLDP support and an export feature to a mobile/laptop.

The export or “history” addition will allow a log to be saved to an external device as easy as possible. As a prototype, it’s had an ESP8266 added to it with a web server running showing modified serial output.

Initial results work, but I’m again getting plagued with power issues from the ESP8266’s. Getting those 3.3v and enough amps into the original container will be problematic.

The benefit of this is it’s exported as text for future use.

Update 28/02/2019

LLDP is an active work in progress, and should be finished soon.

WIFI was a good idea and may be revisited later. Instead I’ve replaced it with what should have been thought of a while ago. I’ve redesigned the case to integrate the bluetooth to serial converter (HC-06 with dual DB9’s). When connected to the bluetooth, its as simple as flicking a switch to go from the external DB9 port to the output of the screen (as show above) and back again.

Update 05/03/2019

I’ve tested the LLDP code against a Dell 3548 with all TLV options enabled. It doesn’t show the VLAN number but the rest of the information could be scraped:

While it doesn’t fully support the standard it does provide enough information to find what is on the other end of a cable and how it’s configured – enough to satisfy a field test.

The current space usage on the Arduino Mini Pro is at about 52% and the LCD can fit about 4 more lines of text, so more support can be added. The next step will be to decode the enabled capibilites, port description, chassis subtype and MAC/PHY Configuration/Status.

Update: 08/03/2019

  • CDP: Added Voice VLAN and Capabilities. No further features of CDP will be added
  • LLDP: Added Capabilities. Without a production environment to test on, there will most likely be no further additions.

**NOTE: The RST pin on the LCD has been changed to pin 9, and a new wiring diagram will be created soon to reflect the Bluetooth changes.

Update:10/03/2019

Circuit has been updated to add it’s own charging circuit, including the battery level displayed on the screen. It’s still in Beta at the moment, as the battery levels stick at 98% even when charging, and after extensive use.

Update: 16/03/2019

  • Added LLDP VLAN ID and Voice VLAN ID.
  • Uploaded the project code to github for better version control: https://github.com/ModLogNet/CDP-LLDP-with-arduino
  • Cheers Colin for your assistance.
  • If your testing the LLDP portion and some fields aren’t displayed, **PLEASE** Check which LLDP-Med TLV’s enabled on the switch/router and confirm what information is being displayed with Wireshark before posting comments.
  • NOTE: Due to memory constraints on the Arduino mini pro – Capabilities are disabled, and the battery status is still in Beta.

New case to accommodate battery and charge circuit:

1 switch is for power, the other defines what is output through Bluetooth (screen or Serial port).

8 thoughts on “Arduino CDP Revisited

  1. Hi Colin,

    The source code has been uploaded in the post above. You’ll see some of the old functions have been re-used to save on space and at least one new reference needs to be added for code I used to decode the capability bits. Also note the RST reassignment on the LCD to pin 9 on the Arduino. I found this more re-liable when initializing the LCD.
    Let me know how it goes.

    Cheers.

  2. Hi Kristian,

    Thanks for the code. It looks to work. Only why isn’t the VLAN displayed using LLPD? I have other LLPD software that does displays the VLAN. Also I don’t see this on the while loop of LLPD.

    And what is the Voice VLAN. Is that a tagged VLAN? And I only see this option with CDP. Is this not available in the LLPD protocol?

    • ON the Dell switch I used for testing, I don’t believe it fully supports LLDP as it didn’t show “IEEE – port VLAN ID” in the wireshark captures I got from it. It only shows in the LLDP-MED TLV’s when voice is turned on (its a Dell 3548). I have found an LLDP packet capture from online, but I cant test it, so I’ll be going at it somewhat blind. The packet capture I found came from a Cisco 3560 running IOS 12.2(44)SE. Hopefully it will be useful.

  3. I have an LLDP packet capture. Only I will not see how you convert this to the relevant code. Email me otherwise. You have my email address

Leave a Reply to Colin Cancel reply

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

*