EthernetNetworkDiagnostics Cluster

Cluster ID: 0x0037  |  Endpoint: Endpoint 0 (Root Node)

EthernetNetworkDiagnostics provides Ethernet interface operational status and statistics — link rate, duplex mode, TX/RX packet counts, error counts, etc. This cluster has only 1 command and 9 attributes, with a simple structure primarily for network health monitoring and troubleshooting.

When to Use

Hub or bridge connected via Ethernet, want to confirm the link is working? Just read PHYRate and CarrierDetect. Device network unstable with severe packet loss? Check TxErrCount and CollisionCount to locate the issue. Need to restart statistics? Send a ResetCounts command to reset all counters.

Feature Bitmap

EthernetNetworkDiagnostics Declares which diagnostic capabilities the device supports through FeatureMap (0xFFFC):

Bit 0
PKTCNT(PacketCounts) Supports TX/RX packet counts — enables PacketRxCount, PacketTxCount attributes
Bit 1
ERRCNT(ErrorCounts) Supports error counts — enables TxErrCount, CollisionCount, OverrunCount attributes
Relationship Between Features and Attributes

Not all devices support all attributes. PacketRxCount / PacketTxCount require the PKTCNT feature, TxErrCount / CollisionCount / OverrunCount require the ERRCNT feature. Check FeatureMap (0xFFFC) before reading to confirm which features the device supports.

Attribute Overview

Click an attribute ID to jump to detailed description. Attributes marked with a Feature only exist when the device supports the corresponding feature.

ID Name Type Feature Description
0x00 PHYRate enum8, nullable — Physical layer link rate
0x01 FullDuplex bool, nullable — Whether in full-duplex mode
0x02 PacketRxCount uint64 PKTCNT Total packets received
0x03 PacketTxCount uint64 PKTCNT Total packets transmitted
0x04 TxErrCount uint64 ERRCNT Transmission error count
0x05 CollisionCount uint64 ERRCNT Collision count
0x06 OverrunCount uint64 ERRCNT Buffer overrun count
0x07 CarrierDetect bool, nullable — Carrier detect status
0x08 TimeSinceReset uint64 — Seconds since last counter reset

PHYRate (Physical Layer Rate)

Read-only attribute indicating the physical layer link rate negotiated by the current Ethernet interface. null indicates unknown rate or interface not connected.

PHYRateEnum Enum Values

0
Rate10M 10 Mbps
1
Rate100M 100 Mbps
2
Rate1G 1 Gbps
3
Rate25G 2.5 Gbps
4
Rate5G 5 Gbps
5
Rate10G 10 Gbps
6
Rate40G 40 Gbps
7
Rate100G 100 Gbps
8
Rate200G 200 Gbps
9
Rate400G 400 Gbps

FullDuplex (Full Duplex Mode)

Read-only attribute indicating whether the current Ethernet link operates in full-duplex mode. true for full-duplex, false for half-duplex, null means unable to determine. Modern Ethernet devices are almost always full-duplex; half-duplex usually indicates a negotiation anomaly.

PacketRxCount (Received Packet Count)

Read-only attribute, total packets received since last reset. Requires device PKTCNT feature support. This counter resets to zero upon calling the ResetCounts command or device reboot.

PacketTxCount (Transmitted Packet Count)

Read-only attribute, total packets transmitted since last reset. Requires device PKTCNT feature support.

TxErrCount (Transmission Error Count)

Read-only attribute, number of transmission failures since last reset. Requires device ERRCNT feature support. Continuous growth usually indicates poor cable quality or switch port issues.

CollisionCount (Collision Count)

Read-only attribute, collision count since last reset. Requires device ERRCNT feature support. On a full-duplex link, this value should always be 0; if it continues to grow, the link may have degraded to half-duplex.

OverrunCount (Overrun Count)

Read-only attribute, number of receive buffer overruns since last reset. Requires device ERRCNT feature support. Overruns mean the device cannot process received data in time, possibly due to high device load or excessive network traffic.

CarrierDetect (Carrier Detect)

Read-only attribute indicating whether the Ethernet interface detects a carrier signal. true means the cable is connected and the remote device is working, false means the cable is disconnected or the remote end is unresponsive, null means unable to determine. This is the most direct indicator of physical connection status.

TimeSinceReset (Time Since Counter Reset)

Read-only attribute, seconds elapsed since the last counter reset (ResetCounts command or device reboot). Combined with packet counts and error counts, you can calculate average per-second TX/RX rates and error rates.

Commands

EthernetNetworkDiagnostics has only one command. It is only meaningful when the device supports PKTCNT or ERRCNT features.

ID Name Description
0x00 ResetCounts Reset all counters to zero

ResetCounts — Reset Counters (0x00)

Resets PacketRxCount, PacketTxCount, TxErrCount, CollisionCount, and OverrunCount all to zero, while TimeSinceReset also resets to 0 and restarts counting. No parameters needed, just send directly.

Request example:

{
  "invokeRequests": [{
    "commandPath": {
      "endpointId": 0,
      "clusterId": "0x0037",
      "commandId": "0x00"       // ResetCounts
    },
    "commandFields": {}
  }]
}

Example Data

Reading an Ethernet Hub device's EthernetNetworkDiagnostics Cluster attributes:

{
  // --- Attributes ---
  "0x0": 2,           // PHYRate = Rate1G (Gigabit Ethernet)
  "0x1": true,        // FullDuplex = true (full-duplex)
  "0x2": 1048576,     // PacketRxCount = 1048576 (approximately 1 million packets received)
  "0x3": 524288,      // PacketTxCount = 524288 (approximately 500K packets transmitted)
  "0x4": 3,           // TxErrCount = 3 (3 transmission errors)
  "0x5": 0,           // CollisionCount = 0 (no collisions)
  "0x6": 0,           // OverrunCount = 0 (no overruns)
  "0x7": true,        // CarrierDetect = true (carrier detect normal)
  "0x8": 86400        // TimeSinceReset = 86400 (24 hours since last reset)
}
Developer Advice

PHYRate and FullDuplex reflect link negotiation results, do not change frequently, and are suitable for one-time display on the device detail page. Packet counts and error counts are cumulative values, suitable for periodic polling or subscription, used for trend graphs or triggering alerts.

Common Scenarios

Scenario 1: Link Health Check

App device detail page displays Ethernet connection status, helping users quickly determine if the link is healthy.

  1. Read CarrierDetect (0x07) to confirm physical connection is normal (true)
  2. Read PHYRate (0x00) and FullDuplex (0x01) to display link rate and duplex mode
  3. If PHYRate is null or CarrierDetect is false, prompt user to check cable connection
  4. If FullDuplex is false, indicate link degraded to half-duplex, recommend checking switch port configuration
Scenario 2: Network Fault Troubleshooting

When device is slow to respond or communication is unstable, locate network layer issues through counters.

  1. First check FeatureMap (0xFFFC) to confirm device supports PKTCNT and ERRCNT
  2. Send ResetCounts (0x00) to reset all counters
  3. After waiting a period, read TxErrCount, CollisionCount, OverrunCount
  4. Use TimeSinceReset (0x08) to calculate error rate: TxErrCount / TimeSinceReset
  5. Persistently high error rate → check cable quality and switch port; CollisionCount non-zero → check duplex mode configuration