59  Matter Protocol Stack and Data Model

In 60 Seconds

Matter’s six-layer protocol stack runs on IPv6 using UDP with a custom Message Reliable Protocol (MRP) for transport and AES-CCM for encryption. The Data Model organizes physical devices (Nodes) into Endpoints hosting Clusters of Attributes and Commands, enabling any Matter controller to interact with any device regardless of manufacturer or transport.

59.1 Matter Protocol Stack: Layered Architecture and Data Model

15 min | Advanced | P08.C46.U02

Minimum Viable Understanding

Matter’s protocol stack is a six-layer architecture built on IPv6 that uses UDP with a custom Message Reliable Protocol (MRP) for transport, AES-CCM for encryption, and a structured Data Model where physical devices (Nodes) contain Endpoints, which host Clusters of Attributes and Commands. This layered design enables any Matter controller to discover and interact with any Matter device regardless of manufacturer or transport (Thread, Wi-Fi, or Ethernet).

Learning Objectives

By the end of this section, you will be able to:

  • Diagram Matter’s six-layer protocol architecture and identify each layer’s responsibility
  • Analyze how each protocol layer contributes to transport-agnostic interoperability
  • Differentiate between nodes, endpoints, clusters, attributes, and commands in the Matter Data Model
  • Design endpoint structures for multi-function devices using standardized cluster assignments
  • Map physical device capabilities to Matter cluster implementations following device type specifications
How It Works: Matter’s Six-Layer Protocol Stack

Matter’s protocol architecture organizes functionality into six distinct layers, each with specific responsibilities:

  1. Link Layer - Physical transmission using Thread (802.15.4 mesh), Wi-Fi (802.11), or Ethernet. This layer is swappable – a Matter device can switch transports without changing upper layers.

  2. Network Layer (IPv6) - Provides addressing and routing. Every Matter device has an IPv6 address, enabling direct peer-to-peer communication without proprietary bridges. Thread uses 6LoWPAN for IPv6 over 802.15.4.

  3. Transport Layer (UDP + MRP) - Uses UDP for low overhead, but adds Matter Reliable Protocol (MRP) for guaranteed delivery. MRP implements application-layer acknowledgments and retransmission without TCP’s connection overhead.

  4. Message Layer - Handles message framing, fragmentation/reassembly for large payloads, and duplicate detection. Manages retransmission timers and exponential backoff.

  5. Security Layer (AES-CCM + CASE/PASE) - All messages are encrypted with AES-128-CCM after session establishment. PASE (Passcode Authenticated Session Establishment) handles initial commissioning; CASE (Certificate Authenticated Session Establishment) handles ongoing operation.

  6. Application Layer - Contains the Data Model (how devices describe themselves) and Interaction Model (how controllers access device capabilities). This layer is transport-agnostic.

This separation of concerns enables true interoperability: a controller can use the same Application Layer APIs whether the device uses Thread, Wi-Fi, or Ethernet.

“Matter’s protocol stack has six layers, like a six-story building!” said Max the Microcontroller, drawing on the whiteboard. “The ground floor is the transport – Thread, Wi-Fi, or Ethernet. Second floor is IPv6 addressing. Third is UDP for sending packets. Fourth is MRP – a special reliability layer that makes sure messages actually arrive.”

Sammy the Sensor counted along. “What about floors five and six?” Max continued, “Fifth floor is encryption – AES-CCM wraps every message in a secure envelope. And the top floor is the application layer with the Data Model, where devices describe themselves using Nodes, Endpoints, and Clusters.”

“I love the Endpoint system!” said Lila the LED. “A smart power strip might have Endpoint 0 for device-wide info, and then Endpoints 1 through 4 for each individual outlet. Each Endpoint has its own set of Clusters – On/Off, Power Measurement, and so on. It is like each outlet is its own mini-device.”

Bella the Battery appreciated the efficiency. “And since Matter uses UDP instead of TCP, there is less overhead and less energy wasted on connection management. The MRP layer handles reliability with lightweight acknowledgments, so I do not drain my power on heavy protocols!”

59.2 Prerequisites

Before diving into this chapter, you should be familiar with:

Architecture Deep Dives:

Device Implementation:

Transport:

59.3 For Beginners: Matter Architecture Simplified

Think of a Matter device like a well-organized office building:

  • The Building (Node) = The physical device (a smart light, thermostat)
  • Floors (Endpoints) = Different functional areas (main light, nightlight)
  • Departments (Clusters) = Groups of related capabilities (On/Off, Level Control, Color)
  • Employees (Attributes) = Specific pieces of information (current brightness: 80%)
  • Actions (Commands) = Things you can ask departments to do (turn on, set brightness to 50%)

