0% found this document useful (0 votes)
5 views192 pages

All in One

The document provides an overview of real-time embedded systems, defining them as systems that respond to real-time situations within specified time constraints. It discusses the characteristics, types (soft, hard, and firm real-time systems), and components of these systems, including sensors, actuators, and the importance of timing constraints. Additionally, it outlines the design process and architecture of embedded systems, highlighting the role of microcontrollers and the distinction between hardware and software components.

Uploaded by

Shafi Esa
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)
5 views192 pages

All in One

The document provides an overview of real-time embedded systems, defining them as systems that respond to real-time situations within specified time constraints. It discusses the characteristics, types (soft, hard, and firm real-time systems), and components of these systems, including sensors, actuators, and the importance of timing constraints. Additionally, it outlines the design process and architecture of embedded systems, highlighting the role of microcontrollers and the distinction between hardware and software components.

Uploaded by

Shafi Esa
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/ 192

Real-Time Embedded System

By: Desalegn A.(MSc, SW Eng’g)


Oda Bultum University
2015 E.C

1
Introduction to Real Time & Embedded Systems

• An embedded system is an electronic system that are designed to


perform a dedicated function which is embedded with in large system.
• A real time system are those that can provide guaranteed worst-case
response times to noncritical events.
• Embedded systems differ from general-purpose computing devices
mainly in two aspects:
• First, an embedded system is designed simply for a specific function, whereas a
general-purpose computing device, such as smartphone, laptop, or desktop
computer, is not; they can be used as Web servers or data warehouses, or can
be used for writing articles, reading news, playing games, or running scientific
experiments, to mention only a few applications.
• Second, an embedded system is traditionally built together with the software
intended to run on it. Such a parallel model of developing hardware and
software together is known as hardware-software co-design.
Definition of Real Time Embedded Systems

• The embedded systems which respond to real time situation with


the help of its embedded software and hardware, within the
specified time constraints are called real time embedded
systems.
• A systems that need to respond to a service request within a
certain amount of time.
Definition of Real Time Embedded Systems

• A real time system is a system that must satisfy explicit


(bounded) response-time constraints or risk severe
consequences, including failure.
• A real time system is one whose logical correctness is
based on both the correctness of the outputs and their
timeliness.
• A real time system is any information processing activity
or system which has to respond to externally generated
input stimuli within a finite and specified period.
Definition of Real Time Embedded Systems

Related Notions
• reactive system: continuous interaction with the environment
(as opposed to information processing)
• embedded system: computer system encapsulated in its
environment (device it controls), combination of computer
hardware and software, dedicated to specific purpose
• safety-critical system: a failure may cause injury, loss of lives,
significant financial loss
Characteristics of a Real-Time Embedded System
• Real time embedded systems must have the following
characteristics;
1. Constant Response:
• A real-time embedded system always responds in the
same manner to a certain situation, it is not allowed to
deviate from its normal designated output. An air-
conditioner is not allowed to throw hot air in summers.
2. Deadline:
• A deadline is crucial to the working of an embedded
system, a missed deadline can cost lives and finances.
Characteristics of a Real-Time Embedded System
3. Accuracy:
• In case of any malfunctioning, the system failure can cause
havoc
• For example, what would happen if the pacemaker can't maintain
the heartbeat, patient would eventually die!
4. Quick Response:
• Is the most important characteristic of all, the real-time
embedded system must be swift enough to respond to the
changing external environment with immediate effect.
Examples of real-time and embedded systems
Missile launcher
Medical equipment
Handheld devices
Avionics
Industrial control systems
Transportation control
Examples of real-time and embedded systems
Central Health System
GPS Systems
Fitness trackers
Medical devices
Automotive systems
Examples of real-time and embedded systems
Transit and fare Collection(air port in Ethiopian context)
ATMs
Factory robots
Model of Real Time System
• The basic model of a real-time system presents the overview
of all the components involved in a real-time system.
• Real-time system includes various hardware and software
embedded in a such a way that the specific tasks can be
performed in the time constraints allowed.
• The accuracy and correctness involved in real-time system
makes the model complex.
• There are various models of real-time system which are more
complex and are hard to understand.
Model of Real Time System
• Basic model of real-time system which has some commonly
used terms for hardware.
Model of Real Time System
• Sensor: Sensor is used for the conversion of some
physical events or characteristics into the electrical
signals.
• These are hardware devices that takes the input from
environment and gives to the system by converting it.
• For example, a thermometer takes the temperature as
physical characteristic and then converts it into electrical
signals for the system.
Model of Real Time System
• Actuator: Actuator is the reverse device of sensor.
• Where sensor converts the physical events into electrical
signals, actuator does the reverse.
• It converts the electrical signals into the physical events or
characteristics.
• It takes the input from the output interface of the system. The
output from the actuator may be in any form of physical
action.
• E.g Some of the commonly used actuator are motors and
heaters.
Model of Real Time System
• Signal Conditioning Unit: When the sensor converts the
physical actions into electrical signals, then computer can’t
used them directly.
• Hence, after the conversion of physical actions into
electrical signals, there is need of conditioning.
• Similarly while giving the output when electrical signals are
sent to the actuator, then also conditioning is required.
Therefore, Signal conditioning is of two types:
• Input Conditioning Unit: It is used for conditioning the
electrical signals coming from sensor.
• Output Conditioning Unit: It is used for conditioning
the electrical signals coming from the system.
Model of Real Time System
• Interface Unit: Interface units are basically used for the
conversion of digital to analog and vice-versa.
• Signals coming from the input conditioning unit are analog
and the system does the operations on digital signals only,
then the interface unit is used to change the analog signals to
digital signals.
• Similarly, while transmitting the signals to output conditioning
unit the interface of signals are changed i.e. from digital to
analog. Interface unit is also of two types:
• Input Interface: It is used for conversion of analog signals to digital.
• Output Interface: It is used for conversion of digital signals to analog.
Types of Real Time Embedded Systems
A real time embedded system,
being made up of real time
operating system, embedded
software and hardware. Real Time
embedded systems have the
following three types.
Types of Real Time Embedded Systems
1. Soft Real Time Embedded Systems
• A soft real-time constraint is a constraint that a
system should meet, but when the deadline is
occasionally missed, it won’t cause any disastrous
result, and the delivered service is still useful to a
certain extent.
• Try to reach deadlines but do not fail if a deadline
is missed.
• However, they may degrade their quality of
service in such an event to improve
responsiveness.
• Examples of soft real-time systems: audio and video
delivery software for entertainment
Types of Real Time Embedded Systems
1. Soft Real Time Embedded Systems
• Characteristics of soft real time embedded systems;
• Timeliness of a task poses a positive impact on the system, but it
is not crucial for the performance of the system.
• Missing a deadline would not degrade the performance of the
whole embedded system.
• Example of Soft Real Time Embedded Systems
• A data acquisition system can tolerate delays and hence its a
soft real time embedded system.
• websites, computer games, cellular networks, online database
and multimedia transmission and reception.
Types of Real Time Embedded Systems
2. Hard Real Time Embedded Systems
• A hard real-time constraint is a constraint that a
system must meet.
• Hard real-time software systems have a set of strict
deadlines, and missing a deadline is considered a
system failure.
• If the deadline is missed, it will either cause the
system failure or result in a zero usefulness of the
delivered service.
• Examples of hard real-time systems: airplane sensor
and autopilot systems, & spacecrafts.
Types of Real Time Embedded Systems
2. Hard Real Time Embedded Systems
• characteristics of hard real time embedded
systems;
• Time is crucial.
• The output must be completely on time, the
prescribed deadline can not be missed in any
case.
e.g You can't submit your exam paper after the time is
over, or can you?
• In case a deadline is missed, it would be
regarded as a system failure.
Types of Real Time Embedded Systems
3. Firm real-time systems
Firm real-time systems treat information delivered/
computations made after a deadline as invalid.
• Like soft real-time systems, they do not fail after a missed
deadline, and they may degrade QoS if a deadline is missed.
• Examples of firm real-time systems: financial forecast systems,
robotic assembly lines.
Modeling timing constraints
Timing constraints is a vital attribute in real-time
systems.
Timing constraints decides the total correctness
of the result in real-time systems.
 The correctness of results in real-time system
