Use I²C To Make SFP Modules Cisco Compatible

Use I²C To Make SFP Modules Cisco Compatible

A Day in the Life of a Junior Network Engineer

Responding to Alerts

  • The junior network engineer receives an alert about a down fiber link while on-call, prompting immediate action.
  • After preparing with coffee and gathering spare SFPs, the engineer heads to the data center to address the issue.

Troubleshooting SFP Issues

  • Upon replacing the SFP in a Cisco switch, it fails to work due to compatibility issues; Cisco switches prefer their own optics.
  • The speaker notes that while redundancy should prevent catastrophic failures, many enterprises still face challenges with non-vendor optics.

Understanding SFP Compatibility

  • The discussion shifts towards counterfeit and third-party optics, raising questions about how they pass validation tests.
  • Interest is expressed in understanding how certain devices can recode optics for compatibility with Cisco switches.

Exploring I²C Communication

  • The engineer recalls past experiences with I²C communication and its relevance in troubleshooting optical components.
  • A blog post inspires experimentation using Raspberry Pi to communicate via I²C with an SFP module.

Modifying Non-Cisco SFP Modules

Hands-On Experimentation

  • The engineer begins disassembling a non-Cisco SFP module for modification, aiming to make it compatible without using unsupported commands.

Wiring and Initial Testing

  • Connections are made between the Raspberry Pi and the modified SFP module for testing purposes.
  • Initial attempts at detecting the modified SFP yield no results, indicating potential wiring issues.

Debugging and Script Utilization

Utilizing GitHub Resources

  • Scripts from GitHub are explored as tools for manipulating I²C data related to vendor information on the SFP.

Overcoming Write Protection Challenges

  • Attempts to write changes fail due to write protection on the Finisar SFP; discovering unlock scripts becomes crucial.

Unlocking and Writing Data

Successful Modification of Values

  • After finding appropriate values for unlocking, modifications are successfully written into the Finisar module's memory.

Validating Changes Made

  • Verification through reading back shows that changes were successful; this indicates progress toward creating a valid Cisco-compatible optic.

Understanding Key Values for Compatibility

Analyzing IDPROM Output

  • Using specific commands reveals critical output from valid Cisco optics necessary for mimicking their characteristics.

Key Components Explained

  • Vendor name: Can be any string but must fit within 16 bytes.
  • Serial number: Also padded out to 16 bytes.
  • Manufacturer ID: Important single-byte value linked with pre-shared keys used by Cisco.

Generating Valid Optical Module Data

Calculating MD5 and CRC Values

  • MD5 checksum generation involves concatenating key values including manufacturer ID and serial number.
  • CRC32 checksum calculation requires careful manipulation of byte order after computation.

Finalizing Modifications

  • With all calculations confirmed correct, final writes are executed on the non-Cisco optic ensuring compatibility without triggering unsupported transceiver warnings.

Conclusion of Experimentation

  • Successful detection of modified optic confirms that proper values were written; further tweaks may be needed but initial goals have been achieved.

Turn any video into a summary like this

YouTube links, meetings, lectures. With transcripts, search, and chat.

Video description

Ever since learning of 3rd party "Cisco Compatible" SFP modules I've wondered how the vendors make them work without the switch balking. I did a little googling and a little tinkering and this is what I found out. Check it out! -------------- ERRATA: The Raspi GPIO I2C pins I used were 3 & 5! DON'T use pin 2 for that! Follow the picture not my voice there! -------------- Resources: Raspberry Pi and Programming EEPROMs on SFP/SFP+ modules http://eoinpk.blogspot.com/2014/05/raspberry-pi-and-programming-eeproms-on.html Github for the person above. Check out the vendor related program for hints. https://github.com/sonicepk/sfppi Lukas2511 Github. Place where I snagged the shell scripts I modified. https://github.com/lukas2511/sfp-vercybern My github where I'll be placing some example code related to this https://github.com/slofunk/sfp-fun CyberChef https://gchq.github.io/CyberChef/ Reversing-Cisco-ios-raw-binary-firmware-images-with-Ghidra https://gist.github.com/nstarke/ed0aba2c882b8b3078747a567ee00520 ------ As I always say, if you've not already, go check out my awesome neighbor-in-retro, @retroCombs ! He's got good stuff! If you have actually read this far down and would like a HackShack sticker, figure out a way to get in touch with me and I'll see what I can do to get one to you! :-D Music: @WhiteBatAudio