When you ask Alexa to “dim the living room light to 50%,” here’s what happens: 1. Alexa identifies the Node (your smart light) 2. Selects the correct Endpoint (main light, not nightlight) 3. Finds the Level Control Cluster 4. Sends a MoveToLevel Command with value 50% 5. The cluster updates its CurrentLevel Attribute to 50% 6. The light physically dims to 50%

59.4 Matter Protocol Stack

59.4.1 Complete Architecture Overview

Geometric visualization of Matter protocol stack showing six layers from bottom to top: Link Layer (Thread, Wi-Fi, Ethernet), Network Layer (IPv6), Transport Layer (UDP with MRP reliable protocol), Message Layer (framing), Security Layer (AES-CCM encryption with CASE and PASE authentication), and Application Layer (Data Model with clusters, attributes, commands and Interaction Model)

Matter Protocol Stack
Figure 59.1: The Matter protocol stack provides a complete solution for smart home device interoperability. Built on IPv6, it works seamlessly over Thread mesh networks, Wi-Fi, and Ethernet, enabling devices from different manufacturers to communicate using a common language.
Matter protocol stack diagram showing six layers: Application Layer (teal) with Data Model and Interaction Model, Security Layer (orange) with AES-CCM and CASE/PASE authentication, Message Layer (navy) for framing, Transport Layer (navy) with MRP and UDP, Network Layer (gray) with IPv6, and Link Layer (gray) with Thread, Wi-Fi, and Ethernet options.
Figure 59.2: Matter protocol stack showing all layers from application to link layer

This diagram focuses on Matter’s security mechanisms and trust model.

Diagram showing Trust

59.4.2 Layer Responsibilities

Layer Component Responsibility
Application Data Model Define device capabilities (what it can do)
Application Interaction Model Define how to access capabilities (how to control it)
Security CASE/PASE Establish secure sessions
Security AES-CCM Encrypt and authenticate messages
Message Framing Structure messages with headers and payloads
Transport MRP Ensure reliable delivery over UDP
Network IPv6 Route packets between nodes
Link Thread/Wi-Fi/Eth Physical transmission

59.4.3 Transport Layer Details

The Message Reliable Protocol (MRP) provides reliable delivery over UDP:

  • Acknowledgments: Every message requiring reliability gets an ACK
  • Retransmission: Configurable retry intervals (default 200ms initial, exponential backoff)
  • Deduplication: Message counters prevent duplicate processing
  • Timeout: Sessions expire after configurable idle periods

Why UDP instead of TCP?

Consideration UDP + MRP TCP
Latency Lower (no connection setup) Higher (3-way handshake)
Power Lower (simpler stack) Higher (state maintenance)
Sleepy devices Better (stateless) Problematic (connection timeouts)
Multicast Supported Not supported

59.5 The Matter Data Model

59.5.1 Core Concepts Hierarchy

The Matter Data Model defines how device capabilities are structured and accessed.

Matter Data Model hierarchy showing Node at top containing multiple Endpoints, each Endpoint containing Clusters, and each Cluster containing Attributes and Commands. Example shows a smart light with Endpoint 0 for utility clusters and Endpoint 1 for On/Off, Level Control, and Color Control clusters with their respective attributes and commands.
Figure 59.3: Matter Data Model hierarchy: Node to Endpoints to Clusters to Attributes and Commands

59.5.2 Nodes

A Node is a uniquely addressable Matter entity—typically a physical device.

Node Properties:

  • Unique Node ID within a fabric (64-bit)
  • One or more Endpoints (functional units)
  • Network address (IPv6)
  • Cryptographic identity (device certificate)

Node Examples: | Physical Device | Matter Node | |—————–|————-| | Smart light bulb | Single node, 1-2 endpoints | | Smart power strip (4 outlets) | Single node, 4 endpoints | | Thread Border Router | Single node, bridge endpoint |

59.5.3 Endpoints

An Endpoint is a logical container for related functionality within a node.

Standard Endpoints: | Endpoint | Purpose | Required Clusters | |———-|———|——————-| | Endpoint 0 | Root/Utility | Basic Information, Network Commissioning | | Endpoint 1+ | Application functions | Device-specific clusters |

Example: Smart Light with Nightlight

