Slide 1
Discovery and Group Communication for Constrained Internet of Things Devices using the Constrained Application Protocol Ontdekken van en groepscommunicatie met toestellen met beperkte mogelijkheden in het 'internet der dingen' door middel van het 'Constrained Application Protocol’
Isam Ishaq
[email protected] www.ibcn.intec.ugent.be Internet Based Communication Networks and Services research group (IBCN) Department of Information Technology (INTEC) Ghent University - iMinds
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
Slide 2
Home Automation Example
My PhD has to do with the future of this guy. He might be any one of you. Anyway, let’s just call him Adam. As you can see, Adam has a smartphone.
Slide 3
Home Automation Example
Adam also has a beautiful home. In the next 40 minutes, I will show you how my PhD research can help Adam make his home not just beautiful, but also smart so that it adapts to his life style. For example by automatically turning of some if not all of these lights to save energy. First, allow me to provide some background information.
Slide 4
Internet of Things (IoT)
Today
Start of my PhD
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
4
The title of my PhD includes the term Internet of Things or IoT in it. This term was first used in 1999. However, even when I started my PhD in 2011 there was not a lot of public interest in the Internet of Things yet as you can see in this google trends graph. Only the last two or three years show real increase in the public interest in the Internet of Things.
Slide 5
Nice, but what is the Internet of Things (IoT)? HYPE, BUT WHAT IS IT ALL ABOUT? Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
5
Slide 6
Summary of 8 IoT definitions
6
There are many definitions for the IoT. My promoter (Prof. Hoebeke) used wordle to summaries 8 of the most used definitions and this is what he got. Confusing?? Let me explain. The bigger the word is, the more frequent it was used in the definitions. So we can tell that the IoT is a network, it has objects that are physical a produce a lot of information. They have virtual representations and of course are connected to the Internet. And a lot more.
Slide 7
What is IoT? Physical
Virtual
Everyday objects
Network (Internet)
Services, applications
Sense
Connect
Control
Communication technology Data created by PERSONS Unique identity (addressable) Virtual representation Data created by THINGS
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
7
Still confused? Let me try it in a different way. We all know the Internet, which the largest network of devices. We all use Internet applications and services. For example Facebook or twitter. We call this the Virtual world. On the other hand, we are surrounded with many physical objects. For example the coffee machine. The first step for achieving the Internet of Things is to connect our everyday objects to the Internet. Now the objects can sense their environment and send this Information to the Internet applications. For example the coffee machine can now tweet that it is almost out of coffee. In the opposite direction, the applications can control everyday objects. For example, letting my wrist watch remind me to buy coffee, when I am at the supermarket, as a result of the coffee machine tweet. So the IoT involves a lot of communication technology to connect all these objects together. Every object needs an identity that is unique across the complete Internet. So that I know it was my coffee machine that sent the tweet. Not somebody’s else. The objects get virtual representations so that applications can work with them. We can say that the shift from the current Internet to the Internet of Things is the shift from Data being created by PERSONS to data created by THINGS.
Slide 8
IoT Adoption rate
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
8
If you just image all the objects around us that can potentially become connected or all the information that can be collected about our environment using sensors, then it is clear that the Internet of Things will be huge. According to forecasts, 50 billion devices will be connected to the Internet by 2020, outnumbering the number of human beings on our planet. The adoption rate will be unprecedented, 5x faster than electricity and telephony.
Slide 9
IoT application domains Smart metering
Building Automation/ Smart Home
Smart cities Logistics Health
Internet of Things
Transportation
Remote monitoring
Industrial automation
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
9
IoT can be applied in many application domains, such as in Smart metering/smart grids: detailed monitoring of energy production (wind, solar, etc.) and energy consumption (homes, electrical vehicles) allowing operators to balance supply and demand. In this presentation we will focus on building automation and smart homes. It is easy to understand and it links to your personal life
Slide 10
Home automation Light/Temp.Soil humidity Sensors /Humidity RFID reader Magnetic locks
Lights
Fireplace Magnetic locks Actuators
Movement detection
Windows shutters
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
10
The first step in making Adam’s home smarter is to use or equip it with sensors to measure different aspects about it. For example: Light/Temperature and Humidity sensor. RFID reader on the door, Magnetic locks on the doors and windows. Movement detection. Soil humidity sensors for the plants. Actuators are also needed to control the home. Such as the Lights, the Magnetic locks, the fireplace and the window shutters.
Slide 11
Home automation products Philips Hue bridge
Philips Hue app
Access point home network Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
11
There are already products that you or Adam can buy to make the home smarter. For example these smart lamps from Philips that can be controlled from the smartphone.
Slide 12
Home automation products smappee
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
12
Another IoT application that Adam can buy nowadays is SMAPPEE. For just one device of 199 Euro, he can monitor the consumption for all the electrical devices at in his home. Smappee measures the main electricity current at the fuse box. Based on that, it analyses the data and it can tell Adam which device are switched on or off (every device has +- electrical fingerprint). He can even use his smart phone to do so regardless if he is at home or far away from it.
Slide 13
Home automation products
Egg Minder
13
15/10/2015
Source: Quirky
Or the Example of an IoT device that can dramatically improve Adam's life. Keeps track of # of eggs in fridge, date he bought them and comes with a handy app. Today there is no market for such gadgets, but in the future it may be embedded in your fridge at a fraction of the current production cost.
Slide 14
IoT Devices Implants
Vehicles
Smart Phones
Machines
Smart Glasses Smart meters
Sensors
Factories
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
Smart Cities
14
The devices of the IoT are very diverse and have a wide range of capabilities. Some devices are big and have a lot of resources, such as vehicles or factories. Other devices are tiny and have very limited capabilities.
Slide 15
Constrained IoT devices
Dot Mote
Smart Dust
Tmote Sky
Zolertia Z1
Rmoni RM090
Processor
16bit 8MHz
64bit Quad Core, 3 GHz
1 : 10 000
Memory
RAM: 10KB ROM: 100KB
100 GB
1 : 1 000 000
Battery charge
Years
1 Day
1 000 : 1
Cost
Low cost
Expensive
1 : 1 000
15
In fact, many experts believe that soon the majority of the IoT devices will be embedded devices with very limited resources, for example 10KB RAM and 100 KB ROM. These constrained devices are the focus of this PhD research. To get an idea about the amount of resources these devices have, let us compare them with the smartphone of Adam that he has just bought.
Slide 16
Design Goals
Application
design goals
Simple Energy
efficient Reduce communication Short messages
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
16
Slide 17
Interconnecting sensor networks
client
HTTP
Gateway
HTTP
TCP
Trans.
TCP
IP
IP
Internet Gateway Trans.
server Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
17
In today’s Internet, the most important devices are maybe computers and smartphones and servers. Typical communication is the exchange of data between a client and a server. For example, when you use your phone to access the University of Ghent website, your phone is the client and the server is the computer, where the website is stored. The Internet is working most of the times fine, because its devices know how to speak to each other. They use open standard protocols to exchange data. One important protocol that you always use when you use your web browser is HTTP. Other important protocols on the Internet are TCP and IP. In order to connect sensor networks to the Internet special devices called gateways are used. However these protocols were not designed for constrained devices. They are too complex and big and thus are not suitable for the constrained networks.To solve this problem, vendors developed proprietary protocols to connect their respective constrained networks to the Internet. Again these protocols cannot be understood by Internet devices. So in order to allow communication between the devices on the Internet and the sensors the gateway has to translate between the protocols. Different venders developed different protocols and solutions that are incompatible with each other.
Slide 18
Challenge: Home Automation Example Can I make all lights automatically go on when the burglar alarm goes on?
Unfortunately not. They speak different protocols.
15/10/2015
18
This approach leads to vendor lock-in. This means, if for example Adam bought a smart light system from vendor X and bought an alarm system from vender Y. He would typically have no way to make the systems work together. That is he will not be able to let the lights go on if there is an alarm as a result of unauthorized window open in the night.
Slide 19
Slide 20
Interconnecting sensor networks http://light1.adam.home
HTTP client
TCP IPv6
CoAP Gateway Trans.
UDP
server
6LoWPAN
Internet IPv6 address: 2001:abcd:1234:5678:90ab:cdef:1234:5678
Short address: 1234
server Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
20
Luckily, this situation is changing lately. Now it is possible to use standard protocols that are tailored to IoT devices. The most important protocol on the Internet is the IP protocol. In its current version IPv6 every device gets an IP address that is 128 bit long.However, these addresses are to large for constrained devices. Inside the constrained networks 6LoWPAN allows the constrained devices to use short addresses (for example,16 bit long) and appear on the Internet as if they had valid and complete IPv6 addresses. The gateway does the protocol translation between IPv6 and 6LoWPAN transparently. It also translates between the other protocols. TCP to UDP and HTTP to CoAP. Using these standard protocols Adam can now access his lights from the web browser on his smartphone, in the same way he accessed the University of Ghent website. Since now the alarm system and the light system speak the same language, Adam is able to let the lights go on if there is a burglar alarm, even if the solutions are from different vendors.
Slide 21
Constrained Application Protocol coap://[sen1]/temp CoAP
Gateway
sen1
Internet GET coap://[Sen1]/temp 2.05 Content (text/plain) Body: 23 • •
Only two packets < 100 bytes each
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
21
The focus of this PhD is on the Constrained Application Protocol (CoAP), which is a lightweight alternative to HTTP. Using CoAP, clients can interact with constrained devices by accessing URI’s in a way similar to HTTP. We can see that the communication is simple. Only one packet is sent from the phone to the sensor to request the temperature. And one packet as a reply from the sensor to the phone with the current temperature 23 in this case. There is little overhead from CoAP. These packets including all headers and addresses are less than 100 bytes.
Slide 22
Observing Resources coap://[sen1]/temp
Internet
Gateway
sen1
GET Obs coap://[Sen1]/temp
Registration
2.05 Content Obs (text/plain) Body: 23
Notification of current state
2.05 Content Obs (text/plain) Body: 24 2.05 Content Obs (text/plain) Body: 25
Notifications upon state change
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
22
Another important feature of CoAP is its observe mechanism, where a client can notify the server that it needs to be updated each time the state of the resource changes. Here we can see that the client registered its interest in the temperature resource. It was notified about the current temperature and also about each change in the temperature after that point. This is efficient, because the client does not have to always check if there was a change or not.
Slide 23
I am using onlyAutomation standards based solutions. Home Example Are all my problems solved?
Unfortunately not
15/10/2015
23
Now Adam is happily using only standard protocols and his home automation systems all work together. Are all his problems solved? Unfortunately not for Adam. But this is fortunate for me, since this is where there is a need for my PhD research.
Slide 24
Challenge: Home Automation Example What devices can I use? What services do they offer?
15/10/2015
Device discovery Service discovery Self-organization Self-configuration
24
One major challenge that my PhD addresses, is to answer Adam’s question about which devices and services he can access at his home. In out Jargon, we call this Device discovery, Service discovery and also Selforganization and Self-configuration. This is where the first word of my complex PhD title is coming from.
Slide 25
Sensor Discovery CoAP
coap://light1.adam.home hum 9
Name
Address
light1.adam.home temp.adam.home hum.adam.home light2.adam.home
aaaa::5 aaaa::6 aaaa::9 aaaa::3
Gateway
light2
GET 3 /.well-known/serverInfo
light1 5
temp 6
Internet DNS suffix: adam.home IP address prefix: aaaa::
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
25
Our CoAP based solution for sensor discovery starts from the Gateway. The gateway sends a multicast CoAP request asking all CoAP servers for their information. This request should be received by all devices. For example, we see that the light answers with its short name light1 and short address 5. The Gateway stores this information in an internal database. This database we call DNS system. It is used so that users do not have remember computer addresses. It is easier to remember a name such as light1.adam.home. But where did the “adam.home” and “aaaa::” come from? They are preconfigured on the Gateway. The other devices also send there information in the same way, so that the gateway builds a complete database off all devices. Now Adam can access the light as coap://light1.adam.home
Slide 26
Gateway Discovery DNS suffix: living.adam.home IP address prefix: aaaa::1:
Gateway1 Name
iGateway
GET living /.well-known/serverInfo Address
light1.living.adam.home aaaa::1:5
Name suffix prefix temp.living.adam.home aaaa::1:6 Gateway1 living aaaa::1: GET hum.living.adam.home aaaa::1:9 Gateway2 bath aaaa::2: /.well-known/serverInfo
Internet
Home network
DNS suffix: bath.adam.home IP address prefix: aaaa::2:
Gateway2 Name
GET bath /.well-known/serverInfo Address
light1.bath.adam.home aaaa::2:3 temp.bath.adam.home aaaa::2:6 Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
26
If Adam has a larger home, he could arrange it hierarchically with multiple gateways. For example one for the living room and the other for the bath. The gateways are configured with the respective information. Each gateway discovers its devices as we have just seen. The gateway that connects the home to the Internet “iGateway”, does a similar process to discover all the other gateways in the home.
Slide 27
Self Organization process Home
Internet
iGateway network Gateway1
Add Gateway1 to DNS Add it as DNS server Add route to sensor subnet
Create unique name Store info in local DNS
sen1
coap://[ff02::1]/.well-known/ServerInfo List of known CoAP server addresses
coap://[ff02::1]/.well-known/ServerInfo List of known CoAP server addresses
Self-configuration
coap://[IGW]/.well-known/Servers Discovered gateways
coap://[SensorGW]/.well-known/Servers Discovered sensors
Sensor Discovery
coap://[sensor]/temperature
temperature
Sensor Access
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
27
In summary the complete discovery process works as follows: In the self-configuration phase the devices and gateways are discovered and added to the DNS. When a client on the Internet wants to know which devices are available at a particular location, it contacts its Internet Gateway to get a list of all other gateways. It then contacts one of those gateways to see which sensors are available. It can then contact that sensor to get its value.
Slide 28
Challenge: Home Automation Example Can I access multiple living room lights resources at once? kitchen lights shutters
shutters TV spots
locks
locks
15/10/2015
Group Communication
locks
28
Another Challenge that Adam has is his need to access multiple resource at the same time. For example, all the locks. All the shutters, All the lights, or maybe just all the living room lights. In our Jargon we call this Group Communication, which also in the title of my PhD and is the larger part of my research.
Slide 29
CoAP Multicast PUT Home Automation Example living room lights /light Payload: light=off
CoAP Multicasts are Non-confirmable → Not reliable
15/10/2015
“The single biggest problem in communication is the illusion that it has taken place.” - George Bernard Shaw 29 (1856-1950)
CoAP has a proposed solution group communication. This solution works as follows. If Adam wants to switch off all room lights on using his smartphone, he presses a botton. Then his phone sends a multicast CoAP request to the /light resource telling them to go off. Note that all lights should have this resource in order for this to work. Ideally, all lights should go off. However, it is likely that the message does not reach all lights and one of them stays on as in this case. If Adam is at home, he can just do it again until all lights are off. However, if he is away from his home, he has no visual feedback that one light did not go off. The reason that this happened is that CoAP multicasts are Non-confirmable, that means the lights do not have to tell the phone if they went off or not. That is way it is not reliable. This is the serious problem. George Bernard Shaw said 100 years ago: The single biggest problem in communication is the illusion that it has taken place.
Slide 30
Alternative Group Communication
Internet
Gateway
30
In this PhD research, we have developed an alternative group communication architecture. Central to this architecture is the Entity Manager, which can reside on the gateway of the constrained network and acts as an intermediary between the constrained devices and the Internet. Clients interact with the Entity Manager to create groups. The Entity Manager assigns a group URI, that clients can use to obtain aggregated results from the group. In the background, the Entity Manager interacts with the group members in order to validate groups and to obtain the results of individual resources via unicast messages. The use of unicast messages avoids many of the multicast limitations mentioned before.
Slide 31
PUT /lights state=on
Group access
Internet ACK
phone
Gateway
/lights
31
Slide 32
Home Automation Example
15/10/2015
CoAP Unicasts can be confirmable 32 → Reliable
Slide 33
Evaluation
Methods
Mathematical models Simulations Testbeds
Performance parameters
Reliability Packets transmitted Latency
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
33
We have evaluated our approach using several methods: We built mathematical models, used simulations and several testbeds. As key performance parameters, we looked at the reliability, the number of transmitted packets and the latency.
Slide 34
Reliability Reliability of complete group of 5 nodes (%) 100 4-hop 3-hop
2-hop
entity
1-hop
80
multicast
60
1-hop 40 2-hop 20 3-hop 4-hop
0 0
5
10
15
20
25 30 Packet Loss (%)
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
Main results of this research. As expected, our approach enhances reliability.
34
Slide 35
Number of Packets Average # packets/group member (group of 5 nodes) 15
4-hop 3-hop
10 2-hop 4-hop
5
entity
3-hop 2-hop
1-hop
1-hop
0 0
5
multicast
10
15
20
25 30 Packet Loss (%)
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
35
The trade-off is in the number of transmitted packets and the latency.
Slide 36
Group access from cache GET /temp
Internet 23
phone
Gateway
/temp
36
Slide 37
Number of Packets with cache Average # packets/group member 8
Entity 4-hop Multicast
6
Entity 3-hop Multicast
4
Entity 2-hop Multicast
2
Entity 1-hop Multicast
0 0
10
20
30
40
50
60 70 Time between requests (s)
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
37
However, when we take into consideration the cacheabilty of our solution, then we see also improvements in the number of packets and the latency as well.
Slide 38
Advanced Group Communication Gateway
Internet
Precision
• 23 instead of 23.2
Observe • Notifications only upon group state change
Operations • • • •
List Minimum Maximum Average
38
Slide 39
Entity Operations sen2
coap://[EM]/temp?eo=avg
Internet
Gateway
sen1
GET coap://[EM]/temp?eo=avg GET coap://[sen2]/s/t GET coap://[sen1]/sens/temp 2.05 Content (text/plain) Body: 23 2.05 Content (text/plain) Body: 24
2.05 Content (text/plain) Body: 25
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
39
Slide 40
Entity Observe coap://[EM]/doors
Internet Registration
GET Obs coap://[EM]/doors
Notification of current state 2.05 Content Obs (text/plain) Body: door1,closed door2,closed
door2
Obs
Gateway
door1
GET Obs coap://[sen2]/lock GET Obs coap://[sen1]/sens/lock 2.05 Content Obs (text/plain) Body: closed 2.05 Content Obs (text/plain) Body: closed
Notification upon state change 2.05 Content Obs (text/plain) Body: door1,closed door2,open
2.05 Content Obs (text/plain) Body: open
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
40
Slide 41
Key improvements
Reliability
Groups of resources
Validation
Observe support
Cache friendly
Flexibility
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
41
We can summarize the key improvements of our solution in six points: Better Reliability. Grouping of Resources (instead of entire nodes), validation of groups, Flexibility, and being cache friendly.
Slide 42
Outlook
Security Privacy Automatic suggestion of groups Automatic creation of groups
Automatic adjustment of parameter settings
Department of Information Technology – Internet Based Communication Networks and Services (IBCN)
As future work we think that the following should be examined.
42
Slide 43
Questions ? Isam Ishaq
[email protected] www.ibcn.intec.ugent.be Internet Based Communication Networks and Services research group (IBCN) Department of Information Technology (INTEC) Ghent University - iMinds