Altaf-RealTime System Scheduling Project Report

advertisement
Real-Time System: Web based Scheduling
Simulator Application
Summary Report
Written and Submitted by:
Altaf Hussain, X2011bep, STD NO: 201104026
10/16/2012
This document contains the project report of the “Real-Time Scheduling Application.”
Real-Time System: Web based Scheduling Simulator Application
1. Report on Comparison
The comparison for the Per-Task response time and deadline misses for periodic tasks when
applying Fixed Priority, Earliest Deadline First, and Rate-monotonic algorithm is given below.
For the comparison I have used the following inputs.
Task Id
1
2
3
4
Release Time
Period
Execution Time
0
4
2
0
6
1.5
0
5
0.5
0
7
1
Table 1: Table Showing Inputs
Priority
4
3
1
2
The table 2 below shows the comparison among the algorithms on per-task response time,
deadline misses and pre-emption. From the table we can clearly see Fixed Priority scheduling
gives the worst response time. In contrast, the Earliest Deadline First scheduling provides the
best result as it doesn’t miss any deadline. The Rate-monotonic schedule provides worst time
(3.20). Even though, the Fixed priority schedules provide best response time (2.05) comparing
to EDF (2.80) and RM (3.20), it caused most number of task to miss their deadlines (2) and
cause 4 preemptions. On the other hand, the EDF successfully scheduled the tasks without any
pre-emption and any miss of deadlines as the utilization of the tasks is 0.992. RM scheduling
schedules the task with 1 deadline miss and without any pre-emption.
Scheduling Used
Number of Preemption
Number of Deadline Average Response
Misses
Time
Fixed Priority
4
2
2.05
Earliest Deadline First
0
0
2.80
Rate-monotonic
0
1
3.20
Table 2: Table Showing Comparison among scheduling for Per-Task Response Time and Preemption
Altaf Hussain, X2011bep, STD NO: 201104026
1
Real-Time System: Web based Scheduling Simulator Application
1.1 Schedules
Schedules generated for the input are given below:
1. FIXED PRIORITY:
Figure 3: Fixed Priority Schedule for input case
Altaf Hussain, X2011bep, STD NO: 201104026
2
Real-Time System: Web based Scheduling Simulator Application
2. EARLIEST DEADLINE FIRST
Figure 4: Schedule using EDF for input
Altaf Hussain, X2011bep, STD NO: 201104026
3
Real-Time System: Web based Scheduling Simulator Application
3. RATE-MONOTONIC:
Figure 5: Schedule using Rate-Monotonic for Input
2. ACCESSING THE PROJECT

PROJECT URL: http://141.109.62.5/RTS/SelectSchedule.aspx
The project is deployed on my Lab PC which is publically accessible from SFTX domain. As you
are outside of the campus you can access it through STFX provided Cisco VPN client.
1. Run VPN client
Altaf Hussain, X2011bep, STD NO: 201104026
4
Real-Time System: Web based Scheduling Simulator Application
2. Provide your STFX user name and password
3. Open a browser and insert the project url.
NB: If you don’t have VPN installed, you can find a guide in the following url. If you have any
problem setting it up please let me know.
http://www.sites.stfx.ca/tsg/sites/sites.stfx.ca.tsg/files/VPNSetup7.pdf%20
3. TECHNOLOGY AND TOOLS USED:
The project is developed to run on Windows Web server running Internet Information Service
(IIS 7.5) so that it can be accessible from web using any browsers. Visual Studio 2010 is used as
an IDE for developing the project.

ASP.NET 4:
Web forms or User interfaces are developed in ASP.NET 4.
 C#.NET:
Web forms functionalities are supported by C#.net 4.
 XML:
XML is used as input data store and as provider of input. User can provide and store inputs
in XML which is then feed to the system.
 LINQ TO XML:
Language Integrated Query (LINQ) is used to read XML files and also query over the XML
files using XPATH and XQuery.
 ASP.NET AJAX:
Ajax is being used to do asynchronous page post back. This reduce time and amount of data
transfer between each communication between client and server.
Altaf Hussain, X2011bep, STD NO: 201104026
5
Real-Time System: Web based Scheduling Simulator Application
 JAVA SCRIPT:
Java Script is being used for client side scheduling, validation and assertions.
 CSS AND ASP.NET THEME:
CSS-3 and Asp.net theme is used for site look and feel.
 HIGHCHARTS:
HighCharts Asp.net and Java Script API are used to render graphs on Web page.
http://www.highcharts.com/
4. PROJECT SCOPE AND ARCHITECTURE
The purpose of the project is to create simulators that simulate Real-Time Scheduling
Algorithms.