does not depends only on logical correctness but
also the result should be obtained within the time
constraint.
Several events happening in real time system and
these events are scheduled by schedulers using
timing constraints.
Modeling timing constraints
Timing constraints are broadly classified into two
categories:
1. Performance Constraints
 The constraints enforced on the response of the system
is known as Performance Constraints.
 It is how quickly and accurately the system is
responding.
2. Behavioral Constraint
 The constraints enforced on the stimuli generated by
the environment is known as Behavioral Constraints.
Modeling timing constraints
 The both performance and behavioral
constraints are classified into three
categories
I. Delay Constraint
II. Deadline Constraint
III. Duration Constraint
D >= d

Modeling timing constraints


D >= d

 Delay Constraint
 It defines the minimum time interval between
occurrence of two consecutive events in the real-time
system
 If an event occurs before the delay constraint, then it
is called a delay violation.
 The time interval between occurrence of two events
should be greater than or equal to delay constraint.
 If D is the actual time interval between occurrence of two
events and d is the delay constraint, then
D>=d
Modeling timing constraints
 Deadline Constraint
 A deadline constraint describes the maximum
time interval between occurrence of two
consecutive events in the real-time system.
i.e. the latest time by which two consecutive
events in the real-time system.
 If an event occurs after the deadline constraint,
then the result of event is considered incorrect.
 The time interval between occurrence of two
events should be less than or equal to deadline
constraint.
 If D is the actual time interval between occurrence of
two events and d is the deadline constraint, then
D<=d
Modeling timing constraints
 Duration Constraint
• Duration constraint defines the full-length of time an
event to occur in real-time system.
• The minimum and maximum time period of an event.
• So, it is further classified into two types:
Minimum Duration Constraint:
after the initiation of an event, it can not stop before
a certain minimum duration.
Maximum Duration Constraint:
 after the starting of an event, it must end before a
certain maximum duration elapses.
Computer organization concepts and memory
 Organization of a computer system defines the
way system is structured so that all those
catalogued tools can be used.
 Organization of a computer system is the internal
parts of a computer
 The basic components of Computer organization
are mother board, RAM, catch, ALU, CU, memory,
and memory organization.
Design process
 Definition: A system designed with the embedding
of hardware and software together for a specific
function with a larger area is embedded system
design.
 In embedded system design, a microcontroller plays
a vital role.
 Micro-controller is based on Harvard architecture, it
is an important component of an embedded
system.
 External processor, internal memory and i/o
components are interfaced with the microcontroller.
 It occupies less area, less power consumption..
Design process
Design process
Steps in the Embedded System Design Process
Abstraction: In this stage the problem related to the system is
abstracted.
Hardware – Software Architecture: Proper knowledge of
hardware and software to be known before starting any design
process.
Extra Functional Properties: Extra functions to be implemented
are to be understood completely from the main design.
System Related Family of Design: When designing a system,
one should refer to a previous system-related family of design.
Modular Design: Separate module designs must be made so
that they can be used later on when required.
Design process
Steps in the Embedded System Design Process
Mapping: Based on software mapping is done. For example,
data flow and program flow are mapped into one.
User Interface Design: In user interface design it depends on
user requirements, environment analysis and function of the
system. For example, on a mobile phone if we want to reduce
the power consumption of mobile phones we take care of other
parameters, so that power consumption can be reduced.
Refinement: Every component and module must be refined
appropriately so that the software team can understand.
Architectural description language is used to describe the
software design.
Design process
 Steps in the Embedded System Design
Process
Real-Time Embedded System

By: Desalegn A.(MSc, SW Eng’g)


Oda Bultum University

1
Chapter 2

Embedded System Architecture

2
Embedded System Architecture

• Embedded system mainly have two parts i.e.,


embedded hardware and embedded software.
• Embedded hardware's are based around microprocessors
and microcontrollers, also include memory, bus,
Input/Output, Controller, where as embedded software
includes embedded operating systems, different
applications and device drivers.
Embedded System Architecture

• The two types of architecture i.e., Harvard architecture and Von


Neumann architecture are used in embedded systems.
Embedded System Architecture

• Hardware Architecture of the Embedded System includes Sensor,


Analog to Digital Converter, Memory, Processor, Digital to Analog
Converter, and Actuators etc.
• The below figure illustrates the overview of basic architecture of
embedded
Embedded System Architecture
Sensors
A sensor converts some physical characteristics
of its environment into electrical signals
Examples of sensor
• A photo-voltaic cell converts light energy into
electrical energy
• A temperature sensor typically operates based
on the principle of thermocouple.
• Pressure sensor typically operates based on
piezoelectricity principle.
Actuators
An actuator converts electrical signals into

some physical actions.


The physical action may be:
• Motion, change of thermal, electrical,
pneumatic, or physical characteristics of
some objects.
Actuators
Examples of actuators
• Motors
• Heaters
• Hydraulic and pneumatic actuators
ADC & DAC

Analog – to – digital converters (ADC)


• Converts continuous signals to discrete numbers

The reverse operation


• Performed by digital – to- analog converters
(DAC)
Implementing Embedded System
 Hardware
 Processing elements
 Peripherals
 I/O Devices
 Interfacing Sensors and actuators
 Memory Hardware
 Bus
Software
Partitioning
 Software
of
 System software
Tasks
 Application
ARM Cortex M0+ Hardware Overview:
 The most energy efficient ARM processor.
 system level and debug features (all optional) .
 It supports the same instruction set as the Cortex-M0
processor.
 Based upon 32 bit RISC (Reduced Instruction Set Computing)
Architecture with enhancements to meet requirements of
embedded application.
• A large uniform register file
• Load-Store architecture, where data processing
operations operate on register.
ARM Cortex M0+ Hardware Overview:
ARM Cortex M0+ Hardware Overview:
ARM Cortex M0+ Hardware Overview:
ARM Cortex M0+ Hardware Overview:
 vonNeuman Architecture
 Instruction sets
• Based on 16-bit (thumb) instruction set and includes 32-bit
(thumb-2) instruction set technology
• 32-bit processor
• Instructions are 32-bit long
• Good speed/power consumption ratio
ARM Cortex M0+ Hardware Overview:
 Instruction sets
• High code density with 32 bit performance
• Two stage pipeline(fitch and execute instructions)
• Support interrupts
• None-Maskable interrupts (NMI)-(can not control from
executing) + 1to 32 physical interrupts
• Have 4 interrupt priority level:4 bit
ARM Cortex M0+ Hardware Overview:
ARM Cortex M0+ core Hardware Overview:
Enhancement to basic RISC feature
 RISC: Reduced Instruction Set Computer
 Control over ALU & shifter for every data
