0% found this document useful (0 votes)
5 views

RTS Notes

The document provides an overview of Real-Time Systems (RTS), detailing their types, structure, and classification based on timing constraints and task types. It discusses the characteristics of real-time systems and tasks, issues in scheduling, and various algorithms for task assignment and scheduling. Additionally, it covers fault tolerance techniques, clock synchronization, and real-time communication protocols essential for applications requiring minimal delay.

Uploaded by

q259342
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 views

RTS Notes

The document provides an overview of Real-Time Systems (RTS), detailing their types, structure, and classification based on timing constraints and task types. It discusses the characteristics of real-time systems and tasks, issues in scheduling, and various algorithms for task assignment and scheduling. Additionally, it covers fault tolerance techniques, clock synchronization, and real-time communication protocols essential for applications requiring minimal delay.

Uploaded by

q259342
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/ 16

RTS(CS320)

UNIT 1:
1. Introduction to Real-Time Systems
A Real-Time System (RTS) is a system that must respond to inputs or events within a speci ed
deadline. The correctness of such systems depends not only on the logical results of computations
but also on the time at which the results are produced.

Examples:

• Air Traf c Control Systems

• Medical Monitoring Systems

• Industrial Automation Systems

• Automotive Systems (e.g., ABS)

Types of Real-Time Systems:

• Hard Real-Time Systems: Missing a deadline is catastrophic (e.g., pacemakers).

• Soft Real-Time Systems: Missing a deadline is undesirable but not fatal (e.g., video
streaming).

• Firm Real-Time Systems: Occasional deadline misses are tolerable, but the results are
discarded if late.

2. Structure of a Real-Time System


A real-time system typically consists of the following components:

• Sensors: Gather inputs from the environment.

• Controllers (Processing Unit): Perform computations and make decisions.

• Actuators: Execute commands based on decisions.

• Real-Time Operating System (RTOS): Manages hardware resources and task scheduling.

• Communication Interfaces: Handle input/output with other systems or components.

Diagram (textual representation):


fi
fi
less
CopyEdit
[Sensor Input] ---> [Controller/Processor with RTOS] --->
[Actuator Output]
|
[Task Scheduler]
|
[Memory Management]

3. Classi cation of Real-Time Systems


Real-Time Systems can be classi ed as:

a. Based on Timing Constraints:

• Hard Real-Time Systems

• Soft Real-Time Systems

• Firm Real-Time Systems

b. Based on Task Types:

• Periodic Tasks: Occur at regular intervals.

• Aperiodic Tasks: Occur irregularly.

• Sporadic Tasks: Occur unpredictably but with a minimum separation time.

c. Based on Control:

• Event-driven Systems: Triggered by events (interrupts).

• Time-driven Systems: Actions based on time (clock).

d. Based on Application:

• Embedded Real-Time Systems

• Distributed Real-Time Systems

• Mobile Real-Time Systems

4. Embedded Systems
An Embedded System is a computer system designed for dedicated functions within a larger
system, often with real-time computing constraints.

Features:
fi
fi
• Speci c functionality

• Real-time operation

• Resource-constrained

• Often use microcontrollers

Examples:

• Washing machines

• Microwave ovens

• Smartwatches

• Industrial robots

5. Characterizing Real-Time Systems & Tasks


a. Real-Time System Characteristics:

• Determinism: Predictable behavior

• Responsiveness: Fast response to external events

• Reliability & Fault Tolerance

• Concurrency: Ability to handle multiple tasks simultaneously

• Time Constraints: Deadlines are crucial

b. Real-Time Task Characteristics:

• Arrival Time: When a task becomes ready

• Execution Time: Time required to complete

• Deadline: Time by which task must be completed

• Periodicity: Whether the task repeats periodically

• Priority: Used for scheduling decisions

6. Various Issues in Real-Time Systems


a. Task Scheduling:

• Choosing which task to execute next


fi
• Preemptive vs Non-preemptive scheduling

• Priority Inversion problem

b. Timing Constraints:

• Ensuring all tasks meet deadlines

c. Resource Management:

• Ef cient usage of CPU, memory, I/O

d. Synchronization:

