Esme
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # IoT Final Note ## CH1- Introduction to IoT ### Block Diagram of IoT Device * consisted of interfaces for connections to other devices --> **wired/ wireless** ![](https://i.imgur.com/XdsIZ4T.png =500x) ### Protocols * From bottom to top ![](https://i.imgur.com/pp0aDBJ.png =300x) * Link layer: 802.3(ethernet)、802.11(wifi)...... * network/Internet Layer: IPv4, IPv6...... * Transport Layer: TCP、UDP * Application Layer: HTTP、WebSocket、MQTT...... ### **Models** #### Request-Response communicatin model * client: sends requests to server * server: respose to the requests * how to response? * fetches data...? * retrieved resource representations * prepare response * send back ![](https://i.imgur.com/wrirKKf.png) #### Publish-Subscribe communication model * publisher: **source of data** - send data to the topics managed by **broker** - Not aware of consumers * Consumer: subscribe to topics * After broker received data from publisher--> send data to all the **subscribed consumers** ![](https://i.imgur.com/uSSfyX6.png) #### Push-Pull communication model * data producer: push data to queue * Not aware of consumers * consumers: pull the data from the queue * Queues: help decoupling the messages * Queues: Buffer in situation --> mismatched pull/ push rate ![](https://i.imgur.com/vacQvNP.png) #### Exclusive Pair communication model * bidirectional, fully duplex (雙向) * **persistent connection** --> communication remains open till client sends close request ![](https://i.imgur.com/vVJjw66.png =500x) ### **API** #### REST-based Communication APIs * REST: Representational State Transfer * design web services and web APIs * focus on a system’s resources * how resource states are addressed and transferred * model: request-response communication model ![](https://i.imgur.com/E9zXkuB.png) #### WebSocket-based Communication APIs * bidirectional, full duplex communication * model: exclusive pair communication model ![](https://i.imgur.com/2k8s1PL.png) ### IoT Components * Device * Resource: software components **on the IoT device** * function: a. accessing, processing, and storing sensor information b. controlling actuators c. enable network access for the device * Controller Service: native service * runs on the device * interacts with the web services * function: * sends data: device ---> web service * receives commands <---(via: web services)--- application * Database: local/ cloud * Web Service: link between the **IoT device**, **application**, **database**, **analysis components** * Implemented methods: * HTTP and REST principles (**REST service**) * WebSocket protocol (**WebSocket service**) * Analysis Component * Application: * interface for users to control and monitor * view the system status * view the processed data ### IoT Level #### Level 1 * single node/device * sensing/ actuation * stores data * analysis * hosts application * lowcost, low-complexity solutions ![](https://i.imgur.com/0SrJAp8.png =400x) #### Level 2 * single node * sensing/ actuation * local analysis <font color = red> * Data/ application * cloud </font> * big data involved, analysis not computationally intensive ![](https://i.imgur.com/BOwzfLx.png =400x) #### Level 3 * single node * sensing/ actuation * Data/ application/ <font color=red>analysis </font> * cloud * big data involved, analysis <font color=red>computationally intensive</font> ![](https://i.imgur.com/mTJwHfg.png =400x) #### Level 4 * <font color = red>multiple</font> node * sensing/ actuation * local analysis * <font color = red>local/ cloudbased observer nodes</font> * subscribe to/ receive information * Data/ application * cloud * multiple nodes required, big data involved, computationally intensive analysis ![](https://i.imgur.com/bS3HmUa.png ) #### Level 5 * <font color = red>multiple end nodes and one coordinator node</font> * end node: sensing/ actuation * <font color = red>coordinator node: collects data from end, sends to the cloud</font> * Data/ application/ analysis * cloud * solutions based on <font color = red>wireless sensor networks</font>, big data involved, computationally intensive analysis ![](https://i.imgur.com/XK2jICk.png) #### Level 6 * multiple independent end nodes <font color = red> * sensing/ actuation * send data to the cloud </font> * Data/ application/ analysis * cloud <font color = red> * centralized controller * aware of the status of all the end nodes * sends control commands to the nodes </font> ![](https://i.imgur.com/hWdPGpb.png) ### Comparision between Levels ![](https://i.imgur.com/sRPPJG7.png =700x) ## CH3- IoT vs. M2M ### M2M Intro. * Machine-to-Machine * networking of machines (devices) * remote monitoring, control, data exchange * Machine: * embedded hardware modules * sensing, actuation and communication * Communication: * protocols: * ZigBee * Bluetooh * ModBus * M-Bus * Wirless M-Bus * Power Line Communication (PLC) * 6LoWPAN * IEEE 802.15.4 * ...... * network: **wire/ wireless networks(IP)** * M2M area networks: proprietary or non-IP based communication protocols * Unable to communicate with nodes in an external network ---> use **gateways** ![](https://i.imgur.com/CphhPs2.png) ### Difference |Comparison|IoT|M2M| |-|-|-| |Emphasis|software|hardware with embedded modules| |Data Collection & Analysis|cloud (public, private or hybrid)|point solutions& on-premises storage infrastructure| |Applications|collected in the cloud& accessed by cloud applications|collected in point solutions& accessed by on-premises applications| ![](https://i.imgur.com/G2aTIGH.png) ### SDN * Software-Defined Networking * separates control plane from data plane * maintain a unified view of the network * make configuration, management, provisioning simpler * use simple packet forwarding hardware ![](https://i.imgur.com/NIgptth.png) * Components * Centralized Network Controller * Programmable Open APIs * **Northbound interface**: interface between the SDN application and control layers * Standard Communication Interface<font color=red> (OpenFlow)</font> * **Southbound interface**: interface between the control and infrastructure layers ### NFV * Network Function Virtualization * leverages <font color=blue>virtualization</font> to consolidate the heterogeneous network devices * **complementary to SDN** ---> infra. to run * Elements: * **VNF** (Virtualized Network Function): * software implementation of a network function * **NFVI** (NFV Infrastructure): * virtualize compute, network and storage resources * Management and Orchestration: * Use case: virtualize Home Gateway * private IP addresses to the devices in the home * connects to network services: VoIP, IPTV ![](https://i.imgur.com/o75qC4j.png) ## CH4- IoT System Management with NETCONF-YANG ### SNMP (Simple Network Management Protocol) - protocol allowing monitoring and configuring network devices - components: - NMS (Network Management Station) - Managed Device - MIB (Management Information Base) - SNMP Agent ![](https://i.imgur.com/2dzlvIv.png =300x) - stateless& the SNMP request contains all the info. ---> **application needs to be intelligent** - connectionless protocol (UDP) ---> **unreliable** - MIBs lack writable objects ---> device configuration is impossible - difficulty retrieving current configuration - lack strong security features ### NETCONF (Network Configuration Protocol) - session-based network management protocol - retrieving state/ configuration data - manipulating configuration data ![](https://i.imgur.com/TkcPzF4.png) - SSH transport protocol - transport layer ---> end-to-end connectivity, reliable delivery - XML-encoded Remote Procedure Calls (PRCs) ---> framing request and response messages - RPC layer ---> mechanism for encoding of RPC calls and notifications - Content Layer ---> configuration and state data (XML-encoded) - **```YANG```** ---> data modeling language ### YANG - usage: model configuration and state data - contains: - definitions of configuration data - state data - RPC calls that can be issued - format of the notifications - defines the data between the NETCONF client and server - hierarchical tree structure ![](https://i.imgur.com/Xow7JgO.png) ## CH5- IoT Design Methodology ![](https://i.imgur.com/UJwWP5N.png) ## CH8- IoT Physical Servers & Cloud Offerings ### WAMP (Web Application Messaging Protocol) - sub-protocol of Websocket - publish-subscribe model - Publisher: publishes events to topic maintained by the Broker - Subscriber: subscribes to topics, receives the events - remote procedure call (RPC) - Caller: issues calls to the remote procedures - Callee: executes the procedures which calls are issued by the caller and returns the results back to the caller - Router: perform generic call and event routing - PS-mode: Broker: routes messages published to a topic to all subscribers - RPC-mode: Dealer: routes RPC calls from the Caller to the Callee and routes results from Callee to Caller ![](https://i.imgur.com/qeCP6uO.png) ## CH10- Data Analytics for IoT ### Hadoop Ecosystem - open source framework for distributed batch processing of big data ## Lab1 ### OS Installation - Download Raspbian - Flash .img file into SD card - **SSH** - add new raw file ```ssh``` into the ```boot``` disk - ssh command ```ssh pi@raspberrypi.local``` - default password: raspberry - VNC - ```raspi-config``` - Adjust ```VNC```, ```Resolution``` - Reboot - Trouble shoot - reinstall: delete ```known_hosts``` file or line related to ```raspberrypi.local``` ## Lab2 ### Request - pip install request - ```response = request.get(url, params={‘key’ : ‘data’}, headers={‘key’ :‘data’}``` - HTTP status code: - Informational responses (100–199) - Successful responses (200–299) - Redirects (300–399) - Client errors (400–499) - Server errors (500–599) - response.json(): get the message in ```json``` format

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully