In this module, the self-study material focus on the main network technologies allowing to transmit information from one device to another. While industry standards are quickly evolving, we will particularly look at selection criteria to make choices that fit what you are designing.



Network Terminology

Reading (45 minutes)

Network technologies are all the elements that enable a machine to transmit information to another machine. In our lightbulb context, each student as a home network which we call a local network. All these networks are connected to the Internet, which is a network of (many) networks.

A router routes communication from one device to another. For instance, it receives a ‘turn ON’ message from the Raspberry Pi to be sent to the lightbulb, within the local network. It also routes information to the Internet, such as data to be saved on Bucket.

Each device on the network has a MAC address (for Media Access Control). This is a unique identifier of the device attributed by its manufacturer. A device with multiple network interface (e.g. WiFi and Bluetooth) will have a MAC address for each network interface.

The IP address (for Internet Protocol) is the identifier of a device on a network at a given time. In contrast with the MAC address, this address is attributed by the network and can change over time.

The hostname is the name of a device on a network. This name can only be used to reach the device on a small local network. On the Internet, because IP addresses are difficult to memorise, domain names are given to machines so that we can reach out for example google.com without memorising one of Google’s IP addresses.

Bucket is a server, a computer like a personal computer connected to the Internet and providing a service such as storing data, serving the content of a website, processing information and so on. Clients are the consumers of these services. The complexity of each of those services (e.g. storing data) often requires a set of servers to work together, without clients being aware of this ‘network of servers’. We refer to this abstraction as cloud infrastructure.

IP Network Architecture

Network protocols are sets of rules and convention enabling machines to communicate through a network. It makes sure that both machine ‘speak’ the same language to understand each other’s messages.

There are many aspects to agree about: what is the information? how is it physically transported? what is its destination? How is it protected? How is it compressed? All these aspects of network communication ruled by different protocols organised in layers. OSI is the reference model to organise these protocols in 7 layers from the physical layer (e.g. transmission over a LAN cable or WiFi) to the application layer (e.g. email, web browsing, video streaming).

As designers of connected products, let’s focus on what we can influence.

Physical network technologies

The physical layer is the most tangible part of the network: how is the information transmitted physically?

Beyond the choice between wired and wireless, there are physical network protocols for all type of applications. However, it is always a trade-off between these four criteria:

In this context, cost should be understood broadly as the effort by stakeholders to switch to this ‘new’ infrastructure. It ranges from user acceptability (e.g. switching from WiFi to a new protocol) to environment restrictions (e.g. hospital regulation on wireless technologies).

As designers, you are at the centre of these network technology choices. With your holistic view on the context and the problem to be addressed, you the key factors that should influence the decision.

Network Topology

The network topology is how devices of a network connect or relate to one another. In this course, we emphasise the star topology as introduced in the first diagram in which devices communicate through a router (the centre of the start). All devices of the local network interact with a router which routes the traffic to its destination: another device on the local network or the next router on the Internet. It is a typical topology for a home, Internet-enabled environment.

However, there are other network topologies. For connected products, you might encounter bus and mesh topologies.

If all devices are connected to all devices, it is a fully connected network.

Network Technologies

Gateway and Hub

As we introduce different protocols, there is a need to connect networks of different protocols. This is the role of a gateway to translate information from a protocol to another.

For example, you might use multiple sensors on your body to collect information about how you exercise, through the ANT or Bluetooth protocols. Your phone will play the role of a gateway to transmit this information through the Internet.

Your home devices such as fridge, washing machine or light bulbs might communicate via Z-Wave or ZigBee. These devices require a gateway to connect to the Internet, e.g. to translate from these protocol to the Internet Protocol. A home hub play the role of a gateway among other tasks such as storing and processing data locally and controlling devices: the role of your Raspberry Pi in the course setting.

The following article presents three common types of devices architectures for connected products Connected Product Architecture.

The Message Queuing Telemetry Transport

Reading (15 minutes)

In this course, we will explore the two major protocol to exchange messages on top of the Internet Protocol: HTTP and MQTT. We will dedicate the next module to HTTP, the fundamental protocol of the web technology.

Message Queuing Telemetry Transport (MQTT) is a protocol designed to send messages between devices. All messages go through an MQTT server which receives the messages to be published and transmit them to all subscribers. MQTT clients are all devices connecting to the MQTT server to publish or subscribe:

MQTT

MQTT has two main advantages:

Events: callbacks and handlers

A key challenge of prototyping connected products is the code development on several devices. In this distributed context, we want to ask other devices to do tasks for us and let us know when it is done. This principle is also true inside our programme. Let’s introduce two examples:

In both cases, we need to wait, for the weather data or for user interaction. Meanwhile, we could sleep, nothing would happen, and regularly we would check if there is any change. Both tasks could be addressed with a loop, continuously asking:

We call this ‘pulling’ information. We go and get it ourself. A more efficient approach is to wait and ask to be notified want the results of the service has been received or when the user clicked on the button. This is what we call callback in the first example or handler in the second example.

Callbacks and handlers are functions which are called as a result of an event. In our case, we have the event ‘the weather forecast arrived’ and ‘the user clicked’.

What are the key advantages of this mechanism?

Is there a link with Python async/await keywords? Both are dealing with the challenge of letting an action being performed and coming back to it once it has been completed. In the course, each time we call a function that controls the lightbulb, the program is reaching out to the lightbulb over the network. A callback is called when the response from the lightbulb arrived. async tells Python that the function we call involves this mechanism. await tells Python that we want to wait until the results come back. It enables Python to manage the callback for us, returning the result of the request as the result of a ‘normal’ function instead of calling a dedicated callback function.

Quiz

Check your understanding with the following quiz! It is anonymous and you can try as many times as you want!

#4 Connect
Prototyping Connected Product - Module 4

Discovering devices on the network
Prototyping Connected Product - Assignment 4

TU Delft IoT Rapid-Proto Labs Erasmus +

The European Commission's support for the production of this publication does not constitute an endorsement of the contents, which reflect the views only of the authors, and the Commission cannot be held responsible for any use which may be made of the information contained therein.