• Avoiding race conditions and deadlocks between concurrent tasks

e. Interrupt Handling:

• Managing multiple interrupts with minimum delay

f. Fault Tolerance:

• Ability to continue operation despite failures

g. Power Constraints:

• Especially in mobile or battery-operated embedded real-time systems

UNIT 2:
1. Task Assignment & Scheduling
Overview

• Goal: Assign tasks to processors and schedule them to meet deadlines and optimize
performance.

• Tasks may have constraints such as periodicity, deadlines, execution time, and priority.

2. Classical Uniprocessor Scheduling Algorithms


2.1 Rate Monotonic Scheduling (RM)
fi
• Type: Static-priority algorithm.

• Assumption: Tasks are periodic, with xed execution time and deadlines equal to their
periods.

• Priority Rule: Shorter period = higher priority.

• Schedulability Test:

• ∑i=1nCiTi≤n(21/n−1)
i=1∑n Ti Ci ≤n(21/n−1)where C
iCi = execution time, T
Ti = period.

2.2 Earliest Deadline First (EDF)

• Type: Dynamic-priority algorithm.

• Priority Rule: Task with the earliest deadline has the highest priority.

• Schedulability Test:


∑i=1nCiTi≤1i=1∑n Ti Ci ≤1

• Optimal: For preemptive scheduling of periodic tasks.

3. Uniprocessor Scheduling of IRIS Tasks


• IRIS Tasks: Tasks in real-time embedded systems, often with timing constraints and
rewards.

• Scheduling involves selecting which tasks to run to maximize rewards and meet deadlines.

• Depends on:

◦ Type of reward function (0/1, linear, concave).

◦ Processor type (identical or non-identical).

◦ Task characteristics (execution time, arrival time, deadline).

4. Reward Functions
4.1 Identical vs Non-identical Processors

• Identical Processors: Same execution time for all tasks.


fi
• Non-identical Processors: Execution time varies based on processor-task combination.

4.2 Reward Types

a. Linear Reward Function

• Reward increases linearly with task completion.

• Goal: Maximize total reward over time.

b. Concave Reward Function

• Diminishing returns for completing tasks.

• Models urgency—delaying task reduces reward.

c. 0/1 Reward Function

• Binary reward: full reward if task completed before deadline, 0 otherwise.

• Suitable for hard real-time systems.

5. Task Assignment Algorithms


5.1 Utilization Balancing

• Goal: Distribute tasks so that all processors have balanced utilization.

• Utilization

• Ui=∑CiTiUi =∑Ti Ci

• Avoid overloading any single processor.

5.2 Next-Fit Algorithm for RM Scheduling

• Procedure:

1. Assign task to the current processor.

2. If the processor cannot schedule it under RM, try the next one.

3. Repeat until the task is placed or fail if no processor can schedule it.

• Pros: Simple and fast.

• Cons: May lead to suboptimal assignments.

5.3 Myopic Of ine Scheduling FAB Algorithm

• FAB: Fixed priority Assignment with Bene t.


fl
fi
• Myopic: Takes only partial view (limited time window).

• Assigns tasks based on current info and estimated future rewards.

• Ef cient for of ine scheduling with reward optimization.

5.4 Buddy Strategy

• Groups processors/tasks into pairs ("buddies").

• Tasks assigned to buddy groups to reduce overhead and improve locality.

• Often used in parallel/distributed systems for real-time task management.

UNIT 3:

1. Real-Time vs. General-Purpose Database


Feature Real-Time Database General-Purpose Database
fi
fl
Designed for general data
Purpose Supports real-time applications
management tasks
Must meet strict deadlines (hard or
Timing Constraints No strict timing constraints
soft)
Data must be current and consistent
Data Freshness Freshness is not a key concern
in time
Concurrency Prioritizes timeliness over Ensures serializability and
Control serializability consistency
Transaction
Deadline and priority-based FIFO, round-robin, or locking-based
Scheduling
Air traf c control, industrial
Applications Banking systems, web applications
automation

2. Main Memory Database (MMDB)


A Main Memory Database stores data entirely in RAM instead of on disk.

Features:

• Fast access due to in-memory storage

• Low latency, ideal for real-time systems

