0% found this document useful (0 votes)
45 views38 pages

Cec367 Iiot Unit II

The document provides an overview of three communication protocols: UART, SPI, and I2C. UART is an asynchronous protocol used for device-to-device communication with configurable settings, while SPI is a synchronous protocol that allows full-duplex communication between a master and slave devices. I2C is a two-wire synchronous protocol that supports multiple devices on the same bus, allowing for flexible data transmission and addressing.

Uploaded by

paranthamang18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views38 pages

Cec367 Iiot Unit II

The document provides an overview of three communication protocols: UART, SPI, and I2C. UART is an asynchronous protocol used for device-to-device communication with configurable settings, while SPI is a synchronous protocol that allows full-duplex communication between a master and slave devices. I2C is a two-wire synchronous protocol that supports multiple devices on the same bus, allowing for flexible data transmission and addressing.

Uploaded by

paranthamang18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

UNIT-II

UART
Introduction:
A UART (Universal Asynchronous Receiver/Transmitter) is a hardware device designed for
asynchronous communication. Unlike other communication protocols, UART is a hardware
communication protocol that uses asynchronous serial communication with configurable speed.
Asynchronous means there is no clock signal to synchronize the output bits from the transmitting
device going to the receiving end.
The UART component can be configured for Full Duplex, Half Duplex, RX only or TX only
versions. To assist with processing of the UART receive and transmit data, independent size
configurable buffers are provided. The independent circular receive and transit buffers in SRAM
as well as hardware FIFOs help to ensure that data will not be missed while allowing the CPU
to spend more time on critical real time tasks rather than servicing the UART. It is one of the
most used device-to-device communication protocols.

UART can be configured to work with many different types of serial protocols that involve
sending and receiving serial data. Serial communication uses only one line or wire to transfer
data bit by bit. Serial data transfer over two wires is possible in two-way communication. Serial
communications may require less circuitry and wires depending on the application and system
requirements, which reduces the implementation cost.
UART is mainly used by embedded systems, microcontrollers, and computers as a device-to-
device hardware communication protocol. In contrast to the other communication protocols,
UART uses only two wires for transmission and reception. In this case, we can configure the
data format and transmission speed.

Functions of the UART:


For outbound communications, it transforms parallel data into serial data. For inbound
communications, it transforms serial data into parallel data. The parity bit is added to outgoing
transmissions, and the parity bit is checked for inbound transmissions. Manages to interrupt
requests and device management, involving synchronizing the operating speed of the computer
and the device.
UART Connections
A serial format is used to transmit data. There are only two pins/terminals/ports, one for receiving
and another for transmission. Receiving pins are denoted by Rx, while transmitting pins are
denoted by Tx.The figure below illustrates how two UART devices communicate directly with
each other. A Tx from the first device is connected to an Rx from the second device, and vice
versa.

UART Connections
Data is sent parallel to the transmitting UART by a controlling data bus. Data will now be
transmitted serially, bit by bit, over the transmission line (wire) to the UART that will receive it.
In turn, this will convert the serial data into parallel for the receiving device. Asynchronous
means there are no clock signals; instead, it employs start and stop bits to signal the beginning
and ending of each data packet. By reading these bits, a receiving UART device knows when to
begin reading data packets and when to stop reading them.

Maintaining the baud rate is crucial. A Baud rate is simply the number of bits transferred in a
second, expressed in bits per second. In the serial port context, the set baud rate will serve as the
maximum number of bits per second to be transferred. Transmitter generates bitstream based on
its clock signal. Receiver samples the incoming data using its internal clock signal. Same baud
rate on both devices ensure synchronization and in-turn avoids discrepancies during data
handling. Allowable difference of baud rate is up to 10% before timing of bits get too far off.

Working of UART
The peripherals that use UART for data transmission send their data in parallel. E.g., if a
microcontroller wants to communicate with another peripheral using UART, it must first send
data to the UART in parallel format. UART devices collect all data and convert it to a serial
format. To create a complete data packet, they add the start bit, parity bit, and stop bit.
These data packets are sent by the transmitter (Tx) to the receiver (Rx). This data packet is
accepted by the receiving UART device, which removes all extra bits such as the stop bit, start
bit, and a parity bit. Then it converts the received serial data packet into the parallel format and
sends it further to the targeted peripheral.

UART Packet
Start Bit
The ideal UART data transmission line (Tx) state is logical high (meaning there is a high pulse).
In order to start transmission, the sender UART sets the TX line to low (which means it sends a
low pulse to the receiver RX), indicating that transmission has begun. As soon as the receiving
UART receives a low signal/pulse, it gets ready to receive data from the transmitter.
Data Frame
The data being transferred is contained in this part. A data frame can have a length of up to 9 bits
when the parity bit is not set or absent but is usually between 5 and 8 bits with the parity bit
included. In many cases, the least significant bit (LSB) is transmitted first.
Parity Bit
The receiver checks whether the data received is correct or not with this single bit field. This is
an optional bit. This field has odd parity and even parity. It is added as LSB in the original data.
Odd parity: When the total number of 1's (high bits) in the data frame is odd, then the parity bit
is set to 0, indicating odd parity.
Even parity: If the number of 1s in the data frame is an even number, then the parity bit will be
set to 1, indicating even parity.
Stop Bit
This bit indicates the end of the data packet. The transmitter sets the Tx (Transmission line) line
in the ideal state, i.e., in high state (High pulse), to indicate the end of transmission.

Steps of UART Transmission


First: Parallel data is received by the transmitting UART from the data bus.
Data bus to the transmitting UART
Second: A transmission UART will add the start bit, parity bit, and stop bit(s) to a data frame.

Transmitting UART
Third: Serially, the packet is sent from the transmitting UART to the receiving UART from start
bit to stop bit. Data is sampled on the receiving UART at the preconfigured baud rate.

UART transmission
Fourth: Start, parity, and stop bits are discarded by the receiving UART.

Receiving UART
Fifth: Receiving UARTs convert serial data back into parallel and send it to the data bus.
Receiving UART to the data bus
Advantages of UART
• Can be configured for Full Duplex, Half Duplex, RX only or TX only versions.
• There is no clock signal because it is asynchronous.
• Error checking using parity bit.
• Data format and transmission speeds are configurable.
• As long as both sides are set up for it, the structure of the data packet can be changed.
Disadvantages of UART
• The length of the data packet is limited to a maximum of 9 bits.
• The baud rates of every UART must be within 10% of each other.
• It does not support multiple slaves or masters therefore there are no multiple senders or
receivers.

SPI
Introduction:
The Serial Peripheral Interface (SPI) is a synchronous serial communication interface
specification used for short-distance communication, primarily in embedded systems. SPI is one
of the most extensively used interfaces between microcontrollers and peripheral ICs such as
sensors, ADCs, DACs, shift registers, SRAM, and other devices. It is Motorola designed
synchronous serial data protocol that serves as an interface bus that functions in full-duplex
mode, allowing data to be delivered and received concurrently.
SPI Interface

Serial Peripheral Interface (SPI) is a synchronous data bus, which means it uses distinct lines for
receiving and transmitting data and a clock to maintain both sides in perfect sync and an
addressing line. The main is the device that generates the clock signal. The data sent between the
main and the subnode is synced with the main's clock.
In comparison to I2C connections, SPI devices support substantially higher clock frequencies.
The clock frequency specification of the SPI interface should be found on the product datasheet.
The SPI bus will have four lines in total, which will be used to communicate between the master
and peripheral device:
• MOSI – Master Output, Slave Input
• MISO – Master input, Slave output
• Clock (SPI CLK, SCLK)
• Chip select (CS)

MOSI and MISO


MOSI and MISO's data lines are responsible for conveying data from the master to the slave,
while MISO is responsible for transmitting data from the slave to the master. Data is sent from
the main to the subnode via MOSI, and data is sent from the subnode to the main via MISO.
When the slave needs to respond to the master, the master will create a certain number of clock
cycles before the slave sends data across the MISO line.In SPI, unlike an asynchronous serial,
where data is delivered in either direction at any rate, the master knows how much and when
data is returned.

SPI Data Transmission

An SPI communication will typically start with:


• The master sends a clock signal through the SS line and selects a slave.
• The master will transmit a logic 0 signal to pick a slave, as this line is on an active low
signal.
• If a waiting period is required (for example, analog to digital conversion), the master
must wait for a certain amount of time before sending the clock signal.
SPI is a full-duplex interface, which means that both the master and slave can send data to each
other at the same time via the MOSI and MISO lines, and data is delivered concurrently between
the master and slave. The serial clock will keep everything in sync. For e.g., these two operations
will happen at the same time:
• On the MOSI connection, the master transfers data one bit at a time and slave reads it.
• On the MISO line, the slave sends the data one bit at a time to the master and master
reads it.
SPI allows us to choose whether to sample or shift data on the rising or falling edge of the clock.
The number of data bits to be transmitted is different for different device.

Clock Polarity and Clock Phase