Smart Light endpoint structure diagram showing Node (Smart Bulb) in teal at top connecting to three endpoints in orange: Endpoint 0 (Root) containing Basic Information, Network Commissioning, and Administrator Commissioning clusters in navy; Endpoint 1 (Main Light) containing On/Off, Level Control, and Color Control clusters in navy; Endpoint 2 (Nightlight) containing On/Off and Level Control clusters with limited range in navy.
Figure 59.4: Smart Light endpoint structure with main light and nightlight as separate endpoints

59.5.4 Clusters

A Cluster is a collection of related attributes and commands representing a specific capability.

Cluster Types:

Category Cluster Examples Purpose
Utility Basic Information, Binding Device management
Lighting On/Off, Level Control, Color Control Light operations
HVAC Thermostat, Fan Control Climate control
Closure Door Lock, Window Covering Access and privacy
Sensors Temperature, Humidity, Occupancy Environmental data

Cluster Structure:

On/Off Cluster structure diagram showing cluster ID 0x0006 containing: two attributes in teal (OnOff boolean 0x0000, GlobalSceneControl boolean 0x4000), three commands in orange (Off 0x00, On 0x01, Toggle 0x02), and one event in gray (StateChange). Demonstrates cluster organization with IDs and types.
Figure 59.5: On/Off Cluster structure with attributes, commands, and events

59.5.5 Attributes

Attributes are named, typed data values within a cluster:

Property Description Example
ID Unique within cluster 0x0000 (OnOff)
Type Data type Boolean, uint8, string
Access Read/Write permissions R, RW
Quality Nullable, Reportable, Persistent Reportable

Common Attribute Types:

  • Boolean - true/false (On/Off state)
  • uint8 - 0-255 (brightness level)
  • int16 - -32768 to 32767 (temperature x 100)
  • string - Variable length (device name)
  • struct - Complex objects (color XY)
  • list - Arrays (supported features)

59.5.6 Commands

Commands are actions that can be invoked on a cluster:

Property Description
ID Unique command identifier within cluster
Direction Client-to-Server or Server-to-Client
Fields Input parameters
Response Expected response command

Example: MoveToLevel Command

Command: MoveToLevel (0x00)
Direction: Client -> Server
Fields:
  - Level (uint8): Target brightness 0-254
  - TransitionTime (uint16): Transition time in tenths of seconds
  - OptionsMask (uint8): Override options
  - OptionsOverride (uint8): Override values
Response: None (status only)

59.6 Worked Example: Matter Device Type Implementation

Worked Example: Designing a Smart Light Endpoint Structure

Scenario: You are designing a Matter-compatible smart light bulb with dimming and color temperature control. Define the endpoint structure, required clusters, and attribute implementation following Matter specification.

Given:

  • Device: Dimmable Color Temperature Light
  • Matter device type: 0x010C (Color Temperature Light)
  • Required features: On/Off, Brightness (0-254), Color Temperature (2700K-6500K)
  • Transport: Thread (802.15.4)
  • Target certification: Matter 1.2

Steps:

  1. Define endpoint structure:

    Matter Color Temperature Light endpoint structure showing Node (Smart Light Bulb) in teal connecting to two endpoints in orange: Endpoint 0 (Root/Utility) containing five utility clusters with their hex IDs (Basic Information 0x0028, General Commissioning 0x0030, Network Commissioning 0x0031, Administrator Commissioning 0x003C, Operational Credentials 0x003E) in navy; Endpoint 1 (Light Application) containing five application clusters (Identify 0x0003, Groups 0x0004, On/Off 0x0006, Level Control 0x0008, Color Control 0x0300) in navy.
    Figure 59.6: Matter Color Temperature Light device type endpoint structure with cluster IDs
  2. Implement On/Off Cluster (0x0006):

    • Attributes:
      • OnOff (0x0000): Boolean, read-only, reportable
      • GlobalSceneControl (0x4000): Boolean
    • Commands:
      • Off (0x00): Turn light off
      • On (0x01): Turn light on
      • Toggle (0x02): Toggle current state
    • Implementation: GPIO control to LED driver enable pin
  3. Implement Level Control Cluster (0x0008):

    • Attributes:
      • CurrentLevel (0x0000): uint8 (0-254), read-only, reportable
      • MinLevel (0x0002): uint8 = 1
      • MaxLevel (0x0003): uint8 = 254
      • OnLevel (0x0011): uint8 (level when turned on)
    • Commands:
      • MoveToLevel (0x00): Level, TransitionTime, OptionsMask
      • Move (0x01): MoveMode, Rate
      • Step (0x02): StepMode, StepSize, TransitionTime
    • Implementation: PWM duty cycle control (0.4% to 100%)
  4. Implement Color Control Cluster (0x0300) for Color Temperature:

    • Attributes:
      • ColorMode (0x0008): enum8 = 2 (Color Temperature mode)
      • ColorTemperatureMireds (0x0007): uint16, read-only, reportable
      • ColorTempPhysicalMinMireds (0x400B): uint16 = 153 (6500K)
      • ColorTempPhysicalMaxMireds (0x400C): uint16 = 370 (2700K)
    • Commands:
      • MoveToColorTemperature (0x0A): ColorTemperature, TransitionTime
    • Implementation: Dual-channel LED driver (warm + cool white mixing)
    • Conversion: Mireds = 1,000,000 / Kelvin