processing operations to maximize their usage.
 Auto-increment & auto-decrement addressing modes
to optimize loops
 Load & store multiple instructions to maximize
data throughput
 Conditional execution of instruction to maximize
execution throughput.
Core Data Path
Data items are placed in register file
• No data processing instructions directly manipulate
data in memory
Instructions typically use two source
registers & single result or destination register
A barrel shifter on the data path can pre-
process data before it enters ALU.
ARM Cortex M0+ Hardware Overview: Ports

 The Cortex-M0+ processor implements a dedicated single-


cycle I/O port for high-speed, single-cycle access to
peripherals.
 The single-cycle I/O port is memory mapped and supports
all the load and store instructions described in Memory
access instructions.
 The single-cycle I/O port does not support code execution.
Registers
 General purpose registers hold either

 data or address.
 All registers are 32 bits
 In user mode 16 data
registers & 2 status registers are
available.
Registers
Data registers: r0 to r15
• Three registers r13, r14, and r15 perform
special functions
• r13: stack pointer
• r14: link register (where return address is input
whenever a subroutine is called)

• r15: Program counter


Registers
 Depending upon context, registers r13 & r14 can
also be used as GPR.
 In addition, there are two status registers
 CPSR: Current Program Status Register

 SPSR: Saved Program Status Register


Registers: r15

When the processor is executing in

ARM state
 All instructions are 32 bit wide

 All instructions are word aligned

 PC value is stored in bits [31:2] with bits [1:0]


undefined.
Status Registers

CPSR: monitors & control internal


operation.
ARM Cortex M0+ Hardware Overview: GPIO

 The GPIO (General Purpose Input/Output) pins are


used for interfacing with external devices.
 The GPIO pins can be configured as either inputs or
outputs
ARM Cortex M0+ Hardware Overview: Analog I/O

• The ADC/DAC (Analog-to-Digital Converter/Digital-


to-Analog Converter) pins are used for interfacing
with analog devices.
• The ADC/DAC pins can be configured as either
inputs or outputs
Communication interfaces

Serial vs Parallel Communication


Serial Communication Parallel Communication
One bit is transferred at a time Eight bits are transferred at a time

Used for long distance Used for short distance

Circuit used in serial communication is Communication is complex


simple
slow fast

Cost- efficient Not cost-efficient


Communication interfaces

The interfaces included in the processor for


external access include:
External AHB-Lite interface: a subset of the full
AHB specification for use in designs where only a
single bus master is used.
Debug Access Port (DAP): is a Debug Port (DP)
that is connected to one or more Access Ports
(APs).
Optional single-cycle I/O Port: provides very high
speed access to tightly-coupled peripherals, such
as general-purpose-I/O (GPIO)
Communication interfaces

• USB- used for serial communication if available


Have one USB port
• USART: Universal Synchronous Asynchronous
Receiver Transmitter. It is sometimes called the
Serial Communications Interface
Two USARTs with master/slave synchronous SPI; one
supporting ISO7816 interface, LIN, IrDA capability,
auto baud rate detection and wakeup feature
• A USART (universal synchronous/asynchronous
receiver/transmitter) is hardware that enables a
device to communicate using serial protocols.
Communication interfaces