FIXED PRIORITY
EARLIEST DEADLINE FIRST
RATE-MONOTONIC
EDF ALGORITHM WITH DEFERRABLE SERVER
RATE-MONOTONIC WITH DEFERRABLE SERVER
4.1 Project Scope
1. Taking Input: Input from user was taken by XML. A default XML input is provided with
number of example cases. User can also upload separate input XML files and store the
input for later use. User can select from uploaded cases to run schedule from select
option.
2. Schedule Select: Web interface was given from where user can select from different
schedule type as well as selecting from different inputs.
3. Schedule Show Graph and Schedule Summary: After scheduling graphs shows the
scheduling events like when a job got pre-empted, released, started, and ended. In
addition a task based summary is being provided including information how many times
a task being pre-empted, average response time and number of jobs missed deadline.
4.2 Project Architecture
The project architecture is given below showing different components
Altaf Hussain, X2011bep, STD NO: 201104026
6
Real-Time System: Web based Scheduling Simulator Application
Real-Time Scheduling
Input Files
XML input files (Default)
User Uploaded
Web Forms





User Interfaces developed in Web Forms using Asp.net
C# define the Logic with Linq, Java Script
Process Input, Scheduling, Selecting Scheduling, Listing
input cases
List of Input XML, Upload XML
Graph Shown, Schedule summary shown
Upload New XML
Uses XML Input


Figure 6: Application Architecture
Once Inputs are loaded from XML, the task list is populated using XmlInputReader.cs. When
users
select
a
schedule
from
SelectSchedule.aspx,
SelectSchedule.aspx,
DeferrableServerSchedule.aspx, the tasks input from C# types are forwarded to java script in
ShowSchedule.aspx logic codes. Then the ScheduleJS.js file called through function
PassForScheduling(selectedSchedulingType).
Also
after
scheduling
functions
DrawGrapAndShow()
and
ShowSchedulingSummary()
called
respectively
from
ShowSchedule.aspx to draw HightCharts and schedule summary.
4.2.1 Visual Studio Structure
Project structure in Visual Studio is given below showing File types and all files.
Altaf Hussain, X2011bep, STD NO: 201104026
7
Real-Time System: Web based Scheduling Simulator Application
Figure 7: Frontend Structure in Visual Studio 2008
5. DATA STRUCTURE AND CLASSES
The classes or data model used can be described as below. Custom typed classes/ data
structure developed to exchange data inside application. This types load data from XML and
contains data for scheduling in Java Script, C# and show information summary.
1. APERIODIC TASK:
This class represents an aperiodic task with property Deadline,
Release Time and Execution Time.
Altaf Hussain, X2011bep, STD NO: 201104026
8
Real-Time System: Web based Scheduling Simulator Application
2. PERIODIC TASK:
This class represents a periodic task with property Priority, Period,
Release Time and Execution Time.
3. DEFERRABLE SERVER:
This class represents a deferrable Server with property Priority,
Budget, Release Time and Execution Time. It has extra property same
as Periodic task as when we don’t have use any Deferrable Server,
system will schedule as periodic task.
4. TESTCASE:
This class used as a container or all the other classes and represent a
Test Case. It warps and contains data for other type i.e. Aperiodic Task,
Periodic Task, Deferrable Server, and Simulation Time for the test case.
It contains the all input data for a test case.
5. JAVA SCRIPT TYPES:
This section list the some of the important java script type used.

TaskObjectInScheduling: Contains values for tasks object in the schedule.
o TaskId
o IsDeferrable
o CurrentJobId
o CurrentJobRemaining
o ReleaseTime
o ExecutionTime
o Priority
o Period
o DeferrableServerInfo
o schedulingJobQueue
Altaf Hussain, X2011bep, STD NO: 201104026
9
Real-Time System: Web based Scheduling Simulator Application




DeferrableServerInfo: Contains values for specific to Deferrable Server if the task is a
Deferrable Server.
o TaskId
o Budget
o ReleaseTime
o isRunning
o AperiodicJobQueue
o FinishedAperiodicJobQueue
AperiodicJobQueue: Contains aperiodic job which then pushed to Deferrable Server and
eventually TaskObjectInScheduling.
o AperiodicTaskId
o AperiodicJobStartTime
o AperiodicJobEndTime
o Deadline
o ReleaseTime
o ExecutionTime
o Reaming
SchedulingJobQueue: Contains Job information or property values that are running,
released and waiting for scheduling.
o TaskId
o JobNumber
o remaining
o Priority
o ReleaseTime
o ExecutionTime
o AperiodicJobStartTime
o AperiodicJobEndTime
o Deadline
o startTime
o EndTime
o isPreempted
SchedulingEvent: Contains event information time to show it on the graph with indicator
image.
o NameDescription
o ReleaseTime
o PreemptionTime
o Task number
Altaf Hussain, X2011bep, STD NO: 201104026
10
Real-Time System: Web based Scheduling Simulator Application