There is no data exchange mechanism in SPI, which limits overhead and allows for high speed
and data streaming. The rising or falling edge of the data clock signal affects whether data is
transferred in and out in each SPI mode (known as the clock phase), as well as whether the clock
is idle at high or low frequencies (known as Clock polarity). Switching the clock polarity (CPOL)
and clock phase (CPHA) can form four unique modes to provide flexibility in communication
between master and slave.

The four transmission modes are listed in the table below:


Advantages of using SPI
• Full-duplex communication is supported, which means data can be transmitted and
received simultaneously.
• Better signal integrity, supporting high-speed applications.
• Only four signal lines are required for the hardware connection.
• The transceiver is not required.
• There is no need for the slave device to address.

Disadvantages of using SPI


• Short transmission distance.
• Unlike I2C, no flow control is provided, and no acknowledgment mechanism confirms
data receipt.
• The number of devices is approaching the practical limit of Pin ports.
• Unlike UART, there is no error check (using parity bit).
• Only additional signal lines can be used for interrupt operation.
• Only one master.

I2C
Introduction
I2C stands for Inter-Integrated Circuit and also known as TWI (Two Wired Interface). I squared
C. This bus interface connection protocol incorporated into devices for serial communication.
Philips Semiconductor initially designed it in 1982. Recently it has been a widely used protocol
for short-distance transmission. It is extensively followed for communication among
microcontrollers and sensor arrays, displays, IoT devices, EEPROMs etc.

I2C Communication Protocol


This is a sort of synchronous serial communication protocol. Data bits are transferred at normal
periods set by a reference clock line.
Features
Only two comm standard lines (wires) are required to control any device/IC on the I2C
network. There is no need for prior settlement on the data transfer rate like in UART
communication. So the data switch pace can be adjusted every time required. Simple mechanism
for validation of data transferred. It uses a 7-bit addressing machine to target a particular
device/IC at the I2C bus. I2C networks are easy to scale.

Working of I2C
It uses only two by-directional open-drain lines for SDA and SCL data communication. Both
these lines are pulled high.
• Serial Data (SDA) – Transfer of data through this pin.
• Serial Clock (SCL) – Fetches the clock signal.
I2C operates in 2 modes –
• Master mode
• Slave mode
All information bits transferred on the SDA line are synchronised by employing an excessive
low pulse of each clock on the SCL line.

According to I2C protocols, the information line cannot change when the clock; is excessive. It
can trade only when the clock line is low. The two lines are open drains; hence, a pull-up resistor
is required to keep the lines excessive for devices on the I2C bus that are active low. The statistics
are transmitted in the form of packets which incorporate nine bits. I2C data packets are arranged
in 8-bit bytes comprising slave address, register number, and data to be transferred. Transmission
over the bus is either a read or write operation. The reading and writing protocols build upon a
series of sub-protocols such as start and stop conditions, repeated start bits, address byte, data
transfer bits and acknowledge/not acknowledge bits.

Start and Stop Conditions


START and STOP may be generated via preserving the SCL line high and changing the level of
SDA. The SDA is changed from excessive to low to develop the START condition while
maintaining the SCL high. To generate the STOP condition, SDA goes from low to high while
keeping the SCL high, as shown in the figure below.

Repeated Start Condition


Between each start and stop circumstance pair, the bus is considered as busy, and no master can
take manage of the bus. If the master tries to start a new transfer and no longer wants to release
the bus earlier than beginning the new transfer, it troubles a unique START situation. It is called
a REPEATED START situation.

Read/Write Bit
An excessive Read/Write bit indicates that the master is sending the data to the slave, whereas a
low Read/Write bit means that the master is receiving records of information from the slave.

ACK/NACK Bit
After every data frame goes along with an ACK/NACK bit, if the data frame is obtained
successfully, the ACK bit is despatched to the sender.

Addressing
The address frame is the primary frame after the beginning bit. The deal with the slave with
which the master sends the master desire to communicate to every slave connected with it. The
slave then compares its address with this address and sends ACK. A slave address is sent in 8-
bit byte format, MSB first, but the last bit signifies whether the transaction will read or write to
the slave. In effect, the upper 7 bits, constitute the slave address, while the 8th bit serves as a
READ/WRITE# command bit. Thus, there is an address space of 128 unique addresses for
addressing up to 128 slaves.

I2C Packet Format


In the I2C communique protocol, the records are transmitted in packets. These packets are 9 bits
lengthy, out of which the first 8 bits are positioned in the SDA line, and the 9th bit is reserved
for ACK/NACK, i.e. Acknowledge or Not Acknowledge by using the receiver. START
condition plus address packet plus multiple data packets plus STOP condition together form an
entire Data switch.

Data Transmission In I2C


The master sends the start circumstances to each related slave via diverting the SDA line from
a high voltage level to a low voltage level earlier than switching the SCL line from high to low:

The master sends each slave the seven or 10-bit address of the slave it desires to communicate
with, alongside the read/write bit:
Each slave compares the address get off from the master to its address. If the address coordinate
with, the slave returns an ACK bit with the aid of pulling the SDA line low for one bit. If the
lesson from the master does not match the slave’s address, the slave leaves the SDA line
excessive.

The master sends or receives the data frame:


After each data frame has been conveyed, the receiving gadget returns any other ACK bit to the
sender to acknowledge victorious receipt of the frame:

To stop the data transmission, the master gets off a stop circumstances to the slave employing
switching SCL excessive before converting SDA high:

Single Master with Multiple Slaves


Because I2C uses addressing, more than one slave can be curbed by a single master. With a 7 bit
address, 128 (27) precise addresses are available. Using 10-bit addresses is uncommon but offers
1,024 (210) individual lessons. To join more than one slaves to a single master, wire them like
this, with 4.7K Ohm pull-up resistors connecting the SDA and SCL lines to Vcc:
Multiple Master with Multiple Slaves
Multiple masters can be related to a single slave or numerous slaves. The hassle with more than
one master inside the same device comes while masters attempt to send or receive facts
concurrently over the SDA line. Each master desires to detect if the SDA line is low or excessive
before transmitting a message to solve this problem. If the SDA line is down, another master has
control of the bus, and the master should wait to send the message. If the SDA line is high,
transmitting the statement is safe. To connect a couple of masters to a couple of slaves, use the
following diagram, with 4.7K Ohm pull-up resistors joining the SDA and SCL lines to Vcc:

Advantages
• It can be configured in multi-master mode.
• Complexity is reduced because it uses only two bi-directional lines (unlike SPI
Communication).
• Cost-efficient.
• It uses ACK/NACK attribute, due to which it has enhanced error handling capabilities.

Disadvantages
• Slower data transfer rate than SPI.
• The size of the data frame is limited to 8 bits.
• More intricated hardware needed to implement than SPI.
WIFI
In general, IoT applications have diverse requirements in terms of range, data rate, energy
efficiency and the cost of devices. WiFi is a wireless technology that provides local area network
connectivity and is well suited to support IoT applications that require high data rate and a
reasonably low latency. Due to the existence of in-building WiFi connectivity, it becomes a good
choice for some IoT applications.

Like a mobile phone, a Wi-Fi network uses Radio Waves to send data across a network. The
computer should include a wireless adaptor that converts data transferred to a radio signal. The
identical signals deliver to a router decoder through an Antenna. After decoding, the data is sent
to the Internet over a connected Ethernet connection. Because the wireless network is
bidirectional, data from the Internet will also transit via the router and coded into a radio signal
that the computer's wireless adapter will receive.

The first Wi-Fi standard was released in 1997. Since then, WiFi technology has been constantly
evolving to provide faster speeds and larger coverage. The name of existing WiFi standards are
listed in Table given below
Table : Names of existing WiFi standards

802.11b used the same 2.4 GHz frequency band with a bandwidth of 83 MHz and supported a
maximum data rate of 11 Mbps and had a range up to 150 feet. This technology used spread
spectrum technology and became very popular due to its cost. Almost at the same time, 802.11a
standard introduced a WiFi technology that operated in 5 GHz frequency band, and used OFDM
technology for its operation. Due to utilizing larger bandwidth (300 MHz), use of OFDM
technology and higher frequency band which is less prone to noise, 802.11a could support
maximum data rate of 54 Mbps. 802.11a did not become very popular mainly because its cost
was higher than 802.11b.

802.11g used both capabilities of 802.11a and 802.11b. It supports data rates of up to 54 Mbps
similar to 802.11a. It also uses the 2.4 GHz frequency for greater range, and it is backward
compatible with 802.11b. Therefore, 802.11g access points can work with 802.11b wireless
network interface cards. 802.11g became standard in 2003 and is also referred to as WiFi 3.
802.11n operated in both the 2.4 GHz and 5 GHz bands. It supported a maximum data rate of
600 Mbps. The main reasons for its better performance were the use of modified OFDM, an
enhancement in Layer 2 design, utilizing higher channel bandwidth, and support of up to four
spatial streams Multiple Input Multiple Output (MIMO) for spatial multiplexing. MIMO allows
multiple transmitters or receivers to operate simultaneously at one or both ends of the link and
provides a substantial increase in data rate. In 2018, WiFi Alliance decided to use a better naming
system for WiFi standards and called 802.11n as WiFi-4.

