0% found this document useful (0 votes)
14 views34 pages

Fog and Edge notes

The document discusses the Internet of Vehicles (IoV), detailing various types of vehicle connectivity such as Vehicle-to-Vehicle (V2V) and Vehicle-to-Infrastructure (V2I), along with their communication protocols and challenges. It also highlights the need for optimization in fog and edge computing, addressing resource allocation, task scheduling, and security. Additionally, middleware solutions for fog and edge computing are explored, emphasizing their importance in managing IoT systems effectively.

Uploaded by

mprasannaragav
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)
14 views34 pages

Fog and Edge notes

The document discusses the Internet of Vehicles (IoV), detailing various types of vehicle connectivity such as Vehicle-to-Vehicle (V2V) and Vehicle-to-Infrastructure (V2I), along with their communication protocols and challenges. It also highlights the need for optimization in fog and edge computing, addressing resource allocation, task scheduling, and security. Additionally, middleware solutions for fog and edge computing are explored, emphasizing their importance in managing IoT systems effectively.

Uploaded by

mprasannaragav
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/ 34

Page | 78

79

Index Page
Fog and Edge Computing – Principles and Paradigms
Chapter 3 – Internet of Vehicles (IoV) (Page 81)
- Connected Vehicles: Concepts and Architectures

- Types of Vehicle Connectivity (V2V, V2I, V2C, V2P, V2E)

- Vehicle-to-Vehicle (V2V) Communication

- Vehicle-to-Infrastructure (V2I) Communication

- Vehicle-to-Cloud (V2C) Communication

- Vehicle-to-Pedestrian (V2P) Communication

- Vehicle-to-Everything (V2E) Communication

- IoV Architecture and Protocol Stack

- Challenges in IoV

Chapter 4 – Optimization Problems in Fog and Edge Computing (Page 92)


- Need for Optimization in Fog Computing

- Resource Allocation Optimization

- Task Scheduling and O loading

- Data Management and Storage

- Quality of Service (QoS) Optimization

- Energy E iciency

- Security and Privacy

- Case Study: Optimizing IoT-Enabled Smart Grids

- Optimization Techniques and Challenges

Chapter 5 – Middleware for Fog and Edge Computing (Page 102)


- Introduction to Middleware

- Advantages of Middleware

- Need for Fog and Edge Computing Middleware

- Key Design Goals

- State-of-the-Art Middleware Infrastructures

Page | 79
80 Fog and Edge Computing – Principles and Paradigms

- IoT Platforms and Middleware Solutions

- System Model

- Case Study: Perpetrator Tracking Application

- Proposed Middleware Architecture

- Middleware Components

- Mobility and Network Management

- Execution and Resource Management

- Security and Privacy Considerations

- Sensors and Actuators in Fog and Edge Computing

Page | 80
81

Chapter 3
Internet of Vehicles (IoV)

Connected Vehicles: Concepts and Vehicle-to-Infrastructure (V2I)


Architectures This refers to a vehicle being connected to
A connected vehicle is one that has access highway infrastructure that includes traffic
to the Internet for the sharing of data with lights, traffic signal sensors, road sensors,
smart devices inside the car as well as with speed cameras, communication satellite,
smart objects outside the car including other parking metres, bus stops, etc.
cars, traffic lights, and road sensors, etc.  Communication is wireless and bi-
Types of Vehicle (or Car) Connectivity directional. Hardware technologies and
components include sensors such as
1. Vehicle-to-Vehicle (V2V), RFID, radars, and cameras.
2. Vehicle-to-Infrastructure (V2I),  Communication takes place using
dedicated DSRC frequencies which are
3. Vehicle-to-Cloud (V2C), similar to V2V connectivity.
4. Vehicle-to-Pedestrian (V2P) and  The purpose is to capture infrastructure
data to provide travellers with real-time
5. Vehicle-to-Everything (V2E). advisory information to change speed,
Vehicle-to-Vehicle (V2V) apply brake, follow diverted roots or
avoid certain situations.
 V2V communication allows vehicles to
Vehicle-to-Cloud (V2C)
send and receive omni-directional
messages (normally every 5–10 s), This refers to a vehicle being wirelessly
creating a 360-degree ‘awareness’ of linked up to a cloud environment mainly to:
other vehicles in proximity.
1. access, transfer, share, and analyse
 V2V technology uses dedicated short-
information; and make decisions in real
range communication (DSRC),
time;
sometimes described as being a WiFi
network because one of the possible 2. to store and retrieve data; and
frequencies is 5.9 GHz, normally used
by WiFi. 3. to provision and consume other cloud-
based services
 Employs visual, tactile, and audible
alerts, or a combination of these, to Cloud related capabilities can also enhance
warn drivers to take appropriate action automotive safety as well as augmented
to avoid crashes, e.g. change speed or reality in vehicles.
change direction.

Page | 81
82 Fog and Edge Computing – Principles and Paradigms

Vehicle-to-Pedestrian (V2P)
This involves direct communications
between a vehicle and pedestrians, within
close proximity of the vehicle.
One important aspect of V2P is the
pedestrian detection system that can be
implemented in a number of ways:
1. within vehicles (for blind spot warning,
incident ahead warning, etc.);
2. embedded within the roadside
infrastructure (e.g. lane closure warning);
and
3. carried by pedestrians (e.g. smart devices Architecture of a local context aware
to warn the drivers). system
Example: Vehicle to Pedestrian (V2P)
Telstra in partnership with Cohda Wireless,
who have successfully conducted V2P
technology experiments over a mobile
network in South Australia.
V2X (Vehicle-to-Everything)
Communication
It refers to the technology and processes that
allow vehicles to communicate with
different parts of the traffic system around
them. Protocol stack for IoV

In this respect, V2X is a context aware


system that includes V2V, V2I and V2P
communication

Seven-Layered IoV Architecture

Page | 82
Chapter 3 – Internet of Vehicles (IoV) 83

Node-RED is a programming tool for wiring


together hardware devices, APIs and online
services
Challenges
1. Data Integration- Lack of interoperability
and standardization between IoT devices
2. Security and Privacy
3. Investment and Operating Costs
4. Sabotage and System Evasion

Sequence diagram for an IoV scenario


Internet of Vehicles: Architecture,
Protocols, and Security
Connected Vehicles: Concepts and
Architectures
A connected vehicle is one that has access to
the Internet for the sharing of data with
smart devices inside the car as well as with
smart objects outside the car including other
cars, traffic lights, and road sensors, etc.
Types of Vehicle (or Car) Connectivity
MQTT
1. Vehicle-to-Vehicle (V2V)
MQTT is an messaging protocol for the
Internet of Things (IoT). It is designed as an 2. Vehicle-to-Infrastructure (V2I)
extremely lightweight publish/subscribe
3. Vehicle-to-Cloud (V2C)
messaging transport that is ideal for
connecting remote devices with a small code 4. Vehicle-to-Pedestrian (V2P)
footprint and minimal network bandwidth.
5. Vehicle-to-Everything (V2E)
MQTT today is used in a wide variety of
Vehicle-to-Vehicle (V2V)
industries, such as automotive,
• V2V communication allows vehicles to
manufacturing, telecommunications, oil and
send and receive omni-directional messages
gas, etc.
(normally every 5–10 s), creating a 360-
MQTT Use Cases degree ‘awareness’ of other vehicles in
proximity.
SAIC Volkswagen and EMQ create a new
• V2V technology uses dedicated short-
generation of intelligent Internet of Vehicles
range communication (DSRC), sometimes
systems
described as being a WiFi network because
one of the possible frequencies is 5.9 GHz,
normally used by WiFi.
Page | 83
84 Fog and Edge Computing – Principles and Paradigms