o IndicatorImageToShow
o DeadlineMiss
o Preemption
GraphInputArray: Contains event information to show on the graph area. Like X-axis
information, Y-Axis Information.
6. DESCRIPTION AND SCREEN SHOTS
6.1 Select Scheduling
This screen lists all scheduling algorithms and input test case. To show schedules for a specific
example case please select “Show Schedule” Button. Any valid input cases uploaded by the user
will list here automatically. Selecting this node from left menu will also enable four other pages
specifically designed for individual scheduling types and shows list of example cases.
Figure 8: Select Schedule Page (Page Clipped)
Altaf Hussain, X2011bep, STD NO: 201104026
11
Real-Time System: Web based Scheduling Simulator Application
6.2 Select Scheduling: Fixed Priority
This page shows example list for Fixed Priority Scheduling.
6.3 Select Scheduling: Earliest Deadline First
This page shows example list for Earliest Deadline First Scheduling.
Altaf Hussain, X2011bep, STD NO: 201104026
12
Real-Time System: Web based Scheduling Simulator Application
6.4 Select Scheduling: Deferrable Server
This page shows example list for Rate-monotonic and EDF with Deferrable Server.
6.5 Select Scheduling: Rate-monotonic Scheduling
This page shows example list for Rate-monotonic Scheduling.
Altaf Hussain, X2011bep, STD NO: 201104026
13
Real-Time System: Web based Scheduling Simulator Application
6.6 Show Schedule
This page shows the scheduling details (Graph with Summary) when user clicked “Show
Schedule” from “SELECT SCHEDULE” Page.
Figure 9: Page showing schedule and Summary
Altaf Hussain, X2011bep, STD NO: 201104026
14
Real-Time System: Web based Scheduling Simulator Application
6.7 Upload Input Files
This page can be used to upload a file. User can only upload a XML files. Other File types are
ignored. The file inserted will be saved. Valid input cases will be automatically added to the end
of example lists in “Select Schedule” page and pages showing list for specific scheduling type.

Invalid files uploaded will be ignored. In that case only default input file will be used
while annotating list of test cases.
Figure 10: Upload files UI
6.8 Show Input XML
This page shows list of Input XMLs files (User Uploaded) in the system other than the default is
one used. If there is no user uploaded input xml then nothing shown in the list.




This page also shows input xml. By default the default input XML is shown.
If user clicks on “Show File”, that specific file is shown.
User can delete a file by clicking on “Delete File” Button.
User can also download the default Input XML by clicking “Download Default Input
Altaf Hussain, X2011bep, STD NO: 201104026
15
Real-Time System: Web based Scheduling Simulator Application
XML” but can’t delete it.
Figure 11: Input List and Showing XML file

Now when user go to Select Schedule, the list will combine and show inputs cases from
user uploaded files
Altaf Hussain, X2011bep, STD NO: 201104026
16
Real-Time System: Web based Scheduling Simulator Application
Figure 12: List showing user added input
7. INSTALLATION GUIDE:
This section describes the installation steps of the application in IIS 7.5 (Web Server). Assuming
that your computer is running on Windows 7.0.
7.1 Steps
Steps related to the deployment of the web application in short:
1.
2.
3.
4.
5.
Install IIS 7.5
Install .NET Runtime 4.0
Copy the files in IIS Folder
Make the deployed Folder a IIS Application
Browse your application in Localhost
7.2 Steps in Details
7.2. 1. Installing IIS 7.5
To install IIS 7.5 please follow the following steps
1. First check if you have IIS 7.5 already installed
Altaf Hussain, X2011bep, STD NO: 201104026
17
Real-Time System: Web based Scheduling Simulator Application
a. Go to: http://localhost/
b. If you don’t see following screen, then you either don’t have IIS installed or have
a corrupt installation:
c. If you see the page, then skip this step (Step 7.2.1) and forward to step 7.2.2.
2. Go to Control Panel
3. In control panel click on Turn Windows Features ON or OFF
Altaf Hussain, X2011bep, STD NO: 201104026
18
Real-Time System: Web based Scheduling Simulator Application
4. Tick the Internet Information Service node ON and click OK. You might see a progress
bar given below:
Figure 13: IIS OPTION
Figure 14: Progress Bar
5. Now you should have IIS Installed in your PC. To check it go through the following steps
as you did before:
a. Go to: http://localhost/
b. If you don’t see following screen, then you either don’t have IIS installed or have
a corrupt installation:
Altaf Hussain, X2011bep, STD NO: 201104026
19
Real-Time System: Web based Scheduling Simulator Application
7.2. 1. Installing .NET 4
By default, the .NET 4 will be installed with IIS7. You can also download and install it from the
following location.
http://www.microsoft.com/en-ca/download/details.aspx?id=17718
7.2. 3 Copy the files in IIS Folder
1.
As you have installed IIS 7, you should have a folder named “Inetpub” in your C:
drive or OS default drive.
2.
3.
4.
Go to C:\inetpub\wwwroot
Make a new Folder and Name it “RTS”. You can name it as you wish.
Now copy the deployment files attached in the project
Altaf Hussain, X2011bep, STD NO: 201104026
20
Real-Time System: Web based Scheduling Simulator Application
7.2.4. Make the deployed Folder a IIS Application
1.
Go to Run Bar and Type inetmgr, it will open Internet Service Management UI:
2. Now Look for “RTS” Folder (Your application Folder where files were copied)
Altaf Hussain, X2011bep, STD NO: 201104026
21
Real-Time System: Web based Scheduling Simulator Application
3. Right Click on the Folder and Click to Convert to Application and click OK.
7.2. 5.Browse your application in Localhost
1. Open a Browser Go to http://locahost/RTS/
2. You should see the RTS pages from localhost:
Following these installation guide, if you have any clarification please let me know.
Altaf Hussain, X2011bep, STD NO: 201104026
22
Download