802.11 ac, also called WiFi 5, was a huge step in WiFi evolution. It supported maximum data
rate of above Gigabits per second. The technology operated exclusively in the 5 GHz frequency
band, supported up to eight spatial streams, utilized higher bandwidth of up to 160 MHz, and
took advantage of denser modulation technique. 802.11ac uses 256 Quadrature Amplitude
Modulation (QAM) up from 64QAM used in 802.11n.

802.11 ad (WiGig) operates on 60 GHz band (millimeter waves). The spectrum for this
technology is different in different parts of the world. In North America, 802.11 ad uses 57-64
GHz. WiGig is a very high data rate and low distance technology. 60 GHz was not a license
exempt band, but it became license exempt band after 2013. Due to existence of a large spectrum
of 7 GHz, it is possible to implement simple modulation techniques to achieve very high data
rates. For example, 7 Gbps can be achieved by using simple 1b/Hz modulation techniques instead
of using more complex methods. Due to small wavelength (millimeter wave), many antennas
can be put in a chip to make the antenna array. Due to the use of directional antenna and very
short distance coverage of this technology, the technology introduces low interference and
inherent security.

802.11 ax is one of the newest generation of Wi-Fi standard which is also called Wi-Fi 6. Wi-Fi
6 offers higher data rates and capacity, up to 9.6 Gbps, and operates in both 2.4 GHz and 5 GHz
spectrum. There also exists Wi-Fi 6E that supports an all-new 6 GHz spectrum, which has higher
throughputs and lower latency.

802.11ah (Wi-Fi HaLow) is a below one gigahertz wireless technology which operates in 900
MHz license-exempt bands. Since it uses a lower frequency band, it can offer longer range
wireless connectivity and therefore can provide robust connectivity in challenging environments.
It also provides lower power consumption as compared to other WiFi technologies and for this
reason meets the requirements for IoT.

Working of Wi-Fi

• In wireless network, nodes are mobile and the set of reachable nodes change with time.
• Mobile nodes are connected to a wired network infrastructure called access points (AP)
• Access points are connected to each other by a distribution system (DS) such as ethernet,
token ring, etc.
• Two nodes communicate directly with each other if they are reachable (eg, A and C)
• Communication between two stations in different APs occurs via two APs (eg, A and E)
• The technique for selecting an AP is called active scanning. It is done whenever a node
joins a network or switches over to another AP.
o The node sends a Probe frame.
o All APs within reach reply with a Probe Response frame.
o The node selects one of the APs and sends an Association Request frame.
o The AP replies with an Association Response frame
• APs also periodically send a Beacon frame that advertises its features such as transmission
rate. This is known as passive scanning.

Frame Format

􀂾 Control
- contains subfields that includes type (management, control or data), subtype
(RTS, CTS or ACK) and pair of 1-bit fields ToDS and FromDS.
􀂾 Duration
- specifies duration of frame transmission.
􀂾 Addresses
-The four address fields depend on value of ToDS and FromDS subfields. When one
node is sending directly to another, both DS bits are 0, Addr1 identifies the target node, and
Addr2 identifies the source node. When both DS bits are set to 1, the message went from a node
onto the distribution system, and then from the distribution system to another node. Addr1
contains ultimate destination, Addr2 contains immediate sender, Addr3 contains intermediate
destination and Addr4 contains original source.
􀂾 Sequence Control
- defines sequence number of the frame to be used in flow control.
􀂾 Payload
- can contain a maximum of 2312 bytes and is based on the type and the subtype
defined in the Control field.
􀂾 CRC
- contains CRC-32 error detection sequence.
Collision Avoidance
o Collision detection is not feasible, since all nodes are not within the reach of each
other.
o The two major problems are hidden and exposed terminals.
o In figure, each node is able to send and receive signals from nodes to its
immediate left and right.
o
.

Hidden Station
o Suppose station B is sending data to A. At the same time, station C also has data
to send to station A.
o Since B is not within the range of C, it thinks the medium is free and sends its
data to A.
o Frames from B and C collide at A. Stations B and C are hidden from each other.
Exposed Station
o Suppose station A is transmitting to station B and station C has some data to send
to station D, which can be sent without interfering the transmission from A to B.
o Station C is exposed to transmission from A and it hears what A is sending and
thus refrains from sending, even if the channel is available

Multiple Access with Collision Avoidance (MACA)


o The idea is for the sender and receiver to exchange short control frames with each
other, so that stations nearby can avoid transmitting for the duration of the data
frame.
o The control frames used for collision avoidance is Request to Send (RTS) and
Clear to Send (CTS).
o Any station hearing RTS is close to sender and remains silent long enough for CTS
to be transmitted back.
o Any station hearing CTS remains silent during the upcoming data transmission.
o The receiver sends an ACK frame to the sender after successfully receiving a
frame.
o If RTS frames from two or more stations collide, then they do not receive CTS.
Each node waits for a random amount of time and then tries to send RTS again
Handshake for hidden & exposed station
o B sends an RTS containing name of sender, receiver & duration of transmission.
o It reaches A, but not C.
o The receiver A acknowledges with a CTS message back to the sender B echoing
the duration of transmission and other information.
o The CTS from A is received by both B and C. B starts to transmit data to A.
o C knows that some hidden station is using the channel and refrains from
transmitting.
o The handshaking messages RTS and CTS does not help in exposed stations because
C does not receive CTS from D as it collides with data sent by A.
Solution for hidden node Handshake for exposed node
Advantages of Wi-Fi in IoT
• We can transport a wireless laptop from one location to another.
• We can reduce the expense of cables by using wireless network communication devices.
• Wi-Fi setup and configuration are much more straightforward than wiring.
• It is fully secure and will not disrupt any network.
• We may also use hot spots to connect to the Internet.
• Wireless internet access is possible.
Disadvantages of Wi-Fi
• Wi-Fi emits radiation that is harmful to human health.
• When we are not utilizing the server, we must terminate the Wi-Fi connection.
• There are certain limitations to data transfer; we cannot transport data across great
distances.
• When compared to a conventional connection, Wi-Fi deployment is more costly.
Applications of Wi-Fi
• Apps for smartphones
• Applications for business
• Applications for the home
• Computerized software
• Automotive industry
• Video conferencing while surfing the Internet

Router/Gateway

Introduction:
The task of receiving, examining, and forwarding data packets from the network to linked
computers is carried out by a router, which is a switching device. WiFi or Ethernet-connected
devices are connected to local network by a home router, which functions as a traffic controller,
tunneling information between them and out to the modem.

Also, the corporate router is equipped with more powerful features than a residential router, like
flash memory and VPN service. Also, there are options for both wireless and wired
routers. A Bluetooth router is a device that extends range while enabling the connection and
control of several Bluetooth devices. Similar to a Wi-Fi router, Bluetooth routers operate. Some
Bluetooth extenders can carry our signal up to three walls and 1,000 feet of open space.

The Internet of Things IOT Router is a rapidly growing technology that is changing the way we
live, work, and play. With millions of connected devices, IoT has the potential to create a smarter
and more connected world. To make this a reality, it is crucial to have the right infrastructure in
place. One critical component of this infrastructure is an IoT Router.

An IoT Router is a specialized device that is designed to manage the flow of data between IoT
devices and the internet. Unlike traditional routers, IoT routers are optimized for IoT devices and
their unique requirements. They provide secure, reliable, and efficient connectivity for IoT
devices and networks.
There are several key benefits of using an IoT Router in an IoT network.
1. Security: IoT routers provide advanced security features such as firewall, encryption,
and VPN support. This ensures that IoT devices and the data they generate are
protected from cyber threats.
2. Scalability: IoT networks can quickly grow as new devices are added, and an IoT
Router provides the ability to manage and scale the network efficiently.
3. Reliability: IoT routers are designed to be highly reliable and to provide 24/7
connectivity to IoT devices. This is essential for applications where downtime is not
an option, such as smart homes and factories.
4. Performance: IoT routers provide fast and efficient connectivity, with low latency
and high bandwidth. This is essential for IoT devices that need to transmit large
amounts of data in real-time.
When a packet enters a network through one port, the router scans the address information to
identify the correct destination before using a routing table or routing policy to send the packet
to the next network or hop. An overlay network may be built using a router, which can send and
receive data packets between computer networks.

In contrast, IoT gateway devices connect many systems. A gateway is an element of a network
that enables communication across networks using various protocols. A gateway is a network
node that serves as an access point to another network. The gateway may also enable an internet
connection for the PC via the network.

Using communication technologies, the end devices (sensors, actuators, or more complicated
devices) and backend systems (data, device, and subscriber administration) are linked to the IoT
gateway. It has a computational platform that makes it possible for built-in or user-defined
programs to manage data, devices, security, communication, and other gateway-related tasks (for
routing and computing at the edge). In essence, an IoT gateway serves as a central hub for smart
IoT devices. Internet of Things (IoT) gateways connect IoT devices to one another and the cloud,
translating IoT device communication and filtering data into meaningful information.

