DNS and MQTT Flashcards

1
Q

What does DNS stand for and what is it?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does a users computer obtain an IP address for a website?

A
  1. 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…
  2. 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.
  3. 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.
  4. 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
  5. The user will then connect to the IP address given.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is MQTT and what does it stand for?

A

Message Queuing Telemetry Transport

A publish-subscribe architecture based lightweight asynchronous messaging protocol for machine-to-machine communication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the two types of users for MQTT? What are there roles?

A

Client: Can publish messages or receive messages from MQTT server
Server: Forward messages to those clients who have subscribed to a topic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does subscriptions work for MQTT?

A

Client can subscribe to one or more topics or groups of topics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the unique reason for the existence of MQTT?

A

It is used for connections that have a low bandwidth

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the naming conventions for MQTT?

A

Case sensitive
At least 1 character long
Spaces are allowed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the format of an MQTT packet?

A

Fixed Header: 2 bytes (Control header 1byte, Packet Length 1byte), Compulsory
Variable length header: Size changes, Not compulsory
Payload: Size changes, Not compusory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which layer does MQTT run on?

A

Application layer

Runs over TCP and IP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the naming structure of MQTT?

A

Organised like a file system with folders or topics separated by ‘ / ‘.
There is a higherarchy so the levels are structured like a tree

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the naming conventions of MQTT?

A
> Case sensitive
> At least 1 character long
> Space can be used in topic name
> Cannot include NULL character
> Names should not exceed 65535 bytes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the special reserved topic name?

A

$SYS
This is reserved for MQTT data information
Anything leading with a $ isnt allowed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are MQTT wildcards?

A

> 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 +

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the protocol for when a client publishes to a server?

A

C: Connect
S: Connect acknowledgment
C: Publish
S: Publish acknowledgment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the protocol for a client subscribing to a topic?

A

C: Connect
S: Connect acknowledgment
C: Subscribe
S: Subscribe acknowledgment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is QoS?

A

This is quality of service of MQTT. There are 3 levels of QoS

17
Q

What is QoS 0?

A

“Fire and forget” Messages are sent out to clients from servers and this quality of service assumes that the user has received it

18
Q

What is QoS 1?

A

Server sends message to client repeatedly until the client replied with acknowledgment

19
Q

What is QoS 2?

A
  1. Server sends message to client (PUBLISH)
  2. Client responds with acknowledgment (PUBREC)
    > If no acknowledgment is received from client then it will send it again with a duplicate flag
  3. The server responds with an acknowledgment (PUBREL)
  4. The client responds with an acknowledgment (PUBCOMP)
20
Q

What are the two transport layer choices?

A

UDP and TCP

21
Q

What is UDP? what does it stand for?

A

User Datagram Protocol
This is an unreliable data transfer protocol that is used for real-time applications that often require minimum sending rate and want reduced transmission delay. It does not guarantee that data will arrive on time, in order or at all.

22
Q

What does TCP stand for?

A

Transmission control protocol.

23
Q

What are the features of TCP?

A

> Reliable data transfer
Congestion control across an entire network
Prevents nodes from swamping links
Equal share of bandwidth to each packet travelling through congested links using rate control.

24
Q

What is the purpose of a TCP/UDP port?

A

An IP identifies the computer that the packet needs to travel to and the port identifies the application or service on the computer.

25
Q

What is special about the port numbers ranging from 0 to 1023

A

These are called well-known port numbers and are restricted to well known application protocols (e.g. HTTP)

26
Q

What is the port used for MQTT?

A

1883

27
Q

What are the ports used for TCP?

A

21,23,25

28
Q

What are the ports used for UDP?

A

53,69,161

29
Q

What are the features of UDP?

A
> Multiplexing
> Demultiplexing
> Basic error detection
> No handshaking
> No congestion control or flow control
30
Q

How does UDP establish a connection and what happens with the connection state?

A

There is no connection establishment which means there is less packet exchanges and overhead for transmission.
UDP does not maintain connection state which means that servers are able to handle more users.

31
Q

How does TCP maintain connection state?

A

TCP maintains a connection state by receiving and sending buffers, congestion-control parameters and sequence and acknowledgment number parameters

32
Q

What are the applications of UDP?

A

Internet phone, real-time video conferencing, streaming of audio and video.