IoT Protocol Stack - Adaptive layer
IoT Protocol Stack - Adaptive layer
• A new set of wireless technologies has received a lot of attention from the
industry, know as
– Low-Power Wide-Area (LPWA) networking technology
LoRaWAN
Protocol Stack
LoRa PHY layer
• Semtech LoRa PHY
Node Addressing: endpoints are also known by their 32-bit end device address
• 7 bit for network + 25 bit for devices
LoRaWAN Address Space
• LoRaWAN uses a number of identifiers for devices, applications and gateways.
– Data security applied at the end points (end device / application server)
• second layer of security by an application session key (AppSKey)
• performs encryption / decryption between the Endpoint and its Application server.
• it computes and checks the application-level MIC
• LoRaWAN service provider does not have access to the application payload if it is
not allowed
LoRa® Network Features
Networ
Base k
station Server
s
Applicatio
Sensor
ns
s
Module
s
End Device
Cloud LoRa
Gateway
Email
End Device LoRa Network TCP/IP SSL
Gateway Server Application
Server
Customer IT
Frequency
Spectrum: unlicensed, i.e. the 915 MHz ISM band in the US, 868 MHz in Europe
Protocol and message structure
Uplink – P A YL O A D/DEBITS
ra: n s m it te d Time on Air
(for 12 bytes sent)
Data rate
(for 12 bytes sent)
Overhead Max Payload
LoRa SF7 62 ms 1556 bits/s
LoRa 17 bytes Up to 242 bytes LoRa SF12 1,48 sec 64,74 bits/s
A Listens only
after end
device
Modules with
no latency
economic
communication
Class
•
•
Fire Detection
Earthquake
(« all ») constraint energetically.. Early
transmission Supported by all Detection
modules. Adapted to
battery powered modules
Modules with
B The module
listens at a
regularly
latency constraints
for the reception of
Consumption optimized.
Adapted to battery
• Smart metering
(« beacon ») adjustable
messages of a few powered modules • Temperature rise
seconds
frequency
Modules with a
C Module
always
strong
reception
latency
Adapted to modules on the grid
or with no power constraints
• Fleet
management
(« continuous ») listening constraint (less • Real Time
than one Traffic
second) Management
1 sec +/- 20 us
• 10.2 ms at SF8 …
R
x Listening duration
1
Listening duration: varies according to the
R
x Listening duration SF
Opens N reception windows 2
between the two tags
R
x Listening duration
3
R
x Listening duration
N • Optimized energy consumption
• Communication initiated by the
End tag GTW
Class C
Gateway
- Permanent listening End Point
-Closes the reception window
only during transmissions
Packet transmission
Adapted to devices on
T
Closed receive window
X
the power grid
7 bits 25 bits
Application identifier (AppEUI): A global application ID in the IEEE EUI64 address space
that uniquely identifies the owner of the end-device.
Network session key (NwkSKey): A key used by the network server and the end-device
to calculate and verify the message integrity code of all data messages to ensure data
integrity.
Application session key (AppSKey): A key used by the network server and end-device
to
encrypt and decrypt the payload field of data messages.
Agriculture - Irrigation
Current LoRa ®
0.5 MILE Radius / 0.75 sq. miles /20 15 mile radius / 706 sq. miles /18k
sensors sensors
6LoWPAN defined
encapsulation and header compression mechanisms
6LoWPAN Applications:
General Automation, Home automation, Smart Grid, Industrial monitoring, Smart
Agriculture, etc.
6LoWPAN Edge Router
By communicating
natively with IP,
6LoWPAN networks are
connected to other
networks simply using
IP routers at the edge.
Source:
https://www.ti.com/lit/wp/swry013/swry013.pdf?
6LoWPAN Architecture
BENEFITS
The utility of a mesh network over other network What is mesh network?
A mesh network is a network in which a
types, such as a hub-and-spoke network, is that if a device or node is linked with all other
node is too far away from the hub, it can still nodes or with a sub-set of nodes directly.
communicate via a closer node until it reaches a
router.
Other Advantages:
• Increased stability by avoiding single point failure
• Increased range by using multi-hop communication
• Direct communication between nodes
• Less power is needed for each node as all nodes
need not send signal to central access point
Source: https://www.e-spincorp.com/what-is-6lowpan-and-its-
functions/
6LoWPAN Advantages
Open IP Multiple
Mesh Routing
Standar PHY
d
• Use open standard such • One-to-many / many-to-
Support
• Freedom of frequency
as TCP, UDP, one routing band and
HTTP, CoAP, physical layer
MQTT, WebSocket • Robust and Scalable
•Can be used across
• End-to-End IP • Self healing multiple
addressable nodes communication
platform
• Flexible •(ex. Ethernet / WiFi /
• No gateway needed. 802.15.4 /
• A router connects the Sub-1 GHz)
6LoWPAN network
to IP • Interoperability at
the IP level
RFCs
6LoWPAN IETF group developed a base specification RFC 4944
“Transmission of IPv6 Packets over IEEE 802.15.4 Networks”
(8)
4. Multicast support
IEEE 802.15.4 & other low power radios do not support multicast (as it
is expensive)
Main Goals of 6LoWPAN Design
Define adaptation layer to match IPv6 MTU requirements
• by fragmentation/reassembly
LoWPAN encapsulation are the payload in the IEEE 802.15.4 MAC protocol data unit
(PDU).
Stacked Headers
• 6LoWPAN uses concept of
• stacked headers
when dispatch header is used to indicate the sub-header type that
immediately follows
• extension headers
when the next header field is used to indicate the header type that
immediately follows
Dispatch Header
Routing by
Mesh
Header
Data packet
routing
in TCP/IP network
Fragmentation Type & Header
First Fragment
Subsequent Fragments
Datagram tag (8 bits): same for all link fragments of a payload, but different for two
IPv6 payload. Datagram offset (11 bits): present only in subsequent fragments
Fragmentation and Reassembly
Fragmentation Principles (RFC 4944)
When an IPv6 packet exceeds link-layer payload size then segments
the packet into fragments.
Offset: It identifies the relative position of the received fragment from the
beginning of the payload datagram to allow out-of-sequence delivery.
Cont...
Only the 1st fragment carries end-to-end routing information.
48 bit MAC
address
64 bit Interface ID
(IID)
6LoWPAN Header Compressions
HC1 (for IP) and HC2 (for UDP) compressions
Assume common values for header fields and define compact forms.
Reduce header size by omission
IPv6 header
Flow Label: used by source to label the packets belonging to the same flow in order to
request special handling by intermediate routers
Payload Length: size (in octets) of the rest of the packet that follows the IPv6 header
Next header: type of header that immediately follows the IPv6 header
Hop limit: Decremented by one by each node that forwards the packet.
Dispatch
Header
Cont...
Uncompressed
Compression: HC2
HC2:Compresses UDP Headers
Reduced
UDP header format to
[ 8 Byte] Source port = P+4bits, 1
P=61616 Byte
Destination port= P+4bits,
Length
P=61616derived from IPv6 2
length Byte
Checksum is always carried
inline
Mesh-under
Route-over
Cont…
Mesh-under Route-over
Uses L2 addresses to forward data Uses L3 addresses to forward data.
Only edge router is the IP router; Each hop acts as an IP router or
other intermediate devices are mesh- 6LoWPAN router.
under forwarder All fragments are sent to same
Individual fragments may take path as routing decision taken
different paths. on per packet basis
Suitable for small and local networks Suitable for all sized networks