Internet of Things (20CS002 ) Department of Computer Science and Engineering Vignan's Foundation for Science, Technology & Research
Internet Of Things: A Hands-On Approach by Arsheep Bahga , Vijay Madisetti Computer Networking: A Top-Down Approach by James Kurose, Keith Ross DATA COMMUNICATIONS AND NETWORKING by Behrouz A. Forouzan References
Network Components Networking hardware includes all computers, peripherals, interface cards and other equipment needed to perform data-processing and communications within the network.
Modem MODEM network device consists of two words MO from modulator and DEM from demodulator. Modem converts digital signal to analog signal then this process is called modulation . Again, when modem converts analog signal to digital signal then this process is called demodulation . Types of MODEM 1. Acoustic coupler modem gives a slower speed. This network device may remain built in in your PC. It is not expensive but no more uses now a days. 2. Direct modem gives more speed than acoustic coupler modem. It is connected with computer port using USB port. This is more expensive network device than acoustic coupler modem .
Hub To establish a local area network, we need a central device which can connect all the computer is called Hub . Active hub increases the value of signal and remove unnecessary signal is called active hub. Moreover, it can also process the signal. Sometimes, this type of hub is called intelligent hub . Passive hub d oesn’t increase the value of signal. Passive hub only helps to exchange information from computer to computer. This type of network devices are connected with active devices. Merits of hub It is not expensive. It can connect various medium. Demerits of hub Increase the network traffic. Increase collision among data. Data filtering can’t possible.
Router Routers connect LANs and WANs together and have a dynamically updating routing table based on which they make decisions on routing the data packets. Merits of router Router has the power to connect different network. It removes the restriction to exchange data. It can filter broadcast data. Demerits of router Router gives a slower speed. Gives complex configuration. It can’t connect network of different protocol.
Gateway Gateway is being used to connect different network. When a network has different protocol then gateway is used to connect that device with the network. Merits of gateway Gateway reduces data collision rate. Send data according to receiver’s protocol. It can connect network from different protocol. Demerits of gateway More expensive than router. It has a complex configuration. Its speed is comparatively slow.
Switch Switch is a network device of many ports which helps to flow information. Though it looks like hub but it exchanges data in a different manner among clients. Switch increases the performance of network and can communicate among many computers at a time. Merits of switch Switch reduces the collision rate of data. It is possible to control broadcast using virtual LAN. Demerit of switch It is more expensive than hub. Not possible to filter data.
Bridge and Repeater A bridge is a repeater, with add on the functionality of filtering content by reading the MAC addresses of source and destination. It is also used for interconnecting two LANs working on the same protocol. It has a single input and single output port, thus making it a 2 port device Repeater regenerate the signal over the same network before the signal becomes too weak or corrupted so as to extend the length to which the signal can be transmitted over the same network. Repeaters did not amplify the signal. When the signal becomes weak, they copy the signal bit by bit and regenerate it at the original strength. It is a 2 port device.
Network
What ’ s the Internet: “ nuts and bolts ” view billions of connected computing devices: hosts = end systems running network apps communication links fiber, copper, radio, satellite transmission rate: bandwidth packet switches: forward packets (chunks of data) routers and switches wired links wireless links router smartphone PC server wireless laptop mobile network global ISP regional ISP home network institutional network
Internet: “ network of networks ” Interconnected ISPs protocols control sending, receiving of messages e.g., TCP, IP, HTTP, Skype, 802.11 Internet standards RFC: Request for comments IETF: Internet Engineering Task Force What ’ s the Internet: “ nuts and bolts ” view mobile network global ISP regional ISP home network institutional network
What ’ s a protocol? human protocols: “ what ’ s the time? ” “ I have a question ” introductions … specific messages sent … specific actions taken when messages received, or other events network protocols: machines rather than humans all communication activity in Internet governed by protocols protocols define format , order of messages sent and received among network entities, and actions taken on message transmission, receipt
a human protocol and a computer network protocol: Hi Hi Got the time? 2:00 TCP connection response Get http://www.awl.com/kurose-ross <file> time TCP connection request What ’ s a protocol?
A closer look at network structure: network edge: hosts: clients and servers servers often in data centers access networks, physical media: wired, wireless communication links network core: interconnected routers network of networks mobile network global ISP regional ISP home network institutional network
Access networks and physical media Q: How to connect end systems to edge router? residential access nets institutional access networks (school, company) mobile access networks keep in mind: bandwidth (bits per second) of access network? shared or dedicated?
ISP Access network: digital subscriber line (DSL) central office telephone network DSLAM voice, data transmitted at different frequencies over dedicated line to central office use existing telephone line to central office DSLAM data over DSL phone line goes to Internet voice over DSL phone line goes to telephone net < 2.5 Mbps upstream transmission rate (typically < 1 Mbps) < 24 Mbps downstream transmission rate (typically < 10 Mbps) DSL modem splitter DSL access multiplexer
ISP data, TV transmitted at different frequencies over shared cable distribution network cable modem splitter … cable headend CMTS cable modem termination system HFC: hybrid fiber coax asymmetric: up to 30Mbps downstream transmission rate, 2 Mbps upstream transmission rate network of cable, fiber attaches homes to ISP router homes share access network to cable headend unlike DSL, which has dedicated access to central office Access network: cable network
Access network: home network to/from headend or central office cable or DSL modem router, firewall, NAT wired Ethernet (1 Gbps) wireless access point (54 Mbps) wireless devices often combined in single box
Enterprise access networks (Ethernet) typically used in companies, universities, etc. 10 Mbps, 100Mbps, 1Gbps, 10Gbps transmission rates today, end systems typically connect into Ethernet switch Ethernet switch institutional mail, web servers institutional router institutional link to ISP (Internet)
Wireless access networks shared wireless access network connects end system to router via base station aka “ access point ” wireless LANs: within building (100 ft.) 802.11b/g/n (WiFi): 11, 54, 450 Mbps transmission rate wide-area wireless access provided by telco (cellular) operator, 10 ’ s km between 1 and 10 Mbps 3G, 4G: LTE to Internet to Internet
Host: sends packets of data host sending function: takes application message breaks into smaller chunks, known as packets , of length L bits transmits packet into access network at transmission rate R link transmission rate, aka link capacity, aka link bandwidth R: link transmission rate host 1 2 two packets, L bits each packet transmission delay time needed to transmit L -bit packet into link L (bits) R (bits/sec) = =
A B How do loss and delay occur? packets queue in router buffers packet arrival rate to link (temporarily) exceeds output link capacity packets queue, wait for turn packet being transmitted (delay) packets queueing (delay) free (available) buffers: arriving packets dropped ( loss ) if no free buffers
Four sources of packet delay d proc : nodal processing check bit errors determine output link typically < msec d queue : queueing delay time waiting at output link for transmission depends on congestion level of router propagation nodal processing queueing d nodal = d proc + d queue + d trans + d prop A B transmission
d trans : transmission delay: L : packet length (bits) R : link bandwidth (bps) d trans = L/R d prop : propagation delay: d : length of physical link s : propagation speed (~2x10 8 m/sec) d prop = d / s Four sources of packet delay d trans and d prop very different propagation nodal processing queueing d nodal = d proc + d queue + d trans + d prop A B transmission
Packet loss queue (aka buffer) preceding link in buffer has finite capacity packet arriving to full queue dropped (aka lost) lost packet may be retransmitted by previous node, by source end system, or not at all A B packet being transmitted packet arriving to full buffer is lost buffer (waiting area)
Throughput throughput: rate (bits/time unit) at which bits transferred between sender/receiver instantaneous: rate at given point in time average: rate over longer period of time server, with file of F bits to send to client link capacity R s bits/sec link capacity R c bits/sec server sends bits (fluid) into pipe pipe that can carry fluid at rate R s bits/sec) pipe that can carry fluid at rate R c bits/sec)
Internet structure: network of networks Question: given millions of access ISPs, how to connect them together? access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net … … … … … …
Internet structure: network of networks Option: connect each access ISP to every other access ISP? access net access net … … … … … … … … connecting each access ISP to each other directly doesn’t scale: O( N 2 ) connections. access net access net access net access net access net access net … access net access net access net access net … access net access net access net access net …
Internet structure: network of networks access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net … … … … … … Option: connect each access ISP to one global transit ISP? Customer and provider ISPs have economic agreement. global ISP
ISP C ISP B ISP A Internet structure: network of networks access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net … … … … … … But if one global ISP is viable business, there will be competitors …. access net
ISP C ISP B ISP A Internet structure: network of networks access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net … … … … … … access net But if one global ISP is viable business, there will be competitors …. which must be interconnected IXP peering link Internet exchange point IXP
ISP C ISP B ISP A Internet structure: network of networks access net access net access net access net access net access net access net access net access net access net access net access net … … … … … … access net IXP IXP access net access net access net regional net … and regional networks may arise to connect access nets to ISPs
ISP C ISP B ISP A Internet structure: network of networks access net access net access net access net access net access net access net access net access net access net access net access net … … … … … … access net IXP IXP access net access net access net regional net Content provider network … and content provider networks (e.g., Google, Microsoft, Akamai) may run their own network, to bring services, content close to end users
Internet structure: network of networks at center: small # of well-connected large networks “ tier-1 ” commercial ISPs (e.g., Level 3, Sprint, AT&T, NTT), national & international coverage content provider network (e.g., Google): private network that connects it data centers to Internet, often bypassing tier-1, regional ISPs IXP IXP IXP Tier 1 ISP Tier 1 ISP Google Regional ISP Regional ISP access ISP access ISP access ISP access ISP access ISP access ISP access ISP access ISP
IoT Communication Models Request - Response Model: Client sends request to the server and the server responds to the requests When the server receives a request, it decides how to respond, fetches the data, retrieves resource representations, prepares the response, and then sends the response to the client Request-response model is a stateless communication model and each request-response pair is independent of others.
Request and Response model
Publish-Subscribe model Publish-Subscribe is a communication model that involves publishers, brokers and consumers Publishers are the source of data Publishers send the data to the topics which are managed by the brokers Publishers are not aware of the consumers Consumers subscribe to the topics which are managed by the broker When the broker receives data for a topic from the publisher, it sends the data to all the subscribed consumers
Push-Pull model Push-Pull is a communication model in which the data producers push the data to queues and the consumers pull the data from the queues Producers do not need to be aware of the consumers Queues help in decoupling the messaging between the producers and consumers Queues also act as a buffer which helps in situations when there is a mismatch between the rate at which the producers push data and the rate at which the consumers pull data
Exclusive-Pair model Exclusive pair is a Bi-directional, fully duplex communication model that uses a persistent connection between the client and server Once the connection is setup it remains open until the client sends a request to close the connection Client and server can send messages to each other after connection setup Exclusive pair is a stateful communication model and the server is aware of all the open connections
IoT Communication APIs Application Programming Interface (API) referring to standard framework collection, protocols, and resources dictating the generic web and mobile application. It defines the communication rules that every application component must follow while exchanging information with each other. An API is an interface used by programs to access an application. IoT APIs are the interface points between an IoT device and the Internet and/or other network components. APIs that are used in the creation of IoT solutions are known as IoT APIs. They are the web services application programming interfaces.
IoT Communication APIs API vendors for the Internet of Things Withings API developers involved in the development of measurement devices can be benefitted hugely as the API can share the collected data over the internet. Most commonly, the collected information by this API vendor is ECG and EKG, body weight, and sleep cycles. Garmin Health API is perfect choice for developers involved in developing the IoT appliances operating in the health care and activity industry , Garmin Health APIs can monitor around 30 types of activities. Data related to total sleep hours, steps walked, stress level, heart rate, and many more. Google Assistant API capable of being integrated into IoT devices easily and supports operations like voice control, natural language processing, and many other facilities. Using the API, developers can easily make IoT devices voice-controlled by phones, displays, watches, TV, laptops, and Google Home Devices. Apple HomeKit API serves as a doable platform for connecting Siri and iPhone with the Apple-based home devices and appliances. Accessible with the help of Apple iOS8 SDK, the APIs can make devices like lights, garages, doors, TV, and many more to be controlled directly via voice.
REST based Communication APIs Representational State Transfer (REST) APIs is a set of architectural principles by which you can design Web services the Web APIs that focus on the system's resources and how resource states are addressed and transferred. Uniform Resource Identifier (URI) are used to depict resources in the RESTful web service. Client tries to access these resources via URIs using commands like GET, PUT, POST, DELETE and so on that are defined by HTTP. In response, the server responds with a JSON object or XML file. The REST architectural constraints are Client-Server Stateless Cache-able Layered system Uniform Interface Code on demand
REST based Communication APIs Client-Server : The principle behind the client-server constraint is the separation of concerns. Client should not interfere the storage of data from server Server should not be concerned about the user interface Stateless : Each request from client to server must contain all the information necessary to understand the request, and cannot take advantage of any sored context on the server. The session state is kept entirely on the client Cache-able : Cache constraint requires that the data within a response to a request be implicitly or explicitly labeled as cache-able or non-cache-able If a response is cache-able, then a client cache is given the right to reuse that response data for later, equivalent requests. Catching can partially or completely eliminate some interactions and improve efficiency and scalability.
REST based Communication APIs Layered System : A layered system defines the boundaries of the components within each specific layer. For example, A client is unable to tell whether it is connected to the end server or an intermediate node. Uniform Interface : This constraint requires that the method of communication between a client and a server must be uniform When a client holds a representation of a resource it has all the information required to update or delete the resource Each message includes enough information to describe how to process the message Code on demand : Servers can provide executable code or scripts for clients to execute in their context (it is optional).
REST based Communication APIs
WebSocket based Communication APIs WebSocket APIs enable bi-directional and duplex communication between customers and servers. It is a stateful type. Unlike REST, There is no need to set up a connection every now and then to send messages between a client and a server. It works on the principle of the exclusive pair model. WebSocket APIs reduce the network traffic and latency as there is no overhead for connection setup and termination requests for each message Due to one time dedicated connection setup, there is less overhead, lower traffic and less latency and high throughput.
WebSocket based Communication APIs
REST vs WebSocket APIs
Levels of IoT An IoT system comprises of the following components: Device: Allows identification, remote sensing, actuating and remote monitoring capabilities. IoT devices include wireless sensors, software, actuators, and computer devices operates through the internet, enabling the transfer of data among objects automatically without human intervention. Resource: Every IoT has a software module for the entry, processing, and storage of sensor data. They are therefore used to control actuators connected to devices. Controller Service: It acts as a connector between web service and device. The controller service sends data from the system to the web service and receives commands for controlling the device from the application (via web services).
Levels of IoT Database: It is the repository for all data provided by IoT devices. It is either held locally or on the cloud in the form of a database. Web Service: It connect the IoT computer, application, database, and research components. Web services may be implemented either using HTTP and REST concepts (REST service) or the WebSocket protocol (WebSocket service). Analysis Component: It retrieves data from the IoT device's database and turns it into useful information. This module analyses data, produce results and presents them in a user-friendly format using various algorithms. This analysis can be performed locally or in the cloud, and the resulting data can be stored locally or in the cloud. Application: IoT applications have a user-friendly interface to track and manage different IoT device aspects. Users will access the monitor system and the data generated.
IoT Level - 1 IoT system consists of a single device performs sensing or actuations, stores data, analyses it and hosts the application. The data sensed is processed locally. Data processing is performed locally. Example: Consider an IoT device that monitors the lights in a house. The lights are controlled through switches. Status of each light is maintained in a local database. REST services deployed locally allow retrieving and updating state of each light in the database and triggers the switches accordingly. Application has a user interface for controlling the lights or applications locally.
IoT Level - 2 A node performs sensing / actuation and local analysis. Data is stored in the cloud. It is useful for solutions where the data is large, but the primary analysis criterion is not computationally intensive and can be performed locally. Example: A single node monitors the soil moisture in the field. This is sent to the database on cloud using REST APIs. Controller service continuously monitors moisture levels. Cloud based application is used for monitoring and controlling the IoT system.
IoT Level - 3 A single node monitors the environment and stores data in the cloud. Application is cloud based. This is suitable where data is voluminous and analysis is computationally intensive. Example: A node is monitoring a package using devices like accelerometer and gyroscope. These devices track vibration levels. Controller service sends sends sensor data to cloud in real time using WebSocket API. Data is stored in cloud and visualised using cloud-based application. Analysis component triggers alert if vibration levels cross a threshold.
IoT Level - 4 Multiple nodes collect information and store in the cloud. A cloud based application controls the system. Local and remote observer nodes are present that subscribe to and receive information collected in cloud from various devices. Observer nodes can process information and use it for applications but do not perform control functions. Example: Noise monitoring of a area requires various nodes functioning independent of each other. Each has its own controller service. Data is stored in cloud database. Analysis is done on the cloud and the entire IOT system is monitored on the cloud using an application.
IoT Level - 5 Nodes present locally are of two types, end nodes and coordinator nodes. End nodes collect data and perform sensing or actuation or both. Coordinator nodes collect data from end nodes and sends it to cloud. Data is stored and analysed in cloud and application is cloud based. Example : A monitoring system has various components: end nodes collect various data from the environment and send it to coordinator node. Coordinator node acts as gateway and allows the data to be transferred to cloud storage using REST API. Controller service on the coordinator node sends data to the cloud.
IoT Level - 6 Multiple independent end nodes perform sensing and actuation and send data to cloud. Data is stored in cloud and application is cloud based. The analytics components analyses the data and stores the results in the cloud database. The results are visualized with cloud based application. The centralized controller is aware of the status of all the end nodes and sends control commands to the nodes. Example: Weather monitoring consists of sensors that monitor different aspects of a system. The end nodes send data to cloud storage. Analysis component, application and storage are in cloud. Centralized controller controls all nodes and provides inputs.
Levels Suitability Level 1 Low- cost and low-complexity solutions where the data involved is not big and the analysis requirements are not computationally intensive. Level 2 The data involved is big , however, the primary analysis requirement is not computationally intensive and can be done locally itself. Level 3 The data involved is big and the analysis requirements are computationally intensive. Level 4 Suitable for solutions where multiple nodes are required, the data involved is big and the analysis requirements are computationally intensive . Level 5 Suitable for solutions based on wireless sensor networks , in which the data involved is big and the analysis requirements are computationally intensive. Level 6 System that has multiple independent end nodes that perform sensing and/or actuation and send data to the cloud.