• Employs visual, tactile, and audible alerts, 1. within vehicles (for blind spot
or a combination of these, to warn drivers to warning, incident ahead warning,
take appropriate action to avoid crashes, etc.);
e.g., change speed or change direction.
2. embedded within the roadside
Vehicle-to-Infrastructure (V2I) infrastructure (e.g., lane closure
• This refers to a vehicle being connected to warning); and
highway infrastructure that includes traffic
3. carried by pedestrians (e.g., smart
lights, traffic signal sensors, road sensors,
devices to warn the drivers).
speed cameras, communication satellites,
parking meters, bus stops, etc. V2X (Vehicle-to-Everything)
• Communication is wireless and bi- Communication
directional. • It refers to the technology and processes
• Hardware technologies and components that allow vehicles to communicate with
include sensors such as RFID, radars, and different parts of the traffic system around
cameras. Communication takes place using them.
dedicated DSRC frequencies which are • In this respect, V2X is a context-aware
similar to V2V connectivity. system that includes V2V, V2I, and V2P
• The purpose is to capture infrastructure communication
data to provide travellers with real-time
advisory information to change speed, apply Internet of Vehicles: Architecture,
brakes, follow diverted routes, or avoid Protocols, and Security
certain situations. • The concept of Vehicular Ad-hoc
Networks (VANETs) was conceived over a
Vehicle-to-Cloud (V2C) decade ago and has since then been a very
This refers to a vehicle being wirelessly active area of research both in academia and
linked up to a cloud environment mainly to: industry as the number of vehicles
connected to the IoT increases, new
1. access, transfer, share, and analyse
requirements of VANETs (such as inter-
information; and make decisions in
vehicular, vehicular infrastructure and
real time;
vehicular-Internet, vehicular personal
2. store and retrieve data; and devices, and intra-vehicular
communications) are emerging.
3. provision and consume other cloud-
• The main problems of VANETs is its
based services
limited capacity for processing all the
Vehicle-to-Pedestrian (V2P) information that is collected by themselves
• This involves direct communications and other actors (such as sensors and mobile
between a vehicle and pedestrians, within devices) around the environment.
close proximity of the vehicle. • Vehicles must evolve into “smart” objects
• One important aspect of V2P is the equipped with a multi-sensor platform, with
pedestrian detection system that can be a set of communication technologies, robust
implemented in a number of ways: computational units.
• IP-based connectivity to the Internet, and a
direct or indirect connection to other

Page | 84
Chapter 3 – Internet of Vehicles (IoV) 85