An IoT gateway is a hardware that serves as a gate between networks, but a router is a
networking layer system used to control and forward data packets to devices network. Although
they have some commonalities, they serve different scenarios. Knowing key differences between
routers and gateways helps us to decide which one to use.

Routers are commonly used in homes and small businesses to connect multiple devices to the
internet. IoT gateways are specialized devices designed to provide connectivity, security, and
management for IoT devices. IoT gateways are used in industrial and enterprise settings to
connect a large number of IoT devices and sensors to a cloud platform or data center.

IoT gateways typically have multiple wireless and wired interfaces to support a variety of IoT
protocols, such as Zigbee, Z-Wave, Bluetooth, Wi-Fi, and so on. IoT gateways also provide
advanced features such as protocol translation, data aggregation, and edge computing
capabilities. Protocol translation allows the gateway to translate between different IoT protocols
and enables the communication between devices that use different protocols.
Data aggregation allows the gateway to collect data from multiple devices and send it to a cloud
platform or data center. Edge computing capabilities allow the gateway to perform data
processing and analytics at the edge of the network, reducing the amount of data that needs to be
sent to the cloud.

When deciding whether to choose a router or an IoT gateway, it is important to consider our
specific use case and requirements. If we are setting up a small home or office network and only
need basic networking capabilities, a router would be sufficient for our needs. However, if we
are working with a large number of IoT devices and need advanced features such as protocol
translation, data aggregation, and edge computing, an IoT gateway would be a better option.
Figure below shows example of IoT gateway/Router implementation.

Although both IoT gateways and routers are crucial elements in the design of IoT systems, their
functions and benefits vary. IoT gateways have the following benefits over routers.

• Protocol translation
IoT gateways convert IoT device protocols into a standard format that the cloud or
other apps can easily handle. This protocol translation feature connects IoT devices to
the cloud regardless of communication protocol. However, routers rarely support
protocol translation.
• Security
To safeguard IoT devices and data from online dangers, IoT gateways may be fitted
with strong security capabilities. The use of firewalls, intrusion detection, and
prevention systems, and encryption are examples of security measures that smart
gateway may use.
• Edge processing
Prior to being sent to the cloud, IoT gateways may process and analyze IoT data at
the network’s edge. This facilitates quicker and more effective decision-making by
lowering latency and bandwidth needs. Usually, routers lack this functionality.
• Scalability
IoT gateways are designed to facilitate widespread IoT device installations. They can
support several communication protocols and a huge number of devices. On the other
hand, routers may not be built to handle the special needs of IoT devices.
Understanding Wireless Routing for IoT Networks
The possibility of using IP-based networks could greatly reduce the energy and costs associated
with wireless IoT communication, which would otherwise need expensive mobile-tower
connectivity and GSM/EDGE-based communication.

The routing of data from source to sink is an integral part of any large-scale wireless sensing and
Internet of Things (IoT) solution. Unplugged and/or mobile embedded devices used in such low-
powered and lossy network (LLN) applications are always severely constrained in terms of
available power. Therefore, energy-efficient routing of data becomes critical to any long-term
sustainable solution.

Background
Many large-scale wireless data acquisition and actuation related applications use low-powered
embedded devices. These applications include precision agriculture, building
management/industrial automation, vehicular ad-hoc networks (VANETs), and urban
networks/energy and water grids to build smarter cities. In these wireless sensor networks, the
embedded devices function under severe energy constraints, which results in computation,
storage, and radio-transmission related constraints. They also communicate over a lossy channel.

The low-powered embedded devices in such applications do not work in isolation and often are
part of a larger wireless network, usually involving hundreds or thousands of similar other
devices (or field nodes). These field nodes may enter or leave the network at arbitrary times. The
wireless routing solution, then, should be highly energy-efficient, scalable, and autonomous.

Low-powered and lossy networks (LLNs) typically consist of sensors, actuators, and routers that
communicate wirelessly with each other. Unlike sensors and actuators, though, routers generally
do not suffer from (long-term) resource constraints. Routers that connect LLNs to the wider
Internet infrastructure are known as LLN border routers (LBRs).

Traffic patterns and data flow within an LLN are highly directional. The patterns can be defined
as multipoint-to-point traffic (MP2P), point-to-multipoint traffic (P2MP), or point-to-point
traffic (P2P). In MP2P traffic, for example, sensed information from multiple sensing nodes is
routed to an Internet application via an LBR. P2MP traffic is observed when a query request is
made from the Internet (outside the LLN) and routed via the LBRs and LLN routers to multiple
field nodes. P2P traffic occurs when control information needs to be sent to a specific actuator
or alert information is received from a specific sensor.

The Internet Engineering Task Force (IETF) has created working groups (WGs) to better
understand the energy-efficient routing protocol requirements for application scenarios like
urban/city-wide networks (RFC 5548), building automation/management systems (RFC 5867),
industrial automation systems (RFC 5673), and home automation (RFC 5826).

Urban Wireless Sensor Networks


Many projects related to urban sensing are looking to monitor and track many of our urban
resources and environmental conditions. The MIT Senseable city lab has several projects running
to understand the “real-time city” for monitoring the “removal-chain,” which is the opposite of
the supply chain of products, in projects like Trash Talk and Real Time Rome. IBM has been
implementing its Smart Cities technologies in more than 100 cities around the world.

Urban networked applications like these represent a special type of LLNs with their unique set
of wireless routing requirements. The Real Time Rome project used aggregated people density
data from mobile telecom operators and GPS location data of public buses communicated via
cell tower connectivity.

Building a sustainable solution that will allow data collection, aggregation, and display, though,
would require implementing a low-powered mesh network that can route data among devices
that are wirelessly connected and powered using low-energy sources. The RFC documents
describe the key functionality and routing requirements for urban LLNs:

• Deployment of nodes: In a typical urban network deployment, hundreds or thousands of nodes


with pre-programmed functionalities are rolled out. Pre- or post-roll-out, the network
initialization phase may include allocation of addresses, (hierarchical) roles in the network,
synchronization, and determination of schedules. Post-roll-out, in the resulting topology there
may be some node that can connect through multiple (redundant) paths, while some other nodes
may depend on critical links to achieve connectivity. The routing protocol should account for
these factors and support self-organization and self-configuration at the lowest possible energy
cost.

• Association and disassociation of nodes: After the initialization phase, nodes may join or leave
the network at arbitrary times. The routing protocol also should be able to handle situations where
a malfunctioning node may affect or jeopardize the overall routing efficiency.

• Regular measurement reporting: Most field nodes are configured to report their readings on a
regular basis (once per hour, per day, etc.). The data routing computation and selection may
depend on the sensed data, the frequency of reporting, the amount of energy remaining in the
nodes, the recharging pattern of the energy-scavenged nodes, or other factors.

• Queried measurement reporting: External applications can launch queries on the urban
network. For instance, the level of pollution at a specific point or along a given road may need
to be known. Round-trip times—i.e., from the launch of a query from a node to the delivery of
the measured data to a node—are important. (The latency is not very stringent, but it should be
smaller than the reporting intervals.)

• Alert reporting: Rarely, the sensing nodes may measure an event that is classified as an alarm,
which is usually when the sensed data is crossing a threshold. Routes for reporting an alarm need
to be unicast (toward an LBR) or multicast (toward multiple LBRs).

• Scalability: The routing protocol must be able to support a field deployment of a few hundred
to tens of thousands of sensor nodes without deteriorating selected performance parameters
below configurable thresholds.

• Parameter constrained routing: The protocol must be able to advertise node capabilities (CPU,
memory size, available battery level) that it can use for routing decisions. The field nodes are
required to dynamically compute, select, and install different paths toward the same destination,
depending on the nature of the traffic.

• Support of autonomous and alien configuration: Given the large number of nodes, manually
configuring each node is not feasible. The scale and the number of possible topologies require
the network to self-organize and self-configure according to some prior defined rules and
protocols, as well as allow externally triggered configurations.
• Support of highly directed information flows: Urban networks often route sensed data from the
field nodes to Internet-based applications via the LBRs. As the nodes are spatially dispersed, and
as the data gets closer to the LBR, the traffic concentration in the nodes nearest to the LBR
increases, causing load imbalances in those nodes. The routing protocol must be able to
accommodate traffic bursts by dynamically computing and selecting multiple paths toward the
same destination.

• Support of multicast and anycast: The routing protocol must have an addressing scheme that
can support routing to a single field device (unicast), routing to a set of nodes subscribed to the
same group (multicast), and routing to multiple field nodes that all can be addressed by the same
Internet protocol (IP) address (anycast).

• Network dynamicity: The field nodes may dynamically associate, disassociate, or disappear
from the urban network. The field node dynamics should not impact the routing in the entire
network, so the routing protocol should have an appropriate updating mechanism to be informed
of changes in field node status. The protocol should use this information to perform the required
routing level reorganization and reconfiguration to maintain overall routing efficiency.

• Latency: The routing protocol should support the ability to route based on different
latency/delay requirements. Urban networks can tolerate delays as long as the information arrives
in a proportionate time compared to the reporting time. (If the time is every few hours, latency
can be a few seconds.)

IPv6-Enabled Wireless Routing Protocol For LLNs (RPL)


The entities and devices involved in building a routing-enabled IoT solution are unable to
maintain state information due to memory and storage constraints. They also can’t maintain
optimizations and overheads in transmitting control information due to energy and other routing-
related constraints.

IoT solutions tend to grow considerably big in scale as well. Hence, the routing protocol needs
to provide routing table scalability and packet loss response. Traditional routing protocols such
as Open Shortest Path First (OSPF), Optimized Link State Routing (OLSR), and Ad-Hoc On
Demand Vector (AODV) were unable to meet the performance requirements for an IoT solution
with such characteristics. The IETF Routing over LLN (RoLL) Working Group developed an
IPv6 enabled routing protocol known as Routing Protocol for LLNs (RPL), which offers:

• Routing state propagation: RPL uses the Trickle algorithm for scalable state propagation. The
Trickle algorithm allows nodes in a lossy shared medium like low-power and lossy net works to
exchange information in a highly robust, energy efficient, simple, and scalable manner. Trickle
dynamically adjusts transmission windows so new information spreads very quickly while only
a few messages are transmitted when information does not change.

• Spatial diversity: Since nodes can dynamically appear and disassociate or disappear, RPL
requires a router to maintain multiple potential parents toward a destination instead of a single
one.

• Expressive link and node metrics: LLNs have significant link-cost variation across multiple
dimensions (e.g., reliability, latency). RPL uses a flexible framework such as estimated number
of transmissions (ETX) for incorporating such dynamic link metrics.
Fundamental Building Blocks Of RPL
At its core, RPL organizes its topology as a directed acyclic graph (DAG) that is partitioned into
one or more destination-oriented DAGs (DODAGs), with one DODAG per sink (see the figure).
Each node in a DODAG, which is akin to a routing device in an IoT solution, has a node rank
that defines the node’s position relative to other nodes with respect to a DODAG root. The exact
way RPL node rank is computed depends on the DAG’s objective function (OF). An OF defines
how routing metrics, optimization objectives, and related functions are used to compute rank. In
essence, the OF dictates the DODAG formation. The RPL topology is built using control
messages that are transmitted as ICMPv6 messages. The three key RPL control messages are:

• DODAG information solicitation (DIS): The DIS solicits a DODAG information object
(DIO) from an RPL node.
• DODAG information object (DIO): The DIO carries information that allows a node to
discover a RPL Instance, learn its configuration parameters, select a DODAG parent set,
and maintain the DODAG.
• Destination advertisement object (DAO): The DAO is used to propagate destination
information upward along the DODAG.

To construct the DODAG topology, nodes may use a DIS message to solicit a DIO, or they may
periodically send link-local multicast DIO messages. Nodes then listen for DIOs and use their
information to join a new DODAG or to maintain an existing DODAG. Based on information in
the DIOs, the node chooses parents that minimize the path cost to the DODAG root.

A successful implementation of the RPL could enable an IoT solution to meet its stated objective
functions and goals. In the scope of RPL, a typical goal is to construct the DODAG according to
a specific OF and to keep connectivity to a set of hosts. RPL is specifically optimized for MP2P
and P2MP traffic patterns. Nodes are stateless, and the routing state information stored in each
node is minimal. RPL also accounts for both link and node properties when choosing paths. And,
link failures do not trigger a global network re-optimization.

For a large-scale IoT deployment (involving thousands of nodes and spread over a large
geographical area), when the routing design and implementation minds the various features,
functionalities, and attributes available in the RPL, the IoT solution could get a battery lifetime
of years. The possibility of using IP-based networks could greatly reduce the energy and costs
associated with wireless IoT communication, which would otherwise need expensive mobile-
tower connectivity and GSM/EDGE-based communication. Such an RPL implementation could
dramatically alter the rollout of IoT solutions for applications such as urban sensing networks.

The RPL topology includes a DAG with multiple roots and no cycles and a DODAG, or a DAG
rooted at a single destination (no outgoing edges).
Building a DODAG
1.Starts at the root node – LBR (LLN Border
Router).
It is Gateway to the Internet. Many LBRs can
exist in the same network. Uses new ICMPv6
control messages such as DIO , DAO, DIS for
RPL.
Where
▪ Edges – LLN connections
▪ Values – e.g. ETX
▪ Can change in time
▪ Using an average value some stability can
be ensured
▪ Goal (OF) – minimize ETX

2.The LBR sends a DIO message to its


neighbors as Link local multicast.
▪ Nodes A, B, C receive and handle it
▪ Many DIOs can be received in the same
time, from different LBRs
▪ Based on the OF and other criteria, they
decide to join the DODAG or not
▪ If yes, the LBR is marked as parent

3.The DIO timer of node C expires


4.C sends a multicast DIO message to its
neighbors.
5.The LBR ignores it, as it come from a higher
ranked node
▪ Rank(LBR) = 0, Rank(C) = 1
▪ Needed to avoid loops
6.B marks C as an alternative parent
7.E joins the DODAG, marks C as a
parent.

8. The DIO timer of node A expires.


9. Sends a multicast DIO message to its
neighbors.
10. The LBR ignores it.
11. B marks A as an alternative parent.
12. As the OF (ETX) value is better if B
connects through A, B deletes the LBR and
C from its parents.
13. The construction of the DODAG is
continuous.
14. The DODAG is continuously
maintained.

MP2P (Multi-Point to Point) traffic


▪ MP2P traffic along the DODAG, from each
node to the LBR
▪ UPWARD routing
▪ The LBR connects to the Internet
▪ A node can participate in parallel in several
DODAGs

P2MP (Point to Multi-Point)traffic


▪ DOWNWARD routing
▪ Routing information has to be built

▪ DAO (DODAG Destination Advertisement) messages


▪ If a node joins a DODAG, sends a DAO to its parents.
▪ Can be initiated by the LBR as well, or any intermediate node in the DODAG.
▪ Marked in the DIO message going downwards.
▪ The DAO timers (DelayDAO) are set so as to expire first at higher ranked nodes in the
DODAG.
▪ The advertise in the DAO message the network prefix reachable through them.
▪ LLN nodes sometimes are not able to store routing entries
▪ If yes – storing mode
▪ If possible, it aggregates the prefix of its children with his own prefix, and send
this aggregated value forward
▪ If not – non-storing mode
▪ Source-routing: the DAO message contains the path
▪ Either storing mode or non-storing, the hybrid solution was
not standardized ▪ Even if it was included in the first drafts
▪ Advantages nd drawbacks
▪ In storing mode routing entries have to be stored, but short messages
▪ In non-storing mode nothing has to be stored but long messages, increased
energy consumption.
P2P (Point-to-Point) traffic
Between any two S (Source) and D (Destination) nodes
▪ If non-storing mode:
• From S, we have to go towards the LBR along the DODAG
• Then source routing from the LBR to D
▪ If storing mode:
▪ Shortcut at the first common ancestor

DODAG maintenance:
Joining
▪ When a node appears (it is switched on, or it moves the the given area), it starts
listening to DIO messages.
▪ If it receives such messages, it decides which DODAG to join.
▪ If it receives nothing, or if it wants to speed up the process, it sends a DIS
message.
▪ DODAG Information Solicitation
▪ Triggers the sending of DIO messages from its neighbors.
▪ If still no DIO is received, it has the choice to become the root of a floating
DODAG.
▪ Starts sending its own multicast DIO messages.
Ethernet
Introduction
Ethernet is the most commonly used Local Area Network (LAN) technology which provides a
wired connectivity scheme to connect many IoT devices together using an Ethernet switch.
Connecting the Ethernet switch to an Internet Protocol (IP) router can give IP connectivity to all
those IoT devices. Ethernet can provide IoT connectivity for stationary or fixed IoT devices. The
IoT devices need to be connected to an Ethernet switch using cables. Ethernet technology
requires that the distance between the devices and the switch be small in range of tens of meters.
Therefore, due to the limitations required by Ethernet standard as well as the cost of cabling, the
IoT devices that use Ethernet as IoT connectivity should be located very close to each other.

In applications where the IoT devices are not mobile and their locations are close to each other,
Ethernet can provide a networking solution with low latency and very fast data rate. Ethernet
was developed as a 10 Mbps network in 1980s and advanced to fast Ethernet (100 Mbps), gigabit
Ethernet (1 Gbps), 10 Gbps, 40 Gbps, 100 Gbps, and above 100Gbps. The market drivers for
higher speed Ethernet are the data centers or Internet media providers as well as video service
providers. These types of high-speed Ethernet technologies are also used by the Internet Service
Providers (ISP) and enterprise LANs. Terabit Ethernet (TbE) is an Ethernet with speeds above
100 Gbps. IEEE P802.3bs Task Force has approved 200 Gbps and 400Gbps Ethernet standards
and several networking manufacturers are offering devices operating in 200 Gbps and 400 Gbps.
The very high-speed Ethernet is not a requirement for most IoT applications. On the contrary,
many IoT devices produce small amounts of data. The data rate of the slowest Ethernet
technology often is more than enough for those IoT applications. Even in the smart factories and
industrial applications with high data rate requirements, the data rate of newer Ethernet standards
would not be needed.
Traditional Ethernet does not support any quality of service and it supports only best-effort
service. This reduces the complexity of the network and enables simple protocol operations
which consequently brings down the cost of Ethernet interfaces. Regardless of the huge success
of Ethernet during past decades, the lack of support for devices with different QoS requirements
has become a major drawback for the use of this technology in some IoT applications.

Ethernet was not originally designed to meet the requirements needed for guaranteed real-time
communication. For example, many automation applications have made modifications to the
Ethernet which resulted in creation of several bus systems to handle time critical traffic more
efficiently. Examples of these systems are Fieldbus (IEEE 1394), Ethernet for Controlled
Automation Technology (EtherCAT), and Process Field Network (ProFiNet). There also exist
many industrial Ethernet protocols that have been created by different manufactures and industry
alliances. Some compatibility issues may arise due to the fact that most of the industrial Ethernet
networks are not based on standards.

In a smart factory, data needs to be collected and analyzed in a timely manner and the real-time
connectivity and availability is crucial in operation and processing. Unfortunately, traditional
Ethernet does not support time synchronization using global timing information in its network
elements. Traditional Ethernet also lacks a network management scheme for bandwidth
reservation or policy enforcement schemes to ensure a guaranteed QoS level for its connected
devices.

For this purpose and due to existence of traditional Ethernet shortcomings, IEEE 802.1 TSN
Task Group has defined a set of Ethernet sub-standards called Time-Sensitive Networking (TSN)
or Ethernet TSN. TSN extends Ethernet standards to create a convergence between time critical
data and less time critical data. The most important parameter for time critical data is availability.
Ethernet TSN defines the physical layer (Layer 1) and data link layer (Layer 2) based on Open
Systems Interconnection (OSI) model. It should also be noted that the Internet Engineering Task
Force (IETF) has formed the DETerministic NETwork (DETNET) working group which works
on the network layer (Layer 3) and higher layer techniques for adaption to the new requirements.

A TSN flow is identified by a traffic class which is characterized according to the QoS properties
such as latency, jitter and bandwidth. A TSN packet contains a Virtual Local Area Network
(VLAN) tag based on 802.1Q standard and a Priority Code Point (PCP). The value of PCP and
VLAN tag are application oriented. Using these values, different traffic with different
requirements can be differentiated. Industrial automation applications sometimes need low
latency and jitter requirements in range of microseconds and high bandwidth requirements in
gigabit range, while power grid applications may need less bandwidth and can tolerate higher
latency measures.

TSN guarantees the latency for real time critical data. Both time sensitive and non-time sensitive
data traffic can coexist in the network using the same infrastructure. In other words, we can have
several devices connected to a TSN switch with time sensitive data, while exist other devices
that generate non-critical data. To be able to provide a sense of time to the network, it is essential
that all network equipment such as switches and terminals on the network are time synchronized
and have the same understanding of time. To be able to guarantee the timely delivery of packets,
traffic scheduling is also needed besides time synchronization. All devices connected to a TSN
Ethernet switch are time synchronized and know the network scheduling information as regards
packets forwarded to them by the TSN switches. Each switch in the network has several queues
and performs packet forwarding based on the schedule that can calculate, predict and ensure the
timely delivery of the packets.
Ethernet TSN defines a concept called Preemption which reduces the transmission latency for
high priority frames. It allows high priority packets to interrupt low priority ones in transmission,
which minimizes the latency of high priority traffic. This feature is especially effective on lower-
speed networks such as standard Ethernet or fast Ethernet carrying large Ethernet packets. Since
Ethernet uses a variable length packet forwarding scheme, a large size low-priority packet might
be delayed by higher-priority traffic in the network. In a high traffic situation, this large size low-
priority packet might even be dropped. Preemption fragments the large packets into smaller
pieces which get reassembled in the next TSN switch in order to maximize the bandwidth
utilization. This allows for small pieces of large low-priority packets to go through the network
any chance that they get.

Physical Properties

􀂾 Ethernet uses Manchester encoding scheme and digital signaling (baseband) at 10 Mbps.
􀂾 Hosts connect to the Ethernet segment by tapping, each at least 2.5 m apart.
􀂾 The transceiver is responsible for transmitting/receiving frames and collision detection.
􀂾 Protocol logic is implemented in the adaptor.
􀂾 The various forms of Standard Ethernet are 10Base5, 10Base2, 10Base-T & 10Base-F
10Base5 (Thick Ethernet)
􀂾 Thick Ethernet uses bus topology with an external transceiver
􀂾 Collision occurs only in the thick coaxial cable.
􀂾 The maximum length of the cable must not exceed 500m.
10Base2 (Thin Ethernet)
􀂾 Thin Ethernet also uses bus topology, but the cable is much thinner and more flexible.
􀂾 The transceiver is part of the network interface card (NIC).
􀂾 The length of each segment should not exceed 185m and is less expensive.
10Base-T (Twisted-Pair Ethernet)
􀂾 10Base-T uses a star topology.
􀂾 The stations are connected to a hub via two pairs of twisted cable.
􀂾 The maximum length of the twisted cable is 100m
􀂾 Collision happens in the hub only.
10Base-F (Fiber Ethernet)
􀂾 10Base-F uses star topology to connect stations to a hub.
􀂾 Stations are connected to the hub using two fiber-optic cables with a max. length of 2000m.

Frame Format

􀂾 Preamble—contains alternating 0s and 1s that alerts the receiving system and enables it
to synchronize its input timing.
􀂾 Destination address—contains physical address of the destination host.
􀂾 Source address—contains the physical address of the sender.
􀂾 Type/Length—It may contain either type of the upper layer protocol or frame length.
􀂾 Data—carries data (46–1500 bytes) encapsulated from the upper-layer protocols.
􀂾 CRC—the last field contains error detection information (CRC-32).

Addressing
􀂾 Each host on the Ethernet network has its own network interface card (NIC).
􀂾 NIC provides a globally unique 6-byte physical address (in hex, delimited by colon).
o Each manufacturer is given a unique prefix (3 bytes).
􀂾 If LSB of the first byte in a destination address is 0, then it is unicast else multicast.
􀂾 In broadcast address, all bits are 1s.
Transmitter algorithm
􀂾 Ethernet is a working example of CSMA/CD.
􀂾 Minimum frame length (64 bytes) is required for operation of CSMA/CD.
􀂾 Signals placed on the ethernet propagate in both directions and is broadcasted over the entire
network.
􀂾 Ethernet is said to be a 1-persistent protocol. When the adaptor has a frame to send:
o If line is idle, it transmits the frame immediately.
o If line is busy, it waits for the line to go idle and then transmits immediately.
􀂾 It is possible for two (or more) adaptors to begin transmitting at the same time.
In such case, the frames collide
o A 96-bit runt frame (64-bit preamble + 32-bit jamming sequence) is sent and
transmission is aborted.
􀂾 Retransmission is attempted after a back-off procedure (k × 51.2μs)
Receiver algorithm
􀂾 Each frame transmitted on an Ethernet is received by every adaptor on that network.
􀂾 Ethernet receives broadcast frames, frames addressed to it and multicast frames if it belongs
to that group. Otherwise frames are discarded
􀂾 Receives all frames, if it runs in promiscuous mode.
􀂾 Ethernet does not provide any mechanism for acknowledging received frames, making it as
an unreliable medium.

Ethernet Configuration
Although multiple IP addresses can be assigned to each NIC, we do not configure either NIC
such that it has an IP address that is in the same subnet as an IP address on the other NIC. In this
scenario, packet loss occurs with packets originating from the IP on the NIC that does not have
the default gateway. Consider the following example configuration:

• eth0 is configured with the default gateway of 192.168.1.1


• eth0 is assigned with 192.168.1.5
• eth1 is assigned with 192.168.1.10
• Both eth0 and eth1 are connected to the same subnet switch

Given this configuration, traffic from both NICs are sent to the default gateway (192.168.1.1)
regardless of which NIC received traffic. Switches configured with dynamic ARP send packets
randomly to either eth0 (192.168.1.5) or eth1 (192.168.1.10), not both. When eth0 receives these
packets from the switch destined for eth1, eth0 drops the packets. Some switches are configured
with static ARP. These switches drop all packets received from eth1 since this NIC does not have
the default gateway and is not present in the static ARP table of the gateway. If you wish to
configure redundant NICs on the same subnet, us e NIC teaming.

By default, Dynamic Host Configuration Protocol (DHCP) is enabled for our B Series
Appliance. DHCP is a network protocol that uses a DHCP server to control the distribution of
network parameters, such as IP addresses, allowing systems to automatically request these
parameters. This reduces the need to manually configure settings. In this case, when checked, an
IP address is obtained from the DHCP server and is removed from the pool of available IP
addresses.

