Skip to content

Conversation

@rszarecki
Copy link
Contributor

@rszarecki rszarecki commented Nov 20, 2025

Adding FEC statistics to Ethernet interface.

Change Scope

The Ethernet interface that use PAM4 modulation (400GE and bove) must support FEC (typicaly KP4-FEC). The NRZ port may but in most cases not have to. Exposing FEC statistics provides ability to monitor link quality.
(ref: IEEE802.3bs, IEEE802.3.df)
This is espetially usefull with 400GBASE-FR4 400GBASE-LR4 PMDs, an their 800GBASE equivlents.

          FEC stats stream/get
                   ^
                   |
   +---------------+--------+
   |     Switch    |        |
   |               |        |
  Transciver ====ASIC_port  |
   |                        |
   +------------------------+

module: openconfig-interfaces
  +--rw interfaces
     +--rw interface* [name]
         +--rw oc-eth:ethernet
         |  +--ro oc-eth:state
         |  |  +--ro oc-eth:counters
+        |  |  |  +--ro oc-eth:fec-uncorrectable-blocks?   oc-yang:counter64
+        |  |  |  +--ro oc-eth:fec-corrected-blocks?       oc-yang:counter64
         |  |  |  +--ro oc-eth:in-mac-control-frames?    oc-yang:counter64
         |  |  |  +--ro oc-eth:in-mac-pause-frames?      oc-yang:counter64
         |  |  |  +--ro oc-eth:in-oversize-frames?       oc-yang:counter64
         |  |  |  +--ro oc-eth:in-undersize-frames?      oc-yang:counter64
         |  |  |  +--ro oc-eth:in-jabber-frames?         oc-yang:counter64
         |  |  |  +--ro oc-eth:in-fragment-frames?       oc-yang:counter64
         |  |  |  +--ro oc-eth:in-8021q-frames?          oc-yang:counter64
         |  |  |  +--ro oc-eth:in-crc-errors?            oc-yang:counter64
-        |  |  |  +--ro oc-eth:in-block-errors?          oc-yang:counter64
+        |  |  |  x--ro oc-eth:in-block-errors?            oc-yang:counter64
         |  |  |  +--ro oc-eth:in-carrier-errors?        oc-yang:counter64
         |  |  |  +--ro oc-eth:in-interrupted-tx?        oc-yang:counter64
         |  |  |  +--ro oc-eth:in-late-collision?        oc-yang:counter64
         |  |  |  +--ro oc-eth:in-mac-errors-rx?         oc-yang:counter64
         |  |  |  +--ro oc-eth:in-single-collision?      oc-yang:counter64
         |  |  |  +--ro oc-eth:in-symbol-error?          oc-yang:counter64
         |  |  |  +--ro oc-eth:in-maxsize-exceeded?      oc-yang:counter64
         |  |  |  +--ro oc-eth:out-mac-control-frames?   oc-yang:counter64
         |  |  |  +--ro oc-eth:out-mac-pause-frames?     oc-yang:counter64
         |  |  |  +--ro oc-eth:out-8021q-frames?         oc-yang:counter64
         |  |  |  +--ro oc-eth:out-mac-errors-tx?        oc-yang:counter64
         |  |  |  +--ro oc-eth-ext:in-distribution
         |  |  |     +--ro oc-eth-ext:in-frames-64-octets?          oc-yang:counter64
         |  |  |     +--ro oc-eth-ext:in-frames-65-127-octets?      oc-yang:counter64
         |  |  |     +--ro oc-eth-ext:in-frames-128-255-octets?     oc-yang:counter64
         |  |  |     +--ro oc-eth-ext:in-frames-256-511-octets?     oc-yang:counter64
         |  |  |     +--ro oc-eth-ext:in-frames-512-1023-octets?    oc-yang:counter64
         |  |  |     +--ro oc-eth-ext:in-frames-1024-1518-octets?   oc-yang:counter64