• Supports durability using logging or replication

• Often used in telecom, nance, and real-time analytics

Advantages:

• Extremely high speed

• Low I/O latency

• Supports real-time response

Disadvantages:

• Data volatility in case of power loss

• Needs persistent backups or replication

3. Concurrency Control Issues in Real-Time Databases


Concurrency control ensures correct results despite multiple simultaneous transactions.

Challenges in Real-Time Systems:


fi
fi
• Timeliness vs. Consistency: Traditional locking can cause deadline misses

• Priority Inversion: A low-priority transaction may block a high-priority one

• Blocking and Deadlocks: Must be avoided to prevent timing failures

Solutions:

• Priority Inheritance Protocol

• Real-Time Optimistic Concurrency Control

• Deadline-aware Scheduling

4. Real-Time OS (RTOS): Threads and Tasks


Threads:

• Lightweight execution units within a process

• Share address space

• Faster context switching than processes

Tasks:

• Basic units of scheduling in RTOS

• Each task can be assigned a priority

• Tasks may be periodic or aperiodic

Types of Task Scheduling:

• Preemptive Scheduling: High-priority tasks can interrupt lower ones

• Rate Monotonic Scheduling (RMS)

• Earliest Deadline First (EDF)

5. Kernel in RTOS
Functions:

• Task scheduling

• Interrupt handling

• Inter-process communication (IPC)


• Synchronization (semaphores, mutexes)

• Time management

Characteristics:

• Deterministic behavior

• Minimal jitter

• Low interrupt latency

• Small footprint

6. Case Studies
a. QNX

• Type: Microkernel RTOS

• Use: Automotive, medical devices

• Features:

◦ POSIX-compliant

◦ High reliability and fault tolerance

◦ Microkernel separates drivers/services from kernel

b. VRTX (Versatile Real-Time Executive)

• Type: Real-time multitasking OS

• Use: Embedded systems in telecom, aerospace

• Features:

◦ Small footprint

◦ Deterministic response

◦ Fast context switching

c. VxWorks

• Type: RTOS by Wind River

• Use: NASA rovers, automotive systems, defense

• Features:
◦ Preemptive multitasking

◦ Modular, scalable kernel

◦ Real-time networking support

◦ High performance with development tools support

UNIT 4:
Fault Tolerance Techniques
1. Introduction

Fault tolerance is the ability of a system to continue functioning correctly even in the presence of
faults. It aims to ensure system reliability, availability, and dependability despite errors.

2. Fault, Fault Detection, and Error Containment

• Fault: A defect in a system that may lead to an error.

• Error: A manifestation of a fault that may cause a system failure.

• Failure: The deviation of the system from its expected behavior.

Types of Faults:

• Transient: Temporary and disappear after some time.

• Intermittent: Appear and disappear unpredictably.

• Permanent: Persist until repaired.

Fault Detection Techniques:

• Watchdog timers

• Heartbeat signals

• Checksums and CRCs

• Exception monitoring

Error Containment:
• Prevents the propagation of errors using:

◦ Memory protection

◦ Process isolation

◦ Fault containment zones

3. Redundancy

Redundancy is a key strategy for fault tolerance, involving extra components or information.

Types of Redundancy:

• Hardware Redundancy: Using backup hardware (e.g., dual power supplies).

• Software Redundancy: Running multiple versions of software (N-version programming).

• Time Redundancy: Retrying operations after failure.

• Information Redundancy: Using extra bits (parity, Hamming codes) to detect/correct


errors.

4. Data Diversity

• Multiple versions of the same data are used to check for discrepancies.

• Example: Storing a value in multiple formats or sources.

• Useful against common-mode failures (e.g., same bug in all systems).

5. Reversal Checks

• After performing a computation, perform the reverse operation to validate correctness.

• Example: Perform A = B + C, then check if B = A - C.

• Helps in software-level fault detection.

6. Malicious and Integrated Failure Handling

• Malicious Faults: Faults caused intentionally (e.g., security attacks).

• Requires Byzantine fault tolerance (BFT).

• Integrated Failure Handling:

◦ Combining detection, recovery, and masking strategies.


