03 - 08 - 04 Tunnelling v01.05.03 AS
03 - 08 - 04 Tunnelling v01.05.03 AS
KNXnet/IP
Tunnelling
Summary
This document provides the KNXnet/IP Tunnelling specification.
Version 01.05.03 is a KNX Approved Standard.
This document is part of the KNX Specifications v2.1.
KNX Standard Tunnelling KNXnet/IP
Document updates
Version Date Modifications
1.0 DP 2004.01.07 Final version for Release for Voting
1.1 DV 2005.05.30 Draft for Voting for Final Voting.
1.3 AS 2008.07.02 Publication of the Approved Standard.
1.4 AS 2008.09.05 • AN110 "Phasing out A-Mode" integrated
1.4 AS 2009.06.29 Editorial update in view of inclusion in the KNX Specifications v2.0.
01.05.00 2013.07.18 • AN139 "Procedures for the assignment of IAs to KNXnet/IP
Tunnelling connections" integrated.
01.05.01 2013.07.18 • Editorial review.
01.05.01 2013.09.20 • 3.2.3.5.3 “Assignment via PID_INDIVIDUAL_ADDRESS”:
PID_KNX_INDIVIDUAL_ADDRESS is located in the KNXnet/IP
Parameter Object, and not in the Device Object.
01.05.03 2013.10.28 Editorial updates for the publication of KNX Specifications 2.1.
References
A general reference is made to the RFCs 1) defining the Internet Protocol. These documents can be
obtained on the Internet at http://www.ietf.org/rfc.html.
[1] Chapter 3/5/2 “Management Procedures”
[2] Chapter 3/5/3 “Configuration Procedures”
[3] Chapter 3/6/3 “External Message Interface”
[4] Chapter 3/8/1 “Overview” (KNXnet/IP)
[5] Chapter 3/8/2 “Core” (KNXnet/IP)
[6] Chapter 3/8/3 “Device Management” (KNXnet/IP)
[7] Chapter 3/8/3 “Remote Configuration and Diagnosis” (planned)
1) Request for Comment: Internet Standards defined by the Internet Engineering Task Force (IETF) are firstly
published as RFCs.
Content
1 Introduction ............................................................................................................................ 4
1.1 Scope............................................................................................................................... 4
1.2 Definitions, acronyms and abbreviations ....................................................................... 4
2 Tunnelling of KNX frames .................................................................................................... 5
2.1 Introduction..................................................................................................................... 5
2.2 Tunnelling ....................................................................................................................... 5
2.2.1 General requirements .......................................................................................... 5
2.2.2 Tunnelling on KNX Data Link Layer ................................................................. 5
2.2.3 Tunnelling in cEMI Raw mode........................................................................... 7
2.2.4 Tunnelling on KNX Busmonitor ........................................................................ 7
2.3 Timing............................................................................................................................. 8
2.4 Sending KNX frames via KNXnet/IP Tunnelling Server to local subnet ...................... 8
2.5 Receiving KNX frames via KNXnet/IP Tunnelling Server from local subnet .............. 8
2.6 Frame confirmation ........................................................................................................ 8
3 Configuration and Management ........................................................................................... 9
3.1 General ............................................................................................................................ 9
3.2 IA assignment for KNXnet/IP Tunnelling connections.................................................. 9
3.2.1 Goal ..................................................................................................................... 9
3.2.2 Prerequisites ........................................................................................................ 9
3.2.3 Procedure ............................................................................................................ 9
3.3 Handling of E_NO_MORE_UNIQUE_CONNECTIONS by the KNXnet/IP
Tunnelling Client .......................................................................................................... 14
4 Frame structures .................................................................................................................. 16
4.1 Introduction................................................................................................................... 16
4.2 Common constants........................................................................................................ 16
4.3 Common error codes..................................................................................................... 16
4.4 KNX telegram tunnelling ............................................................................................. 16
4.4.1 KNXnet/IP services .......................................................................................... 16
4.4.2 Connection Type ............................................................................................... 16
4.4.3 Connection Request Information (CRI) ............................................................ 16
4.4.4 Connection Response Data Block (CRD) ......................................................... 17
4.4.5 Connection header ............................................................................................ 17
4.4.6 TUNNELLING_REQUEST ............................................................................. 17
4.4.7 TUNNELLING_ACK....................................................................................... 18
5 Binary examples of KNXnet/IP frames .............................................................................. 19
5.1 TUNNELLING_REQUEST ......................................................................................... 19
5.2 TUNNELLING_ACK .................................................................................................. 19
6 Certification .......................................................................................................................... 20
6.1 Introduction................................................................................................................... 20
6.2 Support matrix .............................................................................................................. 20
1 Introduction
1.1 Scope
This specification defines the integration of KNX protocol implementations on top of Internet Protocol
(IP) networks, called KNXnet/IP. It describes a standard protocol for KNX devices connected to an IP
network, called KNXnet/IP devices. The IP network acts as a fast (compared to KNX transmission speed)
backbone in KNX installations.
An overview of KNXnet/IP is presented in [4].
General frame descriptions and data exchange protocols between KNXnet/IP devices are described in [5].
General device management and configuration of KNXnet/IP devices is specified in [6].
This Chapter 3/8/4 “Tunnelling” of the KNXnet/IP specification describes point-to-point exchange of
KNX telegrams over an IP network between an KNXnet/IP device acting as a server and an KNXnet/IP
Client for configuration and diagnostics. KNX frames are encapsulated inside IP datagrams. KNXnet/IP
Tunnelling does not address timing issues caused by IP data network latency greater than one second.
Refer to [7] (planned).
This document specifies a standard protocol that is implemented within KNX devices and the
Engineering Tool Software (ETS) to support KNX data exchange over non-KNX networks.
2.2 Tunnelling
2.2.1 General requirements
KNX frames shall always be sent within a TUNNELLING_REQUEST frame. This frame shall contain
the KNX frame in cEMI format. The cEMI format shall be supported by all KNXnet/IP devices.
After a communication channel has been established, the following KNX services shall be supported by a
KNXnet/IP version 1 implementation:
KNXnet/IP Tunnelling on KNX Data Link Layer
Client Server L_Data.req, M_Reset.req
KNX Individual Addresses for any additional Tunnelling connection shall be assigned by ETS.
The additional KNX Individual Addresses shall be stored in Property PID_ADDITIONAL_-
INDIVIDUAL_ADDRESSES.
To prevent other Management Clients from using or assigning any of these additional IAs the KNXnet/IP
Tunnelling device shall defend its additional IA. Such Management Client will to this execute the
Management Procedure NM_IndividualAddress_Check (see [1]). If this Management Client in this
request tries to establish a Transport Layer connection to any of these IAs by sending a T_Connect-PDU,
then the KNXnet/IP Tunnelling device shall act as follows.
- If no Tunnelling connection is open for the additional KNX Individual Address, then the
Tunnelling device shall send a T_Disconnect-PDU.
- If the Tunnelling connection for this additional IA is currently open, then the Tunnelling device
shall forward the above request as T_Connect-PDU to the connected KNXnet/IP Tunnelling
Client. The KNXnet/IP Tunnelling Client then shall respond to the request.
Additional KNX Individual Addresses shall be permanent. The KNXnet/IP Server shall generate Layer-2
acknowledge frames for these additionally assumed KNX Individual Addresses [see Figure 1-B] 2).
If a KNXnet/IP Server also implements KNXnet/IP Routing it shall not use its own KNX Individual
Address for KNXnet/IP Tunnelling connections but shall assume KNX Individual Addresses as described
above [see Figure 1-C].
A KNXnet/IP Router shall not activate KNXnet/IP Tunnelling until at least one additional KNX
Individual Address has been set via KNXnet/IP Device Management.
These are the bootstrap steps to take for a KNXnet/IP Router.
a) KNXnet/IP Discovery of KNXnet/IP Router IP address
b) Initiation of KNXnet/IP Device Management connection to KNXnet/IP Router and setting KNX
Individual Address for this KNXnet/IP Router.
c) Setting KNXnet/IP Router additional KNX Individual Address(es)
The KNXnet/IP Tunnelling Server shall only pass those KNX point-to-point addressed telegrams to the
KNXnet/IP Tunnelling Client that contain the KNX Individual Address of the KNXnet/IP Tunnelling
connection with this KNXnet/IP Tunnelling Client. All KNX telegrams on KNX point-to-multipoint
communication (i.e. group addressing) shall be forwarded to the KNXnet/IP Tunnelling Client.
If the KNXnet/IP Tunnelling Client sends a cEMI frame L_Data.req with a KNX Individual Address
(KNX Source Address) set to 0000h then the Tunnelling server shall enter the KNX Individual Address
assigned to this Tunnelling connection. Otherwise the KNX frame shall be sent unchanged (see cEMI
specifications in [3]).
2) Every KNXnet/IP Tunnelling connection shall use its own (unique) Individual Address and hence logically
appears as another device on the KNX bus. Hence, it shall acknowledge telegrams even if the telegram is coming
from the physically same device.
C KNXnet/IP server
Individual Address (1.1.0)
Individual KNXnet/IP client
Address Routing
(1.1.0) Tunnelling Connection #1
Individual
Address Tunnelling Connection #1
(1.1.37) KNXnet/IP client
Individual
Address Tunnelling Connection #2
Tunnelling Connection #2
(1.1.74)
Figure 1 – Tunnelling connections and KNX Individual Addresses in the KNXnet/IP Server
2.3 Timing
KNXnet/IP Tunnelling as such does not provide any mechanisms to modify timing requirements on the
tunnelled data packets. More precisely, the timing requirements defined by the KNX specification are still
valid while tunnelling or routing over a non-KNX network. Therefore the transfer time of tunnelled data
packets shall allow operation within these timing requirements.
This implies that tTunnelling_protocol_transfer_time << tKNX_transfer_time-outs.
2.4 Sending KNX frames via KNXnet/IP Tunnelling Server to local subnet
To send a KNX frame, the KNXnet/IP Tunnelling Client shall send a TUNNELLING_REQUEST frame
to the KNXnet/IP Tunnelling Server, with an L_Data.req, according to the KNX specification. The
KNXnet/IP Tunnelling Client shall be connected and shall not be in Busmonitor Mode.
2.5 Receiving KNX frames via KNXnet/IP Tunnelling Server from local
subnet
If a connection is established, the KNXnet/IP Tunnelling Server shall send a TUNNELLING_REQUEST
frame for each telegram it receives from the local KNX Subnetwork. The KNX services of the embedded
KNX frame may be L_Data.con, L_Data.ind, or L_Busmon.ind, according to the KNX specification.
3.2.2 Prerequisites
1. The KNXnet/IP Tunnelling Client shall not assign an IAreq for which the Device Address part is 00h.
NOTE 1 The responsibility for this lies with the Management Client. In the Management Server definition for the
Individual Address and PID_ADDITIONAL_INDIVIDUAL_ADDRESSES no error handling is foreseen for values of any entry
with Device Address 00h.
2. Form 2.2.2: a KNXnet/IP Router shall not use its own IA as KNXnet/IP Tunnelling IA. However,
other IAs with Device Address part 00h can still be used if these are not used by other Couplers in the
installation. The Device Address part of CRD.IA can thus be 00h.
(CRD.IA is at any time the IA assigned to the KNXnet/IP Tunnelling Connection.)
NOTE 2 This second prerequisite is mainly intended to take into account KNXnet/IP Tunnelling Clients that do not
respect the first prerequisite. It is not a wanted situation that an additional Tunnelling Address in a KNXnet/IP Router has the
Device Address part 00h. The Tunnelling Address would then be topologically not be correct, because the KNXnet/IP Tunnelling
Server is logically linked to the Subnetwork at the secondary side of the KNXnet/IP Router and should therefore also have the
same Subnetwork Address as the KNXnet/IP Router, in line with the IAs of the Subnetwork at the secondary side.
3.2.3 Procedure
3.2.3.1 General
It is the intention that the KNXnet/IP Tunnelling Client executes the steps in the clause 3.2.3 one after the
other.
3.2.3.2 Step 1: Establish a KNXnet/IP Tunnelling connection to the device and get
the IA used for the KNXnet/IP Tunnelling Connection
This is the KNXnet/IP Tunnelling Connection of which the IA will be changed. If the KNXnet/IP
Tunnelling connection is already open, then this step shall be skipped and the existing KNXnet/IP
Tunnelling connection shall be used.
If IAreq = dmp_CRD.IA then the procedure can be halted here: the used IA is the requested IAreq.
3.2.3.3.2 Step 3: Read the additional IAs of the KNXnet/IP Tunnelling Server
NOTE 3 The Additional Individual Addresses IAadditional[] are read firstly and then only the IAdevice is read. This fits best to the
models B and C in Figure 1, in which the KNXnet/IP Tunnelling Server does not use its own device Individual Address as KNXnet/IP
Tunnelling Address.
NOTE 4 In this procedure, it is assumed that there is only one instance of the KNXnet/IP Parameter Object. Implementations
with more than one instance of this Interface Object, e.g. with more than one IP connection, are not yet considered in this
specification.
The resulting information is the list of additional Individual Addresses, IAadditional[], that is maintained
by this KNXnet/IP Tunnelling Server. This list shall be queried for the presence of two values.
1. The CRD.IA used for the open KNXnet/IP Tunnelling connection.
2. The IAreq requested by the ETS user.
1. Search CRD.IA in IAadditional[]
The CRD.IA should be searched in this list IAadditional[]. There are three possible results.
a. CRD.IA is found exactly once in IAadditional[].
b. CRD.IA is found more than once IAadditional[].
c. CRD.IA is not found at all in IAadditional[].
NOTE 6 It may be that the index CRD.IA is not the index of the entry for CRD.IA that is taken by the
KNXnet/IP Tunnelling Server for this connection. This is only possible in the very rare case that one or more other
KNXnet/IP Tunnelling Clients would manage the Additional Individual Addresses in parallel and uses the same value for
its IAreq.
KNXnet/IP KNXnet/IP
Tunnelling Client Tunnelling Server
IAreq IAdevice
CRD.IA = 1.1.7
1.1.10 1.1.5
IAadditional[]
⇓ 1.1.7 IA1
CRD.IAindex = 1 !
1.1.8 IA2
1.1.7 IA3
If all below tests prove positive, the assignment shall then be done by writing PID_KNX_-
INDIVIDUAL_ADDRESS as specified in 3.2.3.5.3.
2. Check if IAdevice equals IAreq
If thus IAdevice ≠ CRD.IA but however IAdevice = IAreq then the device already has the IA requested
for the KNXnet/IP Tunnelling connection, but did not assign it to this KNXnet/IP Tunnelling Client,
e.g. as another KNXnet/IP Tunnelling connection using IAdevice already stands.
KNXnet/IP KNXnet/IP
Tunnelling Client Tunnelling Server
IAreq IAdevice
CRD.IA = 1.1.7
1.1.5 1.1.5
IAadditional[]
1.1.7 IA1
1.1.8 IA2
1.1.9 IA3
Figure 3 – CRD.IA ≠ IAdevice but IAreq = IAdevice
ETS should report to the ETS user that the requested IAreq is used as the own IA of the KNXnet/IP
Tunnelling Server and is not used for the KNXnet/IP Tunnelling Connection. It can propose to
change IAreq.
The procedure is exit here.
3.2.3.4 Tests
3.2.3.4.1 Step 5: Compare with IAdevice
IAreq shall be compared with IAdevice. If the Subnetwork Address is different, then ETS should signal this
to the ETS user and request the user to select a different IAreq with the same Subnetwork Address as in
IAdevice. This is certainly relevant if the KNXnet/IP Tunnelling Server is hosted in a KNXnet/IP Router.
NOTE 8 This should only be a warning. It should always be possible to use a KNXnet/IP Tunnelling Address (IAreq) with an SNA
that is not identical to the SNA that is not identical to the SNA of the KNXnet/IP Tunnelling Server (IAdevice).
NOTE 9 This is only a consistency measure when assuming a new KNXnet/IP Tunnelling Address. If the Subnetwork Address of
the KNXnet/IP Tunnelling Server changes later on, there is no requirement towards the KNXnet/IP Tunnelling that it “corrects” any
of its KNXnet/IP Tunnelling IAs.
/* This procedure will always work independently of any IA used by the KNXnet/IP Tunnelling Server */
/* as it uses broadcast communication mode. */
NM_NetworkParameter_Read_R(hop_count_type_req = 0, object_type = Device Object,
PID = PID_SUBNET_ADDR, test_info = 00h, comm_mode_res = broadcast, hop_count_type_res = 0,
result_data[])
The Couplers that are with their primary or secondary side in the same segment as the KNXnet/IP
Tunnelling Server will reply at that side. From the number and values of result_data[], the topological
position of the KNXnet/IP Server can be concluded and it can be concluded if IAreq would be a suitable
IA. Please refer to “SNA Read” in [2].
The KNXnet/IP Tunnelling Client should have a time-out on the bus 3) for collecting any answer of at
least 3 s.
3) This is the time on the bus between the transmission of the request and the reception of the answer. the
KNXnet/IP Tunnelling Client should take into account the times needed for Datagrams on IP to travel forth and
back to the KNXnet/IP Tunnelling Server.
If this results positive, then it is sure that IAreq is used in the Subnetwork and cannot be chosen. ETS
should signal this to the ETS user and request the user to select a different IAreq. The Configuration
Procedure is stopped here and restarted from the beginning if the ETS user selects a different IAreq.
If this results negative, then it is not guaranteed that IAreq is really a free IA, namely if IAreq does not have
a suitable SNA, the present Routers do not support SNA-reading or have incorrect SNAs. With the
preceding tests, this risk should be minimal.
The KNXnet/IP Tunnelling Server shall apply and use the newly assigned IAreq immediately, without
requiring a restart. The M_PropWrite.con contained in this procedure DMP_InterfaceObjectWrite_IP
shall be the confirmation that the KNXnet/IP Tunnelling Address has changed and is used.
5b. If IAdevice equals FFFFh, then ETS shall request the ETS user to enter a new value for IAdevice.
Let this address be IAunique. ETS shall only accept a value complying with the following.
- It shall not conflict with any other used Individual Address in the installation.
- It shall not be present in the list of additional Individual Addresses PID_ADDITIONAL_-
INDIVIDUAL_ADDRESS.
ETS shall evaluate IAunique according the tests specified in 3.2.3.4.2 and 3.2.3.4.3.
ETS shall change the IA of the KNXnet/IP Tunnelling Server, by setting PID_INDIVI-
DUAL_ADDRESS to the value IAunique as specified in 3.2.3.5.3.
ETS shall retry establishing a KNXnet/IP Tunnelling Connection to the KNXnet/IP Tunnelling
Server. This may have the following results.
- If this retry is successful, this KNXnet/IP Tunnelling Connection can be used and the
procedure is closed here.
- If this retry returns again in E_NO_MORE_UNIQUE_CONNECTIONS, then the above
procedure shall be repeated from 2.
- If this retry results in other errors (e.g. E_NO_MORE_CONNECTIONS) then these shall
be handled as specified for these errors.
6b. If IAdevice differs from FFFFh, all entries in PID_ADDITIONAL_INDIVIDUAL_ADDRESSES
that equal PID_INDIVIDUAL_ADDRESS shall be set to FFFFh, using the procedure specified in
3.2.3.5.2.
ETS shall retry establishing a KNXnet/IP Tunnelling Connection to the KNXnet/IP Tunnelling
Server. This may have the following results.
- If this retry is successful, this KNXnet/IP Tunnelling Connection can be used and the
procedure is closed here.
- If this retry returns again in E_NO_MORE_UNIQUE_CONNECTIONS, then the above
procedure shall be repeated from 2.
- If this retry results in other errors (e.g. E_NO_MORE_CONNECTIONS) then these shall
be handled as specified for these errors.
4 Frame structures
4.1 Introduction
All KNXnet/IP frames shall have a common header, consisting of the protocol version, length
information, and the KNXnet/IP service type identifier.
4.4.6 TUNNELLING_REQUEST
KNXnet/IP header
+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+
| HEADER_SIZE_10 | KNXNETIP_VERSION |
| (06h) | (10h) |
+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+
| TUNNELLING_REQUEST |
| (0420h) |
+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+
| HEADER_SIZE_10 + sizeof(Connection Header) + |
| sizeof(cEMI Frame) |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
KNXnet/IP body
Connection header
+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+
| Structure Length | Communication Channel ID |
| (1 octet) | (1 octet) |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| Sequence Counter | reserved |
| (1 octet) | (1 octet) |
+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+
cEMI frame
+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+
| Message Code | Additional Info Length |
| (1 octet = 08h) | (1 octet) |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| Additional Information |
| (optional, variable length) |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| Service Information |
| (variable length) |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
4.4.7 TUNNELLING_ACK
KNXnet/IP header
+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+
| HEADER_SIZE_10 | KNXNETIP_VERSION |
| (06h) | (10h) |
+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+
| TUNNELLING_ACK |
| (0421h) |
+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+
| HEADER_SIZE_10 + sizeof(Connection Header) |
| |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
KNXnet/IP body
Connection header
+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+
| Structure Length | Communication Channel ID |
| (1 octet) | (1 octet) |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| Sequence Counter | Status |
| (1 octet) | (1 octet) |
+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+-7-+-6-+-5-+-4-+-3-+-2-+-1-+-0-+
5.2 TUNNELLING_ACK
+-------------------------------+ - - - - KNXnet/IP header - - - -
1 | 06h | header size
+-------------------------------+
2 | 10h | protocol version
+-------------------------------+
3 | 04h | \
+- - - - - - - - - - - - - - - -+ > service type identifier 0421h
4 | 21h | /
+-------------------------------+
5 | 00h | \
+- - - - - - - - - - - - - - - -+ > total length, 10 octets
6 | 0Ah | /
+-------------------------------+ - - - - connection header - - - -
7 | 04h | structure length of connection header
+-------------------------------+
8 | 15h | communication channel ID, e.g. 21
+-------------------------------+
9 | 00h | sequence counter
+-------------------------------+
10 | 00h | status, e.g. 00h (NO_ERROR)
+-------------------------------+
6 Certification
6.1 Introduction
This clause provides information on the test procedures and requirements of the certification process.