This page last changed on May 21, 2009 by knxsimulator.

Hi to all!
I'm a new openRemote user.
I'm trying to simulate KNXnet/IP client and server using OMNET++ to realize my degree thesis; so i hope that here i can receive some useful advise.
In the KNXnet/IP protocol i have read tha every KNXnet/IP server must implement, at least, one Service Container.
Can anyone tell me what is exactly a service container?

The second question is: a KNX frame must be first translated in a cEMI message and then the cEMI is encapsulated into an UDP frame?

Third: in this case the KNX stack contains the Data Link Layer?


Immagine.jpg (image/jpeg)
Immagine2.jpg (image/jpeg)
Immagine2.jpg (image/jpeg)
Immagine2.jpg (image/jpeg)
Immagine2.jpg (image/jpeg)

Service container is an KNX end point (so it has its own Host Protocol Address Information HPAI block). As far as I can tell it's a logical entity for a service provided by the server (discovery, control, etc.). For each connection to the KNX network, the spec mandates a logical service container (my reading of the spec anyway).

There's a cEMI RAW mode but I don't know the details about that, and its implementation is optional by devices.

For tunnelink in KNX datalink, first you need a EIBnet/IP frame, then assuming you're using an already established connection, you append a connection header. Then finally you embed a cEMI frame.

In pure byte format, you'll end up with something like this (group write w/ tunneling on link layer):

      byte[] writebuffer = new byte[21];

      // EIBnet IP Header ----------------------------------------

      writebuffer[0] = 0x06;      // Header size: 6 bytes
      writebuffer[1] = 0x10;      // EIBnet IP Version
      writebuffer[2] = 0x04;      // Tunneling Request (2 bytes)
      writebuffer[3] = 0x20;      //  -- '' --
      writebuffer[4] = 0x00;      // size (2 bytes) == header size (6b) + connection header (4b) + cEMI frame (11b for short telegram) == 21 == 0x15
      writebuffer[5] = 0x15;      //  -- '' --

      // Connection Header ---------------------------------------
      writebuffer[6] = 0x04;      // struct len: 4 bytes  -- TODO : wiki claims 0x06 value!
      writebuffer[7] = channelID;
      writebuffer[8] = 0x00;      // sequence counter
      writebuffer[9] = 0x00;      // reserved

      // cEMI frame ----------------------------------------------

      int controlField1 = 0x8C;
      int controlField2 = 0xE0;
      int switchON      = 0x81;

      writebuffer[10] = 0x11;     // message code
      writebuffer[11] = 0x00;     // additional info length : 0
      writebuffer[12] = (byte)controlField1;
      writebuffer[13] = (byte)controlField2;
      writebuffer[14] = 0x00;     // source address hi byte  (to be filled by gateway)
      writebuffer[15] = 0x00;     // source address lo byte  (to be filled by gateway)
      writebuffer[16] = 0x00;     // dest address hi byte
      writebuffer[17] = 0x04;     // dest address lo byte
      writebuffer[18] = 0x01;     // data len
      writebuffer[19] = 0x00;     // TPCI/APCI
      writebuffer[20] = (byte)switchON;     // APCI/data    (0x80 + 1 == bit on)

So 21 bytes to send 1 bit command to a 2 byte destination address. Supposedly the cEMI RAW mode allows less?

The above assumes you already established a connection (you have ChannelID), your connection will need a heart beat or the gateway is likely to cut you off, and then you need to deal with the ACKs from the gateway itself and the ACK from the endpoint in the KNX network.

Disclaimer: some of the above information may be wrong, my KNX experience is rather limited.


Posted by juha at May 21, 2009 18:25

Hi to all.
I still have a problem in understanding how the KNX comunication stack comunicate with the KNXnet/IP protocol.
A KNX/IP device, has this structure.

I think that, in the step , i must create a message like this (cEMI):

Is this correct?


Posted by knxsimulator at May 23, 2009 07:00


I am new on this site. So I am searching for KNXnet/IP specification. Does anybody have the specification?

Thank you very much.


Posted by mytrash at Jan 26, 2011 13:49
Document generated by Confluence on Jun 05, 2016 09:31