High Level Communication Protocols Flashcards
Describe a publish-subscribe service
A distributed network of devices (clients). Clients publish data to a server (broker). Data that is published is tagged with a topic and clients that want access to a topic subscribe to it. When the broker receives new data it pushes is to all clients subscribed to that topic. Clients can be publishers to some topics and subscribers to others.
What are the advantages of publish-subscribe services?
Clients never have direct contact
Publishers don’t know how the network is laid out
Publishers operate separately to subscribers
Good scalability
What is message queue telemetry transport?
Designed for resource constrained devices and low bandwidth, high latency networks. MQTT is a lightweight publish-subscribe messaging transport. It is commonly used for machine to machine and IoT
How does a control area network work?
Electronic control units (ECUs) act as nodes connected by a CAN bus. Any ECU can communicate with any other ECU without overloading the central controller.
What are the goals of CAN?
Low cost Flexible Robust Efficient Centralised monitoring No centralised network controller
How are messages transmitted using CAN?
Data is sent in packets called frames. Nodes detect collisions or corrupted messages and retransmits. A message is formatted as a SOF (start of frame), DLC (data length code) which is the number of bytes to be transmitted and CRC (cyclic redundancy check) which is error detection.
How does the physical layer of CAN work?
The CAN bus uses two wires (CANH & CANL). Termination resistors damp out reflected energy on the wire. The voltage between the two wires is zero when no node is driving
What is arbitration?
Logic 0 is the dominant state
Logic 1 is the recessive state
Messages start with an arbitration field and the first device to transmit a 1 loses arbitration
How is CAN synchronised?
There’s no clock so receivers are synchronised on recessive to dominant clock edges
What is bit stuffing?
If data contains a long string of 0s or 1s an additional 1 or 0 is added to help synchronisation
What is carrier sense multiple address?
Nodes monitor the bus for inter-frame space and transmit in this space. All nodes have an equal right to transmit.
Name two high level CAN protocols
On-board diagnosis
CANopen
How is MQTT initiated?
Include libraries to support ethernet connection and pub/sub
Define MQTT broker
Define function to be called when subscribed data updates