Reader small image

You're reading from  Internet of Things from Scratch

Product typeBook
Published inFeb 2024
PublisherPackt
ISBN-139781837638543
Edition1st Edition
Right arrow
Author (1)
Renaldi Gondosubroto
Renaldi Gondosubroto
author image
Renaldi Gondosubroto

Renaldi Gondosubroto is an accomplished software engineer and developer advocate in the tech community. With a wealth of experience in developing proprietary and open-source solutions, he has made significant contributions to numerous organizations and communities. Currently, he holds all 12 AWS certifications, along with 20 Microsoft Azure certifications. He has a Bachelor of Science in Computing and Software Systems from the University of Melbourne and a Master of Science in Computer Science from Columbia University. Outside of the industry, he is active in the academic community, with his research focused on IoT and Artificial Intelligence. Having spoken at over 40 events, conferences, and workshops, he has been an international speaker for the past six years, sharing his experiences and projects. He aims to build open-source solutions and deliver content that can help people achieve more value in what they do and promote best practices for practitioners.
Read more about Renaldi Gondosubroto

Right arrow

Understanding and Designing IoT Networks

Understanding and designing IoT networks is a critical part of the work that needs to be done in establishing and deploying such systems within your smart environments. In this chapter, we will discuss the types of networks that are commonly designed, including wired and short-range wireless networks, machine-to-machine (M2M) networks, and long-range wireless networks, and discuss the use cases of each of these types of networks. We will investigate the key considerations of what to choose as part of the design, including the range, power consumption, cost, and security. We will also discuss the trade-offs to make when designing the infrastructure of the system, and the challenges and opportunities in utilizing the emerging technologies that come with these choices.

You will learn about common design patterns in how these networks are formed, how the topologies discussed in the previous chapter come into play as part of these best practices...

Technical requirements

This chapter requires you to have the following hardware and software ready, grouped into two parts – Raspberry Pi hardware and software requirements for the practical:

  • Hardware:
    • Raspberry Pi 4
    • Power supply for Raspberry Pi 4
    • MicroSD card
    • Keyboard and mouse (external)
    • Computer screen
    • HDMI/DVI/VGA cable
    • Ethernet cable (optional)
  • Software:
    • Diagram design software of your choice (e.g., Draw.io)
    • Arduino IDE

The Raspberry Pi computer is a cheap, credit-card-sized but powerful computer that runs the Linux environment, while providing you with the ability to do everything a desktop computer can do, such as playing high-definition video, word processing, and making spreadsheets. It can interact with the environment around it through its input/output (IO) pins and can be used to control hardware projects through this. It is compatible with several programming languages such as Python, C, and C++.

We will be running our programs on the Raspberry Pi...

Understanding the fundamentals of network design

Before we head into seeing some best practices for designing networks, it is imperative that we have a good grasp of the networking concepts that go into designing them. So far, we have been looking at devices individually but not at the linking factor that brings them together: the connectivity that helps them communicate with one another as well as with the internet itself, hence the term smart objects. Here, we will illustrate some high-level concepts of how this is done in terms of the communication technologies needed and the seven layers of interaction that IoT goes through.

Ranges

Ranges determine the maximum distance at which devices can communicate with one another. They affect the area of coverage that the network can provide and the number of devices that can be connected. There is a vast variety of networking technologies, each with its own advantages and disadvantages on factors such as its range, its impedance by...

Defining the design of an IoT network

It is important for us to understand the building blocks of an IoT network and how they connect with each other to form an effective, optimized network that suits our use case. In this section, we will be discussing the components of the network and how they fit together to function as we need them to. It is important to note that this is certainly not exhaustive of the components that an IoT network would have, but it contains what almost all, if not all, networks would have, and shows you how to piece the components together to be able to then apply them to the different network designs that you will see in the next section. Before we jump into the components, however, it is important we understand how we define smart objects, their components, and how they fit within the network to best utilize them in our networks.

Defining what constitutes a smart object

A smart object often has many definitions. However, it is important that we understand...

Designing wired and wireless IoT networks

When choosing the method of how you want your network to be deployed, you always have many options. In most cases, most methods of deployment would work. However, the challenge has always been finding the right type of deployment with the appropriate configurations to best ensure that the network effectively delivers and performs as it needs to, in terms of both performance and cost. In this section, we will cover the most common types of deployments for networks, including wired and short- and long-range wireless networks, as well as some other types of deployments. As part of this, the considerations behind how each network can be optimized will be discussed as well. You will also get the opportunity to design your own network deployments based on select scenarios and become more confident in your network design skills and in the choices that you make as part of the network architecture.

The following is a table of common IoT wireless...

Practical – creating a Raspberry Pi Wi-Fi extender

In this chapter’s practical, we will create a Wi-Fi extender based on a Raspberry Pi. As part of this, we will be using the dnsmasq package, which will act as both the Domain Name System (DNS) and Dynamic Host Configuration Protocol (DHCP) server for the connections that we will need. DNS servers translate domain names into IP addresses, while DHCP servers automatically assign IP addresses and other network configuration parameters to devices on a network. We will also use the hostapd package, which will help set up one of the Wi-Fi modules as an access point.

Ensure that you have an active Wi-Fi router to connect to, alongside an Ethernet device we will be intending to bridge the Wi-Fi connection to.

You will be able to find any code segments used also located on GitHub, within the corresponding filename, in the raspberry_pi_wifi_extender subdirectory of Chapter02 at https://github.com/PacktPublishing/IoT-Made...

Summary

In this chapter, we learned the fundamentals of IoT networks based on the components they have and how to apply different topologies as design patterns to the networks. We also gained an understanding of the design of the networks themselves. We looked at designing wired and short-range wireless networks, long-range wireless networks, and M2M networks. When factoring design considerations such as cost and environment, designing networks is not only about finding something that works but also about doing so in such a way that the flow of information from one part of the network to another can be done optimally while still meeting the requirements that are put out.

Finally, we discussed how you can use this knowledge to design the flow of a Raspberry Pi router and implement it, all while connecting objects to it that would use it as a gateway. With this practical, you should have become more confident in designing IoT networks and gained an understanding of how to apply critical...

Further reading

For more information about what was covered in this chapter, please refer to the following links:

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Internet of Things from Scratch
Published in: Feb 2024Publisher: PacktISBN-13: 9781837638543
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Renaldi Gondosubroto

Renaldi Gondosubroto is an accomplished software engineer and developer advocate in the tech community. With a wealth of experience in developing proprietary and open-source solutions, he has made significant contributions to numerous organizations and communities. Currently, he holds all 12 AWS certifications, along with 20 Microsoft Azure certifications. He has a Bachelor of Science in Computing and Software Systems from the University of Melbourne and a Master of Science in Computer Science from Columbia University. Outside of the industry, he is active in the academic community, with his research focused on IoT and Artificial Intelligence. Having spoken at over 40 events, conferences, and workshops, he has been an international speaker for the past six years, sharing his experiences and projects. He aims to build open-source solutions and deliver content that can help people achieve more value in what they do and promote best practices for practitioners.
Read more about Renaldi Gondosubroto