The Internet of Things: Architecture and Applications (ELEC423)
The Internet of Things: Architecture and Applications (ELEC423)
The Internet of Things: Architecture and Applications (ELEC423)
[email protected]
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
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
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
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 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 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 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
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
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
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
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
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
Data Message
Transport
Internet
Link
LoRa MAC
LoRaWAN Implementation of the LoRaWAN protocol
Class Class Class
A B C
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