You are on page 1of 38

The Internet of Things:

Architecture and Applications


(ELEC423)
Dr Valerio Selis

V.Selis@liverpool.ac.uk
Outline
• M2M in the IoT:
• LoRaWAN recap
• Over-The-Air-Activation (OTAA)
• The Things Network (TTN):
• LoRaWAN
• Fair Access Policy
• Components
• Gateways
• TCP/IP suite vs LoRaWAN
M2M in the IoT – Recap
LoRa Alliance – LoRaWAN
Application
Servers

M2M Network
domain
Network
Server

Gateways
M2M Device
and Gateway
domain

Things
M2M in the IoT – Recap
LoRa Alliance – LoRaWAN
Device classes:
• Class A: used for battery powered devices
• The server can send a message to the device
(downlink) only after receiving a message from it
(uplink)
• Class B: used for low latency
• The server can send a message to the device
(downlink) only during specific time windows (ping
slots)
• Class C: usually used for main powered devices
with no latency
• The server can send a message to the device
(downlink) any given time
M2M in the IoT – Recap
LoRa Alliance – LoRaWAN
Network Application
Things Gateways
Server Servers

IP IP

Packet
NwkSKey
Control
AppSKey
Data

• Network Session Key (NwkSKey): unique key shared between


the device and the network server, used for control messages
(message integrity)
• Application Session Key (AppSKey): unique key shared
between the device and the application server, used for data
messages (message payload encryption)
M2M in the IoT – Recap
LoRa Alliance – LoRaWAN
LoRaWAN identifiers:
• Device Address (DevAddr): 32 bit identifier for the
device within its network (non-unique worldwide)
• The device is identified by matching the MIC, which
is calculated by using the NwkSKey and the
message, to a device in the database
• Device Extended Unique Identifier (DevEUI): 64 bit
unique identifier for the device worldwide assigned
by the chip manufacturer
• Application Extended Unique Identifier (AppEUI): 64
bit unique identifier for the application worldwide
• Gateway Extended Unique Identifier (GatewayEUI):
64 bit unique identifier for the gateway worldwide
M2M in the IoT – Recap
LoRa Alliance – LoRaWAN

Activation mechanisms:
• Over-The-Air-Activation (OTAA)
• An over-the-air handshake based on the Application
key (AppKey) is used to obtain the DevAddr, and
derive the NwkSKey and AppSKey keys
M2M in the IoT
LoRa Alliance – LoRaWAN
Network Application
Thing Gateways
Server Server
DevEUI
AppEUI IP IP
AppKey AppKey

Join Request with MIC


AppEUI DevEUI DevNonce MIC

1. The device generates a message containing the AppEUI, DevEUI and DevNonce
2. The DevNonce is a counter starting from 0 and used to identify the join request;
this must be different every time for the same AppEUI
3. The device selects a random channel and transmits the message with the MIC
M2M in the IoT
LoRa Alliance – LoRaWAN
Network Application
Thing Gateways
Server Server
DevEUI
AppEUI IP IP
AppKey AppKey

Join Request with MIC


Device authentication and
Session keys generation

1. The Network Server (NS) receives the join request and checks the DevNonce
• If it has been previously used, the NS will discard it (attack prevention)
• Otherwise, the NS will authenticate the device by using the MIC
2. If the device is successfully authenticated, the NS will generate the NtwSKey, the
AppSKey and the AppNonce (random value)
M2M in the IoT
LoRa Alliance – LoRaWAN
Network Application
Thing Gateways
Server Server
DevEUI
AppEUI IP IP
AppKey AppKey

Join Request with MIC


Device authentication and
Session keys generation

Join Accept
AppNonce NetID DevAddr DLSettings RxDelay MIC

1. The Network Server sends a Join Accept to the device encrypted by using the
AppKey and containing: the AppNonce, the network ID (NetID), the device
address (DevAddr), the downlink settings (DLSettings), the delay between the
transmission and reception (RXDelay) and the MIC
M2M in the IoT
LoRa Alliance – LoRaWAN
Network Application
Thing Gateways
Server Server
DevEUI
AppEUI IP IP
AppKey AppKey

Join Request with MIC


Device authentication and
Session keys generation

Join Accept

Send AppSKey

1. The Network Server sends the AppSKey and the DevAddr to the Application
Server
M2M in the IoT
LoRa Alliance – LoRaWAN
Network Application
Thing Gateways
Server Server
DevEUI
AppEUI IP IP
AppKey AppKey

Join Request with MIC


Device Authentication and
Session keys generation

Join Accept

Send AppSKey
Session keys
derivation

1. The device decrypt the join accept message by using the AppKey
2. The device uses the AppNonce derives the NtwSKey and the AppSKey
M2M in the IoT – Recap
LoRa Alliance – LoRaWAN

Activation mechanisms:
• Over-The-Air-Activation (OTAA)
• An over-the-air handshake based on the Application
key (AppKey) is used to obtain the DevAddr, and
derive the NwkSKey and AppSKey keys
• Activation By Personalization (ABP)
• The device is pre-configured with the DevAddr,
NwkSKey and AppSKey keys
• A mechanism may be required to keep track of frame
counters for messages exchanged between the
device and the server
The Things Network
LoRaWAN

How can we create a LoRaWAN-based solution


for the Internet of Things?

The Things Network (TTN):


• Open, decentralized and crowd sourced Internet of
Things data network
• Compliant with the LoRaWAN standard
• Compliant with ETSI regulations
• Created and maintained by a global community
• Currently at version 3
www.thethingsnetwork.org
The Things Network
LoRaWAN

The TTN mission is to “build a decentralized,


technology independent IoT network, owned
and operated by its users.”