Assign a default gateway, selecting which ethernet port to use. Enter an IP address for one or
more DNS servers. If DHCP is enabled, the DHCP lease provides us with a default gateway as
well as a listing of DNS servers in order of preference. Any statically configured DNS servers
listed in the Custom DNS Servers field are attempted to be reached first, followed by DNS
servers received from DHCP.

When adding or editing an IP address, choose whether that IP should be enabled or disabled.
Select the network port on which we would like this IP to function. The IP Address field sets an
address to which IoT device can respond. When editing an IP address that is on the same subnet
as another IP address for this IoT device, choose if this IP address should be Primary. This helps,
for example, to ensure that any network traffic originating from the IoT device on that subnet
matches and complies with defined firewall rules.

From Access Type, we can restrict access over this IP to the public site or all clients outside of
the normal web traffic. It is possible to separate the web and session traffic by changing the
configuration of the network. The exact process depends on the existing configuration of the
network.
Bluetooth
Introduction
Bluetooth is a standardized protocol for sending and receiving data via a 2.4GHz wireless link.
It’s a secure protocol, and it’s perfect for short-range, lowpower, low-cost, wireless
transmissions between electronic devices. Since its invention by Ericsson in 1994,
Bluetooth has been used as a wireless channel for connecting devices. Since then, Bluetooth has
become the standard for wireless communication in wearables, gadgets, and other devices.
Bluetooth is now available in automobiles, speakers, wearables, medical equipment, wireless
headphones, and shoes, among other places. It is reasonable to assume that if we possess any
modern gadget, Bluetooth is a short-range wireless technology means for transmitting data over
a short distance between two electronic devices. The usage of wires for connectivity is eliminated
with this method. For example, we may now listen to music with a headset on the move without
plugging it into the mobile device's headset jack. Bluetooth IoT applications are used in industrial
and enterprise solutions. These include asset tracking, indoor locating, beacons, industrial
automation sensors, tire pressure monitors, electronic shelf labels, etc., which will reduce
ownership and maintenance costs because battery replacement is no longer needed.

Bluetooth With IoT


Bluetooth technology has progressed from standard Bluetooth to smart Bluetooth, with the most
recent version being Bluetooth 5. Compared to previous generations, Bluetooth 5 provides four
times the range, quadruple the speed, and 800 percent greater data transmitting frequency.
Companies with vast and vital infrastructure may have 100 percent uptime and cost-efficient
solutions by installing Bluetooth 5-enabled IoT devices thanks to these upgraded characteristics.
Furthermore, Bluetooth Low Energy (BLE), a form of Bluetooth optimized for low-powered
devices, can assist IoT devices in conserving energy by keeping them in sleep mode until they
are connected. BLE is perfect for IoT applications since it can pair and reconnect with devices
in six milliseconds instead of six seconds with traditional Bluetooth. This not only improves
operating efficiency but also increases device availability.
The hardware, communication, software system, and application layers make up a typical IoT
design, with Bluetooth serving as the communication layer. The communication layer, which
consists of a multi-layer stack that includes data connection, network or transport, and session
protocols, is a vital link between the layers. Bluetooth, often known as BLE, is a data
communication layer that links sensors to sensors or sensors to gateways. On the other hand, the
network layer is in charge of routing or transporting packets across the network using the best
pathways possible. The session layer protocols allow communication between different aspects
of the IoT communication subsystem.
Bluetooth technology is less expensive to implement than other communication protocols such
as RFID, NFC, WLAN, LoRa WAN, LTE-A, and WiFi-Direct. It also allows for wireless
communication and the creation of an immediate Personal Area Network (PAN) in areas where
wireless infrastructure is lacking. It features a uniform methodology and minimum interference.
Furthermore, by increasing the power beyond one milliwatt, Bluetooth's standard range of 0-30
meters may extend.

Working of Bluetooth
The Bluetooth protocol operates at 2.4GHz in the same unlicensed ISM frequency band where
RF protocols like ZigBee and WiFi also exist. There is a standardized set of rules and
specifications that differentiates it from other protocols. If you have a few hours to kill and want
to learn every nook and cranny of Bluetooth, check out the published specifications, otherwise
here’s a quick overview of what makes Bluetooth special.
Masters, Slaves, and Piconets
Bluetooth networks (commonly referred to as piconets) use a master/slave model to control when
and where devices can send data. In this model, a single master device can be connected to up to
seven different slave devices. Any slave device in the piconet can only be connected to a single
master.

The master coordinates communication throughout the piconet. It can send data to any of its
slaves and request data from them as well. Slaves are only allowed to transmit to and receive
from their master. They can’t talk to other slaves in the piconet.

Bluetooth Addresses and Names


Every single Bluetooth device has a unique 48-bit address, commonly abbreviated BD_ADDR.
This will usually be presented in the form of a 12-digit hexadecimal value. The most-significant
half (24 bits) of the address is an organization unique identifier (OUI), which identifies the
manufacturer. The lower 24-bits are the more unique part of the address.
This address should be visible on most Bluetooth devices. For example, on this RN-42 Bluetooth
Module, the address printed next to “MAC NO.” is 000666422152:

The “000666” portion of that address is the OUI of Roving Networks, the manufacturer of the
module. Every RN module will share those upper 24-bits. The “422152” portion of the module
is the more unique ID of the device.
Bluetooth devices can also have userfriendly names given to them. These are usually presented
to the user, in place of the address, to help identify which device it is. The rules for device names
are less stringent. They can be up to 248 bytes long, and two devices can share the same name.
Sometimes the unique digits of the address might be included in the name to help differentiate
devices.

Connection Process
Creating a Bluetooth connection between two devices is a multi-step process involving three
progressive states:
1. Inquiry – If two Bluetooth devices know absolutely nothing about each other, one must run
an inquiry to try to discover the other. One device sends out the inquiry request, and any device
listening for such a request will respond with its address, and possibly its name and other
information.
2. Paging (Connecting) – Paging is the process of forming a connection between two Bluetooth
devices. Before this connection can be initiated, each device needs to know the address of the
other (found in the inquiry process).
3. Connection – After a device has completed the paging process, it enters the connection state.
While connected, a device can either be actively participating or it can be put into a low power
sleep mode.
• Active Mode – This is the regular connected mode, where the device is actively
transmitting or receiving data.
• Sniff Mode – This is a power-saving mode, where the device is less active. It’ll sleep
and only listen for transmissions at a set interval (e.g. every 100ms).
• Hold Mode – Hold mode is a temporary, power-saving mode where a device sleeps for
a defined period and then returns back to active mode when that interval has passed. The
master can command a slave device to hold.
• Park Mode – Park is the deepest of sleep modes. A master can command a slave to
“park”, and that slave will become inactive until the master tells it to wake back up.

Bonding and Pairing


When two Bluetooth devices share a special affinity for each other, they can be bonded together.
Bonded devices automatically establish a connection whenever they’re close enough. When we
start up my car, for example, the phone in my pocket immediately connects to the car’s Bluetooth
system because they share a bond. No UI interactions are required!
Bonds are created through one-time a process called pairing. When devices pair up, they share
their addresses, names, and profiles, and usually store them in memory. The also share a common
secret key, which allows them to bond whenever they’re together in the future.
Pairing usually requires an authentication process where a user must validate the connection
between devices. The flow of the authentication process varies and usually depends on the
interface capabilities of one device or the other. Sometimes pairing is a simple “Just Works”
operation, where the click of a button is all it takes to pair (this is common for devices with no
UI, like headsets). Other times pairing involves matching 6-digit numeric codes. Older, legacy
(v2.0 and earlier), pairing processes involve the entering of a common PIN code on each device.
The PIN code can range in length and complexity from four numbers (e.g. “0000” or “1234”) to
a 16-character alphanumeric string.

Power Classes
The transmit power, and therefore range, of a Bluetooth module is defined by its power class.
There are three defined classes of power:

Some modules are only able to operate in one power class, while others can vary their transmit
power.