Result: Smart light implements Matter device type 0x010C with full dimming (0-254) and color temperature (2700K-6500K) support. Endpoint 0 handles commissioning and network management. Endpoint 1 provides application-level light control through On/Off, Level Control, and Color Control clusters.

Key Insight: Matter’s cluster-based architecture enables interoperability by standardizing behavior. Any Matter controller (Apple, Google, Amazon) can control this light identically because the On/Off, Level Control, and Color Control clusters have standardized attribute types, command formats, and expected behaviors defined in the Matter specification.

Objective: Use the Matter SDK’s chip-tool to inspect a real Matter device’s endpoint and cluster structure, understanding the hierarchical Data Model in practice.

Prerequisites:

Exercise Steps:

  1. Discover All Endpoints:

    chip-tool descriptor read parts-list 1 0
    • Endpoint 0’s parts-list attribute returns all endpoints (e.g., [1, 2])
    • This is the starting point for device discovery
  2. Read Device Type on Endpoint 1:

    chip-tool descriptor read device-type-list 1 1
    • Returns device type ID (e.g., 0x0100 = On/Off Light, 0x010C = Color Temperature Light)
    • Device type determines which clusters are required
  3. List All Clusters on Endpoint 1:

    chip-tool descriptor read server-list 1 1
    • Returns cluster IDs (e.g., [0x0006, 0x0008, 0x0300] = On/Off, Level Control, Color Control)
  4. Read Cluster Attributes:

    chip-tool levelcontrol read current-level 1 1
    chip-tool levelcontrol read min-level 1 1
    chip-tool levelcontrol read max-level 1 1
    • Observe the attribute values and types (uint8 for levels, range 0-254)
  5. Inspect Cluster Metadata:

    chip-tool levelcontrol read cluster-revision 1 1
    chip-tool levelcontrol read feature-map 1 1
    • ClusterRevision shows specification version
    • FeatureMap shows which optional features are implemented

What to Observe:

  • Endpoint 0 always exists (Root Node with utility clusters)
  • Application endpoints (1+) contain the device’s functional clusters
  • Each cluster has mandatory attributes (like ClusterRevision)
  • Device types enforce required clusters (e.g., lights MUST have On/Off)

Challenge: Find a multi-endpoint device (like a smart plug with 4 outlets) and map all endpoints to clusters. Does each outlet have its own On/Off cluster on separate endpoints?

59.7 Knowledge Check

59.8 Quick Assessment

59.8.1 Knowledge Check: Matter Transport Choice

59.8.2 Knowledge Check: Matter Endpoint Structure

59.8.3 Knowledge Check: Matter Cluster Attributes

59.9 Message Size Budget: What Actually Fits in a Matter Packet?

Developers often overlook how much of a Matter packet is consumed by protocol overhead. Understanding the message size budget prevents surprises when payload doesn’t fit.

Matter over Thread (worst case for payload):

Layer Overhead Remaining
IEEE 802.15.4 frame 127 bytes total 127 bytes
MAC header + FCS 25 bytes 102 bytes
6LoWPAN + IPv6 (compressed) 7 bytes 95 bytes
UDP header (compressed) 4 bytes 91 bytes
MRP header 6 bytes 85 bytes
Matter message header 8 bytes 77 bytes
Matter security (AES-CCM tag) 16 bytes 61 bytes
Matter protocol header 4 bytes 57 bytes available

The available payload for a single unfragmented Matter-over-Thread packet:

\[\text{Payload} = \text{Frame Size} - \sum \text{Overheads}\]

Worked example: Starting with 127-byte 802.15.4 frame:

