2013年3月13日星期三

Understand MQTT protocol internal (updating...)

   Regarding to MQTT, three most important references are:

  As Linus said, read the fucking source code to learn how it works. In the same way, let's read the fucking protocol specification to learn outline and detail.
  
  We are going to focus on topics below:
  1. What's MQTT?
  2. MQTT Features
  3. MQTT Use Cases
  4. MQTT Principle & Infrastructure
  5. MQTT Protocol Analysis
  6. MQTT Development
  7. MQTT Application Sample

In the following days, i'll expand each topic based on reading spec.

  1. What's MQTT?

  2.            Definition is described in Spec
      "MQ Telemetry Transport(MQTT) is a lightweight broker-based publish/subscribe messaging protocol designed to be open, simple, lightweight and easy to implement."
      
      "These characteristics make it ideal for use in constrained environments, for example, but not limited to:
       * Where the network is expensive, has low bandwidth or is unreliable
       * When run on an embedded device with limited processor or memory resources"


  3. MQTT Features
  4. * Provide network connectivity based on TCP/IP
    * Provide one-to-many message distribution based on publish/subscribe message pattern
    * Minimum overhead & protocol exchanges in transport layer to  reduce traffic
    * Provide three qualities of service for messaging delivery:
      # "At most once"
      # "At least once" 
      # "Exactly once"
    * Provide a complete mechanism for an abnormal disconnection notify

  5. MQTT Use Cases
  6. Application
    * Gaian DB a distributed database
    * Location Aware Messaging for Accessibility, LAMA an IBM Extreme Blue Project
    * Say It, Sign It (SiSi) an IBM Extreme Blue Project

    Home Automation
    * Andy SC's Twittering / Automated House
    * Power monitoring
    * Lighting control
    * Gardening
    * energy monitoring with an old-style analog ammeter
    * Android/TV/Burglar detection system
    * MQTT<>LLAP bridge example for the Ciseco OpenKontrol Gateway
    * WarmDirt project to control soil temperature for plants (like potatoes!)

    University/Research
    * Southampton University LEGO microscope controller
    * Messaging protocol applications research at CEIT, University of Queensland
    * FloodNet Southampton University
    * Smart Lab Southampton University

    Mobile
    * Facebook Messageer

    Technical
    * Filesystem sync
    * Linux desktop notification applet in GNOME 2
    * Ubuntu desktop notification using pynotify
    * OS X desktop notifications using Grow!
    * MQTT and Websocket thermometer

    Just for Fun
    * Christmas lights
    * Mind controlled taxis
    * Glowing rubber ducks

  7. MQTT Principle & Infrastructure
  8. Figure: Publisher-Broker-Subscriber Pattern
    Obviously, MQTT is built on TCP/IP and implement Publisher-Broker-Subscriber pattern. It means one publisher can easily achieve multicast functionality, which can be used in AD publish platform.

    Infrastructure in MQTT has three parts:
    * Broker Server. Basically, its job is to accept subscribers and re-transmit info from publisher to subscribers. In complex system, broker server can do more jobs related to data analysis and mining.

    * Subscriber Client. In most of time, it listens to broker after subscribing and ready for handling incoming message.

    * Publisher Client. In "Internet of Things" system, each device connected has the ability of sensor and can be triggered by events, which produces useful and important information to notify outside.

    If subscriber and publisher are both integrated in an app, then it can work in duplex mode, which can listen to and notify outside.


  9. MQTT Protocol Analysis
  10. ... ...

  11. MQTT Development
  12. ... ...

  13. MQTT Application Sample
  14. ... ...

没有评论:

发表评论