• I2C (Inter-Integrated Circuit: Is a serial communication


 a system for serial data exchange between the microcontrollers
and specialized integrated circuits of a new generation.
It is used when the distance between them is short (receiver
and transmitter are usually on the same printed board).
Connection is established via two conductors.
is a synchronous, multi-master/multi-slave (controller/target),
packet switched, single-ended, serial communication bus
• Two I2C-bus interfaces supporting Fast mode Plus (1 Mbit/s)
with extra current sink, one supporting SMBus/PMBus and
wakeup from Stop mode
Communication interfaces

• A UART (Universal Asynchronous Receiver/


Transmitter):
 Is a serial communication
is the microchip with programming that controls a
computer's interface to its attached serial devices.
• UART: is one of the most used device-to-device communication
protocols.
• One low-power UART
Communication interfaces

•SPI-Serial Peripheral Interface


Is a serial communication
Have two SPIs (32 Mbit/s) with 4- to
16-bit programmable bit frame, one
multiplexed with I2C interface.
ATmega32 microcontroller Architecture
•The AVR microcontroller is based on the
advanced Reduced Instruction Set Computer
(RISC) architecture.
• ATmega32 microcontroller is a low power
CMOS technology based controller.
•Due to RISC architecture AVR microcontroller
can execute 1 million of instructions per second
if cycle frequency is 1 MHz provided by crystal
oscillator.
features of ATmega32 microcontroller
2 Kilo bytes of internal Static RAM
32 X 8 general working purpose registers
32 Kilo bytes of in system self programmable flash program
memory.
1024 bytes EEPROM
Programmable serial USART
8 Channel, 10 bit ADC
One 16-bit timer/counter with separate prescaler, compare
mode and capture mode.
Prescaler: divides down the clock signals used for the timer.
features of ATmega32 microcontroller
Available in 40 pin DIP, 44-pad QFN/MLF and 44-lead QTFP
Two 8-bit timers/counters with separate prescalers and
compare modes
32 programmable I/O lines
In system programming by on-chip boot program
Master/slave SPI serial interface
4 PWM channels
Programmable watch dog timer with separate on-chip oscillator
Special Microcontroller Features
Available in 40 pin DIP, 44-pad QFN/MLF and 44-lead QTFP
External and internal interrupt sources
Six sleep modes: Idle, ADC noise reduction, power-save, power-
down, standby and extended standby.
Power on reset and programmable brown-out detection.
Internal calibrated RC oscillator
ATmega32 Microcontroller Pin Diagram
ATmega32 Microcontroller is a 40-pin Dual Inline Package (DIP)
SPI-PB4-PB7
USART- PD0 & PD1
I2C- PC0 and PC1

JTAG: PC2-PC5-check the


internal status of all the
register
ADC Power and Reference pins
ATmega32 Microcontroller Pin Diagram
Pin Descriptions:
Port A (PA7-PA0): Port A serves as analog inputs for A/D converter.
It also acts as an 8-bit bidirectional I/O port if the A/D converter
is not used internally.
Port B (PB7-PB0) and Port D (PD7-PD0): These ports are 8-bit
bidirectional I/O ports. Their output buffers have symmetrical drive
characteristics with high source and sink capability. As inputs, these
are pulled low if the pull-up resistors are used. It also provides
various special functional features of the ATmega32.
Port C (PC7-PC0): Port C is an 8-bit bidirectional I/O port. If the
Joint Test Action Group (JTAG) interface is enabled, the pull-up
resistors on pins PC2 (TCK), PC3 (TMS), and PC5 (TDI) will be
activated.
ATmega32 Memory Type
The “data memory” in the ATmega32 is 2K bytes of
RAM plus 32 8-bit general-purpose registers plus 64 8-
bit input/output registers, all byte- organized.
Totally ATmega32 have 40 registers
Instruction Set Architecture(ISA)
An instruction set is list of commands ready to be executed
directly by the CPU.
The function of instruction set is to instruct all CPU’s with a
set of instruction that can:
Tells the CPU where to find data
When to read the data
What to do with the data
Types of Instruction set
Data transfer instruction
Arithmetic instruction
Logical instruction and bit manipulation
Program control instruction
Processing control instruction
Shift and rotate instruction
Instruction Set :Assembly language

AL-is a low level programming language for


computers, microprocessors, microcontrollers and
other programable devices.
AL is one level higher than machine language
Assembly language consists of simple codes
Each statement in AL corresponds directly to a
machine code understood by the microprocessor.
The software used to convert an assembly
program into machine codes is called assembler
ATmega32 Addressing Modes
The CPU can access data in various ways. The data could be in a
register, or in memory, or provided as an immediate value.
These various ways of accessing data are called addressing
modes.
The various addressing modes of a microprocessor are
determined when it is designed, and therefore cannot be
changed by the programmer.

Many instructions such as MOV, operates on two operands.


MOV des,source
Addressing mode indicates where the operands are located
ATmega32 Addressing Modes
There are 5 basic addressing modes for the AVR
o Register Direct
• Single Register
• Two Registers
o I/O Direct
o Immediate
o Data Direct
o Data Indirect
• Data Indirect with Post Increment
• Data Indirect with Pre Decrement
• Data Indirect with Displacement
ATmega32 Addressing Modes: Instruction Format
Addressing Modes: Register Direct-Single
 Instructions can operate on any of the 32 registers
 The group of 32 registers are referred to as the Register File

 The microcontroller:
 Reads the data in the register
 Operates on the data in the register
 Stores the results back in the register

12 bits 4 bits
GPRs
Op. Code Rd 0

Examples:

INC R16
CLR R22 d

31
Addressing Modes: Register Direct-Single Register
Addressing Modes: Direct-Two Registers
o Instructions can operate on any of the 32 registers
• One of theses register is the source register Rs and one is the destination register Rd

6 bits 5 bits 5 bits


GPRs
Op. Code Rr Rd 0

31
Addressing Modes: Register Direct-Two Registers
Addressing Modes: Register Direct-Two Registers
Addressing Modes: Register Direct-Two Registers
Addressing Modes: Register Direct-Two Registers
Addressing Modes: I/O Indirect

I/O Memory
15 5 0 0
Op. Code Rr/Rd A

A
Addressing Modes: I/O Indirect
Addressing Modes: I/O Indirect
Addressing Modes: I/O Indirect
Addressing Modes: I/O Indirect
Addressing Modes: I/O Indirect
Addressing Modes: Immediate

• LDI Rd,K 4 bits 8 bits 4 bits


GPRs
– LDI R19,25 Op. Code Immediate Rd 0

• SUBI Rd,K
d
– SUBI R23,5 ;R23 = R23 – 5

31
• ANDI Rd,K
– ANDI R21,0x15
Addressing Modes: Immediate
Addressing Modes: Immediate
Addressing Modes: Data direct

31 20 19 16 Data Space
Op. Code Rr/Rd 0
o LDS Rd, address Data Address
• LDS R19, 0x313 15 0

o STS address, Rs
• STS 0x95, R19
Note: RAMEND has been used to
represent the highest location in
RAMEND
data space.
Addressing Modes: Data Indirect
Data Space
15 0 0
X, Y, OR Z - REGISTER

Note: RAMEND has been used to represent


the highest location in data space. RAMEND
Addressing Modes: Data Indirect
Addressing Modes: Examples
Chapter Three
Software Frameworks for Real-time and
Embedded Systems

9/28/2024 1
Definition
 A Real-Time Operating System (RTOS) is an operating system
designed to handle real-time applications that require timely,
deterministic responses to events.
 It ensures tasks are executed within a specified deadline, making
it ideal for systems that depend on precise timing, such as
embedded systems, robotics, avionics, and industrial control
systems.
 These systems often operate in constrained environments (limited
CPU, memory, power) and are used in industries such as automotive,
aerospace, medical devices, telecommunications, and industrial
control.

9/28/2024 2
Real-time operating system:
 OS is the software that sits between the hardware and software applications
running on the computer
USER
 OS is a resource allocator and manager.
 Hardware resources could be processor, memory, APPLICATION PROGRAM

I/O controllers, disks, and other devices such as


OPERATING SYSTEM
terminals and networks.

HARDWARE

9/28/2024 3
Real-time operating system:

 All the GPOS such as Linux, windows have execute multi-tasks at the same time
and but it lacks in synchronization of the data.
 It is known that Kernel is core component of OS that control over all of the
hardware devices.
 However, GPOS are not suitable for real-time embedded systems which required
by real time applications in embedded system.

 Here of, real time applications in embedded system requires real time, priority and
time based operating system which is called RTOS.
9/28/2024 4
Rear Time Operating system (RTOS)

 RTOS supports the construction of applications that must meet real-time constraints
 RTOS is a priority based operating system designed to serve real time applications.
 It requires fewer resources in-order to provide accuracy of the task.
 It produce accurate output within no time (within deadline) and occupies less memory.
 It provides mechanisms and services to carry out real-time task scheduling,

9/28/2024 5
Rear Time Operating system (RTOS)
 It provides resource management, and intertask communication.
 RTOS are designed for critical systems or critical tasks for devices like
microcontrollers that are timing-specific devices.

6
Rear Time Operating system (RTOS)
A real-time kernel is software component that manages time and resources of a
microprocessor or microcontroller
It provides essential services such as task scheduling and interrupt handling to
applications.
There are three key requirements of RTOS design
1. Timing behavior of the OS must be predictable or it should be think over about
time.
2. Must manage timing and scheduling for task processing
3. The OS must be fast to meet its deadline
7
Types of RTOS (Real Time Operating System)
It is classified into three types. They are:
1.Soft Real Time Operating System
2.Hard Real Time Operating System
3.Firm Real Time Operating System

9/28/2024 8
 Types of RTOS (Real Time Operating System)
1. Soft Real Time Operating System
Response time of the system is important but not critical to the operation
Deadline is specified but the system can accept short amount of delay
But if missed deadline the performance is degraded.
Example: Online transaction system, TV live broadcasts a delay can be
acceptable etc.

9/28/2024 9
2. Hard Real Time Operating System
Deadline and time duration to execute tasks are specified.
If not respond within the time line specified it will result disastrous consequences.
This OS must be meet its deadline
Example: Medical critical care systems and Aircraft systems etc.
3. Firm Real Time Operating System
Deadline is specified but missing deadline does not cause a big impact
If the result is obtained after the deadline then result will be considered incorrect
Example: Multimedia applications,
9/28/2024 10
Characteristics of RTOS:
 Small footprint: compared to general OSes, RTOS lightweight.
 It occupy a very small amount of memory.
 Consume fewer resources.
 High performance: RTOSes are typically fast and responsive OS.
 Determinism: repeating inputs end in the same output.
 Safety and security: safety and security are typically the highest priority for RTOS
 Priority-based scheduling. Follows high priority task first execution that followed by lower-
priority jobs.
 Timing information. RTOS are responsible for timing and providing application in deadline

9/28/2024 11
Characteristics of RTOS:
 Minimal Latency: RTOS has low interrupt and thread switching latency, allowing fast
responses to external events.
 Preemptive Multitasking: Tasks can be interrupted (preempted) to allow higher-priority tasks
to run.
 Concurrency Management: Supports multiple tasks running concurrently, with mechanisms
like semaphores, mutexes, and message queues to manage shared resources and avoid race
conditions.

9/28/2024 12
Structure of RTOS
 Basic Structure is similar to regular OS but in addition, it provides mechanisms to
allow real time scheduling of tasks.
 OS is nothing but a collection of system calls or functions while real time is time
at which task should executes

9/28/2024 13
Structure of RTOS

User space

Kernel space

Hardware space

Architecture of RTOS
9/28/2024 14
RTOS Support for Applications
 Task Prioritization: Applications can assign priorities to tasks to ensure the most critical tasks
meet deadlines.
 Deterministic Execution: Guarantees time-sensitive tasks will execute within a known time frame.
 Efficient Resource Management: Manages CPU time, memory, and hardware resources to
ensure reliable application behavior.
 Modular Design: Applications can be developed as separate tasks or modules that communicate
via the RTOS.
 Real-Time Clock & Timers: Applications can rely on accurate timekeeping for scheduled or
periodic operations.
 Fault Tolerance: Supports systems that need to continue operating even in the case of component
failures.

9/28/2024 15
Inter process communication
The communication between process while they are running is called interprocess
communication (IPC).
It allows processes to communicate with each other and synchronize their actions.
It helps to know that some event has occurred or the transferring of data from
one process to another.
Inter communication can be method of cooperation between those task.

9/28/2024 16
Inter process communication
The two methods of inter process communication
1. Shared memory
 Assume that process P1 Producer produces some items and the process P2
consumes that item.
 The two processes share a common space or memory location known as a
buffer where the item produced by the Producer is stored and from which the
Consumer consumes the item if needed.
2. Message Passing:
 Processes communicate with each other without using any kind of shared memory.
Assume that two process p1 and p2, want to communicate with each other when they are
running as follows:
1. Establish a communication link b/n the two process: (if a link already exists, no need to
establish it)
2. Start exchanging messages using basic primitives: the two primitives send (message,
destination) or receive (message, host)
17
Some reasons for process cooperation (inter process communication)
 Information sharing − for sharing resources among multiple users
 Computation speeds up − to run tasks faster by break it into subtasks
 Modularity − dividing the system functions into separate processes or threads.
 Convenience − it helps to work on many tasks at the same time.

9/28/2024 18
What is Task?
 A task is a unit of work scheduled for execution on the CPU.
 It is a building block of real-time application software supported by an
RTOS.
 There are three types of tasks:
I. Periodic tasks. Periodic tasks are repeated once a period, for example,
with in 200 milliseconds.
II. Aperiodic tasks. Aperiodic tasks are one-shot tasks. They are event-
driven.
 Aperiodic tasks have no hard deadlines
III. Sporadic tasks. Sporadic tasks are also event-driven. The arrival times
of sporadic task instances are not known a prior, but there is
requirement on the minimum inter arrival time.
 sporadic tasks have hard deadlines
9/28/2024 19
Real Time task scheduling
 Task management and scheduling are core functions of any RTOS kernel.
 Scheduler part of kernel and is responsible for allocating and scheduling tasks to
ensure that deadlines are meet.

 Scheduling is determine the allocating of time between tasks

 If two or more tasks have equal priority, the choice of task is based on FCFS.

 Task scheduling in OS can be either preemptive or non-preemptive.

9/28/2024 20
Task scheduling
1. Preemptive scheduling:
 Used when a process switches from running state to ready state or from
waiting state to ready state.
 Process can be interrupt in between running Algorithms design based on the
following methods:
 Round Robin: Each process is assigned a fixed switches

time slot (called a quantum) to execute. Running state Waiting state


Task1 Task1
 Shortest Remaining Time First (SRTF)

switches
 Priority (preemptive version) Ready state
Task1

9/28/2024 21
Task scheduling
2. Non-preemptive:
 It is scheduling method that does not interrupt a process in the middle of
execution.
 It process switches from running state to waiting state.
Running state Waiting state
 Examples of this scheduling algorithms: Task1 switches Task1

 Shortest Job First (SJF)


 Priority (non-preemptive version)
 Generally most embedded systems use preemptive scheduling.
9/28/2024 22
Comparison between preemptive and non-preemptive scheduling
Preemptive scheduling Non-preemptive scheduling
 Resource (CPU cycles) allocated for  Resource (CPU cycles) allocated until
limited time process execution is complete
 Process can be interrupt in between  Process cannot be interrupt until it
running terminate or time it up
 If process having high priority  If process with long burst time is
frequently arrives in ready queue, the low running in CPU then later coming
priority process may starve process with less CPU burst time may
starve
 It is flexible  Is rigid
 It have high CPU utilization  It have low CPU utilization
 Waiting time is less  Waiting time is high
 Less responsive time  High responsive time
9/28/2024 23
What is Priority in RTOS
 Priority means take attention for a process or task which first should be execute
 If two or more tasks have equal priority, the choice of task is based on FCFS.
 Task scheduling for real-time applications can be priority-based and preemptive
scheduling.
 The two ways of task priorities in OS
1. Static Priorities.
 Or priority of each task does not change during the application's execution.
2. Dynamic Priorities.
 The priorities of a task can be changed during execution time if necessary if
 Some dynamic allocation of tasks
high priority task come to CPU to execute.  Priority based scheduling and
 Cyclic scheduling
9/28/2024 24
1. Priority-based scheduling in dynamic priorities.
 All tasks are not equal in terms of the urgency of getting executed b/c real time
task have deadline
 Tasks with shorter deadlines should be execution first or sooner than longer one
<--Examples Tasks that are ready to run with different deadline D-
Task1 Task2 Task3 Task4
D=2ml D=5ml D=1ml D=4ml

Task3 Task1 Task4 Task2


D=1ml D=2ml D=4ml D=5ml

9/28/2024 25
1. Priority-based scheduling in dynamic priorities.

 Scheduling algorithms such as first-in-first-service (FISE) and round-robin,


are not suitable for real-time systems
 This because they do not take priorities into account
Examples of priority based scheduling for RTOS
1. Earliest deadline first (EDF) scheduling:
2. Rate Monotonic Scheduling (RMS)

9/28/2024 26
1. Priority-based scheduling in dynamic priorities.

1. Earliest deadline first (EDF) scheduling:


It is dynamic and priority based algorithm
It always schedules the task whose absolute deadline is the earliest for execution.
It assign highest priority task with earliest deadline
<----------------Tasks that are ready to run---------
Widely used in applications
Task1 Task2 Task3 such as
Deadline=3ml Deadline =5ml Deadline=2ml
 distributive system,
 networking,
Task3 Task1 Task2  embedded,
Deadline =2ml Deadline =3ml Deadline =5ml
 multimedia and
 Earliest deadline task has high Priority for execution  real time control system
9/28/2024 27
1. Priority-based scheduling in dynamic priorities.
2. Rate monotonic Scheduling (RMS):
This scheduling method is based on how often tasks executes.
Simply put tasks with the highest rate of execution are given the highest priority.
 Assume that Task1, Task2, and Task3 has different execution rate (ER)

Task1 Task2 Task3


ER=3t ER =5t ER=2t

Task2 Task1 Task3


ER =5t ER =3t ER=2t

9/28/2024 28
2. Cyclic scheduling in dynamic priorities.
Cyclic scheduling is simple method than table-driven scheduling (which is not
suitable for embedded system)
Each task is allowed to run to completion before it handover to the next.
 A task cannot be discontinued or interrupted as it runs.
It is precomputed schedule that is repeated again and again
Each task in the task set is repeat identically in each cycle.

9/28/2024 29
Multi-tasking and Concurrency issue
 Multitasking
It is capability of an OS that supports multiple independent programs running on
the same computer or machine and it achieved through time-sharing
 Concurrency
It means several activities are executed simultaneously.
It is the execution of a set of multiple instruction sequences at the same time.
This occurs when there are several process threads running in parallel.

Concurrency 30
Handling resource sharing
 In many applications real time task need to share resources among themselves.
 However, some task cannot immediately handover (transfer or release) it to
another task Task1 resource Task2
1

 But also there are mechanisms that employed by system which is not real time
system for sharing resources among multiples set of tasks such as semaphore,
Mutex, locks and monitors (you learn this in GPOS)
 However, these mechanisms are not adequate for resource sharing in real time
applications b/c they raise problem called priority inversion issue.
31
What is priority inversion
 It is a problem that occur in real time applications when working with a
preemptive priority scheduling algorithm
 Priority Inversion is a phenomenon in scheduling where a higher-priority task is blocked or
delayed because a lower-priority task holds a resource (e.g., a mutex or a lock) needed by the
higher-priority task. Priority inversion typically occurs in a system using priority-based
preemptive scheduling with shared resources.
 Here’s a common scenario:
1. Task A: Low-priority task holding a shared resource (e.g., a lock or semaphore).
2. Task B: Medium-priority task running and not requiring the resource.
3. 9/28/2024
Task C: High-priority task waiting for the resource that Task A holds. 32
Cont….
In this case:
 Task C cannot proceed because Task A holds the resource it needs.
 The system prioritizes Task B over Task A, even though Task C is more
important, because Task B has higher priority than Task A.
 As a result, Task C (high priority) is indirectly blocked by Task B
(medium priority), which does not even need the shared resource. This
is called inversion because a low-priority task (A) indirectly blocks a
higher-priority task (C).

9/28/2024 33
Types of Priority inversion
1. Direct Inversion :
 It occurs when a higher priority task waits for a lower priority task which holding a
critical resource
 Example:
 Suppose there are two tasks T1 and T2 where T2 is having higher priority than T1.
 And T2 needs resource which holds by T1 but T2 will have to wait until T1
executes and releases the critical resource CR.
2. Inheritance-Related Inversion :
 It is also occur when lower priority task is holding a critical resource and a higher
priority task is waiting for this critical resource
 And it makes priority of the lower priority task is set to the equal priority with
higher priority task using the inheritance techniques
34
Resource sharing protocols
1. Priority Inheritance protocol (PIP):
 It designed for sharing resources among tasks or to solve priority inversion issue
during sharing of resources among tasks.
 This means PIP protocol is used whenever lower priority task holding the
resource while high priority task wait for such resources.
 If a low-priority task holds a resource and a high-priority task requests it,
the low-priority task temporarily inherits the high-priority task's priority.
 However, PIP cannot prevent deadlock issue

35
Resource sharing protocols
2. Highest Locker protocol (HLP):
 PLP is an extended of PIP and it overcome some shortcoming of PIP.
 It critical resources is assigned to higher priority value (called ceiling)
 Whenever a task gains a resources, its priority becomes equal to the ceiling
priority value. R1
cv=2
 However, it has its own limitation T1
p=2
T3
T2
3. Priority Ceiling Protocol (PCP):
 Priority Ceiling: the highest priority of all tasks that might lock the resource.
 PCP extends the ideas of PIP and HLP to solve the problems of unbounded
priority inversion, chain blocking and deadlocks, while at the same time
36
minimizing in heritance related inversion.
Fault- tolerance
 Fault tolerance refers to the ability of a system (computer, network, cloud cluster,
etc.) to continue operating without interruption when one or more of its
components fail.
 components fail.
 It is the ability to continue operating even if there is some hardware or software
failure.
 It is important to consider designing of fault tolerant system for real time system
because consequences of violating timing constraints in hard real-rime systems
very dangerous
 Fault tolerance approaches can be classified into two types:
 Proactive approaches predict errors, faults and failures and replace the
suspected components
 Reactive approaches reduce the effect of faults by taking necessary actions. 37
Fault- tolerance vs High availability
 High availability refers to a system’s ability to avoid loss of service by minimizing
downtime.
 It’s expressed in terms of a system’s uptime, as a percentage of total running time.
 It is five nines uptime(99.999% or less than 6 minutes downtime per year)

38
Synchronization techniques

 It the way tasks that share the same memory space are managed OS
 Whenever two tasks want to intercommunication they must be synchronized
for a message transfer
 It insures that multiple process access shared resources without affecting other
tasks
 It prevents the possibility of inconsistency of data due to concurrent access.
 So, it helps to avoid risk of deadlock and other synchronization problems.

9/28/2024 39
Synchronization techniques
 Generally process categorized into two in the case of synchronization
 Independent process
 Cooperation process

Synchronization ensures that the correct execution order among cooperating tasks
Synchronization is the cooperative act among two or more threads or tasks in
relationship to each other

 General there are 2 types of clock synchronization algorithms:


1. Centralized clock synchronization and
2. Distributed clock synchronization
9/28/2024 40
Synchronization techniques
1. Centralized clock synchronization
 Time of main device or server is used as a reference time and this single time
propagates to nodes and all nodes adjust their time accordingly.
 So, all nodes dependent on a single time-server
 And if that server fails, the whole system will lose synchronization.
 Examples of centralized are-Berkeley the Algorithm, Passive Time Server,
Active Time Server etc.

9/28/2024 41
2. Distributed clock synchronization
 Instead of single server time sharing to all nodes, each nodes in share their time
with other.
 The nodes adjust their time by using their local time and, then nodes adjust their
time by taking the average of the differences in time with other nodes.
 So, there is a need for proper allocation of resources and help coordinate
between the several processes.
 Examples of Distributed algorithms are:
 Global Averaging Algorithm,
 Localized Averaging Algorithm,
 NTP (Network time protocol), etc.
42
Real-time applications
 Mobile applications.
 Air traffic control systems.
 Online transaction system.
 Online calling.
 Medical Critical Care systems.
 Ticket reservation systems.
 Aircraft and defense systems (e.g. RADAR)
 Command control systems.
 Price quotation systems.

 Network and multimedia systems.

 Anti-Lock brake systems.

9/28/2024 43
Chapter-4
Embedded Systems Design Issues
Introduction
• Embedded Systems Design Issues refer to the challenges and
considerations that must be addressed when developing an
embedded system.
• These issues arise due to the unique characteristics of
embedded systems, such as real-time performance, hardware
constraints, and application-specific requirements.
Memory Management
• Memory Management in Embedded Systems Design is a
critical aspect because embedded systems often have
limited memory resources (RAM and ROM) due to cost,
size, and power constraints.
• Effective memory management ensures that an embedded
system runs efficiently without exhausting its available
memory, which can lead to system failures or degraded
performance.
Minimize memory usage by optimizing code and data storage.
Use lightweight data structures and efficient memory allocation
algorithms
Memory Management on RTOS
• The memory management of RTOS is a little bit different from
GPOS
• RTOS Memory Management: Determinism(allocation, deallocation, and paging
must be predictable and fast to meet real-time constraints), Low Latency, and
Resource-Constrained.
• GPOS Memory Management: Throughput and Fairness, Complex Memory
Features, and Scalability
• The memory allocation time increases depending on the size of the
block of memory.
• Needs to be allocated and the state of allocated memory
block(initialized memory block consumes more allocation time
than uninitialized memory block)
• The primary focus of RTOS is deterministic behavior and
predictable timing
Cont….
• RTOS commonly uses “block” based memory allocation
technique, instead of dynamic memory allocation technique used
by GPOS.
• RTOS uses blocks of fixed size of dynamic memory and the block
is allocated for a task on a need basis.
• The blocks are stored in a “free buffer Queue”
• Most of the RTOS kernels allow tasks to access any of the memory
blocks without any memory protection to achieve predictable
timing and avoid the timing overheads
• RTOS kernels assume that the whole design is proven correct and
protection is unnecessary.
Cont…
• In “block” based memory allocation, a block of fixed
memory is always allocated for tasks on need basis
and it is taken as a unit.
• So, there will not be any memory fragmentation
• Consumes fixed amount of time for memory
allocation
Hardware Development
• Hardware development for embedded systems involves
selecting and designing the right components to ensure the
system performs efficiently under the required operational
constraints.
• Several critical issues must be addressed when designing
embedded hardware, including the selection of
• Microcontrollers,
• Power Management,
• Interfacing with Peripherals, and
• Environmental Considerations.
Design Requirements
Embedded system must satisfy the following:
Real time operation/ reactive to external event
Conform to size and weight limits.
Budget, power and cooling consumptions
Satisfy safety and reliability requirements
Meet tight cost targets
Real Time/Reactive Operation
Real Time Operation VS Reactive Operation
• Real-time systems are designed to respond to inputs or events within a
strictly defined time limit.
• The correctness of a computation depends, in part, on the time at which it
is delivered.
• The system design must also take into account worst case performance.
• Predicting the worst case may be difficult on complicated architectures.
• For example, Signal Processing and Mission Critical example systems
have a significant requirement for real time operation.
Real Time/Reactive Operation
Reactive Operation
Reactive systems, on the other hand, are systems that
continuously respond to changes in their environment, but they are
not necessarily required to meet strict time constraints.
Reactive computation means that the software executes in
response to external events.
These events may be periodic, in which case scheduling of
events to guarantee performance may be possible.
On the other hand, many events may be aperiodic, in which
case the maximum event arrival rate must be estimated in order
to accommodate worst case situations.
Small Size and Low Weight
Embedded computers are physically located within
artifacts.
Weight is considered as a major factor for
transportation and portable systems.
Safe and Reliable
In mission-critical applications such as aircraft flight
control, severe personal injury or equipment damage
could result from a failure of the embedded computer.
 Such systems, have employed multiply-redundant computers or
distributed consensus protocols in order to ensure continued
operation after an equipment failure.
Harsh environment
Many embedded systems do not operate in a
controlled environment.
Excessive heat is often a problem, especially in
applications involving combustion (e.g., many
transportation applications).
Additional problems can be caused for embedded
computing by a need for protection from vibration, shock,
lightning, power supply fluctuations, water, corrosion, fire,
and general physical abuse.
Cost Sensitivity
Cost is one of the issue when developing a system.
A little change in cost affects the manufacturing quantity of
the system
Software Development
Software development for embedded systems involves
unique challenges and design considerations due to
hardware constraints, real-time requirements, and the need
for efficient resource management.
Embedded systems software must be highly optimized,
reliable, and capable of interfacing directly with the
underlying hardware.
Cont….
The following are some key software development
challenges and design issues in embedded systems:
1. Real-Time Constraints
2. Memory Management
3. Power Efficiency
4. Concurrency and Synchronization
5. Communication with Peripherals
6. Software Debugging and Testing
7. Error Handling and Fault Tolerance
8. Code Portability and Reusability
9. Firmware Updates and Security
10. Development Tools and IDEs
Real-Time Constraints
Many embedded systems must operate under real-time
constraints, where the system must respond to events within
a defined time period.
Missing these deadlines can lead to system failures or undesired
behavior.
Design Considerations: Real-Time Operating Systems (RTOS),
Deterministic Behavior, Priority Scheduling and Interrupt Handling
Memory Management
Embedded systems often have limited memory resources,
both in terms of RAM and non-volatile storage like Flash or
EEPROM.
Efficient memory management is essential to avoid overflow,
memory fragmentation, and system crashes.
Design Considerations:
Static Memory Allocation: Prefer static memory allocation over dynamic
memory allocation to avoid issues like memory fragmentation and
unpredictable allocation times.
Memory Pooling: Use memory pools to allocate fixed-size blocks of
memory, reducing fragmentation and ensuring consistent memory access
times.
Power Efficiency
Power consumption is a critical issue, particularly for
battery-powered devices.
Software must be designed to minimize the system’s energy
use by efficiently managing resources.
Design Considerations:Low-Power Modes, Peripheral
Management, Efficient Code
Low-Power Modes: Utilize low-power modes (e.g., sleep or deep sleep)
available on microcontrollers when the system is idle. Ensure that the software
can transition in and out of these modes efficiently.
Peripheral Management: Disable unused peripherals or clock sources to
reduce power consumption. The software should manage peripheral power
states dynamically.
Efficient Code: Optimize code to minimize CPU cycles, which directly affects
power consumption. Avoid busy-wait loops or polling mechanisms that
consume unnecessary CPU time.
Concurrency and Synchronization
Many embedded systems handle concurrent tasks, whether via
multiple threads, interrupts, or processes.
Synchronization between these tasks must be managed carefully to avoid race
conditions, deadlocks, and priority inversion.
Design Considerations:
 Mutexes and Semaphores,
 Interrupt Prioritization,
 Deadlock Avoidance and
 Priority Inversion Handling(Implement priority inheritance mechanisms
to prevent priority inversion).
Chapter Five
Real-time Communication (RTC)

1
Basic concepts real time
communication/RTC/
 RTC is any mode or types of telecommunications for
exchanging information
 Its exchange of information instantly or with negligible
latency. Or
 RTC is real-time is synonymous with live communication.
 RTC always has a direct path between the source and the
destination.

2
Basic concepts and examples of
real time communication
 RTC can take place in half-duplex or full-duplex modes
 RTC generally refers to peer-to-peer (P2P) communications,
not broadcast or multicast.

3
Some examples of real time
communication (RTC)

Below are some real-time communication examples:


•Chats/Instant Messaging • Voice over IP (VoIP)
•Voice Calls • Teleconferencing
•Live Broadcast • Video calling
•Teleconferencing • Video conferencing.
•Fixed-line telephony. • File sharing.
•Mobile telephony.

4
Real time communication in LAN

RTC in LAN is communication system which is used to


support for soft real-time applications.
Soft real-time communication networks do not provide
absolute Quality of Service (QoS) guarantee to applications.
These networks always ensure prioritized for real-time
messages.
It also ensures that message deadline miss ratio for real-time
messages is kept to a minimum
5
Real time communication in LAN
Real-time communication provides an efficient transfer of
messages from the host to the client with a minimal loss or
tolerable loss.
The Messaging connections are classified into three main
types namely:
 Open System
 Hard Real-time System
 Soft Real-time System

6
Using Ethernet in Real time communication

Ethernet also known as LAN can example of soft real-time


system
In this types of communication, data is transferred from the
sender to the end device using a connectionless service
Connectionless is UDP which comes under the fourth layer
of the OSI model.
However; in Ethernet under high speed situation it increases
delay and drops throughput, increase collision rapidly,
7
Protocols used in Real-Time Communication
in LAN

Protocols used to achieve RTC in LAN by reducing


Ethernet issues under high speed situation.
1. Global Priority Protocols
2. Constant bit rate CBR and variable bit rate-VBR
(encoding techniques)

8
Protocols used in Real-Time Communication
in LAN
1. Global Priority Protocol
The Messages are assigned a separate priority value.
Based on this value, the protocol will transmit the data to the
specific destination.
p=1 P=2 P=3 P=4 R2
R1
 Example router1 need
to send data to router2
based on priority value

9
Protocols used in Real-Time Communication
in LAN

1. Global Priority Protocol


MAC layer protocols try to ensure any instant of time only
highest priority message served or send
The Algorithm used during the data transmission with this
global priority protocol are:
 RMA (Rate monotonic analysis) and
Recall from
 EDF (Earliest Deadline First) Chapter 3

10
Protocols used in Real-Time Communication
in LAN

2. Constant bit rate CBR and variable bit rate-VBR (encoding


techniques)
Bit rates are the number of data transfer within specific time.
The data transmitted from the sender is encoded using the
CBR and VBR encoding techniques.
CBR data is transferred with a constant bit rate, and while
VBR, it can have variable bit rates.
So, hard real time application often involves transmission of
CBR. 11
Protocols used in Real-Time Communication
in LAN

2. Constant bit rate CBR and variable bit rate-VBR (encoding


techniques)
Hard real time communication in LAN its network utilization
is kept low
When hard real time messages not transmitted soft real time
and non-real time messages will transmit.

12
The goals of real-time communication
(RTC) in LAN
 Low jitter--minimizing terror(jam)
 Low latency—minimizing delay
 Ability to integrate--non-real-time and real-time services
 Adaptability of dynamically changing network and
traffic conditions
 High effective bandwidth utilization.
 Low overhead in header bits per packet or cell.
 Low processing overheads per packet within the network
13
What is quality of service (QoS)
QoS is a set of technologies that to provide a guarantee to
run high-priority applications under limited network capacity.
 The main objectives of QoS are to reduce packet loss,
latency and jitter on a network.
QoS controls and manages network resources by setting
priorities for specific types of data on the network

14
Methods to improve QoS
Generally to improve QoS methods or techniques are:
 Resource reservation
 Traffic shaping
 Traffic policing
 Scheduling mechanism
 Admission control

15
Resource reservation

 Resource reservation is one of a techniques that used to


improves the QoS in terms of different parameters such as
delay, reliability, performance, traffic.
The reserved resources are buffer, bandwidth, CPU time
etc. which are important for data flow in the network.

16
Resource reservation protocol (RSVP)
 For improving QoS resource reservation is used for
reserving resource
 It dynamically adapts to the change in route for the
efficient message transfer.
 It is actually not a routing protocol.
 RSVP operates at the Transport layer of the OSI model
 Receiver node in the real time system initiates the protocol
 RSVP is simplex(the receiver node just receives the packet
and does not wont to send data)
 It is widely used in multimedia applications such as video
conferencing, streaming, and online gaming.
17
Resource reservation protocol (RSVP)
 For improving QoS resource reservation is used for
reserving resource
 It dynamically adapts to the change in route for the
efficient message transfer.
 It is actually not a routing protocol.
 RSVP operates at the Transport layer of the OSI model
 Receiver node in the real time system initiates the protocol
 RSVP is simplex(the receiver node just receives the packet
and does not wont to send data)
 It is widely used in multimedia applications such as video
conferencing, streaming, and online gaming.
18
Resource reservation protocol (RSVP)

Advantages Disadvantages

• Predictable resource • Increase resource


allocation overhead
• Deterministic behavior
• Limited flexibility
• Quality of service
guaranties • Scalability challenge
• Resource Optimization • Reservation conflict
and deadlock risks

19
Traffic shaping and policing in Real
time communication
In order to efficiently use of limited network resources, the
traffic sent by users must be limited.
To implement this, Traffic shaping and traffic policing are
used for limited resources
Before implementing traffic policing and traffic shaping
assess whether the traffic exceeds the rate limit.
 Traffic shaping and
 Traffic policing
20
Traffic shaping
 Traffic shaping is a QoS technique configure to enable
higher-priority traffic to flow.
 It makes traffic conform to a certain rate by giving the
packets some delay.
 Traffic shaping, buffers packets with rates that are greater
than the traffic shaping rate and sends the buffered packets at
an event rate.
Traffic shaping also known as packet shaping,
Traffic shaping is a congestion management method that
regulates data transfer by delaying the flow of less important
or less desired packets.
21
Traffic shaping
Generally it is bandwidth management that delays the flow
of some types of packets in order to ensure higher priority
applications use network performance.
 It used to control outbound (outgoing) traffic only

22
Traffic policing

 Traffic policing it can configure by network professionals for


incoming and outgoing traffic.
 Traffic policing directly discards packets with rates that are greater than
the traffic policing rate.
 Policing will simply drop packets as opposed to storing them
in a temporary queue,
 Traffic policing is basically monitors the traffic by using an
action to packets such as dropping it
 It is not cause any delay for certain packets
 It used to control outbound (outgoing) traffic only

23
Scheduling mechanisms
There are several of the most important link scheduling
1. First-In-First-Out (FIFO)
 The FIFO scheduling discipline (also known as First-Come-
First-Served - FCFS) selects packets for link transmission.
2. Round Robin scheduling
Under this algorithm packets are again sorted into classes
such as class1, class2 (such as real time, non real time,
interactive, file transfer etc. ) as with priority queuing.
24
Scheduling mechanisms
2. Round Robin scheduling
However, rather than there being a strict priority of service
among classes, a round robin scheduler alternates service
among the classes.
In short, round robin scheduling, a class 1 packet is
transmitted, followed by a class 2 packet, followed by a class
1 packet, followed by a class 2 packet, etc.

25
Read this example for round robin scheduling
mechanism
Assume that packets 1, 2 and 4 belong to class 1, and packets 3 and 5
belong to class 2.
1 2 4 Class 1 3 5 Class 2

Packet 1 begins transmission immediately upon arrival at the


output queue.
Packets 2 and 3 arrive during the transmission of packet 1
and thus queue for transmission.
After the transmission of packet 1, the link scheduler looks
for a class-2 packet and transmits packet 3.
26
Read this example for round robin scheduling
mechanism

1 2 4 Class 1 3 5 Class 2
After the transmission of packet 3, the scheduler looks for a
class-1 packet and transmits packet 2.
After the transmission of packet 2, packet 4 is the only
queued packet and then it transmitted immediately after
packet 2.
if Packets 2, 3 and 5 arrive during the transmission of
packet 1 and thus queue for transmission how scheduler
will transmit all packets (think it and answer for your
self)? 27
Admission control
 It is a mechanism used by router or switch to accept or reject
flow of traffic based on predefined parameters called flow
specification
 Therefore before accepting flow for processing, router
checks specification to see its capacity such as bandwidth,
buffer size, CPU speed.
 Admission control is a significant process from the point of
view of ensuring of QoS.
 The main function of admission control is to estimate
capacity for the incoming traffic. 28

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy