Protocols - Internet Of Things

Basic


  • Communication Models
    • Request & Response Model
      • Image Not Found
    • Publisher Subscriber Model
      • Image Not Found
    • Push Pull Model
      • Image Not Found
      • Queue is added for better flow control
    • Exclusive Pair
      • Full duplex
      • Image Not Found
  • Sockets
    • REST
      • Stateless
        • Server does not stores any information/reference/previous context
        • Every request is independent of each other
      • Request Response Communication Model
      • Each request involves setting up a new TCP connection
      • Header overhead
      • Not suitable for Real time application (RTA)
    • Web Socket
      • Statefull
        • Information like Session details, Open connection are stored
      • Full duplex
      • Single TCP connection
      • No Header overhead
      • Suitable for RTA

Message Queue Telemetry Transport (MQTT)


  • Uses Publisher-Subscriber model
  • Components
    • Publisher (Sensors)
      • Publishes to Broker
    • Subscriber (Application)
      • Subscribes to a particular topic using Broker
    • Broker
      • Publishes to subscriber based on the subscribed topic
  • Methods
    • Connect
    • Disconnect
    • Publish
    • Subscribe
  • Topic
    • Separated by slash => "value1/value2/value3"
    • Wild card
      • Single-level
        • "value1/+/value3" => Arbitrary values are allowed for value2
      • Multi-level
        • "value1/#" => Subscribing to a topic starting with "value1"

Advanced Message Queuing Protocol (AMQP)


  • Frame => Basic unit of data
    • Open => Open Connection
    • Begin => Begin session between two points
    • Attach => Attach a link
    • Transfer => Sending message over the link
    • Flow => Flow control
    • Disposition => Settlement regarding state of transfer
    • Detach => Detach a link
    • End => End session between two points
    • Close => Close Connection
  • Working
    • Publisher publishes message to Broker with a Routing key received by Exchange
    • Exchange routes it to one of the many Queues based on the Exchange type using Binding key
    • Message is then delivered to respective Consumer based on requirement
  • Exchange
    • Binding
      • Link between Exchange and Queues
      • Routing pattern is specified in binding
    • Exchange type
      • Direct
        • Routes the message to the Queue in which routing and binding key matches
      • Fanout
        • Routes the message to all the Queues bound to it
      • Topic
        • Routes the message to the Queue in which wild card matches routing key and routing pattern
      • Header
        • Routes the message based on message header attribute

Zigbee


  • IEEE 802.15.4 protocol is used in Physical & Data link layer
  • Zigbee protocol is defined for layer 3 and above (NL, TL, SL, PL, AL)
    • Network & Transport layer uses this protocol to define additional communication enhancements like authentication, security, encryption, forwarding, routing
    • Popularly used in Wireless sensor networks using MESH topology
  • Nodes
    • Zigbee Coordinator (C)
      • Monitors information related to network, nodes, transmission
    • Zigbee Router (R)
      • Routes the message to the neighboring nodes connected to it
    • Zigbee End Device (E)
      • Sleeps mostly
      • Low memory and cost requirement
  • Topology
    • Star
      • All "E" are connected with "C"
    • Cluster
      • All "R" are connected with "C" and all "E" are connected with "R"
    • MESH
      • Nodes are connected with each other
  • Zigbee Network Layer
    • Uses Ad Hoc On Demand Distance Vector Routing
Share: