Internet of Things CS631P IoT – Definition & Characteristics • A dynamic global network infrastructure with self-configuring capabilities based on standard and interoperable communication protocols where physical and virtual “things” have identities, physical attributes, and virtual personalities and use intelligent interfaces, and are seamlessly integrated into the information network, often communicate data associated with users and their environments. • • • • • Dynamic & Self-adapting Self configuring Interoperable communication protocols Unique identity Integrated into information network Physical Design of IoT • Things in IoT – Unique identity – Sensing, Actuating, Monitoring – Exchange data, process data, send to server/cloud Connectivity Processor USB Host Ethernet CPU Audio/Video Interfaces HDMI 3.5 mm audio RCA video WIFI/Bluetooth I/O Interfaces (for sensors, actuators etc. UART SPI Memory Interfaces Graphics I2C SD NAND/NOR GPU DDR1/2/3 Storage Interfaces MMC SDIO Fig: Generic block diagram for IoT Device CAN Physical Design of IoT • IoT Protocols – Link Layer – Network Layer – Transport Layer – Application Layer HTTP Application Layer CoAP MQTT WebSockets XMPP DDS AMQP Transport Layer UDP TCP Network Layer IPv4 IPv6 6LoWPAN Link Layer 802.3 - Ethernet 802.16 - WiMax 802.11- WiFi 802.15.4 – LR-WPAN Fig: IoT Protocols 2G/3G/4G/LTE - Cellular Link Layer • Scope of link layer is the local network connection to which the host is attached. – Hosts on the same link exchange data packets over the link layer using link layer protocols. – Determines how the packets are coded and signaled over the medium. IoT Link Layer protocols • IEEE 802.3 Ethernet – Collection of wired Ethernet standards. – Data rates – 10 Mbps to 40 Gbps and higher. – Medium – Coaxial, Twisted pair, Optical fiber. • IEEE 802.11 – Wifi – Collection of wireless LAN communication standards. – Data rates – 1Mbps to 6.75 Gbps and higher. – Radio waves • IEEE 802.16 – WiMax – Worldwide Interoperability for Microwave Access – Collection of wireless broadband standards. – Data rates – 1.5Mbps to 1 Gbps. • IEEE 802.15.4 – LR-WPAN – Collection of standard for Low-rate wireless personal area networks. – Forms the basis for Zigbee, WirelessHART, Thread etc. – Data rate – 40 Kbps to 250Kbps – Low cost and low speed communication for power constrained devices. • 2G/3G/4G – Cellular Communication – 2G - GSM,CDMA – 3G – UMTS, CDMA2000 – 4G – LTE – Data rate – 9.6 Kbps(2G) upto 100 Mbps (4G) • Bluetooth and BLE – transmit small packets of data consuming significantly less power Network/Internet Layer - IoT • Responsible for sending IP datagrams from source network to destination network. • Addressing and Routing • IPv4, IPv6,6LoWPAN • 6LoWPAN – IPv6 over Low power Wireless Personal Area Networks. – Works with IEEE 802.15.4 link layer protocol – Data rate – 250 Kbps Transport Layer - IoT • TCP – Connection Oriented – Reliable – Slow • UDP – Connectionless – Unreliable – Fast Application Layer • Defines how applications interface with the lower layer protocols. • Process to process communication • Port numbers for application addressing Application Layer Protocols - IoT • HTTP – Request-response model – Stateless protocol – Commands – GET,PUT,POST,DELETE,HEAD,TRACE,OPTIONS – Runs on top of TCP. • CoAP – Constrained Application Protocol – Meant for constrained devices and networks. – Request-response model – Runs on top of UDP – Can easily interface with HTTP and supports methods such as GET,PUT,POST,DELETE. • Websocket – The WebSocket protocol enables interaction between a web client (such as a browser) and a web server with lower overheads. – On top of TCP • MQTT – Message Queue Telemetry Transport – Light weight protocol – Publish-Subscribe model – Suited for constrained environments – MQTT Broker • Broker: Broker controls the distribution of information and mainly responsible for receiving all messages from publisher, filtering them, decide who is interested in it and then sending the messages to all subscribed clients. It can do the following things -Accept Client requests. -Receives Published messages by Users. -Processes different requests like Subscribe and Unsubscribe from Users. After receiving messages from publisher sends it to the interested Users. MQTT Working • XMPP – Extensible Messaging Presence Protocol – Protocol for streaming XML data – Real-time communication • DDS – Data Distribution Service – Publish-subscribe model • AMQP – Advanced Message Queuing Protocol – Publish-Subscribe – Interoperability Logical Design of IoT • Refers to an abstract representation of the entities and processes without going in to the low-level specifics of the implementation. – IoT Functional Blocks – IoT Communication Models – IoT Communication APIs IoT Functional Blocks • Device – Sensing, actuation, monitoring, control etc. • Communication – Handles communication for the IoT system • Services – Services for device monitoring, data publishing, device discovery etc. • Management – Functions to govern and manage the IoT system • Security – Authentication, Authorization, integrity and security. • Application – Interface to the user to view/control/analyze. Application Services Security Management Communication Device Fig: Functional Block of IoT IoT Communication Models • • • • Request-Response Publish-Subscribe Push-Pull Exclusive pair Request-Response Client Server Request Sends requests to the Server Response Receives requests from client, processes requests, looks up/fetches resources, prepares response and sends response to client Resources Publish-Subscribe Publisher Broker Publish to topic-1 Sends messages to topics Consumer-1 Topic-1 Subscribers: Consumer-1, Consumer-2 Consumer-2 Publish to topic-2 Topic-2 Subscribers: Consumer-3 Consumer-3 Push-Pull Publisher Queues Consumer-1 Sends messages to the Queue Message pushed to Queues Message pulled from Queues Consumer-2 Exclusive Pair Request to setup connection Response accepting the request Message from client to server Client Server Message from server to client Connection close request Connection close response IoT Communication APIs • REST-based Communication APIS • WebSocket-based Communication APIs REST-based Communication APIS • Representational State Transfer (REST) – A set of architectural principles to design web services and web APIs. • Request-Response communication model • On top of HTTP • XML, JSON, YAML etc. REST Architectural constraints • Client-Server – Separation of concerns • Stateless – No stored context in server • Cache-able – Data within a response should be labeled as cache-able or non-cache-able. • Layered System – Each component cannot see beyond the immediate layer with which it is interacting REST Architectural constraints • Uniform Interface – Uniform method of communication – Resources identified by URI (Uniform Resource Identifier) – Representation of the resource sent to the client • Code on demand – Optional – Servers can provide executable codes or scripts for clients to execute in their context. Request-Response model used by REST REST Client Server Request(GET,PUT,UPDATE or DELETE) with payload (JSON or XML) Response (JSON or XML) Request(GET,PUT,UPDATE or DELETE) with payload (JSON or XML) Response (JSON or XML) HTTP Client HTTP Packet HTTP Server HTTP Command Rest-Aware HTTP Client GET PUT POST DELETE Authorization REST-ful Web Service REST Payload JSON XML Resources URI URI Representations Representations Resources Resources Fig: Communication with REST APIs WebSocket-based Communication APIs • Allow bi-directional, full-duplex communication between clients and servers. • Follow the exclusive pair communication model. • Persistent connection – Do not require a new connection to be set up for each message to be sent. – Begins with WebSocket Handshake. – Suitable for low-latency or high throughput requirements. Exclusive pair model used by WebSocket APIs WebSocket Protocol Client Server Request to setup WebSocket Connection Response accepting the request Data Frame Data Frame Data Frame Data Frame Connection close request Connection close response IoT Enabling Technologies • • • • • Wireless Sensor Networks Cloud Computing Big Data Analytics Communication Protocols Embedded Systems Wireless Sensor Networks WSN Protocol Stack • • • • Low cost - Sensors Energy efficient Computational power - Limited Communication Capabilities – Radio waves, Short range, bi-directional/uni-directional, Robust/Secure. • Security and Privacy • Distributed sensing and processing • • • • • Dynamic network topology Self-organization Multi-hop communication: Application oriented Small physical size Cloud Computing • On demand services • Computing power, Storage, Services Cloud Computing • Infrastructure –as-a-Service(IaaS) – Computing and Storage resources provided as virtual machine instances and virtual storage. – Can deploy OS and applications of choice. – Pay-per-use billing model – DigitalOcean, Linode, Rackspace, Amazon Web Services (AWS), Cisco Metapod, Microsoft Azure, Google Compute Engine (GCE) are some popular examples of Iaas. • Platform-as-a-Service(Paas) – Development tools, APIs, Services, Libraries – Provider manages the underlying cloud infrastructure including servers, network, OS and storage. – Users responsible for developing, deploying, configuring and managing applications. – Examples: AWS Elastic Beanstalk, Windows Azure, Heroku, Force.com, Google App Engine, Apache Stratos. • Software-as-a-Service(SaaS) – Provides Complete software application or the UI to the application. – Provider manages the cloud infrastructure including servers, network, OS, storage and the application software – User unaware of the underlying architecture. – Applications are provided to user through thin client interface like browser, app etc. – Platform independent – Can be accessed from anywhere using any device (Workstations, PCs, Tablets, smart phones etc.) running on different OS. – Examples- Google Apps, Dropbox, Salesforce, Cisco WebEx, Concur, GoToMeeting Big Data Analytics • Data whose volume, velocity and variety is so large that it is difficult to store, manage, process and analyze it using traditional database tools. • Involves – Data cleansing – Data Munging (Data Wrangling) – Data Processing – Visualization 4 Vs 5 Vs • Data cleansing or data cleaning is the process of detecting and correcting (or removing) corrupt or inaccurate records from a record set, table, or database and refers to identifying incomplete, incorrect, inaccurate or irrelevant parts of the data and then replacing, modifying, or deleting the dirty or coarse data. • Data wrangling, sometimes referred to as data munging, is the process of transforming and mapping data from one "raw" data form into another format with the intent of making it more appropriate and valuable for a variety of downstream purposes such as analytics. Big Data in IoT • Sensor data generated by IoT systems such as weather monitoring systems. • Machine sensor data collected from sensors embedded in industrial and energy systems for monitoring their health and failure patterns. • Etc. Communication Protocols Embedded System • An embedded system is some combination of computer hardware and software, either fixed in capability or programmable, that is designed for a specific function or for specific functions within a larger system. • Industrial machines, agricultural and process industry devices, automobiles, medical equipment, cameras, household appliances, airplanes, vending machines and toys as well as mobile devices are all possible locations for an embedded system. • Embedded systems can be microprocessor or microcontroller based. In either case, there is an integrated circuit (IC) at the heart of the product that is generally designed to carry out computation for real-time operations.