DNS and MQTT Flashcards
What does DNS stand for and what is it?
Domain Naming System
This is how a users computer obtains the IP address of a website that a user wishes to access from servers.
How does a users computer obtain an IP address for a website?
- A user requests a website IP address from a local DNS server
> If the local DNS server has the IP address for that website in its cache then it will return that IP address to the user (skip to step 5)
> If the local DNS server does not have the IP address for that website in its cache it will ask other DNS servers… - The Local DNS asks a Root DNS server to refer it to another DNS server that covers a specific domain type (e.g. .org, .edu, .com etc) that will know the IP address.
- The Local DNS asks the other DNS server (e.g. googleplex.edu) that covers a specific domain and this DNS server will refer it another DNS server for the specific website that has the IP addresses for all the pages of the website.
- This final DNS will return the IP address of the website wanted to the Local DNS server which will refer it to the Users computer
- The user will then connect to the IP address given.
What is MQTT and what does it stand for?
Message Queuing Telemetry Transport
A publish-subscribe architecture based lightweight asynchronous messaging protocol for machine-to-machine communication.
What are the two types of users for MQTT? What are there roles?
Client: Can publish messages or receive messages from MQTT server
Server: Forward messages to those clients who have subscribed to a topic
How does subscriptions work for MQTT?
Client can subscribe to one or more topics or groups of topics
What is the unique reason for the existence of MQTT?
It is used for connections that have a low bandwidth
What are the naming conventions for MQTT?
Case sensitive
At least 1 character long
Spaces are allowed
What is the format of an MQTT packet?
Fixed Header: 2 bytes (Control header 1byte, Packet Length 1byte), Compulsory
Variable length header: Size changes, Not compulsory
Payload: Size changes, Not compusory
Which layer does MQTT run on?
Application layer
Runs over TCP and IP
What is the naming structure of MQTT?
Organised like a file system with folders or topics separated by ‘ / ‘.
There is a higherarchy so the levels are structured like a tree
What are the naming conventions of MQTT?
> Case sensitive > At least 1 character long > Space can be used in topic name > Cannot include NULL character > Names should not exceed 65535 bytes
What is the special reserved topic name?
$SYS
This is reserved for MQTT data information
Anything leading with a $ isnt allowed
What are MQTT wildcards?
> topic/# will allow a client to subscribe to all topic threads on the level of the # and below
topic/+ will allow the client to subscribe to all topic threads on the level of +
What is the protocol for when a client publishes to a server?
C: Connect
S: Connect acknowledgment
C: Publish
S: Publish acknowledgment
What is the protocol for a client subscribing to a topic?
C: Connect
S: Connect acknowledgment
C: Subscribe
S: Subscribe acknowledgment