◦ Examples: Self-healing systems, intrusion-tolerant systems.

Clock Synchronization
1. Introduction

In distributed systems, each machine has its own clock, which may drift from others due to
hardware imperfections. Synchronization ensures coherent timestamps, essential for ordering
events and coordination.

2. Clocks

• A clock is typically a quartz oscillator counting time.

• Drift is due to frequency inaccuracies and temperature.

• Measured in parts per million (ppm).

3. A Non-Fault Tolerant Synchronization Algorithm

Cristian’s Algorithm:

• A client sends a time request to a time server.

• Server responds with its current time.

• Client sets its clock considering network delay.

Limitations:

• Assumes trusted server and symmetric delays.

• Not fault-tolerant.

4. Impact of Fault

• If a server or communication is faulty:

◦ Wrong time may be propagated.

◦ Can cause incorrect event ordering or data corruption.

◦ Vulnerable to Byzantine faults (malicious behavior).

5. Fault Tolerant Synchronization in Hardware and Software

Hardware-based Synchronization
• Uses Pulse Per Second (PPS) signals (e.g., from GPS).

• Dedicated circuits reduce delay and jitter.

• High precision (used in real-time systems).

Software-based Synchronization

• NTP (Network Time Protocol):

◦ Uses hierarchy of time servers.

◦ Can tolerate failures using ltering and statistical averaging.

◦ Synchronizes clocks within milliseconds.

• Fault-Tolerant Protocols:

◦ Byzantine Fault-Tolerant (BFT) algorithms: can tolerate malicious nodes.

◦ Fault-tolerant averaging: discard extreme clock values and average others.

UNIT 5:

Real Communication in Real Time


1. Introduction

Real-time communication refers to the exchange of information with minimal delay, enabling
instant or live interaction between two or more parties. It is essential in applications like video
conferencing, VoIP, online gaming, and industrial control systems.

• Types of Real-Time Communication:

◦ Synchronous (Live): Audio/video calls, live streaming.

◦ Asynchronous (Delayed): Emails, recorded messages (not real-time).

◦ Focus here is on synchronous, real-time communication.

2. Network Topologies for Real-Time Communication


fi
Network topology refers to the physical or logical arrangement of network devices.

Topology Features Suitability for Real-Time


Single central cable, devices
Bus Not ideal; high collisions, delays.
connected in line.
Devices connected to a central hub/
Star Good for real-time; minimal collision.
switch.
Can support real-time but may suffer delay if
Ring Devices connected in a circular loop.
many nodes.
Mesh Devices interconnected. Excellent; redundancy ensures low delay.
Tree Hierarchical mix of star and bus. Moderate performance, depends on design.

Best choice for real-time: Star or Mesh topologies, especially with switches or routers supporting
QoS (Quality of Service).

3. Real-Time Communication Protocols

a. Internet Protocols for Real-Time

• RTP (Real-Time Protocol): Used for delivering audio and video over IP networks.

• RTCP (RTP Control Protocol): Monitors RTP transmission statistics and QoS.

• VoIP Protocols: SIP (Session Initiation Protocol), H.323 – initiate and control
communication sessions.

b. Resource Reservation Protocol (RSVP)

• RSVP is used to reserve resources (bandwidth, buffer space) in routers for a real-time
data ow.

• Works with Integrated Services (IntServ).

• Ensures QoS by signaling requirements before data transmission.

c. Time Protocols

• NTP (Network Time Protocol): Synchronizes clocks across systems to ensure time
consistency.

• PTP (Precision Time Protocol): More accurate than NTP; used in nancial, industrial, and
telecom systems.

d. Contention-Based Protocols

Used in shared medium networks where multiple devices compete to send data.

• ALOHA (Pure and Slotted): Random transmission, prone to collisions.


fl
fi
• CSMA (Carrier Sense Multiple Access): Devices sense channel before transmitting.

◦ CSMA/CD (Collision Detection): Used in Ethernet (wired).

◦ CSMA/CA (Collision Avoidance): Used in Wi-Fi (wireless).

Note: Contention-based protocols can introduce unpredictable delays, making them less suitable
for strict real-time systems, unless used with traf c prioritization.

fi

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