What is WoT: OSI layers & network topologies
by the Web of Things Community Group
In WoT we are dealing with interacting with devices over the network. Thus, we need to look at how such a communication is modelled. The WoT focuses on the protocols that operate on the application layer that use TCP and UDP from the transport layer. Thus, it is important to understand OSI layers and how sending and receiving data works. The corresponding web page of this video is at https://w3c.github.io/wot-cg/tutorials/whatiswot/docs/preliminary/osi-layers.
Video
Transcript
In WoT we are dealing with interacting with devices over the network.
Thus, we need to look at how such a communication is modelled.
The WoT focuses on the protocols that operate on the application layer that use TCP and UDP from the transport layer. Thus, it is important to understand OSI layers and how sending and receiving data works.
Okay, so we were talking about sending JSON and changing the temperature before.
Let's assume that a temperature sensor has received a request from a dashboard to send its temperature value.
So let's see the magic behind the network.
Let's assume that we have the temperature data in the payload in the application layer of the temperature sensor and we want to send it via a HTTP message to the dashboard.
Application Layer is an abstraction layer service that masks the rest of the application from the transmission process.
Then our payload, moves to the Presentation Layer, where our data will be encrypted.
After that encryption comes the Session Layer, where we open a session with the device we want to talk with.
Next layer is the Transport Layer.
This layer includes protocols like TCP or UDP which are meant to route data from sender to receiver.
In this layer, all the information that we have in the application layer is encapsulated as payload and TCP or UDP add their own headers.
Then Network Layer comes, where we define how the devices linked together and how they communicate inside the network.
For example: information about the IP address is handled in that layer.
In Datalink Layer, it is defined how to structure bits into data.
For example: information about the MAC address is handled in that layer.
And lastly, our package arrive to the Physical Layer, where the raw bit streams are transmitted over a physical medium such as Ethernet cable or Wi-Fi.
To sum up, we had the temperature data in our sensor and pass it down the OSI layers to change the temperature value in the dashboard. These two are interacting through the network.
Performing this we were able to send the temperature data.
In order for the dashboard to receive the data, it has to go through all the OSI layers but in reverse order. At the end of the process , we can observe that the temperature will change on the indicator.
There are different Network Topologies such as Server Client Model, Broker Client Model, Peer to Peer Model.
In all of these, the underlying network technology is not changing much but rather how you connect the nodes themselves.
WoT can be applied on different network device topologies. It is not constrained to any of them.
One of the most widely used is Server Client Model. It consist of «a server» and one or more clients.
In this model, the server is reactive, and the client is proactive meaning that the server waits for the request and responds to the clients.
Common Server-Client Protocols are HTTP, WebSocket and CoAP.
If server and client are very tightly coupled, it is very hard one to evolve independently from another.
There are architectures that ensure they are not tightly coupled, like REST. Similar to REST, WoT also encourages systems that are not tightly coupled. The REST concept where every resource has URI is also a primary design choice of the WoT.
Second model we will explain is Broker Client Model.
In this model, multiple clients are connected to a central broker. Also, it is referred as Publisher-Subscriber. However, Broker-Client is more specific since there can be PubSub without a broker.
Broker does not contain any application logic, it simply a router that receives messages and sends them to the clients that are listening.
In this model, if one of the clients is inactive, data sent by broker waits for the clients to be active again.
This feature is called decoupling of time.
Or it can happen the other way around as well. For example, two clients can send data to Broker and Broker distribute it to the other client or clients.
And the last one is Peer to Peer Model. This is a true distributed system where there is no single point to get data from.
Examples of this model are BitTorrent and OPC UA PubSub.
In this video we explained the OSI Layers.
You can proceed to the next tutorial by clicking on the card or the video description.