Principles:
• Protect the privacy of the data by using an end-to-
end encryption
• Democratic network in which all data is treated
equally
• Provide an open source solution for the Internet of
Things

www.thethingsnetwork.org
The Things Network
LoRaWAN
Integration for
M2M apps

M2M Network Application Servers,


domain
Network Servers and
Gateway Servers

Gateways
M2M Device
and Gateway
domain

Things
The Things Network
Fair Access Policy
Frequency restrictions usage:
• For ETSI The duty cycle (DC) for each of the 8
frequencies in EU is equal to 1%
• The Things Network applies a fair access policy
• Limit the data each device can send
• 30 seconds uplink Time on Air (ToA) per day per
device
• Given 86400 seconds in a day, the duty cycle
is around 0.035%
• 10 downlink messages per day per device,
including the ACKs for confirmed uplinks
• Restrictions do not apply to private networks

https://www.thethingsnetwork.org/docs/lorawan/duty-cycle.html
The Things Network
LoRaWAN

Gateway
Server
The Things Network
LoRaWAN

Gateway Server:
• Fundamental part of the LoRaWAN network
• Support gateways with packet forwarding
capabilities
• Based on a Gateway Agent:
• Provide remote configuration of gateways
• Enable secure connections
• Manages the connection between the Gateways and
the Network Server
The Things Network
LoRaWAN

Gateway Network
Server Server
The Things Network
LoRaWAN
Network Server:
• Core of The Things Network and handles
LoRAWAN MAC layer
• Contains a list of devices present in the network:
• Device addresses
• State of the devices: frame counters, message
integrity code (MIC) and radio settings (timings, data
rates, etc.)
• Responsible for routing and processing the Internet
of Things data between applications and devices
• Update the state of the device (uplink)
• Add MAC specific information to the message
(downlink) such as frame counter, message type,
option flags and MAC commands
The Things Network
LoRaWAN

Gateway Network Application


Server Server Server

Console
The Things Network
LoRaWAN

Application Server:
• Handle the uplink messages generated by the
devices and generate downlink payloads
• Provide an interface between the network and the
end-user
• Provide a console to manage devices, gateways
and applications
• Provide integration capabilities with M2M application
protocols, e.g. MQTT and HTTP
• Support connection with the TTN client (CLI)
application
The Things Network
LoRaWAN

Identity
Server

Join
Server

Gateway Network Application


Server Server Server

Console
The Things Network
LoRaWAN

Join Server:
• Used to store LoRaWAN root keys
• Derive and issue session keys to the Network
Servers and Application Servers
• Over-The-Air-Activation (OTAA)
Identity Server:
• Issue security tokens
• Contains user, application and gateway registry
rights for using the TTN
The Things Network
LoRaWAN

Identity
Server

Join
Server

Gateway Network Application


Server Server Server

Console
M2M in the IoT
The Things Network – Gateways worldwide
M2M in the IoT
The Things Network – Gateways in EU
M2M in the IoT
The Things Network – Gateways in UK
M2M in the IoT
The Things Network – Gateway in UoL (EEE)
TCP/IP suite vs LoRaWAN
TCP/IP suite
TCP/IP (Transmission Control Protocol/Internet Protocol)
protocol suite:
Applications for exchange data (e.g. HTTP, FTP, MQTT)
Application • Do something with the data
• Providing network support for applications
Maintain end-to-end communications (e.g. TCP, UDP)
Transport • Deliver packets reliably, to correct process
• (Reliable) end-to-end delivery
Manage packets and connect networks (e.g. IP, ICMP)
Internet • Deliver packets to host across networks
• Global best-effort delivery
Manage host to network communication (e.g. Wi-Fi)
Link • Deliver packets to hosts across local network
• Local best-effort delivery
TCP/IP suite vs LoRaWAN
TCP/IP suite

Application Application Application

Transport Transport Transport

Internet Internet Internet

Link Link Link

Smart Edge router


Server
temperature
sensor
TCP/IP suite vs LoRaWAN
TCP/IP suite

Data flow in the TCP/IP suite


Application

Data Message

Transport

TCP header Data TCP segment

Internet

IP header TCP header Data IP datagram (Packet)

Link

Frame header IP header TCP header Data Frame


TCP/IP suite vs LoRaWAN
LoRaWAN
The LoRaWAN protocol stack is composed by three main
layers:
• Interface between the end-user applications
LoRa Application (e.g. HTTP, MQTT) and the device
• Used by the device to send data to the end-
user applications

LoRa MAC
LoRaWAN Implementation of the LoRaWAN protocol
Class Class Class
A B C

LoRa LoRa modulation


Implementation of the LoRa modulation scheme
(Physical) Regional ISM band depending on regional regulations
TCP/IP suite vs LoRaWAN
LoRaWAN

LoRa AppSKey
LoRa
Application
NwkSKey Application
LoRaWAN
LoRaWAN
LoRaWAN
TCP/IP TCP/IP TCP/IP
LoRa LoRa

Smart
temperature Gateways Network Application
sensor Server Server
TCP/IP suite vs LoRaWAN
LoRaWAN
Data flow in LoRaWAN

Application
Preamble
Data End-user application
and header
LoRa Application
Preamble MAC Frame header
Data CRC Application layer
and header header and port
LoRaWAN
Preamble MAC Frame header
Data MIC MAC layer
and header header and port

LoRa
Preamble MAC Frame header
Data MIC CRC Physical layer
and header header and port
Summary

M2M in the IoT

The Things Network

TCP/IP suite vs LoRaWAN


Next class?

Tomorrow at 11 a.m. in the


Mathematical Sciences Building,
Room 106
(MATH-106, Building 206).

You might also like