\[127 - 25 - 7 - 4 - 6 - 8 - 16 - 4 = 57 \text{ bytes}\]

This means a single attribute read response (TLV-encoded) for a thermostat reporting 5 attributes (temperature, humidity, setpoint, mode, fan state) at ~10 bytes each = 50 bytes fits without fragmentation.

But a bulk read of 10 attributes = ~100 bytes requires 6LoWPAN fragmentation into 2 frames. With 5% per-frame loss, success drops from 95% (1 frame) to \((0.95)^2 = 90.25\%\) (2 frames).

Design rule: Keep attribute reports under 50 bytes for reliable single-frame delivery over Thread.

With only 57 bytes per unfragmented packet, a single thermostat attribute report (temperature, humidity, setpoint, mode, fan state) easily fits. But reading all attributes of a complex device in one request may require 6LoWPAN fragmentation, which increases latency and power consumption.

Practical Rule

Design Matter-over-Thread devices to keep individual attribute reports under 50 bytes. For bulk reads (e.g., commissioning), expect fragmentation and plan for 200-500ms latency. Matter-over-Wi-Fi has no practical payload limit since Wi-Fi MTU is 1500 bytes.

59.10 Concept Relationships

Concept Related To Relationship
Node Endpoint A Node (physical device) contains one or more Endpoints
Endpoint Cluster Each Endpoint hosts multiple Clusters representing capabilities
Cluster Attribute/Command Clusters contain Attributes (data) and Commands (actions)
MRP UDP MRP adds reliability (ACKs, retransmit) to unreliable UDP
6LoWPAN IPv6 6LoWPAN compresses IPv6 headers for efficient Thread transmission
Device Type Required Clusters Each Device Type mandates specific clusters (e.g., lights need On/Off)

59.11 See Also

59.12 Key Takeaways

Matter certification requires all mandatory attributes and commands of required clusters to be implemented. Omitting even one mandatory feature will cause certification failure. Read device type specifications carefully and implement all mandatory items.

Matter’s security operates at the application layer on top of the transport. Matter over Thread still needs IEEE 802.15.4 link security enabled. Matter security and transport security are complementary, not redundant.

Matter prohibits certain cluster combinations on the same endpoint and requires descriptor clusters to correctly enumerate composed device types. Violating composition rules will fail commissioning validation.

59.13 Summary

  1. Matter’s protocol stack provides end-to-end interoperability from physical transport through application data models

  2. The Data Model hierarchy is: Node (device) -> Endpoints (functional units) -> Clusters (capabilities) -> Attributes/Commands (data/actions)

  3. Endpoint 0 is mandatory on every device for utility functions (Basic Info, Network Commissioning, Administrator Commissioning)

  4. Clusters are reusable building blocks - the same On/Off cluster works identically on lights, plugs, fans, and any on/off device

  5. MRP (Message Reliable Protocol) provides reliable delivery over UDP with acknowledgments, retransmission, and deduplication

  6. Transport flexibility - Matter works over Thread (low-power mesh), Wi-Fi (high bandwidth), and Ethernet (wired reliability)

::

::

Key Concepts

  • Matter Protocol Stack: The layered architecture: IP Transport (TCP/UDP/BLE) → Secure Channel (CASE/PASE) → Interaction Model → Data Model → Application Clusters.
  • Data Model: The structured representation of a Matter device as a set of endpoints, each containing clusters that group related attributes, commands, and events.
  • Endpoint: A numbered logical device instance on a Matter node; endpoint 0 is reserved for node-level utility clusters, endpoints 1+ for application functionality.
  • Cluster: A grouping of related attributes, commands, and events in the Matter data model (e.g., On/Off Cluster, Level Control Cluster, Temperature Measurement Cluster).
  • Device Type: A standardized Matter specification defining the mandatory and optional clusters an endpoint must implement to represent a specific device category (e.g., Dimmable Light, Door Lock).
  • Message Authentication Code (MAC): A cryptographic tag appended to each Matter message ensuring integrity and authentication within the secure channel session.

59.14 What’s Next

Chapter Focus
Matter Interactions and Commissioning How controllers read, write, subscribe, and invoke commands on clusters
Matter Fabric and Security Multi-admin fabric management, CASE/PASE session establishment, and encryption
Matter Device Types and Clusters Complete library of standardized device types and their required clusters
Matter Implementation SDKs, development tools, and building Matter-compatible firmware
Thread Network Architecture Thread mesh networking fundamentals – Matter’s primary low-power transport