背景
服务器上插入的光模块经常被忽略,往往这里是定位问题最根本的地方。如何通过命令查看?
命令
ethtool提供了-m参数,m是module-info的意思,他是从光模块的eeprom中读取数据。(应该是用i2c协议读取的)
ethtool -m enp1s0f0
实操
本文实操2种光模块插在同一个设备上(设备是CX5 25G)。
一个是1G的千兆SFP光模块
另一个是25G的SFP28的光模块
SFP和SFP28的区别参考兄弟篇:https://blog.csdn.net/essencelite/article/details/138551156
25G 光模块信息
[root@localhost ~]# ethtool -m enp1s0f0
Identifier : 0x03 (SFP)
Extended identifier : 0x04 (GBIC/SFP defined by 2-wire interface ID)
Connector : 0x07 (LC)
Transceiver codes : 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x02
Transceiver type : Extended: 100G Base-SR4 or 25GBase-SR
Encoding : 0x03 (NRZ)
BR, Nominal : 25750MBd
Rate identifier : 0x00 (unspecified)
Length (SMF,km) : 0km
Length (SMF) : 0m
Length (50um) : 0m
Length (62.5um) : 0m
Length (Copper) : 10m
Length (OM3) : 70m
Laser wavelength : 850nm
Vendor name : DTZ
Vendor OUI : 44:7c:7f
Vendor PN : SFP28-25G-SR
Vendor rev : 1A
Option values : 0x00 0x1a
Option : RX_LOS implemented
Option : TX_FAULT implemented
Option : TX_DISABLE implemented
BR margin, max : 0%
BR margin, min : 0%
Vendor SN : 2312280516
Date code : 231228
Optical diagnostics support : Yes
Laser bias current : 7.000 mA
Laser output power : 0.6205 mW / -2.07 dBm
Receiver signal average optical power : 1.0533 mW / 0.23 dBm
Module temperature : 33.24 degrees C / 91.83 degrees F
Module voltage : 3.2922 V
Alarm/warning flags implemented : Yes
Laser bias current high alarm : Off
Laser bias current low alarm : Off
Laser bias current high warning : Off
Laser bias current low warning : Off
Laser output power high alarm : Off
Laser output power low alarm : Off
Laser output power high warning : Off
Laser output power low warning : Off
Module temperature high alarm : Off
Module temperature low alarm : Off
Module temperature high warning : Off
Module temperature low warning : Off
Module voltage high alarm : Off
Module voltage low alarm : Off
Module voltage high warning : Off
Module voltage low warning : Off
Laser rx power high alarm : Off
Laser rx power low alarm : Off
Laser rx power high warning : Off
Laser rx power low warning : Off
Laser bias current high alarm threshold : 15.000 mA
Laser bias current low alarm threshold : 0.000 mA
Laser bias current high warning threshold : 15.000 mA
Laser bias current low warning threshold : 0.000 mA
Laser output power high alarm threshold : 3.4674 mW / 5.40 dBm
Laser output power low alarm threshold : 0.0724 mW / -11.40 dBm
Laser output power high warning threshold : 1.7378 mW / 2.40 dBm
Laser output power low warning threshold : 0.1445 mW / -8.40 dBm
Module temperature high alarm threshold : 75.00 degrees C / 167.00 degrees F
Module temperature low alarm threshold : -5.00 degrees C / 23.00 degrees F
Module temperature high warning threshold : 73.00 degrees C / 163.40 degrees F
Module temperature low warning threshold : -3.00 degrees C / 26.60 degrees F
Module voltage high alarm threshold : 3.6300 V
Module voltage low alarm threshold : 2.9700 V
Module voltage high warning threshold : 3.4650 V
Module voltage low warning threshold : 3.1350 V
Laser rx power high alarm threshold : 3.4674 mW / 5.40 dBm
Laser rx power low alarm threshold : 0.0468 mW / -13.30 dBm
Laser rx power high warning threshold : 1.7378 mW / 2.40 dBm
Laser rx power low warning threshold : 0.0933 mW / -10.30 dBm
千兆光模块信息
[root@localhost ~]# ethtool -m enp1s0f0
Identifier : 0x03 (SFP)
Extended identifier : 0x04 (GBIC/SFP defined by 2-wire interface ID)
Connector : 0x07 (LC)
Transceiver codes : 0x00 0x00 0x00 0x01 0x20 0x40 0x0c 0x05 0x00
Transceiver type : Ethernet: 1000BASE-SX
Transceiver type : FC: intermediate distance (I)
Transceiver type : FC: Shortwave laser w/o OFC (SN)
Transceiver type : FC: Multimode, 62.5um (M6)
Transceiver type : FC: Multimode, 50um (M5)
Transceiver type : FC: 200 MBytes/sec
Transceiver type : FC: 100 MBytes/sec
Encoding : 0x01 (8B/10B)
BR, Nominal : 1300MBd
Rate identifier : 0x00 (unspecified)
Length (SMF,km) : 0km
Length (SMF) : 0m
Length (50um) : 80m
Length (62.5um) : 30m
Length (Copper) : 0m
Length (OM3) : 300m
Laser wavelength : 850nm
Vendor name : OEM
Vendor OUI : 00:1b:21
Vendor PN : SFP-G-T
Vendor rev : A
Option values : 0x00 0x12
Option : RX_LOS implemented
Option : TX_DISABLE implemented
BR margin, max : 0%
BR margin, min : 0%
Vendor SN : HYBG000001
Date code : 240401
Optical diagnostics support : Yes
Laser bias current : 6.000 mA
Laser output power : 0.5000 mW / -3.01 dBm
Receiver signal average optical power : 0.4098 mW / -3.87 dBm
Module temperature : 24.25 degrees C / 75.65 degrees F
Module voltage : 3.3725 V
Alarm/warning flags implemented : Yes
Laser bias current high alarm : Off
Laser bias current low alarm : Off
Laser bias current high warning : Off
Laser bias current low warning : Off
Laser output power high alarm : Off
Laser output power low alarm : Off
Laser output power high warning : Off
Laser output power low warning : Off
Module temperature high alarm : Off
Module temperature low alarm : Off
Module temperature high warning : Off
Module temperature low warning : Off
Module voltage high alarm : Off
Module voltage low alarm : Off
Module voltage high warning : Off
Module voltage low warning : Off
Laser rx power high alarm : Off
Laser rx power low alarm : Off
Laser rx power high warning : Off
Laser rx power low warning : Off
Laser bias current high alarm threshold : 15.000 mA
Laser bias current low alarm threshold : 1.000 mA
Laser bias current high warning threshold : 13.000 mA
Laser bias current low warning threshold : 2.000 mA
Laser output power high alarm threshold : 1.9952 mW / 3.00 dBm
Laser output power low alarm threshold : 0.1584 mW / -8.00 dBm
Laser output power high warning threshold : 1.5848 mW / 2.00 dBm
Laser output power low warning threshold : 0.1778 mW / -7.50 dBm
Module temperature high alarm threshold : 95.00 degrees C / 203.00 degrees F
Module temperature low alarm threshold : -45.00 degrees C / -49.00 degrees F
Module temperature high warning threshold : 85.00 degrees C / 185.00 degrees F
Module temperature low warning threshold : -40.00 degrees C / -40.00 degrees F
Module voltage high alarm threshold : 3.6000 V
Module voltage low alarm threshold : 3.0000 V
Module voltage high warning threshold : 3.5000 V
Module voltage low warning threshold : 3.1000 V
Laser rx power high alarm threshold : 1.1220 mW / 0.50 dBm
Laser rx power low alarm threshold : 0.0199 mW / -17.01 dBm
Laser rx power high warning threshold : 1.0000 mW / 0.00 dBm
Laser rx power low warning threshold : 0.0223 mW / -16.52 dBm
关键信息分析
Identifier 查看型号,这里主要25G和1G是相同的,会决定外形和引脚
Identifier : 0x03 (SFP)
Connector: 使用 LC(Lucent Connector)光纤连接器。(Lucent /ˈluːsnt/ adj.透明的,光亮的;)
Connector : 0x07 (LC)
Transceiver type 可以看到支持的速率,可以看到光模块的速率型号
Transceiver type : Extended: 100G Base-SR4 or 25GBase-SR
Transceiver type : Ethernet: 1000BASE-SX
BR, Nominal 可以看到比特率(Bit Rate),这个直接决定相同引脚的速率
BR, Nominal : 25750MBd (可见是25.75G)
BR, Nominal : 1300MBd(可见是1.3G)
Laser wavelength 是光线的波长,850nm都是多模的,如果是1350nm是单模
Laser wavelength : 850nm
Vendor name 可以查看光模块的厂商,可以看到25G的是DTZ的和照片相同,另一个是OEM
Vendor name : DTZ
Vendor name : OEM
Vendor PN 厂商的产品序号,这个一定程度标注速率,25G、1G,
Vendor PN : SFP28-25G-SR
Vendor PN : SFP-G-T
Length (OM3): 在 OM3 多模光纤上,最大传输距离为 70 米。
Length (Copper) : 10m 同轴电缆最大10m
Date code 可以看到生产日期
Date code : 231228
Date code : 240401
可见,光模块型号、厂商、生产日期、速率、波长、比特率支持速率这些都能读取到。