by Jason Tollefson, Ian Saturley, USB and Networking Group, Microchip Technology
Here’s a simple explanation of how to build a hard-wired IoT network that doesn’t get clogged by network traffic.
Most people understand what the word reliable means. If you are driving across the Arizona desert, you want to be sure that the vehicle you choose is reliable so you don’t end up stranded. When you buy a new appliance, you will likely pay attention to reliability so you don’t replace it sooner than expected.
However, many people seem to have settled for unreliable internet connections for their internet-connected things. When it comes to making our devices work, shouldn’t reliability be just as important as the devices themselves? Consider the show you’ve been binge-watching online. Is there anything more frustrating than the spinning wheel or stalled progress bar?
Wireless technology is supremely convenient, but reliable is not the first adjective that many would select to describe it.
The Internet of Things (IoT) already consists of more than 5 billion end nodes and is going to 20 billion by 2020 (Gartner 2015). In addition, its applications will span several categories according to the Spanish wireless sensor maker Libelium Comunicaciones Distribuidas S.L.
Though IoT nodes are generally associated with low data rates, many IoT applications will still fight for limited bandwidth. A wireless router may be able to increase the reliability of streaming media with WiFi Multi-Media (WMM), but as more applications get on WiFi, bandwidth maxes out quickly.
For maximum reliable bandwidth, there’s nothing better than a wired connection.
Elements of a Wired IoT System
Consider an IoT network built from four Raspberry Pi single-board computers. The Raspberry Pi are connected to other nodes on the network by 10/100 fast Ethernet. Two connect directly to a five-port switch, while the others daisy-chain-connect through three-port switches with local microcontrollers (MCUs) to the five-port switch. This system is representative of a high-performance IoT system as might be found in a manufacturing environment, in homes or automated buildings, or in security/safety systems, to name a few applications.
The five-port switch has a gigabit Ethernet uplink. This switch configuration allows for superior bandwidth by providing a high-speed link to the resident PC. The PC connects to the gigabit Ethernet port using a bridge device. The bridge takes in gigabit Ethernet and converts it to Universal Serial Bus (USB) 3.1, communicating at 5 Gb/sec, and is then connected to the PC’s USB port.
Such a network could be replicated many times over by adding additional switches to the gigabit network.
This topology offers maximum reliable bandwidth by supplying adequate data rates across the entire network. Each Raspberry Pi is only capable of 100 Mb/sec. If the switch was merely a 10/100 switch, there would be a loss of bandwidth because of packet priority and collisions. With a gigabit switch, there is no loss of bandwidth. This topology also provides a cost-optimized solution as 10/100 networks are inherently less expensive.
The Raspberry Pi and MCUs in the system generate data on the network. In this example, the four Raspberry Pi each run a network performance measurement tool called “iperf.” The data generated includes bandwidth and packet loss.
Daisy-chained to the network are two MCUs. The two MCUs each run code provided by Interniche, an embedded networking software company. The code provides device management services, like Managed Information Base (MIB) and Object Identifiers (OID), that can be shared on the network with the Simple Network Management Protocol (SNMP). Also running is MQTT (formerly the MQ Telemetry Transport protocol). Created well before the concept of IoT, MQTT is a lightweight publish/subscribe messaging protocol suitable for IoT thanks to its minimal bandwidth requirement.
Once the network generates data on performance, the data should be displayed in a way that helps identify important characteristics. A weather map can depict the loading of the IoT network.
The weather map depicts full duplex conditions across the network. A color spectrum coding can provide an instant understanding of network load percentage. Orange and red can indicate high loading conditions.
In the accompanying diagram, the five-port switch resides in the middle of the network. In this representation, you can see that a high amount of data is sent to each network leg. However, the light blue and white colors of the upstream gigabit port show the perfect balance of this network as the loading is minimal. This shows that the bandwidth of each IoT node is maximized while the resident PC has ample bandwidth. If this network were hooked to a larger gigabit network, it would not flood the larger installation with data, so it provides maximum reliable bandwidth.
Wiring up an IoT application
If we were actually adding wired Ethernet to the network in this example, the end device would take the place of either one of the Raspberry Pi boards or the PIC32 Ethernet Starter Kit II.
There are three ways to add Ethernet to an application if it is not already present: adding an Ethernet controller, a bridge, or a physical layer (PHY). Ethernet controllers are used in applications where the MCU does not have an onboard Media Access Controller (MAC). There are several varieties that use Serial Peripheral Interfaces (SPI) or parallel interfaces to the MCU.
Bridges are typically used with a System on Chip (SoC) or Microprocessor Unit (MPU). Bridges use a USB or Peripheral Component Interconnect express (PCIe) interface to the processor and convert to Ethernet.
An Ethernet PHY or transceiver is used in applications with an MCU, SoC or MPU that has a MAC on board. The PHY is the physical Ethernet interface and requires a special processor interface. To extend the reach of the network, daisy chaining is a great option. A network switch is a device with two or more ports to allow for daisy chaining. Look for features such as virtual PHY, which lets the switch appear like a regular PHY in the system. This removes burden and risk when adding ports. An example can be found in Microchip’s LAN9303, where customers with a proven single port design can scale to a dual-port platform.
Hardware design has a lot to do with getting the maximum reliable bandwidth available using wired IoT. The speed of communications can be dramatically affected by board layout and the components used. It can be helpful to use an Ethernet supplier that provides design-check services. These services are often free and can result in significantly better results. The service should check your design schematic, provide printed circuit board (PCB) guidelines, and analyze your PCB layout and routing. These design checks can prevent multiple board design spins.
Diagnostics is another necessity. They are a feature of the network switch. The switch incorporates counters that the host processor can read. The illustration of a network weather map in the accompanying figure was generated using these counters. Diagnostics information can even be used as a service that generates revenue.
A Signal Quality Indicator (SQI) is a metric that can show the quality of the link between devices. It can also give an indication of a possible fault condition before an actual error is detected. Often, the failure mechanism is related to some environmental condition. Features such as SQI and switch counters can generate a long-term data set. This information helps anticipate failure, guide maintenance and minimize downtime.
All in all, it is not difficult to connect any processor based-application to the IoT using a wired connection. Supplier design checks when adding Ethernet by means of a PHY, bridge or controller can yield a highly reliable IoT application. When configured in a network using properly balanced sub-nets, like the example of the five-port switch, traffic delays are avoided and costs stay under control.
Libelium Comunicaciones Distribuidas S.L.
SNMP basics at Paessler AG