+        |  |  +--ro oc-eth:pre-fec-ber
+        |  |  |  +--ro oc-eth:instant?    decimal64
+        |  |  |  +--ro oc-eth:avg?        decimal64
+        |  |  |  +--ro oc-eth:min?        decimal64
+        |  |  |  +--ro oc-eth:max?        decimal64
+        |  |  |  +--ro oc-eth:interval?   oc-types:stat-interval
+        |  |  |  +--ro oc-eth:min-time?   oc-types:timeticks64
+        |  |  |  +--ro oc-eth:max-time?   oc-types:timeticks64
+        |  |  +--ro oc-eth:post-fec-ber
+        |  |  |  +--ro oc-eth:instant?    decimal64
+        |  |  |  +--ro oc-eth:avg?        decimal64
+        |  |  |  +--ro oc-eth:min?        decimal64
+        |  |  |  +--ro oc-eth:max?        decimal64
+        |  |  |  +--ro oc-eth:interval?   oc-types:stat-interval
+        |  |  |  +--ro oc-eth:min-time?   oc-types:timeticks64
+        |  |  |  +--ro oc-eth:max-time?   oc-types:timeticks64

and ( needed on 100GBASE-FR1 w/ CAUI-4 NRZ electrical interface to host)

 module: openconfig-platform
   +--rw components
      +--rw component* [name]
         +--rw oc-transceiver:transceiver
         |  +--rw oc-transceiver:config
         |  |  +--rw oc-transceiver:enabled?                  boolean
         |  |  +--rw oc-transceiver:form-factor-preconf?      identityref
         |  |  +--rw oc-transceiver:ethernet-pmd-preconf?     identityref
         |  |  +--rw oc-transceiver:fec-mode?                 identityref
         |  |  +--rw oc-transceiver:module-functional-type?   identityref
         |  +--ro oc-transceiver:state
         |  |  +--ro oc-transceiver:enabled?                     boolean
         |  |  +--ro oc-transceiver:form-factor-preconf?         identityref
         |  |  +--ro oc-transceiver:ethernet-pmd-preconf?        identityref
         |  |  +--ro oc-transceiver:fec-mode?                    identityref
         |  |  +--ro oc-transceiver:module-functional-type?      identityref
         |  |  +--ro oc-transceiver:present?                     enumeration
         |  |  +--ro oc-transceiver:form-factor?                 identityref
         |  |  +--ro oc-transceiver:connector-type?              identityref
         |  |  +--ro oc-transceiver:vendor?                      string
         |  |  x--ro oc-transceiver:vendor-part?                 string
         |  |  +--ro oc-transceiver:vendor-rev?                  string
         |  |  +--ro oc-transceiver:ethernet-pmd?                identityref
         |  |  +--ro oc-transceiver:sonet-sdh-compliance-code?   identityref
         |  |  +--ro oc-transceiver:otn-compliance-code?         identityref
         |  |  x--ro oc-transceiver:serial-no?                   string
         |  |  +--ro oc-transceiver:date-code?                   oc-yang:date-and-time
         |  |  +--ro oc-transceiver:fault-condition?             boolean
         |  |  +--ro oc-transceiver:fec-status?                  identityref
-        |  |  +--ro oc-transceiver:fec-uncorrectable-blocks?    yang:counter64
+        |  |  +--ro oc-transceiver:fec-uncorrectable-blocks?    oc-yang:counter64
+        |  |  +--ro oc-transceiver:fec-corrected-blocks?        oc-yang:counter64
         |  |  +--ro oc-transceiver:fec-uncorrectable-words?     yang:counter64
         |  |  +--ro oc-transceiver:fec-corrected-bytes?         yang:counter64
         |  |  +--ro oc-transceiver:fec-corrected-bits?          yang:counter64

where:

    leaf fec-uncorrectable-blocks {
      type oc-yang:counter64;
      description
        "The number of block/codeword that were uncorrectable by
        the FEC;
        Applicable if fec-mode is not NONE.
        This is IEEE802.3 clause 119.3.3
        FEC_uncorrected_cw_counter.";
    }

    leaf fec-uncorrectable-words {
      type oc-yang:counter64;
      description
        "The number of words/symbols that were corrected by
        the FEC;
        Applicable if fec-mode is not NONE.
        This is IEEE802.3 clause 119.3.2 (also IEEE802.3df clause
        172.3.2 for 800GE) FEC_corrected_cw_counter";
    }

Platform Implementations

  • Juniper JUNOS-EVO
