OH and the ISO OSI model

Tags: #<Tag:0x00007f616e03ecc0>

Dear community,

I guess everyone knows the ISO OSI layer model. I got asked, for what layers openHAB is relevant?
What do you think?

Best regards,

OpenHAB without any addons does very little by itself and would use layers 5 - 7.

I’d ask what does it mean to be “relevant”?

By itself I agree that 5-7 seem about right. OH provides an API (Session), displays images (Presentation), and uses all sorts of application layer protocols (HTTP, MQTT, etc.)

It gets more interesting when you start adding in add-ons. Network binding operates at layer 3 (Network). The TCP/UDP binding clearly would be at layer 4 (Transport).

I don’t know enough details about Zwave/Zigbee type bindings but by the time OH is involved I wouldn’t be surprised if it’s at layer 5 with the controller/coordinator implementing everything under that.

1 Like

I have to agree that openHAB itself is largely an abstraction platform allowing users to use many different systems without needing to understand the details of each individually.

That does seem to put it at the top of the stack 5-7, with bindings reaching down towards the physical layer (even bit-banging on I/O pins).

If the question was to assist with a conceptual model, I personally found a data flow diagram showing a one-to-many relationship between Binding -< Thing -< Channel and a side mapping to linked Item more useful to remember the context of each term.



i’m not sure 'application" means what is outlined above. The 7-layer model is about communication, not general applications. MS-Office is not an ‘application’ in this context. Nor, I think, is openHAB core.

Working backwards with my old friend Modbus-TCP …
Layer 1, physical = 100baseT wired or optical or whatever radio spec is
Layer 2, data link = 802.x ethernet or Wifi etc.
(those are the responsibility of our host box)
Layer 3, network = IP
Layer 4, transport = TCP
(those are responsibility of host operating system)
Layer 5, Session - null, we haven’t got one here.
Layer 6, Presentation - null, we haven’t got one here.
Layer 7, Application = openHAB at last, but this I see as the OH Modbus bnding, the part that actually does Modbus protocol. The protocol is the application - not the home automation.

openHAB itself is the user, the consumer of the Modbus protocol here.

Of course with something like direct Serial binding, we’ll be plugging in further down at layer 2. Layers 3-6 will probably be null, Layer 7 our rules and transformations dealing with the datastream.

With the HTTP binding, it goes the other way. The host system is I think doing all the work and providing the HTTP ‘application’. No part of openHAB overlaps the ISO model here.

The thing about the model is it is abstract and does not fit the real world jumble of technologies.

So circling back to the question

Not much. Some add-on parts of OH may occupy the upper layers of the model, but that’s configuration dependent.

It uses HTTP/HTTPS even without any add-ons installed. The REST API is there and the Dashboard is present. It also uses ssh to access the Karaf console. And it does so by hosting it’s own web server/sshd servers. OH is not merely a client in these cases.

But, as I mentioned, it depends what it means to be “relevant”. I took it to mean that OH directly interacts with something at a given level.

The HTTP binding uses the Java HTTP libraries and therefore it is OH that is directly interacting with the HTTP servers, not some part of the underlying operating system. Only if one is using executeCommandLine or the Exec binding to call curl or wget would OH be using something outside itself to access HTTP endpoints with the HTTP Binding.

That’s why the TCP/IP model is generally more useful. It better maps to real world applications.

1 Like