# IoT Stoff ###### tags: `fh` `IoT` [TOC] [Juditas Unterlagen](https://hackmd.io/@judytakrz/SkFJvKD6I#TODO---IP-as-the-IoT-Network-Layer-and-Application-Protocols-for-IoT) # What is the IoT? ## Definition * introduced around 1999 * Premise and goal of IoT: "Connect the unconnected" * This allows to sense and control machines remotely across the internet which in turn enables improvements in the areas of efficiency, accuracy automation and the enablement of advanced applications. * IoT is a Umbrella of various concepts, protocols and technologies * IEEE:"A network of items, each embedded witch sensors, whcih are connected to the internet" * ITU-T:"A global infrastructure, enabling advanced services by interconnecting things based on information and communication technologies" * European Commission:"The network of physical objects that contain embedded technology to communicate and sense or interact with their internal states or external environment" ### Things * Passive thing * no power supply * e.g. RFID tag, responding with short message (ID) * Active thing * can send sensor data about current conditions to the Internet (DB, Cloud, ...) * and/or can receive signals to control the environment * Autonomous thing * no central controller needed * decisions based on own sensing ### IEE three-tiered architecture of IoT Applications <-> Networking and Data Communications <-> Sensing ![](https://i.imgur.com/OlliodT.png) ## Genesis of IoT ![](https://i.imgur.com/UuL0jS2.png) * 2008/9 more internet devices than humans ## IoT and Digitization IoT -> connecting "things" (objects & machines), to a network Digitization -> encompasses the connection of "things" with the data they generate and the business insights that result. ### IoT Impact ![](https://i.imgur.com/OFXtuyl.png) It enables real time management and monitoring via smart objects which allows optimization of systems and processes. This service saves time while also improving the overall quality of life. ### The fourth industrial Revolution ![](https://i.imgur.com/fZjnLZD.png) The implementation of IoT in productions lines lead to products which require less antention to maintain since the interconnected communicating parts either tell the user what is to fix or may even fix itself in the future. Things like that are called "smart objects". ## Convergence of IT and OT * Implementation of open standards in OT (Ethernet, IP) * IT implemnts operational requirements of OT * More efficient and profitable business * "Best of both worlds" * Risks of both worlds... IT -> Information Technology * Focused of secure flow of data across an organization * Information systems: email, file, print, databases,... OP -> Operational Technology * Monitors and controls devices and processes on physical operational systems * Factory machines, meters, actuators, electrical distribution automation devices, SCADA (supervisory control and data acquisition) systems,... * Traditionally dedicated networks and specicalized protocols ### comparing OT and IT networks | Criteria | Industial OT Network | Enterprise IT Network | | -------- | -------- | -------- | | Operational focus | Keep business operational 24x7 | Manage computers, data, communication system in a secure way | | Priorities | 1. Availability 2. Integrity 3. Security | 1. Security 2. Integrity 3. Availability | | Types of data | Monitoring, control and supervisory data | Voice, video, transactional, and bulk data | | Security | Controlled physical access to devices | Devices and users authenticated to the network | | Implication of failure | OT network disruption directly impacts business | Can be business impacting, depending on industry; workarounds possible | | Network upgrades | Only during operational maintenance windows | Oftern requires an outage window; impact can be mitigated | | Security vulnerability | Low: OT networks are isolated and often use proprietary protocols | High: continual patching of hosts required; connected to the Internet, requires vigilant protection | ## Challanges * Scale * scale of network may increase by more than a 1000 fold * Security * more nodes -> more possible security risks * Privacy * who owns very personalized data like shopping patterns, health info... * Big Data and Data analytics * evaluating and processing massive ammounts of data from different sources in various forms and in timely manner * interoperability * between IoT networks # IoT Architecture ## IoT Architectures ### OneM2M * Global partnership project * Founded by telco standardization organizations, e.g. ETSI * Focus on services, less on applications and devices * Major architecture domains: * Application layer * Services layer * Networks layer ![](https://i.imgur.com/CO2lqln.png) ### IoTWF * 7-layer IoT architectural reference model * Goals: * Decompose the IoT problem into smaller parts * Identidy different technologies at each layer and how they relate to one another * Define a system in which different parts can be provided by different vendors * Have a process of defining interfaces that leads to interoperability * define a tiered security model taht is enforced at the tranition points between levels ![](https://i.imgur.com/k6RCzdl.png) ### There are many more... And all are layered models. ![](https://i.imgur.com/1m6NtO8.png) ### A simplified IoT Architecture ![](https://i.imgur.com/Ee2zE2l.png) ### The expanded IoT Core Stack ![](https://i.imgur.com/js3EIwt.png) ![](https://i.imgur.com/F1iypfs.png) ## Why do we need an Architecture ### drivers for an IoT Architecture * sale * IT: several thousand devices * IoT:a few thousand up to a few million devices * constrained devices and networks * IT: * powerful servers and devices * multi-gigabit/s networks * IoT * limited power, CPU and memory * deployed in massive scale * lossy networks with low data rates * data * huge ammounts in IoT * valuable like gold (social media) * new insights by analyzing lot of devices data * security * IT * critical infrastructure protected by firewalls * physically placed in secure data centers * IoT * connected via wireless networks using unlicensed spectrum * physically easy accessible and distributed * legacy device support * IT * upgrade * or access denied * IoT * lifetime of devices > 20 years * legacy protocols and interfaces (e.g. RS-232) ![](https://i.imgur.com/fHXQVif.png) ![](https://i.imgur.com/0QufFhH.png) ## Hannes A. The Core IoT Functional Stack Smart objects, if they are not self-contained, need to send their collected data to a central processing station, communicate with adjacent smart objects and may need to receive commands as well. This is done via a network. Interworking components of such a network are: ### "Things" Layer Physical devices that can execute the required tasks. ### Communications network layer To communicate, when not self-contained, tre smart-objects often use wireless technologies which have the following sublayers: #### Access Network Sublayer LoRa, 802.11ah, 802.15.4g or wired. #### Gateways and backhaul network sublayer The Gateway is the central point for a lot of smart devices to transmit data to. This gateway then uses another medium to forward the data over longer distances (also called the backhaul) to a central station where it is processed. #### Network transport sublayer This is where IP & UDP commes into play for successfull communication. #### IoT management sublayer additional protocols are required to ensure the headend application can communicate with the sensor such as **CoAP** or **MQTT**. ### Application and analytics layer At the upper layer an application needs to process the collected data & communicate/controll the smart objects based on the gathered informations. ### Layer 1: Things: Sensors and actuators layer There are a lot of ways to classify the objects in an IoT network due to the variety. Here is one of the possible ways to classify them: * **Battery-Powered or Power-Connected:** Devices with battery are mobile but have a limited lifetime which also influences transmission range & frequency. Power-Connected devices are not as mobile but has no other drawbacks. * **Mobile or static:** If mobile it is important to know how far and how frequent the device is going to be moved. * **Low or high reporting frequency:** how often does the object report -> higher report freq. = higher power consumption * **simple or richt data:** how much data is sent with each pulse? again -> much data = higher power consumption * **report range:** how far away is the gateway? * **object density per cell:** how many smart objects are there on a given area Depending on those criteria, a topology and technology may be chosen for a given project. ![](https://i.imgur.com/vlZbYW0.png) ### Layer2: Communications Network Layer Choosing what hardware to use is dependent on the environment it is deployed in. This depends on the conditions: * hot/cold * caustic environment? * heavyer dust build up? * shockwaves/vibrations? * humidity * volatile gases * available power supplie #### Access Network Sublayer Direct link between chosen IoT network technology & type of connectivity. Every technology works for a specific use case & requires a specific type of connectivity. Key Element for choosing the right access technology is the range: ![](https://i.imgur.com/kVe78mz.png) * PAN(personal area network): few meters; Bluetooth * HAN(home area network): tens of meters; ZigBee, Bluetooth Low Energy(BLE) * NAN(neighbourhood area network): few hundred meters; Wi-Fi * FAN(field area network): several tens of meters to several hundreds of meters. * LAN(local area network): up to 100m; Ethernet, 802.11, * MAN(metropolitan area network):up to a few kilometers; HaloW WiFi in sub-1 GHz, Cellular(LTE) * WAN(Wide area network): more than a few kilometers; WiMAX Adding a W = wireless Each protocol uses a specific frame format, transmission technique and frequency. ![](https://i.imgur.com/bP0RE3h.png) More throughput & better distance -> higher power consumption. ![](https://i.imgur.com/8Bge0UR.png) Similar ranges =/= Similar Topologies. Some examples of topologies are: * **Point to Point:** may refere more to the structure of communication than actual topology since mostly one gatway(coordinator) can communicate with multiple endpoints but each endpoint can only talk with one gateway (actaully StarTopology) * **Point to Multipoint:** one endpoint has more than one gateway (mesh) Reduced Function Device (RFD) = end Nodes in a topology. Communicate with one or more FFD. Full Function Device(FFD) = coordinators in a topology. Communicate with RFDs and other FFDs ![](https://i.imgur.com/gVjuv9P.png) Can also form mesh topologies which has the advantege of redundancy. #### Gateways and backhaul network sublayer Gateway can be static or mobile, wired or wireless. Signal for the Backhaul can also be bridged over mutliple gateways but will suffer from attenuation. Downstream pull -> gateway requests data upstream push -> node sends data out periodically ![](https://i.imgur.com/akpOUZh.png) #### Network transport sublayer nothing noteable #### IoT management sublayer /Application Protocols IP|TCP|UDP bring connectivity.Upper layer protocols based on those underlying protocols handle the transport of data from smart objects to other systems. Alternatevely HTTP. But it is a "fat" protocol and not designed for constrained environments(low memory, power bandwidth and high rate of packet failure). Another alternative is WebSocket(Part of HTML5), XMPP(based on TCP), CoAP(similar to HTTP but more lightweight and UDP), MQTT (broker based and TCP). XMPP for instant messaging (but still on TCP base). ### Layer3: Application and analytics layer #### Analytics vs Control Applications * **Analytics:** collects data & displays the result in a way that cant be achieved by looking at the data of a single smart object * **Control Applications:** controls the behaviour of a smart object or an related object/device. Example for such a system is SCADA Modern IoT systems use both. Analysis of data dertermines how the system is controled/regulated. #### Data vs Network Analytics * **Data Analytics:** processes collected data to provide a relative view of either the object itself, an adjacent machine or about even bigger events. * **Network Analytics:** knowing when and how the connectivity is degrading or even failing. #### Data Analytics vs Business Benefits Flexibility and bidirectional communication is benificial. Example Cisco Jasper. Analyzing what item is sold most may help maximizing profit. ### Smart Services use IoT and aim for efficiency. In a home it could anticipate humans movement to turn on/off lights or even dim them according to mood or time of day. Smart grind solutions may take strain off the electric grid by distributing power consumption evenly thorughout the day (washing machine, charging batteries, etc). ### IoT Data Management and Compute Stack Beside the massive scale of IoT Networks in comparison to standard IT, the scale of the produced data is also an issue. One data set on its own is uesless. The summ of it as well as the correct analysis makes it valuable. Processing is done centraly in the cloud where all smart objects are connected. The cloud also has limitations. Due to increasing data volume and devices new requirements appear: * **minimizing Latency:** fast transmission = faster processing of the data * **Conserving network bandwidth:** not all Data has to be cloud computed/transmitted * **increasing local efficiency:** analyzing areas which are far appart in the same cloud may not be smart. Traditional IT Systems: ![](https://i.imgur.com/aQnGuLr.png) IoT works a bit different: * many endpoints to one gateway -> little bandwidth for each device. * high latency (hunderds of ms) * backhaul links can be expensive and unreliable * high volume backhaul messages with partialy unnecessary data * ammount of data increases -> real time analysis is unrealistic ### FOG Computing De-centralizing the computing process to take strain off the network. Each available unit with storage and processing capabilities is utilized. Idealy they are close to the source of data. It may even only act as a Filter, so that only relevant data gets sent via backhaul. ![](https://i.imgur.com/eOrYgxW.png) Defining Factors for FOG computing are: * **contextual location awareness and low latency** * **geographic distribution** decentralized data processing in contrast to the centralized cloud * **deployment near IoT endpoints** * **wireless communication between the fog and the IoT endpoint** * **use for real time interactions** ### Edge computing endpoints are able to perform low level computing and are able to precompute which data is to be sent out. ### Hierarchyof Edge, Fog & Cloud They are not mutualy exclusive but complement each other. Edge computing takes strain of FOG computing which in turn takes strain from Cloud computing. Also, tasks that need to be computed fast are computed close to the node and are not influenced by the high latency of the backhaul. ![](https://i.imgur.com/DgyxAwQ.png) * most time sensitive data -> edge or fog node * can it wait minutes? ->aggregation node * less time sensitive data -> cloud ## Heimos Folien ![](https://i.imgur.com/kWjRBJM.png) # IoT Smart Objects ## Self-Read Smart Objects are physical objects that contain embedded technology to sense and or interact with the environment in a meaningful way by being interconnected and enabling communication among each other and an extrenal agent. ### Sensors, Actuators, and smart Objects #### Sensors Measures physical values and converts them into digital measurements. Those are sent to a device that can convert it into human readable data. Ways to group/cluster sensors: * **active or passive** active -> have output and own power source; passive -> receive energy & no external power supply * **invasive or non-invasive** part of the environment / comes from the outside * **contact or no contact** physical contact? * **absolute or relative** does it have a reference when measuring? * **area of application** where are they used? * **how sensors measure** thermoelectric, piezoelectric, electrochmical, optic, electric, fluid mechanic,... * **what sensors measure** ![](https://i.imgur.com/Vmk0kpV.png) ![](https://i.imgur.com/DRrfz6c.png) #### Actuators ![](https://i.imgur.com/UaGqxTg.png) Actuators do something opposed to the sensors which "feel" something. Like sensors, actuators can vary is size & shape. They can be classified as follows: * **type of motion** linear, rotary, on/two/three-axes * **power** high/low power output * **binary or continuous** number of stable state outputs * **area of application** where are they used? * **type of energy** ![](https://i.imgur.com/BuRll2R.png) ### Micro-Electro-Mechanical Systems (MEMS) are very small machines that combine actuators and sensors. ### Smart Objects Are the IoT building blocks. They transform objects into intelligent objects. A smart object has at minimum the following characteristics: * **Processing unit** for processing/analyzing data from sensors, controling actuators. * **sensor(s) and actuator(s)** * **communication device** either wireless or wired. For communicating with other objects or the gateway * **power source** #### Trends in smart objects * **size is decreasing** some are not even visible to the naked eye * **power consumption is decreasing** up to 10 years battery life * **processing power is increasing** * **communication capabilities are improving** speed and range * **communication is being increasingly standardized** ### Sensor Networks sensor/actuator network (SANET). Sensors and Actuators are diverse heterogenous and resource-constrained which makes this NW a challange. SANET's are very sensitive and acurate. Smarthomes are an exaple for SANET's. Usually deployed wireless to be more flexible. Some advantages & disadvantages of that are: * Advantages * greater deployment flexibility * simpler scaling * lower implementation cost * easier long-term maintenance * effortless introduction of new sensors/actuators * better equiped to handle dynamic/rapid topology changes * Disadvantages * potentially less secure * typically lower transmission speeds * greater level of impact/influence by environment ### Wireless-Sensor Networks(WSNs) made up of wirelessly connected smart objects. ![](https://i.imgur.com/drQUS7Y.png) Limitations of smart objects in WSMs: * limited processing power * limited memory * lossy communication * limited transmission speed * limited power 2 Communication Patterns: * event driven * Periodicaly Decision depends on use case. Large number of very small devices (like smart dust)need to be self configuring since doing that manually would be very tedious. #### Communication Protocols for Wireless Sensor Networks Many different types of sensors & actuators. Increasingly heterogenous(many different sensors instead of one) and more sophisticated. When choosing a protocol one must consider: * **scaleability**: can it deal with a great number of devices? * **power consumption** * **transmission distance/speed/tolerance** * **packet loss/size**: maybe the data is pre processed before sending (edge computing) * **topology optimization** * **security** * **location**: deployment inside or outside? Standardization is neccessary but hard due to IoT impacing so many industries at once. # IoT Access Technologies Listed technologies already are established in the IoT world or are on the way. ## Available Access Technologies ![](https://i.imgur.com/XDPMbb0.png) * Bluetooth * ZigBee * sigfox * Tetra * WiFi * USB * Satelite * 2,3,4,5g * etc. ## Communication Criteria IoT Devices are only usefull if connected. But what technology is the best? The following criteria are crucial in finding out. ### Range How far does the signal need to be propagated/what is the area that neeeds to be covered? **Short Range**:(up to 10m) serial cable, IEEE 802.15.1 Bluetooth, IEEE 802.15.7 Visible Light Communications (VLC) **Medium Range**:(up to 1km)IEEE 802.11 Wi-Fi, IEEE 802.15.4,802.15.4g WPAN.IEEE 802.3 Ethernet, IEEE 1901.2 Narrowband Power Line Communications (PLC) Wired technologies such as IEEE 802.3 **Long Range**:(greater than 1km) cellular (2g,3g,4g), IEEE 802.11 Wi-Fi and Low-Power Wide-Area (LPWA) * Max coverage derived from optimal conditions * environmental factors * landscape and field topology * interface * noise * Product characteristics * Antenna design * Transmit power * Radio planning needed ### Frequency Bands ![](https://i.imgur.com/Jyh2i7j.png) Frequency bands are managed by local organisations in each country. #### Licensed Spectrum * Applicable to long-range access technologies * allocated to communications infrastructure providers * service providers * public services (blaulicht/militär) * broadcasters * utilities * Users must subscribe to services when connecting IoT devices * subscription free * guarantedd exclusivity of frquency usage over target area * Examples: * cellular * WiMAX * Narrowband IoT(NB-IoT) #### unlicensed Frequency Bands * ITU defined unlicensed spectrum * Industrial, Scientific, and Medical (ISM) * Used in many short-range devices (SRDs) * No guarantees or protections are offered in ISM bands * Well-known ISM band: 2.4 GHz * IEE 802.11b/g/n WiFI * Bluetooth * RFID * NOT unregulated * transmit power, duty cycle, channel bandwith,... * Does not require a service provider. * simple to deploy, no service fees * LKPWA (Low Power Wide Area) technologies using sub-GHz range * Covering long distances * e.g. * LoRa * Sigfox * Sub-Ghz bands allow great range * better ability to penetrate building thatn 2.4GHz ISM band * but lower data rate * ISM sub-GHz ranges: * 196 MHz * 433 MHz * 868 MHz * 915 MHz ### Power Consumption * powered or battery-powered * battery powered devices classified by required lifetimes: * 10-15 y * water or gas meters * 5-7 y * 2-3 y * Devices under regular maintenance * Low-Power Wide-Area (LPWA) ### Topology ![](https://i.imgur.com/qGL4TiG.png) ### Constrained Devices * IETF defines 3 categories of IoT devices * To differentiate from unconstrained nodes: * servers, desktop or laptops * powerful mobile devices (smartphones) * Limited resources impacting networking capabilities * some IoT nodes do not implement an IP stack #### Class 0 * <<10KB memory * <<100KB Flash * Battery powered * No IP stack implemented * Gateway necessary for communication * preconfigured #### Class 1 * ~10KB memory * ~100KB flash * no complete IP stack implemented * cannot easily communicate with nodes employing a full IP stack * Implementation of optimized stack for constrained nodes * e.g. Constrained Application Protocl (CoAP) * communication without gateway possible #### Class 2 * More than 50KB memory * More than 250KB flash * full implementation of IP stack * can be fully integrated in IP networks ### Constrained-Node Networks * composed of constrained nodes * Low-Power and Lossy Networks (LLNs) * Loe-Power: requirement of battery-powered constrained nodes * lossy networks: harsh radio environments * interference and variability * shared spectrum * Application areas: * industrial monitoring, building automation * connected home, health care * environmental monitoring, urban sensor networks Important network characteristics to consider: * data rate and throughput * latency * overhead and payload ### Data Rate and Throughput IoT access technologies for constrained nodes: * Optimized for low power consumption * limited in data rate and throughput * data rates from 100bps to 1Mbps * Throughput lower than data rate: * Protocol stack overhead * communication handling * other devices communicating simultaneously #### EXAMPLE IEE 802.15.4g * for large outdoor wireless mesh networks * data rate 150kbps at 915MHz * forward error correction 75kbps * MAX throughput of 30-40 kbps * best case if only a single device is communicating ### Latency Wireless networks * packet loss and retranmissions are normal behaviours * interference, collision, noise * Latency from few milliseconds to seconds * applications and protocol stacks have to cope with latency * UDP strongly recommended as transport layer for LLNs ### Overhead and Payload * minimum IPv6 MTU size 1280 bytes * link layer access protocols with smaller MTUs * e.g. IEEE 802.15.4 payload size is 127 bytes * Fragmentation of IPv6 payload needed * IEEE 802.15.4g enables payloads up to 2048 bytes * Simpler support of IPv6 ## IEE 802.15.4 * wireless * frequency bands: * 169 MHz * 470 MHz * 863 MHz * 896 MHz * 915 MHz * 917 MHz * 1427 MHz * 2450 MHz * low cost * low data rates * 10kbps to 1Mbps * batterie powered * compact protocol stack * simple and flexible Fond for following deployments: * Home and building automation * automotive networks * industrial wireless sensor networks * interactive toys and remote controls Range is from 10m to 1km (with 4g). Framesize is 127bytes (2047 with 4g). 16 bit FrameCheckSequence (32 with 4g). There are FFD and RFD. FFDs can also work as personal area network(PAN) coordinator. ![](https://i.imgur.com/RvZ6vz8.png) ### Physical Layer extensive number is supported. Originally those: * 2.4 GHZ, 16 channels, with data rate of 250 kbps (worldwide) * 915 MHZ, 10 channels, with data rate of 40 kbps (America) * 868 MHz, 1 channel, with data rate of 20 kbps (Europe, MiddleEast, Africa) Through modulation improvements data rates can be improved. ![](https://i.imgur.com/QLV7GI9.png) ### MAC Layer Manages access to the PHYsical channel by defining how devices in the same area will share the allocated frequencies. This layer performs the following: * NW beaconing for devices acting as coordinators * PAN association and dissassociation by a device * device security * reliable link communication between two peer MAC entities Done by using predefined frame types: * Data frame: Handles all transfers of data * Beacon frame: Used in the tranmission of beacons from a PAN coordinator * Acknowledgement frame: Confirms the successful reception of a frame * MAC command frame: Responsible for control communication between devices All 4 are constructed like this: ![](https://i.imgur.com/wgqs1aJ.png) ## ZigBee Used for: * low bandwith * low power needs * interoperability Deployment areas: * automation for commercial, retail and home allpications * smart energy ![](https://i.imgur.com/T5eiLMR.png) All topology types are supported. Network is controlled by one device. ZigBee coordinator ## ZigBee IP supports TCP&UDP at the natwork and transport layers. ZigBee specific Layers are now only at the top of the protocol stack for the applications. Was created to work with newer standards such as: * IPv6 * 6LoWPAN * RPL ![](https://i.imgur.com/qfOjjND.png) ## Wireless HART Highway Addressable Remote Transducer Protocol (HART) * multi-vendor * interoperable * wireless Works in: * 2.4 GHz * Industtial/Scientific/Medical (2.400-2.480 GHz) In IDEAL condition a range of 228m. ![](https://i.imgur.com/a60OTAx.png) ## IEE 802.15.4g Wi-SUN Improves upon the capabilities with smart-grids/smart utility network communication. It applies to usecases such as the following: * distribution automation and industrial supervision control and data acquisition (SCADA) environments for remote monitoring and control * Public lighting * Environmental wireless sensors in smart cities * electrical vehicle charging stations * smart parking meters * microgrids * renewable energy Has: * datarate up to 300kbps and 0.02 to 1 sec latency * excellent redundancy (mesh) ### Physical Layer Fragmentation no longer necessary due to bigger PSDU of 2047. Better error correction as well. More channels are available. ## IEE 1901.2a NB-PLC specified for lower frequenceis (less than 500kHz) Communication via low and medium power lines (>1000V/1000-73kV) Data rates scalable to 500kb/s Use cases: * grid to utility meter * grid automation * electric vehivle to charging station * home area networking * lighting and solar panel ### Physical Layer Different Nations have different frequency bands for this technology. ### MAC Layer Like 802.15.4e ![](https://i.imgur.com/X1SR2vc.png) ## IEE 802.11ah, WiFi-HaLow sub 1 GHz. Better transmission range due to lower frequency. Can be used for: * large scale sensor networks * extended range hotspots * outdoor WiFi for cellular traffic offloading Since tragets most likely battery powered -> power saving features Main use cases are: * sensors and meters covering a smart grid * backhaul aggregation of industrial sensors and meter data * extended range WiFi ![](https://i.imgur.com/DGor7rU.png) ### Physical Layer ![](https://i.imgur.com/G4IWEPj.png) ### MAC Layer supports larger number of endpoints Enhancments and features specified include the following: * number of devices has increased to 8192 * MAC header has been shortened * Null data packet support * Grouping and sectorization * Restricted access window * Target wake time * Speed frame exchange Ideal for devices that produce short low bit-rate transmissions. ## NB-IoT Basically energy conserving Geolocation for IoT devices. ![](https://i.imgur.com/faTFizh.png) 3 Modes of operation are available to NB-IoT: * Standalone: A GSM carrier is used as an NB-IoT carrier, enabling reuse of 900 MHz or 1800 Mhz * In-band: Part of an LTE carrier frequency band is allocated for use as an NB-IoT frequency. The service provider typically makes this allocation, and IoT devices are configrued accordingly. YOu should be aware that if these devices must be deployed across different countries or regions using a different service provider, problems may occur unsless there is some coordination between the service providers, and the NB-IoT frequency band allocations are the same. * Guard band: An NB-IoT carrier is between the LTE or WCDMA bands. This requires coexistance between LTE and NB-IoT bands. * ## IoT Satellite Communication To access areas with no other services. #### IoT using GEO satelites Hard because antennas and terminals for receiving data from the satelite are big. #### IoT in LEO/HEO constelations Satelites are closer to earth -> smaller antena and terminal to close the link but the satelites are moving a lot. #### Hybrid terrestrial-satellite systems "best of both worlds" terestrial and satelites. To design it knowledge of both is required. ![](https://i.imgur.com/mt66P3r.png) "LEO-Satelites" = "LowEarthOrbit" are well suited for this. ## IEE 802.15.1 Bluetooth bands from 2.402 GHz to 2.480 GHz/2.400 & 2.4835 GHZ/2 & 3.5 MHz * robust * low power consumption * low cost * low range * 1 master/ 7 slaves with same clock ### Device Classes Range is power class dependent: ![](https://i.imgur.com/3Tnt5pc.png) effective range is much lower. there are 2 forms of BT: * basic rate (BR) which includes Enhanced Data Rate (EDR) * Low Energy(LW) both include discovery, connection establishment and connection mechanisms. ### Bluetooth Low Energy Operation on the 2.4 GHz ISM band. 2 access schemes: * Frequency division multiple access (FDMA):40 physical channels seperated by 2 MHz * time division multiple access (TDMA): Only one channel can be used at a time. TDM can be used to simulate using multiple. Both communicating devices must be on the same channel. ### Bluetooth Mesh system architecture ![Uploading file..._vh60yhsbk]() * **Model Layer**: standardize the operation of typical user scenarios (lighting sensors zb) * **foundation model layer**: defines states, messages and models * **Access Layer**: how higher layer applications use the transport layer. defines format of data, encryption & decryption & checks if the right keys are received * **Upper Transport Layer**: encrypts/decrypts & authenticates data * **Lower Transport Layer**: defines segmentation and reassembly of upper transport layer messages * **Network Layer**: sends/receives data packets accepts/rejects them or relays/forwards them * **Bearer Layer**: defines how NW messages are transported. 2 Ways: * advertising bearer * GATT bearer * **Bluetooth LowEnergy Core Specification** #### Friendship limits time to listen for low power nodes. Not listening long enough -> no full mesh message (security updates or normal messages) This may lead to a node droping out of the mesh. Friendship is between LowPowerNode and standard Node which can have multiple friends. the standard node stores messages for the LowPowerNode #### Features Functionality of nodes is determined by the features they support. Additional features may be: * **Relay feature** * **Proxy feature** * **Low Power feature** * **Friend feature** #### Topology ![](https://i.imgur.com/eWWEO8E.png) # Connecting to smart Objects # IP & Application Protocols for IoT ## IP as the IoT Network Layer Its challanging to connect devices that are not IP capable to an IP based network. IoT devices can be classified as follows: * Devices that are very constrained in resources: infrequent communication with few bytes. Needs IP adaptation model * Devices with enough power and capacities to implement a stripped-down IP stack: either optimized IP stack or still gateway and proxies * Devices that are similar to generic PCs in terms of computing and power resources but have constrained networking capacities, such as bandwidth: full IP stack but with bandwidth constraints Devices and Protocols evolve get better/faster. ### IPv4 and IPv6 Internet transitions slowly from IPv4 to 6 due to lack of addresses. IPv4 still has to be used in IoT since it is established which in turn requires tunneling or translation. Some factors applicable to IPv4 and 6 in IoT are: * **Application Protocol**: some Protocols dont work on IPv6. the following DO WORK ON BOTH: * Http/https * CoAp * MQTT * **Cellular Provider and Technology**: * For IPv4(6 needs to be tunneld): * GPRS * Edge * 3G * Both: * 4G/LTE * **Serial Communications**: * **IPv6 Adaptation Layer**: ### Optimizing IP for IoT ![](https://i.imgur.com/37RWhWY.png) #### 6LowPAN uses an adaptation layer to handle the packet size problem and header compression. The provided 3 main functions are: * IPv6 header compression, * IPv6 packet segmentation and reassembly, and * layer 2 forwarding (also referred to as mesh under) ![](https://i.imgur.com/qnn3fyi.png) ##### Header Compression Compresses IPv6 headers into 2bytes. The combined datagram of IPv6 header (40 bytes) and UDP 8Bytes can become as small als 6 bytes. IPv4 does NOT work with this protocol. factors that are improtant for the compression: * implementation of RFCx oder y * wether UDP is included * IPv6 addressing scenarios ![](https://i.imgur.com/CXTRyjp.png) ##### Fragmentation 3 primay fields: * Datagram size: total size of unfragmented payload * datagram tag: set of fragments for a payload * datagram offset: which place this particular fragment has 11000 for the first fragment 111000 susequent fragments ![](https://i.imgur.com/bG369Ay.png) ![](https://i.imgur.com/0DOMOYo.png) ##### Mesh adressing to forward packets over multiple hops. 3 fields are defined: * hop limit * source address * destination address ![](https://i.imgur.com/wstFYqx.png) Mesh header fields: * **V**:0 if 64-bit address, 1 if 16-bit address (originator) * **F**:0 if 64-bit address, 1 if 16-bit address (destination) * **Hops Left**: 4 bits, decrements ever hop * **Originator Address**:link layer address * **Destination Address**:link layer address #### RPL: IPv6 Routing Protocol for Low-Power and Lossy Networks Connections are usuall unstable with low data rates and low packet delivery rates. Patterns are not P2P but P2MP or MP2P and consist of up to thousands of nodes. To deal with the constraints there are 2 modes defined: * Storing mode: all nodes know full routing table * Non-storing mode: only border routers know the full table RPL is based on directed acyclic graphs (DAG). All pahts terminate in the root node.destination oriented acyclic graoh(DODAG) is rooted in ONE destination. ![](https://i.imgur.com/EISjnoW.png) Upward routes are discovered via DAG Information Object(DIO) message. Downward a Destination Advertisement Object (DAO) message is used. ![](https://i.imgur.com/KTmeRN4.png) ##### Object Function OF defines how RPL nodes select and optimize routes within RPL Instance. ##### Rank how "close" a node is to root. to avoid routing loops or count to infitiny. ## Application Protocols for the IoT handle communication between application entities (things, gateways, applications). Support flow of data in one and flow of commands in the other direction. ### The Transport Layer 2 Main Protocols TCP/UDP Performance and scalability of IoT constrained devices and networks is impacted by the choice. ### IoT Application Transport Methods categories of IoT application protocols and their transport methods: * Application layer protocol not present: no application layer protocol used * Supervisory control and data acquisition (SCADA): most common but old and adapted for IP * Generic web-based protocols: well suited * IoT application layer protocols: well adapted. Examples are: * MQTT * CoAP #### Application Layer Protocol Not Present Class 0 devices are not capable of utilizing any protocols due to the small size of packets they are able to transmit and receive. Data is sent directly to the LoRaWAN MAC layer. **IoT data broker** solves this. He standardizes sensor output into a common format. ![](https://i.imgur.com/Noboazm.png) #### Supervisory Control and Data Acquisition (SCADA) Invented without IP, later adapted. Consists of: * GUI: for high-level process supervisory management * Programmable logic controllers (PLC) Master/Slave base. Well structured protocol. Collects sensor data and telemtry from remote devices and allows to control them. Utilizes sub protocol modbus. ##### Modbus Used for Programmable logic controllers(PLCs). Openly published and royalty free. Master/Slave base. Only one master per network and max 247 slave nodes. Slave nodes never communicate without request. ![](https://i.imgur.com/7VDajXv.png) ##### Modbus TCP/IP Specifies how to run it via TCP. Not limited to 247 devices (adressing via IP) ![](https://i.imgur.com/9cm70ZZ.png) 2 devices are in such a system: * Modbus TCP/IP client/server devices * Interconnection devices (bridges, gateways serial line sub-network) ![](https://i.imgur.com/FaXSrOT.png) Has a new header as well: ![](https://i.imgur.com/rfBoZt5.png) #### Generic Web-Based Protocols Again analyze first which protocol is appropriate for the constrained nodes. If bandwidth is not an issue IoT Applications can be developed like WebApplications (use JSON, XML). HTTP/HTTPS client/server model is the foundation. For communicatio purpouses Extensible Messaging and Presence Protocol (XMPP). ### IoT Application Laer Protocols more lightweight than WebBased Protocols. CoAP and MQTT ![](https://i.imgur.com/OCNRQdQ.png) #### CoAP Constrained Application Protocl Standardized by IETF as lightweight alternative to HTTP. HTTP is based on TCP and requires 7 messages for a simple GET. CoAP is based on UDP and uses short headers. CoAP has 4 messages: * confirmable * non-confirmable * acknowledgement * reset Capable of IPv4 and 6 ![](https://i.imgur.com/W8xp41a.png) Based on the REST archtitecture but the "thing" is client and server. Request/Response messages are not sent over established connections but asynchronous with the following methods: * GET * POST * PUT * DELETE #### MQTT Message Queue Telemtry Transport protocol (MQTT) is lightweight publish/subscribe. ![](https://i.imgur.com/T3nuGyD.png) MQTT client can act as a data broker to the server which in turn has subscribers that get information from another node connected to the broker. Subscribers can get either all data or just specific parts of it. Has a smaller header compared to CoAP. MQTT Messages: * Connect * connack * publish * puback * pubrec * pubrel * pubcomp * subscribe * suback * unsubscribe * unsubsck * pingreq * pingresp * disconnect Security through TLS is optional (more workload) 3 levels of QOS: * 0: best effort, unacknowledged data service everything is sent just once * 1: ENSURES that the delivery happens at least once * 2: neither loss nor duplication is acceptable # Operating Systems in IoT 2 types of devices in IoT: * high end: smartphones, raspberry pi * low end: constrained devices This leads to 3 classes for the low end devices: * **class 0** less than 10kb RAM and 100KB flash * highly specialized * low-level programming * OS oftern not required * **class 1** about 10kb RAM and 100KB flash * not meant for highl specialized applications * offer more options e.g. routing * future of IoT devices * **class 2** more resources but still constrained compared to high end devices * not meant for highl specialized applications * offer more options e.g. routing * future of IoT devices **MAIN REQUIREMENTS FOR OS IN IOT** * interoperability with the internet * compatibility to IP protocols * compatibility to programming languages and tools * small memory footpring * network connectivity * power efficiency * real-time capability * security **IoT-OS Challanges** * OS controlls resources of device * security * memory protection * virtual memory e.g. location obfuscation * fault recovery * guaranteed ressources * virtual device drivers * secure scheduling * access control Some OS: * Contiki * TinyOS * FreeRTOS * nuttX * eCos * UClinus * mbedOS * closed source os: * ThreadX * Wind River Rocket * PikeOS * embOS * LiteOS OS-Categories: * Event-Driven: Contiki, TinyOS * Multi-Threading: RIOT-OS, eCos * Pure RTOS: FreeRTOS, ThreadX # LoraWan Low Power Wide Area Network designed to optimize LPWAN regarding power, capacity, range and cost ![](https://i.imgur.com/I9d30cU.png) ## LPWAN-Critical Factors: * Network architecture * Communication range * Battery lifetime / power consumption * robust interface * network capacity * network security * one-way vs. two-way communication * variety of applications ![](https://i.imgur.com/ETOUWJE.png) ![](https://i.imgur.com/ONNwZuN.png) ## LONG RANGE RADIO vs SHORT RANGE RADIO * SRR requires hubs to be locally deployed * zigbee, wifi * LRR integration of devices across wider area * LoRaWAN, Sigfox, Weightless * Addressing of devices organized by the gateway ## Characteristics * Range * 2km in urban * up to 40km in rural * Data rate * between node and gateway: 0.3-50 kbit/s * adaptive data rate (ADR) set by the gateway * Power consumption * Battery life: 2-15 y * Maximum payload * of a single message: 11-242 bytes * bandwidth * bands are divided into channels of 3 different widths: * 125 kHz * 250 kHz * 500 kHz * duty cycle * time constrained acces to physical layer * in eu at least 16 channels can be used * regulated ![](https://i.imgur.com/ivW8nW6.png) ## Device Classes * **A**: downlink only * **B**: downlink at defined time slots * **C**: continuous downlink ![](https://i.imgur.com/dizvlpe.png) ## Keys & EUIs * every device is identified by a 4 bytes address * "network session key" -> used to encrypt the network related data (MAC) * "application session key" -> used to encrypt the application related data ![](https://i.imgur.com/8Wxm6MS.png) # Fragen: * Why do we have so many IoT Architectures? * Tell me about LoRa. What Frequencies, how many classes, power, etc. * LoRa Architecture * What is ISM? Which kind of devices are there? * Tell me about IoT access technologies, criteria * what is short range what is long range? What is medium range? can i use any frequency i want for free? 2 technologies per range * Access Layer protocols and how they differ, advantages and disadvantages * What is PAN what does it do? * welche things gibt es? beschreibe sie * kriterien für access technologies? access technologies nach reichweite? * was ist CoAP? was ist der unterschied zu MQTT * What network management protocols are there? * Difference between OneM2M and IoTWF * What are constrained devices and how to connect them? * What are IoT architectures for? * WiFi HaLo * What is IoT? * What is 802.15.4 and which technologies use it? * LoRa vs Cellular * What is 6loWPAN? * 868mHz -> where to find? * RFID - to use with which protocols? * how to lower latency in networks? * What is fog, edge? * difference zigbee vs wifi? * IoT Drivers? * 802.11ah * wie kann man latenz verrringern in netzwerken, fog, edge * Zigbee vs. wifi * wf vs. m2m architectures, iot drivers