KNX Protocol Stack Explained: Layers and Functions
Advertisement
This tutorial provides a basic overview of the KNX protocol stack.
The KNX protocol is structured into several layers, each responsible for specific functions in the communication process. These layers include:
- Physical Layer
- Datalink Layer
- Routing (or Network) Layer
- Transport Layer
- Application Layer
Figure 1: KNX Protocol Stack Layers
KNX Physical Layer
The physical layer specifications are detailed in Volume 3, Chapter 3/3/1 of the KNX documentation.
The KNX protocol supports various physical media, including:
- Twisted Pair (KNX-TP)
- Power Line (KNX-PL)
- Radio Frequency (KNX-RF)
- KNX-IP
KNX-TP employs a CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance) mechanism at the MAC (Medium Access Control) layer, utilizing inductive coupling. The bus provides a 21-29 Volt power supply, and low-power KNX nodes connected via twisted pair can draw approximately 150 mWatt of power.
KNX-PL (PL110 version) uses FSK (Frequency Shift Keying) modulation. Each PLC line can accommodate up to 64 devices. Since PLC operates on a broadcast medium, domain separation is achieved using a 48-bit domain address.
KNX-RF operates in the 868 to 870 MHz frequency band.
KNX-IP leverages IP protocols for communication and employs either binary or XML encoded PDUs (Protocol Data Units).
KNX Datalink Layer
Figure 2: KNX Telegram Format
Different physical layers utilize distinct telegram formats. Figure 2 illustrates the KNX telegram formats for TP, PL, and RF physical layer modes. Telegrams are transmitted octet by octet and are acknowledged by the recipient node.
KNX Routing (or Network) Layer
Each KNX node is assigned a unique 2-byte address, serving as the source address for telegrams and configurations.
The source address format is:
Source address = { Area Identifier(4 bits), Line identifier(4 bits ), device number ( 8 bits) }
The source address represents the physical address and is configured during installation. Device number 0 is typically reserved for backbone and line couplers.
The destination address can be either a logical group address (bit 17 = 1) or a physical address (bit 17 = 0). A group address of 0000h will address all KNX nodes.
A KNX installation supports a 64K address space. Individual and group addresses are stored in the address table of the KNX device.
The KNX protocol supports four priority levels, encoded as specific control bit values within the frame.
KNX Transport Layer
The transport layer facilitates connection-oriented peer-to-peer communication.
It provides primitives such as connect, disconnect, TL-ACK (Transport Layer Acknowledgment), sequence counter, and timeout management (approximately 6 seconds in configuration mode). The specifications are outlined in Volume 3, Chapter 3/4.
KNX Application Layer
The application layer is defined in Volume 3, Section 3/3/7.
It defines group objects and the exchange of object values through service requests. It also defines the “property value write” service.
This service is used to set values and configure parameters for KNX devices, enabling the interfacing of objects.
Related IoT Wireless Technologies: THREAD, EnOcean, LoRa, SIGFOX, WHDI, NFC, Lonworks, CEBus, UPB