Saturday 25 October 2014

Arista Ethernet Switch Third Party SFP Workaround


I recently had the need to get a third party DWDM SFP+ to work in an Arista 7050T switch. The following work around worked for me. Basically just comment out the vendor checking. I suspect there is a much nicer way to do this.

Step 1 unzip EOS-4.10.6.swi
step 2 unsquashfs rootfs-i386.sqsh (as root)
step 3 make changes to the Python file XcvrAgent.py. See 3.a
step 4 remove original rootfs-i386.sqsh and mksquashfs  squashfs-root/ rootfs-i386.sqsh
step 5 zip up everything without compression
zip -Z store EOS-4.10.6a.swi boot0 initrd-i386 linux-i386 rootfs-i386.sqsh version

Things to change:
/usr/lib/python2.7/site-packages/XcvrAgent.py starts line 172.
3.a) Comment out the 4 lines
assert xcvrStatus.presence == "xcvrPresent"
#Commented out to enable Third Party Optics
# If the xcvr is present, authenticate it.
#t7( "Xcvr", name, "is present. genId status=%d, cfg=%d" % \
 #    ( xcvrStatus.generationId, xcvrConfig.generationId ) )
xcvrConfig.xcvrEnabled = True
 #xcvrConfig.xcvrEnabled = xcvrStatus.xcvrEnabled
#xcvrConfig.configReason = xcvrStatus.configReason

While I would not recommend doing this on a production box it is a handy work around if you are stuck or Arista don't support the SFP+ you need.


Friday 24 October 2014

sfpduino optical power meter vs calibrated optical power meter

According to the data sheet for the third party SFP I am using the optical receive range is from 1200 to 1600nm. While the minimum receive is -13.2dBm for the SFP, the SFP does appear to be capable of measuring accurately down to -28dBm. 

My light source is an Anristu light source 1310 and 1550nm and according to the datasheet has a launch power of -7dBm for both 1310nm and 1550nm. With no attenuation added I was measuring -5.9 at 1550nm and -5.5 at 1310nm.

While SFF-8472 states that the optical power receive accuracy must be better than +/-3dB clearly my third party SFP was remarkable accurate when compared to my nice expensive calibrated power meter. 


Added Attenuation1550Metersfpduino1310Metersfpduino
0dB-5.90dBm-5.81dBm-5.50dBm-5.50dBm
5dB-10.50dBm-10.11dBm-10.10dBm-10.12dBm
8dB-13.50dBm-13.51dBm-13.90dBm-13.59dBm
11dB-17.10dBm-17.21dBm-17.90dBm-17.93dBm
14dB-19.40dBm-19.59dBm-18.9dBm-19.43dBm
15dB-20.20dBm-20.36dBm-19.70dBm-20.04dBm
18dB-22.90dBm-23.77dBm-22.50dBm-23.77dBm
21dB-23.8dBm-24.20dBm-23.60dBm-24.56dBm
25dB-25.60dBm-26.99dBm-26.00dBm-28.86dBm
30dB-31.10dBm-40dBm-33.00dBm-40.00dBm


Saturday 18 October 2014

sfpduino - Arduino SFP optical power meter

I thought it might be interesting to see what I could do with an SFP and an Arduino UNO. My first introduction to Atmel micro-controllers was with the Atmel AVR Butterfly. While the Butterfly is a fantastic piece of hardware it is much quicker to create and test things with the Arduino UNO. 















I have powered the SFP off the 3V power supply on the Arduino UNO and the 16x2 LCD with the 5V supply. I am using the Arduino Liquidcrystal display library hence all the wires! See here for the wiring diagram for the display. http://arduino.cc/en/Tutorial/LiquidCrystal
To connect the SFP to the Arduino UNO I used the Arduino Wire library. http://arduino.cc/en/reference/wire

My SFP is a third party cheap 1310nm transceiver. The SFP is plugged into a Samtec SFP header and is mounted on a piece of  perf board for convenience. The demo code below prints out the temperature and the optical power receive from the SFP using the Arduino UNO as the i2c Master. As most 1310nm SFPs can typically receive light from 1200-1600nm it could be interesting to make a very small plugable coin battery powered optical power meter with a display where all you had to do was add your own SFP with DOM. The sort of thing that you could put on a key ring and give away at trade shows.

While SFF-8472 states that the optical power receive accuracy must be better than +/-3dB. I did a quick test with 1310nm and 1550nm light sources (plus several different attenuators) and compared the measured results between a real calibrated optical power meter and my SFP. I was quite surprised that the SFP power values were typically within 0.2dB of the power meter. 

From SFF-8472
Measured TX output power in mW. Represented as a 16 bit unsigned integer with the power defined as the full 16 bit value (0-65535) with LSB equal to 0.1 uW, yielding a total range of 0 to 6.5535 mW (~ -40 to +8.2 dBm).

Internally measured transceiver temperature. Represented as a 16 bit signed twos complement value in increments of 1/256 degrees Celsius, yielding a total range of -128C to +128C.

The entire sketch is below. 

#include <Wire.h>
#include <math.h>
#include <LiquidCrystal.h>

// LCD interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

const byte EEPROM_ID = 0x51;
int A51[128];

void setup()
{
  Wire.begin();        
  Serial.begin(9600);  
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
}

byte I2CEEPROM_Read (unsigned int address)
{
  byte data;
  Wire.beginTransmission(EEPROM_ID);
  Wire.write(address);
  Wire.endTransmission();
  Wire.requestFrom(EEPROM_ID,(byte)1);
  while(Wire.available() == 0); data = Wire.read();
    return data;
}

void loop()
{
   for (int i = 96; i <106; i++)
  {
    A51[i] = I2CEEPROM_Read(i);
   }
  float temp = A51[96] + (float) A51[97]/256;
  float optical_rx = 10 * log10((float)(A51[104]<<8 | A51[105]) * 0.0001);
  lcd.setCursor(0, 0);
  lcd.print ("Temp = ");
  lcd.print (temp);
  lcd.print ((char)223); //degree symbol
  lcd.print ("C");
  lcd.setCursor (0, 1);
  lcd.print ("RX = ");
  lcd.print (optical_rx);
  lcd.print (" dBm");
    
delay(1000);
}