IoT Study Material 2024-2025 PDF
Document Details
Brainware University, Kolkata
2024
Tags
Summary
This document provides study material on Internet of Things (IoT), including its architecture, communication modules, and protocols. It's geared towards 3rd-semester B.TECH Computer Science and Engineering students at Brainware University, Kolkata, for the 2024-2025 academic session.
Full Transcript
B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Study Material (Internet of Things (ESCG301)) __________________________________________________________________________________________ Table of Contents 1. IoT Architecture and Refer...
B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Study Material (Internet of Things (ESCG301)) __________________________________________________________________________________________ Table of Contents 1. IoT Architecture and Reference Layers 2. Communication Modules (Bluetooth, Zigbee, Wi-Fi, GPS) 3. IoT Protocols (IPv6, 6LoWPAN, RPL, etc., MQTT, CoAP, XMPP) 4. Wired Communication 5. Power Sources Module II: IoT Architecture and Reference Layers Three level Network Architecture of IoT IoT architecture consists of the devices, network structure, and cloud technology that allows IoT devices to communicate with each other. A basic IoT architecture consists of three layers: Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Perception (the sensors, gadgets, and other devices) Network (the connectivity between devices) Application (the layer the user interacts with) These layers support IoT devices through data collection and processing. This architecture goes beyond the OSI model to include the transformation of data into usable information. These insights allow businesses to take immediate action through the use of automation, machine learning, and artificial intelligence. Perception layer This layer is responsible for perceiving and recording the physical properties and sensing changes in the various parameters of the objects connected to the IoT system. The process is carried out by several technologies: RFID, GPS, WSN, NFC etc. Sensors Sensors can be described as ‘smart’ inexpensive devices equipped with multiple on-board sensing elements. Low cost, low power, untethered multifunctional nodes Span several orders of magnitude in physical size Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Sensor Parameters Active/ Passive- An active sensor produces energy output in its operation whereas, passive sensors utilize the energy inputs to make measurements. Intrusive or non-intrusive- If a sensor is installed or embedded in the environment or external object it is considered intrusive. In contrast, if it is part of the device rather than the environment or external object, then it is non-intrusive. Contact or Contactless- Contact based sensors typically are wired as part of a sensing electrical circuit and detect current conductivity to make detection. Contactless sensors typically use electromagnetic principles of operation, such as RFID tag. Application- Based on industry application domain, sensor is customized to have specific range, accuracy and other performance requirements. Network Layer Once perception layer gathers all the required data needed by the IoT system, the network layer is responsible to transfer this data to the application layer where this data processed, analyzed and used according to the use case of the system. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 It also does some preprocessing of the data collected and gathered by the perception layer. It filters data and applies some data security techniques like encryption and decryption at both the end of this layer. Once the data is ready to be transferred to the application layer, it does so through various netwrork paradigms and protocols. Working of this layer is managed by protocols like: HTTP, LoRaWAN, Bluetooth, Zigbee, MQTT etc. Threats that can be posed onto this layer can be: Denial of Service (DoS) attack Manmade attack Storage attack Exploit attack This layer used the processed data from Network layer and exploits the information gained by processing and result of data analysis into building the IoT product that will serve the use case of the application. Cloud or Fog computing is the backbone of this layer. Some examples of this layer are: Smart Homes Smart cities Smart health Animal tracking etc. Five Level Network Layer Architecture Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 IoT Entities or Modules The diagram represents the key components of an IoT system and their interactions: 1. Sensors: Collect data from the environment (e.g., temperature, humidity). 2. Signal Conditioner: Converts raw sensor data into a usable format for processing. 3. Processors & Memory: Acts as the system's "brain," processing data and making decisions. 4. Communication Module: Facilitates data exchange with external devices or cloud systems. 5. Signal Conditioner & Driver (Actuators): Prepares control signals for actuators. 6. Actuators: Perform physical actions, like turning devices on/off or adjusting settings. In summary, data flows from sensors to processors for analysis, and actuators perform actions based on the processed data, with communication modules connecting the system to the outside world. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Bluetooth Low Energy (BLE) Bluetooth has already undergone four changes since 2002, latest being Bluetooth v4.0 or Bluetooth low energy (BLE) (IEEE 802.15.1). Low power usage is the characteristic feature of Bluetooth v4.0 BLE features low latency, low cost, multi-vendor interoperability and easy wireless device application. It uses ISM2.4GHz frequency band. BLE defines PHY and MAC layers for wireless networks. 3 unidirectional advertising channels Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Zigbee Module A Zigbee module is a low-power wireless device used for creating personal area networks. It’s particularly popular in applications like home automation, medical device data collection, and other low-power, low-bandwidth needs. Here are some key points about Zigbee modules: Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Zigbee Network Architecture Application Layer: The application layer in the Zigbee stack is the highest protocol layer and it consists of the application support sub-layer and Zigbee device object. It contains manufacturer-defined applications. Network Layer: This layer acts as an interface between the MAC layer and the application layer. It is responsible for mesh networking. MAC Layer: The MAC layer interfaces between the physical and network layers. It also provides the PAN ID and handles network discovery through beacon requests. Physical Layer: The IEEE 802.15.4 specifications define the physical and MAC (Medium Access Control) layers. The physical layer, closest to the hardware, directly controls the Zigbee radio, translating data packets into over-the-air bits for transmission and vice-versa during reception. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Radio Frequency IDentification (RFID) Definition: Radio Frequency Identification (RFID) is a wireless communication technology that uses electromagnetic fields to automatically identify, and track tags attached to objects. RFID tags consist of a microchip and an antenna. Components: Tag: Consists of a microchip and an antenna. Reader: A device that sends out radio waves and receives signals back from the RFID tag. Antenna: Facilitates communication between the tag and the reader. Tag: Contains a microchip and an antenna. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Reader: Emits radio waves and receives signals from the tag. Antenna: Facilitates communication between the tag and the reader Data Flow: 1. The reader sends out radio waves via the antenna. 2. The tag receives the signal and transmits its stored data back to the reader. 3. The reader processes the received data and forwards it to a computer system for further processing. Communication Types: Passive RFID: Tags are powered by the reader's emitted radio waves. Active RFID: Tags have their own power source and can transmit signals independently. Data Processing: The computer system processes the received data for various applications such as inventory tracking, access control, and asset management. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 (Wireless Fidelity) WiFi WiFi, short for Wireless Fidelity, is a technology that allows electronic devices to connect to a wireless Local Area Network (WLAN) using the IEEE 802.11 standards. It enables devices like smartphones, laptops, tablets, and other gadgets to connect to the internet or communicate wirelessly within a particular area, typically a home, office, or public space. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 WiFi Security Protocols WEP (Wired Equivalent Privacy): An older security protocol that is now considered insecure due to its vulnerabilities. WPA (WiFi Protected Access): An improvement over WEP, providing better security through the use of TKIP (Temporal Key Integrity Protocol). WPA2: Further improvement over WPA, using AES (Advanced Encryption Standard) for better security. WPA3: The latest security protocol, offering enhanced security features, including individualized data encryption and protection against brute-force attacks. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Internet Protocol version 4 (IPv4) IPv4 (Internet Protocol version 4) is the fourth version of the Internet Protocol (IP), which is a set of rules for routing and addressing packets of data so they can travel across networks and arrive at the correct destination. It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. IPv4 uses 32-bit addresses, which allows for approximately 4.3 billion unique addresses (2^32). These addresses are usually written in a dotted-decimal format, such as 192.168.1.1. Internet Protocol version 4 (IPv4) Address Classes: IPv4 addresses are divided into five classes (A, B, C, D, E) to define large, medium, and small networks, as well as multicast and experimental uses. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Limitations of IPv4 Address Exhaustion: The 32-bit addressing scheme limits the number of unique addresses, leading to exhaustion as more devices connect to the internet. Security: IPv4 was not designed with security in mind. Protocols like IPsec were developed later to provide security features. Complexity in Configuration: Managing a large number of IPv4 addresses, especially with subnetting and NAT (Network Address Translation), can be complex Internet Protocol version 6 (IPv6) Due to the limitations and address exhaustion of IPv4, IPv6 was developed as a successor. IPv6 uses 128-bit addresses, significantly increasing the number of available addresses and includes built-in features for security, simpler address configuration, and improved routing efficiency. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Address Types: Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Unicast: A single unique address identifying a single network interface. Packets addressed to a unicast address are delivered to a specific interface. Anycast: Addresses assigned to multiple interfaces. Packets sent to an anycast address are delivered to the nearest interface (in terms of routing distance). Multicast: Addresses assigned to a set of interfaces. Packets addressed to a multicast address are delivered to all interfaces in the group. No Broadcast Address: Unlike IPv4, IPv6 does not use broadcast addresses; instead, multicast addresses are used for similar purposes. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Traffic Class (8 bits): Used for traffic prioritization. Similar to the Type of Service (ToS) field in IPv4, it enables the differentiation of packets by priority and handling. Flow Label (20 bits): Used for labeling packets belonging to the same flow (a sequence of packets sent from a source to a destination). It helps in improving the quality of service (QoS) for real-time applications. Payload Length (16 bits): Specifies the length of the payload, i.e., the data following the header, in octets (bytes). This does not include the length of the header itself. Next Header (8 bits): Indicates the type of header immediately following the IPv6 header. It can specify the transport layer protocol (e.g., TCP, UDP) or an extension header (e.g., routing, fragmentation, security). Hop Limit (8 bits): Specifies the maximum number of hops (routers) the packet can traverse. Each router decrements this value by one, and if it reaches zero, the packet is discarded. This is analogous to the Time to Live (TTL) field in IPv4. Source Address (128 bits): The IPv6 address of the originating node (sender). Destination Address (128 bits): The IPv6 address of the receiving node (recipient). 6LoWPAN 6LoWPAN stands for "IPv6 over Low-Power Wireless Personal Area Networks." It is a network protocol that allows small, low-power devices to communicate with each other using IPv6 over IEEE 802.15.4- Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 based networks. This protocol is designed to support the Internet of Things (IoT) by enabling devices with limited resources to connect to IP-based networks. 6LoWPAN works by encapsulating IPv6 packets into smaller frames that can be transmitted over a low- power wireless network. The protocol uses header compression to reduce the size of the packets, making it possible for small, low-power devices to send and receive data. 6LoWPAN: IoT Properties IPv6 packets can be efficiently transported within short link-layer frames, such as those outlined by IEEE 802.15.4, thanks to the 6LoWPAN adaption layer. The use of an end-to-end, IP-based infrastructure facilitates open standards and interoperability. Low power, IP-driven nodes, and large mesh network support make this technology a great option for IoT. 6LoWPAN: Motivation behind 6LoWPAN Development A sensor transfers little data compared to the usage scenarios of a Smartphone, PC, etc. Sensors are likely to have restricted wireless connectivity. A full unmodified TCP/IP stack might clash with hardware limitations (which are useful for power savings). Using IPv6 instead of something proprietary allows the usage of existing and proven protocols driving the internet. 6LoWPAN Network Architecture Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 The uplink to the Internet is handled by the Access Point (AP) acting as an IPv6 router. Several different devices are connected to the AP in a typical setup, such as PCs, servers, etc. The 6LoWPAN network is connected to the IPv6 network using an edge router. The edge router handles three actions: The data exchange between 6LoWPAN devices and the Internet (or other IPv6 network). Local data exchange between devices inside the 6LoWPAN. The generation and maintenance of the radio subnet (the 6LoWPAN network). 6LoWPAN Working The primary goal of 6LoWPAN is to enable IPv6 communication over low-power and low-data-rate wireless networks. Here’s how it works: IPv6 Adaptation Layer: 6LoWPAN includes an adaptation layer that sits between the IPv6 and IEEE 802.15.4 layers. This layer performs header compression, fragmentation, and reassembly to handle the large IPv6 packets and make them suitable for transmission over the small frame size of IEEE 802.15.4. Header Compression: IPv6 headers are large, typically 40 bytes, which is too big for IEEE 802.15.4 frames. 6LoWPAN compresses these headers to reduce the overhead, allowing more efficient use of the available bandwidth. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Fragmentation and Reassembly: If an IPv6 packet is too large to fit into a single IEEE 802.15.4 frame, it is fragmented into smaller pieces. The receiving device then reassembles these fragments back into the original IPv6 packet. Routing: 6LoWPAN supports various routing protocols, such as RPL (Routing Protocol for Low- Power and Lossy Networks), to manage the routes within the network efficiently. RPL (Routing Protocol for Low-Power and Lossy Networks) RPL is a routing protocol designed specifically for low-power and lossy networks (LLNs), which are typical in many IoT applications. LLNs are characterized by devices with limited power, memory, and processing capabilities, and often have unreliable communication links. RPL is designed to handle these challenges efficiently, making it suitable for a wide range of IoT applications such as smart grids, industrial monitoring, and environmental sensing. It is a Distance Vector Routing Protocol that creates a tree-like routing topology called the Destination Oriented Directed Acyclic Graph (DODAG), rooted towards one or more nodes called the root node or sink node. The Directed Acyclic Graphs (DAGs) are created based on user-specified specific Objective Function (OF). The OF defines the method to find the best-optimized route among the number of sensor devices. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Destination Oriented Directed Acylic Graph (DODAG) DODAG is a graph where each node wants to reach the single destination. Objective function The objective function defines the criteria for selecting the best parent node and calculating the rank. It can be based on various metrics such as hop count, link quality, and energy consumption. RPL Instance When there is one or more DODAGs, then each DODAG is an instance. DODAG ID Each DODAG has IPv6 ID This ID is given to its root and it stays until the route changes. RPL organizes the network into a Destination-Oriented Directed Acyclic Graph (DODAG), where each node has a specific rank based on its distance from the root node (the main gateway or sink). The protocol uses three main types of control messages to build and maintain the DODAG: DIO (DODAG Information Object): Used to disseminate information about the DODAG structure and routing metrics. Nodes use DIO messages to learn about the network topology and decide how to join the DODAG. DAO (Destination Advertisement Object): Used by nodes to inform the root about their presence and their parents. This helps the root node maintain a complete view of the network topology. DIS (DODAG Information Solicitation): Used by nodes to solicit DIO messages from their neighbors, typically when they want to join the network or need updated routing information. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Use Cases Smart Grids: RPL can be used to manage communication between smart meters and the central utility. Industrial Monitoring: Ensures reliable data collection from sensors in harsh industrial environments. Environmental Sensing: Collects data from distributed sensors monitoring environmental parameters. Home Automation: Manages communication between various smart devices in a home network. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Message Queuing Telemetry Transport (MQTT) MQTT is simple, light weight protocol to transfer data between machines. It requires low bandwidth and low power. MQTT can be categorized into the following four parts: Broker Publishing and Subscribing (Pub/Sub) Topics Quality of Service Broker: A broker is a central server or intermediary that facilitates communication between clients in a publish/subscribe model. The broker's primary role is to receive messages from publishing clients and distribute them to subscribing clients based on the topics of interest. Client: The device that connects to broker to send or receive information. The MQTT Client, be it Subscriber or Publisher (or both in one device) is any device from small Microcontroller up to a fully- fledged server, that has an MQTT library running and is connected to an MQTT Broker over any kind of network. Topic: Messages make their way from a publisher, through a broker, to one or more subscribers using topics. Topics are hierarchical UTF-8 strings. Clients publish, subscribe, or do both to a topic. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Publish – Clients that send information to the broker to distribute to interested clients based on the topic name. Subscribe – Clients tell the broker which topic(s) they’re interested in. When a client subscribes to a topic, any message published to the broker is distributed to the subscribers of that topic. Clients can also unsubscribe to stop receiving messages from the broker about that topic. MQTT Quality of Services (QOS) MQTT offers three QoS levels to balance between reliability and overhead: QoS 0 (At most once): The message is delivered at most once, with no acknowledgment required. QoS 1 (At least once): The message is delivered at least once, requiring an acknowledgment from the recipient. QoS 2 (Exactly once): The message is delivered exactly once by using a four-step handshake process, ensuring no duplication or loss Application Example MQTT in Home Automation Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Constrained Application Protocol (CoAP) CoAP is an application layer protocol made to be used by constrained devices in terms of computational power, which may feature limited battery and operate in limited (low power and lossy) networks. RESTful Architecture: CoAP follows the REST (Representational State Transfer) architecture similar to HTTP. Resources are identified by URIs, and standard methods like GET, POST, PUT, and DELETE are used to interact with these resources. Message Exchange: CoAP operates over UDP (User Datagram Protocol), which is lighter than TCP and more suitable for unreliable networks. Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 It uses a simple two-layer messaging model: a short fixed-length header followed by options and a payload. Two different layers that make CoAP protocol: Message Request/Response. The Messages layer deals with UDP and with asynchronous messages. The Request/Response layer manages request/response interaction based on request/response messages. Message Types: Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Confirmable (CON): The client sends a CON message, and the server must acknowledge it with an ACK message. Non-confirmable (NON): The client sends a NON message, and the server does not need to acknowledge it. Acknowledgment (ACK): Sent in response to a CON message to confirm receipt. Reset (RST): Indicates that a message was received but could not be processed. Extensive Messaging Presence Protocol (XMPP) XMPP is a communication protocol that allows XML elements to be transferred over a network. This is one of the most widely used protocols for instant messaging. X (Extensible): Can be implemented or extended based on the requirement as it is an open-source protocol. M (Messaging): Has the best mechanism in real-time message transfer compared to other protocols. P (Presence): Allows to find out the state of a device whether online or busy or offline, etc. So best used for instant messaging. XMPP operation is based on a client-server architecture, one client cannot communicate with another client directly, they can communicate only through an intermediate server. XMPP also supports multiple patterns in communication such as: 1.Request/Response 2.Asynchronous Messaging 3.Publish/Sbscribe Name of the Faculty Designation, CSE Brainware University, Kolkata B.TECH Computer Science and Engineering and 3rd Semester Internet of Things (ESCG301) Academic Session 2024-2025 Brainware University - B.TECH Computer Science and Engineering Academic Session 2024-2025 Name of the Faculty Designation, CSE Brainware University, Kolkata