Bluetooth Profiles
Bluetooth profiles are additional protocols that build upon the basic Bluetooth standard to more
clearly define what kind of data a Bluetooth module is transmitting. While Bluetooth
specifications define how the technology works, profiles define how it’s used. The profile(s) a
Bluetooth device supports determine(s) what application it’s geared towards. A hands-free
Bluetooth headset, for example, would use headset profile (HSP), while a Nintendo Wii
Controller would implement the human interface device (HID) profile. For two Bluetooth
devices to be compatible, they must support the same profiles. Some of the commonly
encountered Bluetooth profiles are discussed below.
Serial Port Profile (SPP)
If we’re replacing a serial communication interface (like RS-232 or a UART) with
Bluetooth, SPP is the profile for you. SPP is great for sending bursts of data between two
devices. It’s is one of the more fundamental Bluetooth profiles (Bluetooth’s original
purpose was to replace RS-232 cables after all). Using SPP, each connected device can
send and receive data just as if there were RX and TX lines connected between them.
Two Arduinos, for example, could converse with each other from across rooms, instead
of from across the desk.
Human Interface Device (HID)
HID is the go-to profile for Bluetooth-enabled user-input devices like mice, keyboards,
and joysticks. It’s also used for a lot of modern video game controllers, like WiiMotes or
PS3 controllers. Bluetooth’s HID profile is actually a riff on the HID profile already
defined for human input USB devices. Just as SPP serves as a replacement for RS-232
cables, HID aims to replace USB cables (a much taller task!).
Hands-Free Profile (HFP) and Headset Profile (HSP)
Those Bluetooth earpieces that makes important business guys look like self-conversing
wackos? Those usually use headset profile (HSP) or hands-free profile (HFP). HFP is
used in the hands-free audio systems built into cars. It implements a few features on top
of those in HSP to allow for common phone interactions (accepting/rejecting calls,
hanging up, etc.) to occur while the phone remains in your pocket.
Advanced Audio Distribution Profile (A2DP)
Advanced audio distribution profile (A2DP) defines how audio can be transmitted from
one Bluetooth device to another. Where HFP and HSP send audio to and from both
devices, A2DP is a oneway street, but the audio quality has the potential to be much
higher. A2DP is well-suited to wireless audio transmissions between an MP3 player and
a Bluetooth-enabled stereo.
Most A2DP modules support a limited set of audio codecs. In the least they’ll suport SBC
(subband codec), they may also support MPEG-1, MPEG-2, AAC, and ATRAC.
A/V Remote Control Profile (AVRCP)
The audio/video remote control profile (AVRCP) allows for remote controlling of a
Bluetooth device. It’s usually implemented alongside A2DP to allow the remote speaker
to tell the audio-sending device to fastforward, rewind, etc.

Common Versions
Bluetooth has been constantly evolving since it was conceived in 1994. The most recent update
of Bluetooth, Bluetooth v4.0, is just beginning to gain traction in the consumer electronics
industry, but some of the previous versions are still widely used. Here’s a rundown of the
commonly encountered Bluetooth versions:
Bluetooth v1.2
The v1.x releases laid the groundwork for the protocols and specifications future versions
would build upon. Bluetooth v1.2 was the latest and most stable 1.x version. These
modules are rather limited compared to later versions. They support data rates of up to 1
Mbps (more like 0.7 Mbps in practice) and 10 meter maximum range.
Bluetooth v2.1 + EDR
The 2.x versions of Bluetooth introduced enhanced data rate (EDR), which increased the
data rate potential up to 3 Mbps (closer to 2.1 Mbps in practice). Bluetooth v2.1, released
in 2007, introduced secure simple pairing (SSP), which overhauled the pairing process.
Bluetooth v2.1 modules are still very common. For low-speed microcontrollers, where 2
Mbps is still fast, v2.1 gives them just about everything they could need. The RN-42
Bluetooth module, for example, remains popular in products like the Bluetooth Mate and
BlueSMiRF HID.
Bluetooth v3.0 + HS
You thought 3 Mbps was fast? Multiply that by eight and you have Bluetooth v3.0’s
optimum speed – 24 Mbps. That speed can be a little deceiving though, because the data
is actually transmitted over a WiFi (802.11) connection. Bluetooth is only used to
establish and manage a connection. It can be tricky to nail down the maximum data rate
of a v3.0 device. Some devices can be “Bluetooth v3.0+HS”, and others might be labeled
“Bluetooth v3.0”. Only those devices with the “+HS” suffix are capable of routing data
through WiFi and achieving that 24 Mbps speed. “Bluetooth v3.0” devices are still
limited to a maximum of 3 Mbps, but they do support other features introduced by the
3.0 standard like better power control and a streaming mode.
Bluetooth v4.0 and Bluetooth Low Energy
Bluetooth 4.0 split the Bluetooth specification into three categories: classic, high-speed,
and lowenergy.
Classic and high speed call back to Bluetooth versions v2.1+EDR and v3.0+HS
respectively.
The real standout of Bluetooth v4.0 is Bluetooth low energy (BLE). BLE is a massive
overhaul of the Bluetooth specifications, aimed at very low power applications. It
sacrifices range (50m instead of 100m) and data throughput (0.27 Mbps instead of 0.7-
2.1 Mbps) for a significant savings in power consumption. BLE is aimed at peripheral
devices which operate on batteries, and don’t require high data rates, or constant data
transmission. Smartwatches, like the MetaWatch, are a good example of this application.

Drawbacks
So far, we have looked at the positive side of the Bluetooth-enabled IoT. But, there are certain
limitations too. Let's look at some of the significant drawbacks of Bluetooth-enabled IoT.
1. Security is one of Bluetooth's significant drawbacks. This is because it functions on
radio frequency, which allows it to pass through barriers.
2. Because HomeRF technology uses the same frequency, it suffers from interference.
3. In comparison to WiFi, the bandwidth is limited.
4. In comparison to when Bluetooth turns off, battery utilization is higher. Bluetooth low
energy or innovative Bluetooth technology is created to extend the battery life.

Zigbee

Introduction
Zigbee is defined and developed by Zigbee Alliance and is based on the IEEE 802.15.4 standard.
It operates in 2.4 GHz ISM band globally, 915 MHz in Americas, and 868 MHz in Europe.
Zigbee uses mesh topology and can achieve a maximum data rate of 250 kbps in 2.4 GHz band.
As a short-range wireless technology, it can provide ranges up to 100 meters depending on the
transmit power level and indoor conditions. Zigbee has a large addressing space and can support
a maximum of 64K IoT devices. Also, larger networks can be supported by linking multiple
Zigbee networks.
ZigBee provides flexibility for developers and end-users and delivers great interoperability.
Because of its important feature of being low-cost, low-power consumption and having faster
wireless connectivity, the protocol has many applications. For instance, it’s a popular technology
for smart home, because it outstands other wireless technologies with some distinct features.
Firstly, communication is two -way which makes ZigBee devices reliable. Secondly, it caters to
all sectors like lightings, security, appliances and home access. Thirdly, and most importantly,
this technology requires very little power mainly due to its low latency and low duty cycle. In
addition, it uses mesh network and thus reduce chances of failure at nodes.
For applications such as smart meters that are usually installed in locations with poor radio
quality, linking multiple networks can provide scalability. In addition, it can increase the
reliability as backup routes also can be established and used in case of failure.
Even though, Zigbee modules do not exist in most of the existing smartphones, tablets, or
computers, Zigbee is used as the only technology in home products such as Samsung Smart
Things, and Philips Hue. Street lighting is an excellent example that can be controlled using
Zigbee mesh topology, since it is capable of providing functionalities such as remote
management for a large network of devices.
Self-forming and self-healing are two important features of Zigbee technology. Self-forming
means that the Zigbee network can configure itself automatically. Self-healing means that it can
reconfigure itself dynamically in situations that Zigbee nodes become faulty, removed or
disabled. Interoperability is one of the important features of Zigbee modules. Interoperability is
important, since there might be Zigbee modules from many different manufacturers especially
in home automation and industrial devices.

System Structure
ZigBee system consists of ZigBee Co-ordinator, Router and End device.
1. ZigBee Coordinator (ZC): A network consists of at least one central unit. ZC is the
most important device as it coordinates and acts as a bridge of network. It is the device
responsible for the start of the network. Most importantly, this unit is responsible for the
transmission and reception of data. It also facilitates the handling and storing of
information.
2. ZigBee Router (ZR): A router is an intermediate unit. It allows data to pass through them
to and fro to other devices.
3. ZigBee End-Device (ZED): A ZED interfaces to a sensor and executes the control
operation. The end device contains just enough functionality to talk to either the
coordinator or the router. This causes the node to stay asleep for a long time thereby
increasing battery life to a great extent. A ZED device requires less energy as compared
to the ZC or ZR.
Topologies
The number of coordinators, routers, devices in the network depends on the topology used. There
are three ZigBee Network topologies: star, Cluster tree and Mesh.
• A star network consists of a coordinator and any number of end devices. These devices
are then connected to the coordinator but isolated from each other.
• In Cluster Tree topology, end devices connect the coordinator via Router.
• In the mesh networks, the nodes are interconnected with other nodes so that there exist
multiple pathways connecting each node. The connection between nodes is updated using
built-in routing methodologies. Thus, it provides good stability in changing conditions or
failure at any node.
ZigBee Architecture
There are four layers in ZigBee network architecture. ZigBee protocol architecture consists of a
stack of various layers of which physical and MAC layers are as defined in IEEE 802.15.4 and
the other two layers belong to Zigbee specification.
• The Physical layer performs modulation and demodulation to the signals send and
received.
• MAC layer transfer data using CSMA/CA. Moreover, the MAC layer synchronizes the
communication between the devices.
• The network layer is responsible for setting up a network, connecting to the devices,
routing data, etc.
• Lastly, the application layer allows the device to interface with a network layer for data
management and communication between the devices.

You might also like