vehicles and with all devices around the congestion traffic level, or vehicular
environment. safety services) for large cities or
• The concept of VANETs is evolving into even a whole country.
the Internet of Vehicle (IoV). • By using intelligent systems on
• The basic principle of a VANET is that a vehicles and different cyber-physical
vehicle is a mobile node that enables it to systems (such as sensors, vehicles,
connect to other vehicles thereby creating a and mobile devices) in cities we can
network. develop a global network that
• Vehicles are connected or disconnected as provides different services to
they fall inside or outside of the coverage vehicles and the humans associated
range. with them.
• VANETs are considered to be a • IoV also refers to vehicles, humans,
conditioned network with mobility components of the transportation
constraints, affected by the number of infrastructure, and a set of devices
connected vehicles, and several factors such allocated in the environment,
as traffic jams, tall buildings, and bad driver connected through an all IP-based
behaviors which affect its performance and infrastructure, that exchange
use. information directly or indirectly to
• VANETs lack the processing capacity for contribute toward a more efficient,
handling global information. safer, and greener world of
• VANETs do not have the capacity to transportation.
analyze, process, and evaluate the global
Benefits of IoV
information that is collected from the
• The IoV might be defined as a platform
different vehicles that are part of the
that enables the exchange of information
network.
between the car and its surroundings through
• VANETs are well suited for short-term
different communication media.
applications or for small scale services such
• As a result of the integration of the IoT
as collision prevention or road hazard
technology with Intelligent Transportation
control notifications services.
Systems (ITSs), IoV will create an
• In contrast, IoV integrates two
integrated network for supporting different
technological visions:
functions (such as intelligent traffic
1. Vehicle’s Networking management, dynamic information services,
intelligent vehicle control, among others).
2. Vehicle’s Intelligence
• IoV is composed of three fundamental
• IoV focuses on the integration of
components:
objects such as humans, vehicles,
things, networks, and environments 1. Intervehicular network
to create an intelligent network based
2. Intravehicular network
on computing and communication
capabilities that supports services 3. Vehicular mobile Internet
(such as global traffic efficiency and
management service based on • IoV allows vehicles to be permanently
pollution levels, road conditions, connected to the Internet, forming an

Page | 85
86 Fog and Edge Computing – Principles and Paradigms

interconnected set of vehicles that can technologies in the IoV environment.


provide information for different services • The first level contains all the sensors
such as traffic management, road safety, and within the vehicle that gather environmental
infotainment. data and detect specific events of interest
• The IoV concept opens up many new such as driving patterns and vehicle
opportunities and applications and offers situations, environmental conditions, among
various benefits to drivers, society, and others.
businesses. • The second level is the communication
• Cisco IBSG Automotive and Economic layer which supports different wireless
practices indicate that IoV will help provide communication modes such as Vehicle to-
$1400 U.S. in benefits per vehicle, per year. Vehicle (V2V), Vehicle-to-Infrastructure
These include the following: (V2I), Vehicle-to-Pedestrian, and Vehicle-
(i) Vehicle User: to-Sensor.
• It is estimated that the saving will be • The communication layer ensures seamless
around $550 U.S. based on lower insurance connectivity to existing and emerging
rates, lower operation costs, and less time networks (such as GSM, Wi-Fi, LTE,
spent in traffic which increases productivity Bluetooth, 802.15.4, among others).
due to reduced traffic congestion by • The third layer includes statistics tools,
recognizing and anticipating risk and support processing infrastructure which
dynamically calculating optimal routes. constitutes IoV for storage, and intelligence
(ii) Society: and provides mobile cars with big data-
• Societal benefits could be around $420 based processing (i.e., accessing computing
U.S. that could be obtained through lower resources, content searching, spectrum
traffic road operational costs, a decrease in sharing, etc.) and is responsible for storage,
the number of crashes and better control of analysis, processing, and decision making
congestion through traffic management and about different risk situations (such as traffic
optimization of road networks and reduced congestion, dangerous road conditions,
CO2 emissions. among others).
(iii) IoV Service Providers: • The goal is to be able to make unified
• They could save around $160 U.S. through decisions based on the fusion of information
traffic guidance, navigation, emergency obtained from different systems and
services, and location-based services. technologies (big data, wireless sensor
(iv) Auto (Original Equipment network, cloud computing, etc.)
Manufacturers/Original Equipment
CISCO has proposed an IoV architecture
Suppliers):
based on four layers
• They could save around $300 U.S. through
• (1) End points layer covers the vehicles,
lower service/warranty costs and new profit
software communication through 802.11p.
pools amortized over eight years
• (2) Infrastructure layer defines all
Seven-layered model architecture technologies that allow connections between
for Internet of Vehicles all actors of IoV.
• A three-level architecture is identified • (3) Operation layer monitors the policy
based on the interaction of different enforcement and the flow-based
management.
Page | 86
Chapter 3 – Internet of Vehicles (IoV) 87

• (4) Service layer specifies the services that sources (vehicle internal sensors and the
the different types of cloud (public cloud, navigation system, data collected from inter-
private cloud, and enterprise cloud) offer to vehicle communication, data from sensors,
drivers based on subscription, data center, or traffic lights, and signals among others)
on-demand. located on the roads.
• IoV allows vehicles and drivers to be (iii) Data Filtering and Preprocessing Layer:
connected to the Internet, and therefore, • This layer analyzes the collected
enables them to have access to a broad range information to avoid the transmission of
of service providers. irrelevant information and reduce the
• This access will facilitate commercial network traffic.
business services’ integration with vehicles • Transmission decisions are based on a
hence creating the vehicle-to-business service profile created for the vehicle which
(V2B) communication. has subscribed or active services.
• SAP research proposed a service-based
(iv) Communication Layer:
architecture based on the service-oriented
• This layer selects the best network to send
architecture and the event-driven
the information by using several selection
architecture.
parameters such as congestion and QoS
• V2B integration architecture specifies two
level in the different available networks,
dedicated components:
information relevance, privacy, and security,
1. The vehicle integration platform as a among others.
back-end system enabling efficient
(v) Control and Management Layer:
information exchange between
• This layer is responsible for managing
enterprise applications and vehicles.
different network service providers that are
2. The back-end integration manager within the IoV environment.
that connects in-vehicle components. • In this layer, different policies (such as
traffic management, traffic engineering, and
The proposed seven-layer IoV
packet inspection) and functions are applied
architecture
to better manage the information received.
(i) User Vehicle Interface Layer:
• This layer provides direct interaction with (vi) Processing Layer:
the driver through a management interface • This layer processes large amounts of
to coordinate all driver notifications and information using various types of cloud
select the best display element for the computing infrastructures locally and
current situation or event to help reduce remotely.
driver’s distractions. • The results of the processed information
• For example, if there is a collision risk can be used by massive data services
with a vehicle ahead, a set of lights on the providers to further improve the service or
car’s dashboard can activate while a sound to develop new applications.
is emitted to alert the driver. • The results obtained after processing can
also be used by various government
(ii) Data Acquisition Layer:
agencies in the development of future
• This layer collects data from various

Page | 87
88 Fog and Edge Computing – Principles and Paradigms

infrastructures, V2B services, and policies to • Based on the vehicle’s profile (service
help improve or better manage road traffic. requirements) and the available information
in the environment (such as available
(vii) Security Layer:
network access technologies, available
• This is a transversal layer that has direct
network service providers, QoS of each
communication with the rest of the layers.
network, costs, and others), the best network
• It is responsible for all security functions
is selected using some intelligent algorithm
(such as data authentication, integrity, non-
(implemented in the communication layer).
repudiation, and confidentiality, access
• All the information transmitted through the
control, availability, among others) within
network is managed through a set of
the proposed architecture.
mechanisms (such as policies and rules,
• The layer is designed to support mitigating
network flow processing and classification,
solutions for addressing various types of
packet inspection, among others) to maintain
security attacks (such as cyberattacks and
high efficiency for all services delivered
others) in IoV.
within the environment.
Communication example of the proposed • The preprocessed information is classified
seven-layered architecture (e.g., as private and business), and then sent
• Proposed seven-layered IoV architecture to the most suitable cloud for analyzing,
based on Contreras-Castillo et al. processing, storing, and availability based
• When a vehicle starts its engine, it triggers on the information type
the initialization process to authenticate
Standards for IoV
itself with the IoV network and begins the
• IoV involves many participants, and the
environmental data acquisition process.
connectivity must be assured between all
• This acquisition step collects all the
participants. One of the main challenging
information generated by vehicles, humans,
issues for the interconnection of vehicles is
and roadside infrastructures (car sensors,
interoperability.
location, pollution level sensors, traffic
• To ensure this, we need to develop
lights, signs, cell phones, mobile devices,
standards for the IoV framework.
body area networks, among others) within
• International organizations and consortia
the mobility area of the vehicular network.
such as Internet Engineering Task Force,
• The collected information is filtered and
EPCglobal, Institute of Electrical and
preprocessed to obtain the most relevant
Electronics Engineers, European Committee
information to be transmitted to:
for Standardization (CEN), European
1. The driver, using one of the Telecommunications Standards Institute
interaction mechanisms such as (ETSI), led by the World Wide Web
visual, acoustic or haptic; Consortium (W3C) are investing a lot of
efforts to define standards and protocols for
2. The network depending on the IoV.
coverage, type, and sensitivity of the • The W3C is focusing on standards for
information; or application developers which will provide
3. Discarded to reduce the load on the more accurate access to vehicle data (such
IoV network. as vehicle identification, acceleration and
speed, tire pressure, battery status, and
Page | 88
Chapter 3 – Internet of Vehicles (IoV) 89

personalization information). However, LIN is not a reliable protocol


• ETSI and CEN published the basic set of compared to the CAN bus in terms of
standards requested by the European latency and is mostly used by applications
Commission to ensure interoperable that are not time-sensitive or have low fault
communication between vehicles made by tolerance. Some examples of LIN usage
different manufacturers. include lights, door locks, electric seats, and
other parts where network performance
PROTOCOLS IN IOV requirements (i.e., latency, reliability, and
Intervehicular communication protocols in bandwidth usage) are not demanding.
VANETs play an essential role in IoV as FlexRay:
they enable different levels of interaction
among vehicles, humans, and roadside units. FlexRay was launched for intra-vehicle
They can provide alternate routes efficiently communication in 2006 and standardized in
and quickly if a problem arises with the ISO 17458. It is a new standard developed
current route. by BMW, Philips, Freescale, and Bosch.

IoV extends beyond VANETs and places Inter-Vehicle Networking


more emphasis on information exchange Inter-vehicle communication can enhance
among vehicles, humans, and the drivers’ performance by collecting data from
surrounding road infrastructures. Below other vehicles or road infrastructures.
briefly presents basic VANET
communication protocols that can be applied Dedicated Short-Range Communication
to IoV. (DSRC):

Intra-Vehicle Networking DSRC was introduced in the early 2000s


under the IEEE 802.11 WiFi family,
CAN Bus (Controller Area Network): standardized as IEEE 802.11p. It is a
CAN bus is a serial bus communication wireless technology designed for automotive
protocol employed for intra-vehicle applications. DSRC provides high
applications and functions. It was introduced efficiency, low latency, and reliability for
in the early 1980s and standardized in the V2X communication, particularly for V2I
ISO 11898 series. The traditional CAN bus and V2V.
contains two serial buses, namely High- Long-Term Evolution Vehicular Network
Speed CAN (HS) and Low-Speed CAN (LTE-V):
(LS). HS has a data transmission rate of up
to 1 Mbps, while the LS transmission rate is In 2016, the Third Generation Partnership
between 40 Kbps and 250 Kbps, where Project (3GPP) announced the first version
ECUs connect through HS or LS according of Release 14, which also supports V2X
to their task priority. communication and is commonly known as
LTE-V. LTE-V has a maximum bit rate of 1
Local Interconnect Network (LIN): Gbps and up to 2000 m coverage with a
LIN protocol, produced in the late 1990s delay of 50 ms.
under ISO 17987 standard, is the CAN and 5th Generation Mobile Networks (5G):
the SAE J1850 protocols’ supplementary.
Page | 89
90 Fog and Edge Computing – Principles and Paradigms

Autonomous vehicles need high bandwidth MAC protocols for IoV should support
and low latency for transmitting sensory different types of applications with different
data or receiving necessary information requirements for QoS (such as low delay or
from outside. At the same time, the high- failure rates).
speed movement of vehicles imposes strict
MAC protocols need to solve several
limits on delay and reliability. 5th
problems, such as the hidden station
Generation mobile networks (5G), as the
problem or the shared bandwidth among the
successor of LTE, is a new access
communicating vehicles. Some protocols,
technology that aims to bring reliable and
such as IEEE 802.11p or DMAC
low-latency transmissions.
(decentralized), use OFDM (Orthogonal
Physical Layer Protocol Frequency Division Multiplexing)
technology and a CSMA (Carrier Sense
When a protocol for the physical layer is
Multiple Access) mechanism to control
designed, factors such as multipath fading
medium access and avoid collisions.
and Doppler frequency shifts caused by the
movement of vehicles must be considered. IEEE 802.11p provides reliability and low
latency requirements in intervehicular
Some recent efforts have focused on using
communications. DMAC increases the reuse
infrared and radio waves for vehicle-to-
of the transmission channel to improve
vehicle communications because they offer
performance and reduce collisions using
line-of-sight and broadcast communications.
directional antennas.
Dedicated Short-Range Communication
Another type of MAC protocol uses the
(IEEE 802.11p WAVE) is based on IEEE
ALOHA approach in its transmission
1609 standards and describes techniques and
scheduler. In this category, some protocols,
interface processes controlled by the MAC
such as ADHOC MAC or VC-MAC, have
layer for public safety and private
recently been proposed as alternatives for
applications.
cooperative communication in VANETs.
The frequency band is divided into six These protocols aim to use spatial
service channels used for different reusability to maximize network throughput,
application types (frequency range 5.855– guarantee QoS, address terminal problems,
5.875 MHz for ITS nonsafety applications and reduce transmission collisions.
and frequency range 5.875–5.905 MHz for
Routing Protocols in IoV
safety and traffic efficiency applications)
and one control channel. Transmission Strategy-Based Routing
Protocols
The main idea of the IEEE 802.11p WAVE
protocol is to integrate PHY and MAC These focus on transmitting data from a
layers of the IEEE 802.11 wireless standard single node to a destination node through all
to allow data exchange among vehicles and nodes in a specified geographical region or
roadside devices in the 5.9 GHz band. via multihop transmissions. These protocols
may suffer from high delays in finding
MAC Layer Protocols
routes and excessive network flooding,
which can disrupt communications.

Page | 90
Chapter 3 – Internet of Vehicles (IoV) 91

Information-Based Routing Protocols vulnerable environments where security


issues are significant, particularly in vehicle-
These distribute routing information using
to-infrastructure and cloud communications.
infrequent full updates and smaller
incremental updates based on beacon IoVs can be susceptible to cyberattacks.
messages. The dynamic behavior of vehicles Hackers can exploit vulnerabilities to
in IoV may lead to inconsistent routing manipulate vehicular data streams with
tables, making it difficult to maintain devastating effects. For example, a
reliable routes. cybercriminal gaining control of a car’s data
system could manipulate its brakes, unlock
Delay-Based Routing Protocols
doors, or even turn the car off. A
 Delay-sensitive protocols need to demonstration at the Black Hat
exchange data as soon as possible. cybersecurity conference showed how
attackers could control a Jeep Cherokee
 Delay-tolerant protocols handle remotely while it was moving.
connection failures using a carry-
and-forward mechanism. Security Requirements

Some challenges include ensuring delay- Hickey mentioned that one way to analyze
tolerant protocols maintain network security threats is to identify mitigation
coverage while limiting transmissions and techniques used in comparable critical
ensuring delay-sensitive protocols avoid infrastructure systems. He argued that
congestion while maintaining a high disrupting a vehicle’s sensors or
delivery ratio with low latency. communication is difficult, but the threat is
real and could have severe consequences for
Target Networks Routing Protocols drivers, passengers, and infrastructure.
These protocols consider different access To address security concerns, the National
technologies in IoV. Unlike traditional Institute of Standards and Technology
VANET routing protocols that assume (NIST) proposed a framework to improve
homogeneous networks, IoV must handle critical infrastructure cybersecurity. Some
heterogeneous models, requiring real-time researchers have also developed secure V2V
handoff strategies, gateway node selection, and V2I communication schemes for
optimal wireless technology usage, IP VANET applications.
addressing, and mobility management.
IoV security solutions must meet key
Security in IoV requirements, such as ensuring user privacy,
Zhang stated that IoVs, like other securing communication channels, and
technologies, have many security preventing unauthorized access.
vulnerabilities. Vehicles operate in

Page | 91
92 Fog and Edge Computing – Principles and Paradigms

Chapter 4
Optimization Problems in Fog and Edge
Computing

Fog and edge computing, while offering minimizing data retrieval


numerous benefits, also present unique time from centralized cloud
optimization challenges. These challenges servers. Techniques like
arise from the distributed nature of these Least Recently Used (LRU)
systems, the resource constraints of edge can be applied.
devices, and the need to balance 2. Latency Minimization:
performance with energy efficiency. o Using geographical
information to optimize the
Need for Optimization in Fog Computing placement of fog nodes,
Optimization is essential for minimizing ensuring that computation is
latency, reducing energy consumption, and performed closer to where
maximizing security and reliability in fog data is generated, thus
computing. reducing latency.
The dynamic nature of mobile devices, 3. Energy Efficiency:
network failures, and other factors o Implementing algorithms that
constantly change the environment, dynamically adjust the
requiring optimization techniques to resource usage of fog nodes
determine the best solution for various based on demand, helping to
scenarios. reduce energy consumption.
Examples of Optimization Techniques in Techniques like Dynamic
Fog Computing Voltage and Frequency
1. Resource Allocation Optimization: Scaling (DVFS) can be
o Load Balancing: utilized.
Distributing workloads across 4. Task Offloading:
multiple fog nodes to avoid o Deciding which tasks should
overloading any single node. be processed locally on
Techniques like round-robin devices versus offloaded to
scheduling or least fog nodes or the cloud.
connections can be Techniques like game theory
employed. or machine learning can be
o Data Caching: used to make these decisions
Implementing caching based on real-time
strategies to store frequently conditions.
accessed data on fog nodes,

Page | 92
Chapter 4 – Optimization Problems in Fog and Edge Computing 93

5. Quality of Service (QoS) executed to optimize overall system


Optimization: performance.
o Ensuring that the fog  Task Offloading: Deciding when
computing infrastructure and which tasks should be offloaded
meets specific performance to the fog or cloud to balance local
metrics, like bandwidth, processing with cloud-based
latency, and reliability, by resources.
adjusting resource allocations 3. Data Management and Storage
based on application needs.  Data Caching: Determining which
Optimization Problems in Fog and Edge data to cache locally on edge devices
Computing to reduce latency and network traffic.
The main optimization problems in fog and  Data Replication: Deciding where
edge computing include: to replicate data to ensure
1. Resource Allocation and redundancy and fault tolerance.
Management  Data Synchronization: Ensuring
2. Task Scheduling and Offloading consistency between data stored on
3. Data Management and Storage different devices.
4. Quality of Service (QoS) 4. Quality of Service (QoS) Optimization
Optimization  Latency Minimization: Reducing
5. Energy Efficiency the time it takes for data to be
6. Security and Privacy processed and transmitted.
1. Resource Allocation and Management  Throughput Maximization:
 CPU and Memory Allocation: Increasing the amount of data that
Efficiently allocating CPU and can be processed and transmitted per
memory resources to tasks to unit time.
maximize performance and minimize  Reliability Enhancement: Ensuring
latency. that the system can operate reliably
 Energy Management: Balancing despite failures or disruptions.
computational tasks with energy 5. Energy Efficiency
consumption to prolong battery life  Power Management: Optimizing
in edge devices. power consumption to prolong
 Network Bandwidth Allocation: battery life and reduce energy costs.
Optimizing network bandwidth  Green Computing: Implementing
usage to avoid congestion and ensure energy-efficient algorithms and
timely data transmission. hardware to minimize the
2. Task Scheduling and Offloading environmental impact of fog and
 Task Placement: Deciding where to edge computing.
execute tasks (on edge devices or in 6. Security and Privacy
the fog/cloud) to minimize latency  Data Protection: Protecting
and maximize resource utilization. sensitive data from unauthorized
 Task Scheduling: Determining the access and breaches.
order in which tasks should be

Page | 93
94 Fog and Edge Computing – Principles and Paradigms

 Privacy Preservation: Ensuring that Optimization Challenges in IoT-Enabled


user privacy is protected while data Smart Grids
is processed and transmitted. 1. Resource Constraints:
Case Study: Optimizing IoT-Enabled o Edge devices have limited
Smart Grids with Fog and Edge computational power and
Computing energy resources,
IoT-enabled smart grids generate massive necessitating efficient
amounts of data from various sensors (e.g., algorithms and data
temperature, voltage, current, power compression techniques.
consumption). Processing this data in the 2. Data Consistency:
cloud can introduce significant latency and o Ensuring data consistency
bandwidth consumption, affecting real-time across edge, fog, and cloud
decision-making and energy efficiency. layers is crucial for accurate
Solution: Leveraging Fog and Edge analysis and decision-
Computing making.
1. Edge-based Data Preprocessing: 3. Latency Minimization:
o Sensors can perform basic o Minimizing latency in real-
data cleaning, filtering, and time anomaly detection and
aggregation locally, reducing control is essential for
the amount of data preventing power outages
transmitted to the fog or and ensuring grid stability.
cloud. 4. Energy Efficiency:
2. Fog-based Anomaly Detection: o Optimizing energy
o Fog nodes can use machine consumption of fog and edge
learning algorithms to detect devices is critical to reduce
anomalies in real-time, such operational costs and
as power surges or equipment improve sustainability.
failures. Optimization Techniques
3. Edge-based Control and  Task Offloading: Dynamically
Optimization: offloading computationally intensive
o Edge devices can make local tasks to the fog or cloud based on
decisions to optimize energy resource availability and latency
consumption, such as requirements.
adjusting power distribution  Data Caching: Caching frequently
or scheduling load to accessed data locally on edge
minimize peak demand. devices to reduce network traffic and
4. Cloud-based Analytics and improve response times.
Visualization:  Energy-Efficient Algorithms:
o The cloud can be used for Employing lightweight, energy-
long-term data analysis, trend efficient algorithms for data
forecasting, and visualization processing and anomaly detection.
to support strategic decision-  Adaptive Scheduling: Dynamically
making. adjusting task scheduling and

Page | 94
Chapter 4 – Optimization Problems in Fog and Edge Computing 95

resource allocation based on Fog computing extends cloud computing


changing network conditions and towards the network edge, aiming to provide
workload. lower latencies for latency-critical
Benefits of Optimizing IoT-Enabled applications within end devices.
Smart Grids The primary optimization objective in fog
 Improved Real-Time Response: computing is minimizing latency while
Faster detection and mitigation of increasing computational capabilities
anomalies, leading to reduced without significantly impacting energy
downtime and improved grid consumption. Optimization in execution
reliability. time and energy consumption are
 Enhanced Energy Efficiency: fundamental aspects of fog computing.
Optimized energy consumption
through demand-side management Formal Modeling Framework for Fog
and load balancing. Computing
 Reduced Network Traffic: Fog computing can be represented by a
Offloading data processing to edge hierarchical three-layer model.
and fog layers reduces bandwidth Higher layers represent higher
consumption and network computational capacity, but they are also
congestion. farther from end devices, which increases
 Enhanced Data Privacy: latency.
Processing data closer to the source  The highest layer is the cloud,
can improve data privacy and which offers virtually unlimited,
security. high-performance, cost-efficient, and
Preliminaries - Optimization in Fog energy-efficient resources.
Computing  The middle layer consists of edge
In the general definition of an optimization resources such as base stations,
problem, it is assumed that there is a single routers, or geographically distributed
real-valued objective function. However, in small data centers owned by
practical problems, there are multiple telecommunication providers. These
objectives, and balancing these conflicting edge resources are all connected to
objectives is a significant challenge. the cloud.
 Single Objective Function: Focuses  The lowest layer contains end
on optimizing one specific goal at a devices such as mobile phones and
time (e.g., minimizing latency or IoT devices. Each end device is
maximizing throughput). connected to one of the edge
 Multi-Objective Function: resources.
Optimizes multiple conflicting Modeling in Fog Computing
objectives simultaneously (e.g., This model provides a foundation for
balancing latency and energy analyzing and optimizing fog computing
consumption). systems. It allows researchers and
The Case for Optimization in Fog practitioners to:
Computing  Quantify resource capabilities
 Evaluate workload distribution

Page | 95
96 Fog and Edge Computing – Principles and Paradigms

 Assess energy consumption computing, including resource allocation,


By understanding these components and network behavior, and failure prediction.
relationships, strategies can be developed for  Queuing Theory: Used for
efficient task allocation, resource modeling task scheduling and
management, and power optimization in resource allocation by analyzing
fog computing environments. system performance under different
Let: load conditions.
 c denote the cloud  Graph Theory: Represents fog
 E be the set of edge resources network topologies and service
 D_e be the set of end devices dependencies, helping optimize
connected to edge resource e ∈ E communication and routing.
 D = ⋃ e ∈ E D_e, which represents  Game Theory: Analyzes resource
all end devices competition among fog nodes,
 R = { c } ∪ E ∪ D, representing the enabling optimal decision-making
set of all resources strategies for load balancing and
Each resource r ∈ R has: pricing mechanisms.
 A compute capacity a(r) ∈ ℝ+  Markov Chains: Models system
 A compute speed s(r) ∈ ℝ+ transitions and failures, allowing
Each resource has some power for reliability and availability
consumption, which depends on its analysis of fog nodes and services.
computational load. The power consumption Specification Languages
of a resource r increases by w(r) ∈ ℝ+ for Specification languages are used to formally
every instruction carried out by r. describe the behavior of fog computing
The set of links between resources is: components, ensuring clear definitions and
 L = { ce : e ∈ E } ∪ { ed : e ∈ E, d ∈ reducing ambiguity in system design.
D_e }  Petri Nets: Used for modeling
Each link l ∈ L has: distributed and concurrent fog
 Latency t(l) ∈ ℝ+ operations, representing task
 Bandwidth b(l) ∈ ℝ+ execution and synchronization
Transmitting one more byte of data over link processes.
l increases power consumption by w(l) ∈  Process Algebra: Defines
ℝ+. communication and interaction
Components of a Formal Modeling between fog nodes, aiding in the
Framework for Fog Computing verification of protocol correctness.
A formal modeling framework for fog  Timed Automata: Captures real-
computing includes multiple aspects that time constraints in fog computing,
help in designing, analyzing, and verifying ensuring compliance with timing
fog-based systems. These components requirements in latency-sensitive
ensure efficiency, reliability, and security applications.
in fog computing environments. Verification Techniques
Mathematical Models Verification techniques ensure that fog
Mathematical models provide a structured computing systems meet their intended
approach to analyzing various aspects of fog

Page | 96
Chapter 4 – Optimization Problems in Fog and Edge Computing 97

specifications, enhancing reliability and in an end device and partly offloaded from
security. the end device to an edge resource, this may
 Model Checking: Uses tools like lead to a situation in which the total
UPPAAL or PRISM to verify execution time is determined by the sum of
performance, security, and reliability multiple computation and data transfer steps.
properties by systematically Resource Usage
exploring possible system states. This particularly applies to end devices,
 Theorem Proving: Employs logic- which typically have very limited CPU and
based verification methods using memory capacity. Edge resources typically
tools such as Coq or Isabelle to offer higher capacities, but also those
prove the correctness of algorithms capacities can be limited, given that edge
and protocols. resources may include machines like routers
 Simulation & Testing: Uses that do not offer exhaustive computational
frameworks like iFogSim, capabilities.
FogTorch, or EdgeCloudSim to To some extent, CPU usage can be
simulate real-world scenarios and compromised with execution time, i.e.,
evaluate system behavior under overbooking the CPU may lead to a
various conditions. situation where the application is still
running, but more slowly. This may be
Metrics - Further Quality Attributes acceptable for some applications, but not for
Independently from the specific application time-critical ones.
– and hence, problem variant – some metrics Memory poses a harder constraint on
play an important role in fog computing. resource consumption since overbooking the
Performance memory may lead to more serious problems
Performance is related to the amount of time like application failure. Beyond CPU and
needed to accomplish a certain task. In a fog memory, also network bandwidth can be a
computing setting, it is important to note scarce resource, both between end devices
that accomplishing a task usually involves and edge resources and between edge
multiple resources, often on different levels resources and the cloud. The use of network
of the reference model. The completion time bandwidth may have to be either minimized
of the task may depend. or constrained by an upper bound.
Some of these steps might be made in Energy Consumption
parallel (e.g., multiple devices can perform Energy is consumed by all resources as well
computations in parallel), whereas others as the network. Even idle resources and
must be made one after the other (e.g., the unused network elements consume energy,
results of a computation can only be but their energy consumption increases with
transferred once they have been computed). usage. Energy consumption is important on
Completion time = Computation time of each layer of the fog, but in different ways.
multiple resources + Time for data For end devices, battery power is often a
transfer between the resources. bottleneck, and thus preserving it as much as
The total execution time depends on the possible is a primary concern. Edge
critical path of compute and transfer steps. resources are typically not battery-powered;
For instance, if a computation is partly done hence, their energy consumption is less

Page | 97
98 Fog and Edge Computing – Principles and Paradigms

important. Overall energy consumption of resources. Using existing techniques


the whole fog system is important because to quantify trust, for instance, based
of its environmental impact. on reputation scores, the usage of
Financial Costs trusted resources becomes an
Energy consumption has implications on optimization objective, in which trust
financial costs. The use of the cloud or edge levels of the used resources should
infrastructure may incur costs. These costs be maximized.
can be fixed or usage-based, or some 3. Colocation Risks: Co-location of
combination. Similarly, the use of the computational tasks belonging to
network for transferring data may incur different users/tenants may increase
costs. the possibility of tenant-on-tenant
Further Quality Attributes attacks. Therefore, minimizing the
For the quality attributes, the mentioned has number of tenants whose tasks are
to be taken into account. co-located is an optimization
 Reliability: Achieved by creating objective that helps to keep security
redundancy in the architecture. and privacy risks at an acceptably
 Security: Achieved by using low level.
appropriate cryptographic techniques o Colocation: The placement
for encryption. of several entities in a single
 Privacy: Achieved by applying location. A colocation center
anonymization of personal data. is a data center where
There are several ways to address quality companies can rent space,
attributes during optimization of a fog equipment, and bandwidth
system, as shown by the following for computing services,
representative examples: known as colocation services.
1. Reliability: To increase reliability, it o Tenant: A group of users
is beneficial to let multiple resources who share a common access
perform the same critical with specific privileges to the
computations in parallel so that the software instance. A tenant is
result is available even if some of the the most fundamental
resources stop working or become construct of a SaaS
unreachable, and also to compare the environment. In a private
results with each other to filter out cloud, the customers, or
faulty results. The higher the number tenants, may be different
of resources used in parallel, the individuals or groups within a
higher level of reliability can be single company, while in a
achieved this way. Therefore, the public cloud, entirely
number of resources used in parallel different organizations may
is an important optimization safely share their server
objective that should be maximized. space.
2. Security and Privacy: Both security 4. Minimizing Network-based
and privacy concerns may be Attacks: Co-location of tasks
mitigated by preferring trusted belonging to the same user decreases

Page | 98
Chapter 4 – Optimization Problems in Fog and Edge Computing 99

the need for exchanging data over orders of degree higher than the
the network, which in turn decreases number of data centers in a
the likelihood of eavesdropping, distributed cloud.
man-in-the-middle, and other 2. Problems involving edge resources
and end devices
network-based attacks. Minimizing
o The collaboration of end
the number of resources used also
devices with edge resources
helps in decreasing risks related to (e.g., offloading computations)
information security. is a typical fog computing
Trade-offs in Optimization problem, and because of the
 Increasing redundancy may be limited resources of end
beneficial for improving reliability devices, optimization plays a
but at the same time, it can lead to vital role in such cases.
higher costs. Computation Offloading
 Preferring service providers with  The technique where computations are
high reputation is advantageous from migrated from resource-intensive end
devices to resource-rich infrastructures,
the point of view of security but may
such as Cloud or nearby edge devices.
also lead to higher costs.
 All three layers can be optimized
 Constraining co-location options
together.
may improve privacy but may lead to  The difficulties relate on one hand to the
worse performance or higher energy computational complexity of large-scale
consumption. optimization problems involving
decision variables for all fog resources.
Optimization Opportunities along the Fog  Many different technical issues would
Architecture have to be integrated into a single
Optimization problems in fog computing optimization problem to capture the
can be classified according to which layer(s) different optimization concerns of the
of the three-layer fog model are involved. cloud, the edge resources, and the end
Real fog computing problems involve at devices, which is challenging in itself.
least two layers.  Changes to the cloud, the edge
This consideration leads to the following resources, and the end devices are
classification of optimization problems in typically made by different stakeholders
fog computing: on different time scales, which is also a
1. Problems involving the cloud and the rationale for independent optimization
edge resources of the different fog layers.
o This is a meaningful setting, Optimization Targets in Fog Layers
which allows, for example, to  Data-related optimization: Decisions
optimize overall energy have to be made about which pieces of
consumption of cloud and edge data are stored and processed in the fog
resources, subject to capacity architecture.
and latency constraints.  Code-related optimization: Program
o This setup shows some code can be deployed on multiple
similarity to distributed cloud resources, and the goal is to find the
computing; a potential optimal placement of the program code.
difference is that the number of
edge resources can be in several

Page | 99
100 Fog and Edge Computing – Principles and Paradigms

 Task-related optimization: The aim is only when the system is running


to find the optimal split of tasks among and used.
multiple resources. o Examples include the specific
Optimization Opportunities along the end devices with their
Service Life Cycle parameters (e.g., compute
Fog computing is characterized by the capacity) and the compute tasks
delivery and consumption of services. The that the end devices want to
different optimization opportunities at the offload to the edge resources.
different stages of the service life cycle can o These aspects are vital for
be differentiated between the following making sound optimization
options: decisions.
1. Design-time optimization o These aspects keep changing
o When a fog service is designed, during the operation of the
exact information about the end system.
devices to be served is typically o Much of the system operation
not available. needs to be optimized during
o Hence, optimization will be run time.
constrained mostly to the cloud o This requires continuous
and edge layers of the monitoring of important system
architecture, where more parameters, analysis of whether
information may already be the system still operates with
available at design time. acceptable effectiveness and
o For end devices, optimization is efficiency, and re-optimization
constrained to questions dealing whenever necessary.
with types of devices (as
different from device instances, Toward a Taxonomy of Optimization
which will be known only Problems in Fog Computing
during run time). Table shows the classification of the work of
2. Deployment-time optimization Do et al. Table shows the classification of
o When the deployment of the the work of Sardellitti et al. Table describes
service on specific resources is the work of Mushunuri et al.
planned, the available Taxonomy of Optimization Problems in
information of the resources can Fog Computing
be used to make further 1. Based on Optimization Objectives
optimization decisions. o Latency Minimization:
o For example, the exact capacity Ensuring low response time for
of the edge resources to be used real-time applications.
may become available at this o Energy Efficiency: Reducing
time so that the split of tasks power consumption in fog
between the cloud and the edge nodes and edge devices.
resources can be (re-)optimized. o Cost Optimization:
3. Run-time optimization Minimizing infrastructure and
o Although some aspects of a fog operational expenses.
system may be optimized in o Load Balancing: Distributing
advance (i.e., during design time workloads efficiently to prevent
or deployment time), many bottlenecks.
important aspects become clear

Page | 100
Chapter 4 – Optimization Problems in Fog and Edge Computing 101

o Security and Privacy:  Smart Cities: Traffic control and


Enhancing data protection while surveillance optimization.
maintaining efficiency.  Healthcare: Remote patient monitoring
2. Based on Constraints and resource management.
o Resource Limitations:  Industrial IoT: Real-time predictive
Constraints on CPU, memory, maintenance and workload scheduling.
and bandwidth.  Autonomous Vehicles: Edge processing
o Network Latency: Ensuring for navigation and safety features.
timely data transmission.
o QoS Requirements: Meeting
user-defined performance
metrics.
o Geographical Distribution:
Handling scattered fog nodes
effectively.
o Scalability: Ensuring solutions
work as the network grows.
3. Based on Optimization Techniques
o Mathematical Optimization:
Linear programming, convex
optimization.
o Heuristic Algorithms: Genetic
algorithms, simulated annealing.
o Machine Learning-Based
Optimization: Reinforcement
learning, deep learning.
o Game Theory Approaches:
Strategic decision-making in
distributed environments.
o Hybrid Approaches:
Combining multiple
optimization methods for
efficiency.
Case Studies and Applications

Page | 101
102 Fog and Edge Computing – Principles and Paradigms

Chapter 5
Middleware for Fog and Edge Computing

Introduction  Communication management


Middleware is a software that connects  Network management
applications, databases, and tools together,  Task scheduling
allowing them to communicate and share  Mobility management
data. It's often called the "glue" that  Security management
connects different software platforms and Need for Fog and Edge Computing
devices. Middleware
Three Types of Middleware Fog and edge computing middleware play a
In a typical web application, there are three crucial role in modern computing
layers of middleware: architectures, especially with the rise of the
 Web server middleware Internet of Things (IoT). Key functionalities
 Application server middleware include:
 Database middleware 1. Resource Management:
Advantages of Middleware Middleware helps efficiently manage
 Advanced processing: Applications and orchestrate resources across fog
can run with just the OS, but and edge nodes, including load
middleware enables more efficient balancing, resource allocation, and
execution of higher-level processes. performance optimization.
 Reducing development costs: 2. Data Processing and Storage:
Middleware consolidates generic Middleware enables local data
functionalities used in applications, processing and storage, reducing the
allowing for efficient development of need to send all data to the cloud,
application software. By focusing which is crucial for low-latency and
only on specialized business real-time applications.
processes, development time and 3. Interoperability: Middleware
costs can be reduced. provides a layer of abstraction that
 Compatibility across a variety of allows different devices and systems
operating systems and hardware: to communicate and work together
Middleware bridges the gap between seamlessly in heterogeneous
different OS and hardware types, environments.
allowing applications to operate 4. Security and Privacy: Middleware
consistently across different implements security protocols and
environments. privacy measures to protect data as it
Middleware handles different tasks to moves between edge devices, fog
reduce the complexity of distributed mobile nodes, and the cloud.
application design, including:

Page | 102
Chapter 5 – Middleware for Fog and Edge Computing 103

5. Scalability: Middleware supports the o Lightweight and efficient:


scalability of fog and edge Middleware should have
computing systems by managing the minimal footprint and be
addition of new devices and nodes optimized for resource-
without disrupting existing services. constrained devices.
6. Application Support: Middleware o Platform-agnostic:
provides APIs and frameworks that Middleware should support
simplify the development and various hardware and
deployment of applications on fog software platforms.
and edge infrastructures. o Security: Middleware should
Design Goals of Fog and Edge Computing include mechanisms for
Middleware protecting applications and
Middleware for fog and edge computing data from security threats.
must meet stringent application 3. Minimal Task Disruption
requirements such as: o Graceful task migration:
 Availability of context on sensing Middleware should allow
devices seamless migration of tasks
 Cost of data transfer and between devices.
processing in different tiers o Fault tolerance: Middleware
 Limitations on edge device should have mechanisms to
numbers and dynamic context recover from failures and
changes minimize disruption to tasks.
 Strict latency constraints o Middleware must address
Key Design Goals unexpected changes due to
1. Ad-Hoc Device Discovery device mobility, usage
o Dynamic device detection: patterns, and network
Middleware should disconnections.
automatically discover and 4. Overhead of Operational
register new devices as they Parameters
join the network. o Efficient parameter
o Device profiling: management: Middleware
Middleware should gather should manage operational
information about device parameters like resource
capabilities, limitations, and allocation and task
workload to optimize scheduling while minimizing
resource allocation. overhead.
o Middleware enables o Adaptive parameter tuning:
communication between Middleware should
dynamically changing dynamically adjust
devices for real-time data parameters based on
acquisition and processing. changing conditions.
2. Run-Time Execution Environment o Middleware should minimize
bandwidth usage, energy

Page | 103
104 Fog and Edge Computing – Principles and Paradigms

consumption, and resource  Traffic monitoring (Waze, smart


distribution overhead. traffic light systems)
5. Context-Aware Adaptive Design  Real-time replay in stadiums
o Context awareness:  Video analytics
Middleware should gather  Emergency rescue processing (e.g.,
information about network disaster response, searching for
conditions, device missing persons)
capabilities, and workload for  Geographically distributed
informed decision-making. systems (e.g., wind farms, smart
o Adaptive resource vehicle-to-vehicle systems)
allocation: Middleware These applications require middleware to
should dynamically allocate support easy design and development.
resources based on context IoT Platforms and Middleware Solutions
and changing requirements.  Google Fit: Cloud-based IoT
o Self-adaptive services middleware for smartphones, using
enhance FEA operations and sensors to collect physical activity
improve quality of service data.
(QoS).  Google Search Network (GSN):
6. Quality of Service (QoS) Service-oriented middleware for
o QoS guarantees: distributed data processing.
Middleware should provide  FemtoCloud: Edge-based system
guarantees for latency, enabling mobile devices to provide
throughput, and reliability. services to requesting devices.
o QoS enforcement:  Process on Our Own (PO3)
Middleware should enforce (Nakamura et al.): Middleware
QoS policies to ensure allowing each device to process its
critical tasks receive own data streams.
necessary resources.  CoTWare (Jaroodi et al.):
o Real-time response, data Middleware integrating IoT devices,
correctness, and fog, and cloud using cloud-hosted
uninterrupted data acquisition services.
are essential QoS measures.  MobiPADs and MobiCon: Context-
By addressing these design goals, FEA aware adaptive middleware for
middleware provides a robust and flexible mobile applications.
platform for deploying and managing  CloudAware (G. Orsini et al.):
distributed applications in Fog and Edge Adaptive middleware for cloudlets,
environments. supporting configuration
management, cost control, security,
State-of-the-Art Middleware and compliance.
Infrastructures State-of-the-Art Middleware Solutions
Real-time data streaming applications 1. EdgeX Foundry
include:

Page | 104
Chapter 5 – Middleware for Fog and Edge Computing 105

o Open-source, vendor-neutral o Enables context-aware


IoT edge computing processing and seamless
framework. AI/ML integration with cloud
o Supports multiple device and services.
cloud communication 6. Baidu OpenEdge
interfaces. o Lightweight edge computing
o Modular microservices framework optimized for AI
architecture supporting and deep learning workloads.
security, analytics, and o Supports offline and online
automation. execution with strong cloud-
2. OpenFog Consortium (Fog edge integration.
Computing Architecture) 7. AWS IoT Greengrass
o Developed a reference o Amazon's edge computing
architecture emphasizing middleware supporting local
security, scalability, and computation, messaging, and
modularity. ML inference.
o Enables seamless o Securely synchronizes with
collaboration between edge AWS Cloud while enabling
devices, fog nodes, and cloud offline operations.
infrastructure. 8. Azure IoT Edge
3. Kubernetes-based Edge o Microsoft's middleware
Middleware solution for containerized
o KubeEdge: Extends workloads at the edge.
Kubernetes for containerized o Integrates AI, analytics, and
workloads in edge business logic for intelligent
environments. edge applications.
o K3s: Lightweight Kubernetes
distribution optimized for System Model
low-resource edge devices. FEA includes devices that can be broadly
o Ensures scalability, efficient classified into five types:
workload orchestration, and  Embedded Sensors or Actuators
fault tolerance.  Personal Devices
4. Eclipse ioFog  Fog Servers
o Open-source edge computing  Cloudlets
platform for deploying  Cloud Servers
microservices at the edge. Mobile devices connected with sensors and
o Supports containerization, actuators are the nearest devices to the users.
real-time data processing, and a. Embedded Sensors or Actuators
decentralized orchestration.  Installed in physical structures or
5. FogFlow (FIWARE Ecosystem) deployed on a human body.
o Distributed, event-driven  Sensors: Responsible for obtaining
framework for fog environmental or physiological
computing. signals processed by the system.

Page | 105
106 Fog and Edge Computing – Principles and Paradigms

 Actuators: Execute actions initiated  Provide computing services to


by the system. mobile devices such as smartphones,
 Built-in networking capabilities tablets, and wearables.
allow communication with nearby  Telecom companies offer Mobile
devices. Edge Computing (MEC) servers
 May have limited computing that bring compute resources into
capability. mobile tower base stations.
b. Personal Devices e. Cloud Servers
 Includes smartphones, which  Offer the highest computational,
inherently demonstrate mobility. communication, and storage
 Connect with embedded sensors and capabilities in the hierarchy.
actuators.  Typically associated with a pay-as-
 Often act as an intermediate data hub you-go model.
or computation platform.  Can easily scale the number of
 Provide a communication link to Virtual Machines (VMs) based on
servers. request.
 Can share part of their resources to
execute fog and edge distributed Case Study Example
applications. A perpetrator tracking application can be
c. Fog Servers designed using middleware as a mobile
 More computationally powerful than application that performs real-time tracking
personal mobile devices. of perpetrators through video surveillance,
 Closer to the edge, providing a utilizing surrogate mobile phones available
cheaper offloading option with in the surrounding area.
respect to communication costs. a. Device Discovery
 Exist between edge devices and the  One of the devices initiates the
cloud. perpetrator tracking application by
 Process data and act as intermediary sending a request on the publish-
storage. subscribe channel.
 Enable communication with other  Participating devices respond to the
edge devices via peer-to-peer (P2P) request, and a communication
or device-to-device (D2D) channel is established for further
techniques (e.g., WiFi, Bluetooth, interaction.
WiFi Direct). b. Context Monitoring
d. Cloudlets  Location is acquired using GPS data
 Small-scale dedicated servers with on the mobile device.
high-bandwidth Internet  Accelerometer variance helps
connectivity, located close to the determine stationary mobile devices,
edge. reducing motion-related distortions
 Also known as "data centers in a in acquired image data.
box."  Device orientation assists in
predicting the perpetrator's potential
location.

Page | 106
Chapter 5 – Middleware for Fog and Edge Computing 107

c. Data Analytics o Battery availability


 Instead of sending all image data o Communication bandwidth
from mobile devices for perpetrator h. Security
recognition, only images containing  Authentication of new devices is
faces are sent. handled by the fog server.
 A face detection algorithm runs on  Data encryption ensures secure
the mobile device to eliminate communication with the fog
images without faces. infrastructure.
 On the fog server, detected face This middleware-based approach enables
images are processed using a face efficient and secure real-time tracking using
recognition application to fog and edge computing resources.
determine if the perpetrator is
present. Proposed Architecture
d. Mobility Support Fog and edge computing applications
 As the perpetrator moves from one include the following: batch processing that
location to another, the set of needs large- scale data acquisition and
participating devices dynamically distributed processing; quick- response
changes. application that needs a response in real
 Only stationary devices are selected time; stream applications that require
for tracking; moving mobile devices processing of a continuous data stream in
are not used. real time
e. Network Management
 A point-to-point connection is Batch Processing
established among devices connected Definition: Processes large volumes of data
via WiFi. at once in a single batch.
 Mobile devices communicate with Latency: High latency as it processes data
the fog server over WiFi. periodically at scheduled intervals.
f. Execution Management Throughput: Handles large volumes of data
 Face detection code is offloaded to efficiently.
the mobile device. Use Cases: Suitable for applications where
 The web server application for face real-time processing is not critical, such as
recognition runs on the fog payroll systems, monthly billing systems,
infrastructure. and data warehousing.
g. Scheduling Complexity: Simpler to implement and
 The application dynamically updates manage compared to stream processing.
as the perpetrator’s GPS location Examples: Hadoop, Apache Spark, AWS
changes. Batch.
 The scheduling module matches
search locations with candidate Stream Processing
device locations. Definition: Processes data continuously in
 Optimization factors include: real-time as it arrives.
o Minimally moving devices Latency: Low latency, capable of
o Device orientation processing data within milliseconds or

Page | 107
108 Fog and Edge Computing – Principles and Paradigms

seconds. establish a secure communication channel


Throughput: Handles data streams for communication of user data.
efficiently but may be limited by the rate at Authentication
which data is produced and consumed. Data ownership and protecting access to the
Use Cases: Ideal for applications that private information is very important to the
require immediate data processing, such as edge participants.
real-time analytics, fraud detection, and live Many “ pay- as- you- go ” services
monitoring systems. necessitate authentication to prevent any
Complexity: More complex to implement unwanted access.
and manage due to the need for handling Public key infrastructure- based systems
continuous data streams. have been proposed for user and device
Examples: Apache Kafka, Apache Flink, authentications for distributed key
Amazon Kinesis. management.
Authentication of VM instances and
These applications exist in different domains migration of VMs that has been used in
such as healthcare , emergency rescue and cloud can be adopted for VMs in MEC and
response systems , traffic management , fog servers.
vehicle- to- vehicle systems , and Mukherjee et al. proposed an Authentication
environment monitoring . as a service to enable authentication in the
Due to huge processing requirements, the participating fog nodes.
above applications need a large distributed Ibrahim proposed a lightweight mutual
architecture that processes data in multiple authentication scheme for roaming fog
tiers. nodes using one long- lived master secret
Lower tier near the edge perform filtering , key.
preprocessing , and extraction of useful This algorithm is efficient and lightweight
information while the edge and fog servers for limited resource devices such as sensors
are used for processing and analytics . FEA and actuator and doesn’t require the devices
mainly consists of middleware services that to re- register.
are common to FEA applications as 1.b.2 Privacy
mentioned in diagram. Data privacy is very important with respect
to handling data from user devices.
API The main challenge in FEA is to ensure the
a. API Code privacy of devices that exhibit mobility in
Services common to fog and edge the edge .
applications can be designed as an API. The Even the sensors and edge devices have
API is then integrated into an app, enabling limited resources, the fog nodes can provide
the design of different functionalities in the the necessary encryption capabilities for
middleware with simple and easy to use edge processing.
functions . Existing works
1.b. Security propose anonymization techniques or
Security in edge devices is essential to pseudo anonymization through which user
ensure access to authorized users and identity is protected.

Page | 108
Chapter 5 – Middleware for Fog and Edge Computing 109

Lu et al. proposed a lightweight privacy Recent research shows that several human-
preserving scheme using Chinese remainder dependent contexts have patterns.
theorem . These patterns can be learned to intelligently
Wang et al. proposed Laplacian mechanism manage the operations between multiple
query model that deals with privacy devices.
preservation of location- aware services . 2.2 Selection of Participating Devices
Dsouza et al. proposed Policy- based access FEA employs devices from the environment
control mechanisms for fog computing. that can sense and/or process the data a
cquired in the FEA applications.
1.c. Device Discovery Selection of the surrogate device can be
Device discovery allows the new devices to based on different policies designed in the
participate and leave the network as they middleware.
become available in the network. Research shows several policies such as
MQTT is used as the standard publish- fairness- based selection , game theoretic ,
subscribe message API, which is a context optimization , and resource
lightweight messaging protocol designed for optimization approaches that are used in
constrained devices and low- bandwidth surrogate selection.
high-latency unreliable networks. Participating users are selected based on
Fog and edge- distributed middleware can different criterion ranging from simple user
also use pub- sub as a service from a third context such as the location of the device to
party such as Nearby Message , or PubNub selection based on the reputation of user task
that may be integrated into the middleware. completion history.
These services Following are different surrogate selection
may provide security , scalability , and techniques.
reliability for Energy- Aware Selection
message exchange. Remaining battery is critical to every mobile
The Nearby Messages API is a publish- user and it determines the amount of
subscribe API that lets you paas small binary resources that the device owner may share.
payloads between internet- connected Selection of surrogates is a trade- off
Android and iOS devices between the quality of information gathered
and the remaining battery on the device with
Middleware Components an incentive budget.
Components of middleware commonly used Delay Tolerance- Based Selection
in fog and edge applications are discussed in Real- time applications and Streaming data
the following subsections. application require the processing to be
Context Monitoring and Prediction completed in a given time constraint .
FEA can adapt to dynamic changes in the Performance- based selection of surrogates
user environment using the context- aware is proposed in incentivized schemes.
design of middleware. Context- Aware Selection.
This may involve continuous monitoring of Context- aware functionality is used in many
relevant context and adaptive actions that mobile applications .
are based on changes in the context. Applications are designed to adapt

Page | 109
110 Fog and Edge Computing – Principles and Paradigms

themselves based on changes in context on 2.4 Scheduling and Resource


the mobile device or that of the user. Management
The context- aware recruitment scheme This engine works continuously to monitor
focused on improving the mobile selection the incoming tasks and their assignment
based on context requirements of the using the surrogate selection policy.
application that is proposed in Context- It monitors the availability of resources in
Aware Recruitment Scheme for different layers such as the availability of
Opportunistic Mobile Crowdsensing. new incoming user devices as well as tenant
Crowd- sensing is an approach involving a resources such as VMs that process data in
large, spread out group of participants using fog devices and the cloud.
mobile devices with the aim of receiving 2.5 Network Management
reliable data from the field. FEA uses the multitier applications.
This approach has been used both in network to distribute the fog and edge
industry and multiple research studies, It may use Software- Defined Networking or
including traffic and road monitoring (geo- Virtual Network Topology in multitenant
crowdsourcing), urban mobility, smart cities, resources in fog and cloud devices .
social networking, healthcare, safety, User devices are usually connected using
environmental and ecological monitoring, point- to- point network topologies that may
and others. either use TCP socket – WiFi connection ,
Large- scale activity prediction is proposed WiFi direct , or Bluetooth communication.
in “CAP: Community activity prediction This module is also responsible for
based on big data analysis” monitoring connection and triggering the
2.3 Data Analytics connection resume procedures for a lost
FEA introduces the idea of processing near connection.
the edge . 2.6 Execution Management
Extensive analytics may be involved in an This module facilitates the application
application that is processing across specific code functionality to execute on the
different layers in the architecture. edge and fog nodes.
Some of the analytics tasks can also be used Existing work in fog computing proposed
to extract the essential information from the the use of a virtual environment or use of
raw data obtained on the user devices. private OS stack provided by CISCO iox .
This not only reduces the processing Bellavista et al proposed Virtualization with
requirements centrally but also reduces the migration support on mobile devices.
communication costs. Plug- in based designs are proposed that are
Data analytics module on the user device downloaded and integrated into the app in
can be used to send essential data towards a runtime.
central server. 2.7 Mobility Management
Cloud server/data center may be used to MEC supports mobile edge devices that are
aggregate information and process high- constantly on the move .
level data analytics tasks. In such cases, the data and the middleware
Bonomi et al . discussed about processing services follow the devices.
data analytics tasks in multiple use cases in a
fog/edge environment.

Page | 110
Chapter 5 – Middleware for Fog and Edge Computing 111

The idea is commonly known as Follow me


Cloud (FMC) and uses Locator/ID
separation (LISP) protocol .

Sensors/Actuators
The sensors handle the important task of
obtaining real- time data from the
environment and user’s surrounding.
The information obtained through sensors is
used in several forms.
Sensor data may be acquired in the FEA
application itself.
It can also be used to evaluate and extract
context information of the device user.
In more complex applications, the closed-
loop information is acquired and analyzed
and further used for taking real- time actions
using the actuators.

Page | 111

You might also like