[email protected]> show interfaces et-0/0/1:0
Physical interface: et-0/0/1:0, Enabled, Physical link is Up
  Interface index: 1228, SNMP ifIndex: 706
  Description: [ae1] df1a001.bjc01:et-0/0/1:0 - rr1a1.bjc01:Ethernet49/1
  Link-level type: Ethernet, MTU: 9258, LAN-PHY mode, Speed: 100Gbps, BPDU Error: None, Loop Detect PDU Error: None,
  Ethernet-Switching Error: None, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled,
  Auto-negotiation: Disabled, Media type: Fiber
  Device flags   : Present Running
  Interface flags: SNMP-Traps
  CoS queues     : 8 supported, 8 maximum usable queues
  Current address: e4:23:3c:ee:13:22, Hardware address: e4:23:3c:ee:07:cc
  Last flapped   : 2025-11-19 10:51:37 PST (1d 05:06 ago)
  Input rate     : 1312 bps (2 pps)
  Output rate    : 1440 bps (2 pps)
  Active alarms  : None
  Active defects : None
  PCS statistics                      Seconds
    Bit errors                             0
    Errored blocks                         0
  Ethernet FEC Mode  :            FEC91-RS544          <<<
  Ethernet FEC statistics              Errors
    FEC Corrected Errors            995901973
    FEC Uncorrected Errors                  1          <<<
    FEC Corrected Errors Rate            9266
    FEC Uncorrected Errors Rate             0          <<<
  PRBS Mode : Disabled
  Interface transmit statistics: Disabled
  Link Degrade :
    Link Monitoring                   :  Disable

  Logical interface et-0/0/1:0.32767 (Index 1033) (SNMP ifIndex 707)
    Flags: Up SNMP-Traps VLAN-Tag[ 0x0000.0 ]  Encapsulation: ENET2
    Protocol aenet, AE bundle: ae1.32767
  • Cisco IOS-XR
show controller FourHundredGigE 0/0/0/31

Fri Nov 21 01:53:14.203 UTC
Operational data for interface FourHundredGigE0/0/0/31:

State:
   Administrative state: enabled
   Operational state: Up
   LED state: Green On

   Media type: Duplex SMF LC Connector 2km
   Optics:
       Vendor: FINISAR
       Part number: FTCD4313E2PCL
       Serial number: X6ABDHP
       Wavelength: 1301 nm
   Digital Optical Monitoring:
       . . .
   Statistics:
       FEC:
           Corrected Codeword Count: 1215520
           Uncorrected Codeword Count: 0                <<<
           . . .
  • Nokia SLR
 info interface ethernet-1/35/1 ethernet forward-error-correction
    operational-host-if-fec cl119-rs544
    statistics {
        host-if-fec-router {
            status locked
            frame-error-count 143         <<<
            pre-fec-ber {
                instant 0.000000E+00
            }
        }
    }

@OpenConfigBot
Copy link

OpenConfigBot commented Nov 20, 2025

No major YANG version changes in commit efdcd9d

@rszarecki rszarecki marked this pull request as ready for review November 21, 2025 02:33
@rszarecki rszarecki requested a review from a team as a code owner November 21, 2025 02:33
@ggrammel
Copy link

ggrammel commented Nov 21, 2025

is this FEC different from: public/release/models/platform
/openconfig-platform-transceiver.yang ?

My understanding is this:
The forward error correction (FEC) is not modeled as part of an interface but in /openconfig-platform-transceiver.yang:
This module defines configuration and operational state data for transceivers (i.e., pluggable optics). The module should be used in conjunction with the platform model where other physical entity data are represented.

The funny thing is that this statement appears to be only true for interfaces that are not linked to an optical channel:
A transceiver will always contain physical-channel(s), however when a line side optical-channel is present (i.e. ZR+ optics) the physical-channel will reference its optical-channel. In this case, the optical-channels components must be subcomponents of the transceiver. The relationship between the physical-channel and the optical-channel allows for multiple optical-channels to be associated with a transceiver in addition to ensuring certain leaves (i.e. output-power) are not duplicated in multiple components.

I didn't find any information anywhere about what exactly necessitates modeling an optical-channel but suppose it is required as soon as the optical signal is wavelength specific. So from an optical perspective, PAM4 ought to be associated to an optical channel since it is wavelength specific and often tunable -- just like ZR+ optics are.

