Networked Embedded Systems
Networked Embedded Systems
The system of PEs and networks forms the hardware platform on which the application
runs. In particular, PEs do not fetch instructions over the network as they do on the
microprocessor bus. We take advantage of this fact when analyzing network performance the
speed at which PEs can communicate over the bus would be difficult if not impossible to predict
if we allowed arbitrary instruction and data fetches as we do on microprocessor buses.
1. Why Distributed?
Building an embedded system with several PEs talking over a network is definitely more
complicated than using a single large microprocessor to perform the same tasks. So why would
anyone build a distributed embedded system? All the reasons for designing accelerator systems
also apply to distributed embedded systems, and several more reasons are unique to distributed
systems.
In some cases, distributed systems are necessary because the devices that the PEs communicate
with are physically separated. If the deadlines for processing the data are short, it may be more
cost-effective to put the PEs where the data are located rather than build a higher-speed network
to carry the data to a distant, fast PE.
An important advantage of a distributed system with several CPUs is that one part of
the system can be used to help diagnose problems in another part. Whether you are debugging
a prototype or diagnosing a problem in the field, isolating the error to one part of the system
can be difficult when everything is done on a single CPU. If you have several CPUs in the
system, you can use one to generate inputs for another and to watch its output.
2. Network Abstractions
Networks are complex systems. Ideally, they provide high-level services while hiding
many of the details of data transmission from the other components in the system. In order to
help understand (and design) networks, the International Standards Organization has developed
a seven-layer model for networks known as Open Systems Interconnection (OSI) models
[Sta97A]. Understanding the OSI layers will help us to understand the details of real networks.
The seven layers of the OSI model, shown in Figure 4.5, are intended to cover a broad
spectrum of networks and their uses. Some networks may not need the services of one or more
layers because the higher layers may be totally missing or an intermediate layer may not be
necessary. However, any data network should fit into the OSI model. The OSI layers from
lowest to highest level of abstraction are described below.
Physical: The physical layer defines the basic properties of the interface
between systems, including the physical connections ( plugs and wires), electrical
properties, basic functions of the electrical and physical components, and the basic
procedures for exchanging bits.
Data link: The primary purpose of this layer is error detection and control across
a single link. However, if the network requires multiple hops over several data links,
the data link layer does not define the mechanism for data integrity between hops,
but only within a single hop.
Network: This layer defines the basic end-to-end data transmission service. The
network layer is particularly important in multi hop networks.
Transport: The transport layer defines connection-oriented services that ensure
that data are delivered in the proper order and without errors across multiple links.
This layer may also try to optimize network resource utilization.
Session: A session provides mechanisms for controlling the interaction of end
user services across a network, such as data grouping and check pointing.
Presentation: This layer defines data exchange formats and provides
transformation utilities to application programs.
Application: The application layer provides the application interface between
the network and end-user programs.
USB associates NRZI (Non Return to Zero Invert) encoding scheme to transmit data with sync
field to synchronize the host system and receiver clock signals.
The Intra system protocol establishes communication between components within the circuit
board. In embedded systems, intra system protocol increases the number of components
connected to the controller. Increase in components lead to circuit complexity and increase in
power consumption. Intra system protocol promises secure access of data from the peripherals.
• I2C Protocol
• SPI Protocol
• CAN Protocol
Each I2C device (Master/slave) is identified by its 7-bit or 10-bit unique address known as
device ID which is provided by device manufacturer only and can act as a transmitter or
receiver at a time, depending on the configuration of it. As we know, the bus consists of SCL
and SDA line, SCL (serial clock line) is responsible for synchronizing the communication and
is controlled by Master (the slave can also control the clock line, we will discuss about this
topic later) and SDA (serial data line) is responsible for providing the data bi-directionally and
can be used by master or slave or both.
• Each signal line in I2C contains pull-up resistors to restore the signal to a high of the
wire when no device is pulling it low.
• All transfers are initiated and terminated by the “master device”; the “master device”
can write data to one or more “slave devices” or request data from the “slave devices”.
“Master” and “Slave” are not fixed in the system. In fact, any device can be used as
“Master” or “Slave” as long as it is configured with appropriate hardware or firmware.
• The data is transmitted in one byte, and each byte is followed by a 1-bit handshake
signal as the ACK/NACK bit (acknowledgement/no response).
Working of I2C:
• I2C data is transferred in messages which are broken up into data frames.
• Each message contains:
• Start condition
• Stop condition
• Read and write bits
• ACK/NACK bits
• Address of the Slave
• Data frame
• Start Condition:
• The transmission will start when the master device switches the SDA line
from high voltage level to low voltage level then switches the SCL line from
high to low.
• Signals to other slave devices that a transmission is going to happen.
• If two masters send a start condition at one time wants to take ownership of
the bus, whoever pulls the SDA low first “wins”
• Stop Condition:
• A stop condition will be transmitted after all the data frames have been sent.
• The SCL line will switch from a low voltage level to high first before the
SDA line switches from a low voltage to high
• Value on SDA should not change when SCL is high during normal data
writing operation as it can cause false stop conditions.
Read/Write Bit
• Single bit specifying whether the master is transmitting (write) data to the slave (low
voltage level) or requesting (read) data from it (high voltage level).
ACK/NACK Bit
• Sent by the receiving device after each frame to signal to the sender whether the data
frame was successfully received (ACK) or not (NACK)
Addressing:
The master device sends the address of the slave device with which it wants to communicate
to each slave device connected to it. The slave device compares the received address with its
own address.
• If the match is successful, the slave device knows that it will establish communication
with the master device. It will send an ACK bit back to the master device.
• Compared to SPI, I2C do not have slave select lines which cause the slave devices not
being able to know when data is being sent to him instead of other slaves.
• To solve this problem, I2C uses an address frame which is the first frame after the start
bit in a new message.
• Master devices will first send the unique address of the slave it wants to communicate
with. I
• If the address does match with the slave own address, it will send an ACK
bit back to the master device.
• If it does not match, the slave will do nothing which leaves the SDA line
high.
• I2C normally has a 7-bit address and there are only 127 different I2C devices. However,
in reality, there are way more types of I2C devices and an I2C device has a high chance
of having the same address on a bus.
• In order to overcome this limitation, many of the devices use dual address through
external configuration pins and also a 10-bit address scheme.
• The 10-bit address scheme has two effects on the normal I2C protocol:
• The address frame now has two bytes instead of 1 byte.
• The first five most significant bits of the first byte is used to identify the 10-
bit address with the convention being “11110”.
Data Frame:
After the master detects the ACK bit from the slave, the first data frame is ready to be
sent. The data frame is always 8 bits long, and sent with the most significant bit first. Each data
frame is immediately followed by an ACK/NACK bit to verify that the frame has been received
successfully. The ACK bit must be received by either the master or the slave (depending on
who is sending the data) before the next data frame can be sent.
After all of the data frames have been sent, the master can send a stop condition to the
slave to halt the transmission. The stop condition is a voltage transition from low to high on
the SDA line after a low to high transition on the SCL line, with the SCL line remaining high.
Protocols for Industrial and Control Applications:
SCADA:
SCADA (supervisory control and data acquisition) is a category of software
applications for controlling industrial processes, which is the gathering of data in real time from
remote locations in order to control equipment and conditions. SCADA provides organizations
with the tools needed to make and deploy data-driven decisions regarding their industrial
processes.
SCADA systems include hardware and software components. The hardware gathers
and feeds data into field controller systems, which forward the data to other systems that
process and present it to a human-machine interface (HMI) in a timely manner. SCADA
systems also record and log all events for reporting process status and issues. SCADA
applications warn when conditions become hazardous by sounding alarms.
• SCADA field controllers. These interface directly with sensors and actuators.
There are two categories of field controllers:
• SCADA supervisory computers. These control all SCADA processes and are
used to gather data from field devices and to send commands to those devices to
control industrial processes.
• HMI software. This provides a system that consolidates and presents data from
SCADA field devices and enables operators to understand and, if needed, modify
the status of SCADA-controlled processes.
• Remote control is achieved through the control of field actuators, based on the data
acquired from field sensors.
• Networked data communication enables all SCADA functions. Data collected
from sensors must be transmitted to SCADA field controllers, which, in turn,
communicate with the SCADA supervisory computers; remote control commands
are transmitted back to actuators from the SCADA supervisory computers.
• Real-time and historical data are both important parts of the SCADA system, as
they enable users to track current performance against historical trends.
SCADA architecture:
• Level 0. The field level includes field devices, such as sensors, used to forward data
relating to field processes and actuators used to control processes.
• Level 1. The direct control level includes local controllers, such as PLCs and RTUs,
that interface directly with field devices, including accepting data inputs from
sensors and sending commands to field device actuators.
• Level 2. The plant supervisory level includes local supervisory systems that
aggregate data from level controllers and issue commands for those controllers to
carry out.
• Level 4. The production scheduling level includes business systems used to manage
ongoing processes.
Field Bus:
A digital, serial, multi-drop, two-way data bus or communication path or link between
low-level industrial field equipment such as sensors, transducers, actuators, local controllers,
and even control room devices. Use of fieldbus technologies eliminates the need of point-to-
point wiring between the controller and each device. A protocol is used to define messages
over the fieldbus network with each message identifying a particular sensor on the network.
Computers and instruments are needed to connect in single network in a manufacturing plant,
so that the sensing and real time control is possible. This connecting network is known as Field
bus. A field bus network bus allow an industry working smoothly.
A simple field bus is shown above, which consist of mainly four levels. As the level increases
the the level of complexity increases.
Internet:
When node A wants to send data to node B, the application’s data pass through
several layers of the protocol stack to send to the IP. IP creates packets for routing
to the destination, which are then sent to the data link and physical layers. A node
that transmits data among different types of networks is known as a router.
Information appliances that use the Internet are rapidly becoming another use of
IP in embedded computing. Internet protocol is not defined over a particular
physical implementation it is an internetworking standard. Internet packets are
assumed to be carried by some other network, such as an Ethernet. In general, an
Internet packet will travel over several different networks from source to
destination.
The router’s functionality must go up to the IP layer, but since it is not running
applications, it does not need to go to higher levels of the OSI model.
In general, a packet may go through several routers to get to its destination. At
the destination, the IP layer provides data to the transport layer and ultimately the
receiving application.
As the data pass through several layers of the protocol stack, the IP packet data
are encapsulated in packet formats appropriate to each layer.
The basic format of an IP packet is shown in Figure 4.7. The header and data
payload are both of variable length. The maximum total length of the header and
data payload is 65,535 bytes.
An Internet address is a number (32 bits in early versions of IP, 128 bits in IPv6).
The IP address is typically written in the form xxx.xx.xx.xx. The names by which
users and applications typically refer to Internet nodes, such as foo.baz.com, are
translated into IP addresses via calls to a Domain Name Server, one of the higher-
level services built on top of IP.
The fact that IP works at the network layer tells us that it does not guarantee that
a packet is delivered to its destination. Furthermore, packets that do arrive may
come out of order. This is referred to as best-effort routing.
Since routes for data may change quickly with subsequent packets being routed
along very different paths with different delays, real-time performance of IP can
be hard to predict.
The Transmission Control Protocol (TCP) is one such example. It provides a
connection oriented service that ensures that data arrive in the appropriate order,
and it uses an acknowledgment protocol to ensure that packets arrive. Because
many higher-level services are built on top of TCP, the basic protocol is often
referred to as TCP/IP.
Below Fig shows the relationships between IP and higher-level Internet services.
Using IP as the foundation, TCP is used to provide File Transport Protocol for
batch file transfers, Hypertext Transport Protocol (HTTP) for Worldwide Web
service, Simple Mail Transfer Protocol for email, and Telnet for virtual
terminals.
A separate transport protocol, User Datagram Protocol, is used as the basis for
the network management services provided by the Simple Network Management
Protocol.
Internetworking Protocol :
Internetworking is the process or technique of connecting different networks by using
intermediary devices such as routers or gateway devices. It ensures data communication among
networks owned and operated by different entities using common data communication and the
Internet Routing Protocol.
TCP/IP is the communication protocol for the Internet. The TCP/IP protocol has two
parts: TCP and IP.
Transmission Control Protocol (TCP) provides reliable transport service, i.e. it ensures that
messages sent from sender to receiver are properly routed and arrive intact at the destination.
TCP converts messages into a set of packets at the source, which are then reassembled back
into messages at the destination. TCP operates with the packet switching technique, which is
described as follows:
Since multiple users can send or receive information over the same communication line,
the packets can arrive out of order at the destination. The sequencing information in the packet
is used to reassemble the packets in order, at their destination.
The error control information is used to check that the packet arrived at the destination is
the same as that sent from the source (i.e. has not got corrupted).
It handles the addressing of packets, and ensures that a packet reaches its destination
traveling through multiple networks with multiple standards.
TCP/IP protocol makes it possible for any pair of computers connected to Internet to
communicate, despite their hardware differences.
Bluetooth:
Bluetooth is a network technology that connects mobile devices wirelessly over a short range
to form a personal area network (PAN). They use short-wavelength, ultra-high frequency
(UHF) radio waves within the range 2.400 to 2.485 GHz, instead of RS-232 data cables of
wired PANs.
There are two types of Bluetooth networks −
• Piconets
• Scatternets
Piconets
Piconets are small Bluetooth networks, formed by at most 8 stations, one of which is the master
node and the rest slave nodes (maximum of 7 slaves). Master node is the primary station that
manages the small network. The slave stations are secondary stations that are synchronized
with the primary station.
Communication can take place between a master node and a slave node in either one-to-one
or one-to-many manner. However, no direct communication takes place between slaves. Each
station, whether master or slave, is associated with a 48-bit fixed device address.
Besides the seven active slaves, there can be up to 255 numbers of parked nodes. These are in
a low power state for energy conservation. The only work that they can do is respond to a
beacon frame for activation from the master node.
Scatternodes
A scatternet is an interconnected collection of two or more piconets. They are formed when a
node in a piconet, whether a master or a slave, acts as a slave in another piconet. This node is
called the bridge between the two piconets, which connects the individual piconets to form the
scatternet.
Spectrum
Bluetooth technology operates in the unlicensed industrial, scientific and medical (ISM) band
at 2.4 to 2.485 GHZ, using a spread spectrum hopping, full-duplex signal at a nominal rate of
1600 hops/sec. the 2.4 GHZ ISM band is available and unlicensed in most countries.
Range
Bluetooth operating range depends on the device Class 3 radios have a range of up to 1 meter
or 3 feet Class 2 radios are most commonly found in mobile devices have a range of 10 meters
or 30 feet Class 1 radios are used primarily in industrial use cases have a range of 100 meters
or 300 feet.
Data rate
Bluetooth supports 1Mbps data rate for version 1.2 and 3Mbps data rate for Version 2.0
combined with Error Data Rate.