So my reading is that the FEC in question is covered in release/models/optical-transport/openconfig-terminal-device.yang

@rszarecki
Copy link
Contributor Author

rszarecki commented Nov 21, 2025

is this FEC different from: public/release/models/platform
/openconfig-platform-transceiver.yang ?

Yes. It is different.
This FEC is inplemented directly on swutch's asic as part of MAC block/SerDes port group servin "port".
Tradionally, before 400GE days, link between MAC frame processing chip/asic/npu and transciver was NRZ, and was not FEC-protected. Also gray optics transcivers do not provide FEC processing. This has changed now.
The MAC frame processing chip/asic/npu SerDes are with PAM4 and IEEE requires to be FEC protected. Consequently we need a ways to get FEC statistics form this chip/asic/npu.

          FEC stats stream/get
                   ^
                   |
   +---------------+--------+
   |     Switch    |        |
   |               |        |
  Transciver ====ASIC_port  |
   |                        |
   +------------------------+

Let consider 400GBASE-FR4. This PMD/transciver do not support FEC. Simply encode signal recived over 8 (PAM4) serdeses running at 28GHz into 4 lambdas, 2 polarization each, directly translating 4 electrical voltage levels (PAM4) to 4 optical power levels.

When transciver is ZR-class, The MAC frame processing chip/asic/npu insert FEC correctioncode, and transciver (on same linecard) reads it, apply corrections and handover to line side that adds OFEC/CFEC acorrection code applicabel to optical transport and send over lambdas with 16QAM or better modulation. On remote site transciver strips OFEC/CFEC correction code while correcting whatever block it can correct and handover to "tributary" site and add "ethernet" FEC before sending to MAC frame processing chip/asic/npu. In short we have 3 segments protected by different FECs.

Updated the description for ethernet FEC statistics and added a new leaf for fec-uncorrectable-blocks.
@dplore dplore moved this to Ready to discuss in OC Operator Review Nov 27, 2025
@rszarecki rszarecki removed the status in OC Operator Review Dec 9, 2025
@rszarecki rszarecki moved this to Ready to discuss in OC Operator Review Dec 9, 2025
@dplore dplore self-assigned this Dec 9, 2025
@dplore
Copy link
Member

dplore commented Dec 9, 2025

Reviewed in Dec 9 OC Operators meeting, the model tree LGTM. I will help @rszarecki resolve the yang issues offline

@aphoenix-hub
Copy link

Regarding the leaf fec-uncorrectable-words and its reference to IEEE802.3 clause 119.3.4. The description of FEC_symbol_error_counter_i in clause 119.3.4 is that it is a counter that counts “once for each 10-bit symbol corrected”. Is the leaf fec-uncorrectable-words intended to count corrected or uncorrected symbol errors ? Thanks.

Copy link
Member

@dplore dplore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion for a TODO comment format

@rszarecki rszarecki moved this from Ready to discuss to last-call in OC Operator Review Dec 16, 2025
@rszarecki
Copy link
Contributor Author

Regarding the leaf fec-uncorrectable-words and its reference to IEEE802.3 clause 119.3.4. The description of FEC_symbol_error_counter_i in clause 119.3.4 is that it is a counter that counts “once for each 10-bit symbol corrected”. Is the leaf fec-uncorrectable-words intended to count corrected or uncorrected symbol errors ? Thanks.

fixed.

@dplore
Copy link
Member

dplore commented Dec 16, 2025

Last call is set for Jan 6, 2026

@dplore
Copy link
Member

dplore commented Dec 16, 2025

Rereviewed in Dec 16 OC Operators meeting, this will merge on Jan 6, 2026

@ElodinLaarz
Copy link
Contributor

@dplore -- this still needs an approval here before we can submit. Can you do a review?

@ElodinLaarz
Copy link
Contributor

/gcbrun

@dplore dplore merged commit 6bda1c7 into openconfig:master Jan 6, 2026
15 checks passed
dplore added a commit that referenced this pull request Jan 7, 2026
* Add FEC statistics and update descriptions in YANG

* (M) release/models/optical-transport/openconfig-terminal-device.yang
* (M)  release/models/interfaces/openconfig-if-ethernet.yang

---------

Co-authored-by: Darren Loher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: last-call

Development

Successfully merging this pull request may close these issues.

7 participants