Professional Documents
Culture Documents
Project Report
i
Candidate’s Declaration
We hereby declare that this project report titled ‘happyRC.NET Remote Con-
trolled Electronic Switching System’ submitted towards the completion of Mini
Project in 5th semester of B.Tech(I.T.) in Indian Institute of Information Tech-
nology, Allahabad is an authentic record of our work carried out under the
guidance of Dr. G. C. Nandi, Dean(Academics), IIIT Allahabad.
Certificate
This is to certify that the above declaration made by Mr. Nishant Shrivastava,
Mr. Parlikar Alok Ulhas, Mr. Shubham Shrestha Agrwal and Mr. Varun Khullar
is true to the best of my knowledge and belief.
ii
Contents
1 Introduction 1
1.1 What the problem is . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Importance of the problem . . . . . . . . . . . . . . . . . . . . . 2
3 System Architecture 4
3.1 ESS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.2 CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3 Smart Device Client . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.4 Architecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5 Design Issues 11
5.1 ESS Client Design . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.2 CSS Server Design . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.3 WebService Design . . . . . . . . . . . . . . . . . . . . . . . . . . 13
A User Manuals 19
A.1 Manual for the ESS Client . . . . . . . . . . . . . . . . . . . . . . 19
A.1.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . 19
A.1.2 Installing the Application . . . . . . . . . . . . . . . . . . 19
A.1.3 Using the Program . . . . . . . . . . . . . . . . . . . . . . 21
A.2 Manual for the CSS Server . . . . . . . . . . . . . . . . . . . . . 24
iii
A.2.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . 24
A.2.2 Using the Program . . . . . . . . . . . . . . . . . . . . . . 24
A.3 Manual for the CSS Webservice . . . . . . . . . . . . . . . . . . . 26
B Hardware Details 28
Bibliography 37
iv
List of Figures
v
List of Tables
vi
Chapter 1
Introduction
Computers and the related technologies are becoming more and more ubiqui-
tous. Various technical arenas in the field of Computer Science and Engineering,
or Information Technology have come very near to the common people. The
number of homes with Personal Computers1 is gradually increasing. A day will
come, somewhere in the long future, when PC is referred to in the same class
of “Food, clothing and shelter”. Improvements in the Networking technologies
have fostered growth of very dense networks. Land line telephones have been
becoming less and less popular and people now prefer communicating while on
the move. ISPs are now laying down their own networks to provide broadband
Internet access to customers.
When people have a good connectivity at their disposal, with tremendous
power of mobile computing to supplement the same, we can think of “connecting
their home appliances to the mobile phone”. With this, people would be able
to turn on and off, and to some extent, control the appliances at their home
even from a distant place. One of the very basic examples of an utility of this
is – switching on the air conditioner in the room just some time before reaching
home, so that the room is sufficiently cool by then.
1
V Sem Mini Project Report, Revision 1, December 3, 2004 2
Even if they are willing to, there is a very low limit to how many users
can get such a privilege.
3. Keeping so many client server systems secure is a serious problem. With
such unmanageable setup, maintaining the software system would be a
mammoth task.
The problem then is, to install a system that would facilitate many clients
to use its architecture and get their devices “online” very quickly, inexpensively,
and with minimal effort.
A Remote Control is perhaps the most popular gadget today. Right from the
intense creativity of remotely controlling laser chip markers to the highly de-
structive remotely ignitable bombs, from the pins to the planes, remote control
is not only occupying a omnipresence state, but is also enhancing its scope and
domains.
We have had InfraRed Remote Controls, which work over very short dis-
tances, and RadioWave Remote Controls, which work over larger distances.
However, something fundamentally common with all these controls is that the
transmitter and receiver should both use some kind of wireless waves. Thus,
the range of the control is limited.
If some control is desired to be remote across the globe, the technology
required intensively uses satellites, and thus, such a control has not been able
to become so popular. The INTERNET is more than just a world wide web.
Mobile phones are the gadgets of this generation. Remote control based on
Internet on mobile phones seems to be satisfactory quench of the desire.
There have been attempts to write such implementations earlier. However,
most of them were targetted towards specific devices. The need is to write
generic device control applications.
3
Chapter 3
System Architecture
The happyRC.NET system consists of three main parts, namely the End User
Server System(ESS), the Central Server System(CSS), and the Smart Device
Client. Figure 3.1 shows the logical structure of these parts, and an outline of
the components therein.
3.1 ESS
The End user Server System is a client1 application that runs on the user’s PC.
It takes authentication details from the user and uses an encrypted TCP/IP
1 The word Server System is a misnomer. The Client installed on ESS acts as if there was
4
V Sem Mini Project Report, Revision 1, December 3, 2004 5
3.2 CSS
The Central Server System is the heart of the art. It has three roles to play, and
therefore has three components that export various important functionalities.
General Component The General CSS Component is where most of the func-
tionality resides. It is the job of this component to receive connections
from various ESS PCs, and maintain their authentication states. This
maintains a lookup information about exactly which ESS particular users
are connected from, and what the device configuration of their system
is. It shares its memory space with the Remoting component described
next. It is the job of this component to proxy requests from the remoting
component to the ESS system, and return the occurrence of a success or
failure.
Remoting Component This component is a stub for .NET Remoting2 calls.
It gives a reference to an object which has proxy functions written to
allow Remoting clients to call functions of the General Component. Every
connection to this component instantiates a new object which maintains
the state (authentication, etc.) of the client. Methods in this object wait
for a reply from the General Component and send the reply back to the
client.
Web Service To facilitate easy HTTP3 access from smart clients, this com-
ponent becomes crucial. It sits on a web server (running IIS) and com-
municates to the General Component via the Remoting Component. The
job of this component is to maintain authentication states over the web.
It should ask the Remoting Component to provide the description of the
user’s device. It should then parse the description out, and display an
interface that can change the device state.
Put together, these components build up the CSS System which can provide
facilities for any user to register his device online, and later on, use browser
complaint smart client to remotely control the same.
Smart Devices Running Browsers This category includes devices that are
very thin in functionality. Typically, these include mobile phones, Wireless
PDAs, etc. They do not have the capability of running large programs,
and ship with an operating system that provides a minimal browsing func-
tionality. All that these can do is display primary interfaces, and request
simple form submitted by the users. They need to interact with the Web
Service component of the CSS in order to facilitate service.
Smart Devices Running CSS Client Some devices have more features than
plain smart devices, and are smarter then we think. Pocket PCs that run
operating systems like Microsoft Windows CE have capabilities of running
custom programs. A custom made CSS client(See Appendix E) can be in-
stalled on these devices so as to customize user interfaces. These devices
can skip the Web Service component and directly interact with the CSS
using .NET Remoting. Clearly, Laptops and Computers are smarter then
even pocket PCs, and they can fall into this category.
As with almost any other computer based system, the working of happyRC.NET
begins with the process of Installation followed by the successive use. Instal-
lation of the ESS on the user’s PC includes configuration of the device.(See
Appendix A The brief working strategy of the system is outlined below.
7
V Sem Mini Project Report, Revision 1, December 3, 2004 8
groups, these bytes can be combined into one. Thus, if the policy of a certain
group is OR, a bitwise OR would be performed among all the states in that group.
This newly generated number is the state of that group.
For every such group specified in the configuration file, a new state number
is calculated. These state numbers are ordered by their group numbers, say
1,2,3, and stored for further processing.
Group Zero is a special group, where there is no union policy. Every state in
this group is sent as if it were in an independent group and the state numbers
of all states in this device are added to the end of the stored list.
5. ESS communicates the details of the device to the CSS on the already
established channel, and sets up callbacks on the CSS, so that it can
receive interesting information from the same.
6. The CSS, when it receives the device details, it sets up a set of functions
for the device, on the web service, to be remotely invoked.
7. The CSS maintains a table containing entries of which authenticated user
is using which instance of the CSS-ESS messenger program.
8. A user can switch on his smart client. The client knows the CSS, or else,
asks the user about the address of the CSS.
9. If the client is able to establish a connection to the CSS, it asks authenti-
cation details to the user.
10. The client calls the initialize function on the CSS by parameterizing it
with the authentication details.
11. The CSS verifies the authentication and if the client is affirmatively iden-
tified, it sends the device description to the client, along with the current
state of the device, if asked.
12. The client extracts a form out of the obtained description and displays it
to the user.
13. If the user suggests any changes in the form, the client parses those
changes, and categorizes them into batch requests to the server, depending
on the action groups.
V Sem Mini Project Report, Revision 1, December 3, 2004 10
14. For each request that the client makes to the CSS, the CSS sends a word
to the ESS that has to be written on the parallel port of the same.
15. The ESS acknowledges the CSS which in turn nods to the client.
16. The client maintains state using some form of cookies and repeatedly keeps
asking user for further change in the circuit. The user can choose to logout
or change his password.
17. Once logged out, there are no changes on the CSS and the ESS.
18. However, the user can choose to disconnect his circuit by closing the ESS
application. In such a case, the CSS would dump all the connection details,
including the device details of the disconnected ESS, into garbage.
19. In any use case, the client shall not allow remote disconnection of the ESS
application.
Chapter 5
Design Issues
In this chapter, we would give details about how the project was conceived and
built, i.e. the Analysis and design phase. Because the project team consists of
four members, the work was distributed in blocks of modules as described in
Table 5.1.
Because the modules have been designed almost independently, the design
issues are separately sectioned.
11
V Sem Mini Project Report, Revision 1, December 3, 2004 12
The User Interface This task involved creating a GUI for the user to interact
with the system. Some salient features of the GUI are:
1. Strict validation of inputs
2. Based on a state machine
3. User friendly errors
4. Use of registry to save settings. The key used for the purpose is
HKEY\LocalMachine\Software\happyRC
The ESS was designed in a round trip engineering mode. To start off, we
had a basic class diagram, with bare functionality built in. Then an automated
code generation was done. That code was edited, and the diagrams modified ac-
cordingly. The class diagram was always synchronized, and many times, adding
more functionality was done from within the diagram. The tools Microsoft Vi-
sual Studio .NET 2005 and Microsoft Visio Enterprise Architect 2005 were very
handy in this kind of approach.
Table 5.2 shows the Element Statistics Summary of the ESS Software. It
should be noted that the numbers in the table also count the classes and packages
that the .NET provides. For example, every object is a specialization of the
Object class, and hence the counter for Generalizations is that high.
Table 5.3 shows the Timeline Details imported as text from the Grant Chart.
Dates specified herein are not Assigned Dates, but are Actual dates. (That is,
these are a posteriori Grant Chart Details).
15
V Sem Mini Project Report, Revision 1, December 3, 2004 16
across the entire world. One can build client applications that use objects in
other processes on the same computer or on any other computer that is reachable
over its network. One can also use .NET remoting to communicate with other
application domains in the same process.
.NET remoting provides an abstract approach to interprocess communica-
tion that separates the remotable object from a specific client or server appli-
cation domain and from a specific mechanism of communication.[Mic03] As a
result, it is flexible and easily customizable. One can replace one communication
protocol with another, or one serialization format with another without recom-
piling the client or the server. In addition, the remoting system assumes no
particular application model. One can communicate from a Web application, a
console application, a Windows Service from almost anything one wants to use.
Remoting servers can also be any type of application domain. Any application
can host remoting objects and provide its services to any client on its computer
or network.
Chapter 7
18
Appendix A
User Manuals
A.1.1 Requirements
Although efforts were made to keep the ESS Client as light as possible, it still
has a set of minimum system requirements, as follows:
• Microsoft Windows1 98 and Later.
• .NET Framework version 2.0 or later
• Network Connection
• Parallel Port (LPT1) on the host system
3. If you get a screen as shown in Figure A.1, please read the license carefully
and click the Accept button to proceed. This error had come because you
had not installed the .NET Framework 2.0, and hence, it required to be
1 It is possible to port the client to other operating systems like Linux, however the appli-
cation as a part of this project compiles, but does not run on Linux
19
V Sem Mini Project Report, Revision 1, December 3, 2004 20
installed. Once you are done with the installation, restart your system
and continue with the installation of this application.
5. If you get a dialogue as shown in Figure A.3, you must be running the
setup from a network location. Make sure you have copied the installation
files to your local system.
6. If your system had met the requirements of the application, it would get
successfully installed. A shortcut would be added to the Start Menu, at
the location All Programs -> IIITA. You can use this shortcut to run
the application.
7. Just after the installation, the application would start running. You may
proceed to start using the same.
V Sem Mini Project Report, Revision 1, December 3, 2004 21
When the application runs, you would get a screen as shown in Figure A.4.
2. Enter the CSS server’s IP address or host name in the first field.
3. Enter the CSS server’s port number (default: 8221) in the second field.
4. In the third field, select the location of the device configuration file on
your system.
5. Once you click the Update button, the application would try to verify the
settings. If any of the settings is incorrect, a red blinking icon would be
placed next to that field. Hover the mouse over that box to see what error
was encountered, and take appropriate corrective steps.
6. If the updation is successful, the application would return back to the
login screen.
Logging in
1. At the login screen (Figure A.4), enter your authentication credentials.
2. Please note that the username has to be alphanumeric word, and that the
password can not be blank.
V Sem Mini Project Report, Revision 1, December 3, 2004 23
3. On clicking the Login button, the application would try to log you onto
the CSS server. If the authentication fails, you would get a notification of
the same.
4. If the authentication times out, you would be notified about the same too.
You may then try authenticating again.
5. If the authentication is successful, the application displays the “Logged
In” dialogue as shown in Figure A.6.
4. In case there is some error changing the password, a red blinking icon
would be displayed on the screen which would show the exact error on
hovering the mouse over it. Please read the error and take the suggested
corrective action.
V Sem Mini Project Report, Revision 1, December 3, 2004 24
Logging Out
From the Logged In Screen (Figure A.6), click the Logout link in order to log out.
The application will ask for a confirmation during logout. Click OK to continue
with the logout. You would be presented with the Login screen (Figure A.4)
again.
A.2.1 Requirements
The CSS provides many to many connectivity for its users, and thus it is required
that the underlying OS of the system supports this heavy network load. Here
is a set of minimum requirements.
• .Net Framework 1.1 or Higher
• Windows Server 2003 (Recommended) or Windows XP (Professional)
the server and perform any of the admin tasks for which GUI interface. The
administrator can also start the server which will start the server on request of
client will connect to ESS Client.
Logging in
1. Start the application.
2. Enter userId and password in the login screen.
3. If your credentials are authentic, and you have administrator rights as-
signed, the system would log you in.
Logging out
The application would log the administrator out at the click of the Logout
button.
Note: The server will keep running until you don’t close the application or
you do not stop the server. Logging out would not stop the server.
User Management
1. Log in as told above.
2. Click the Admin task button after logging in.
3. Select the appropriate activity, from those shown in Figure A.9.
4. Write the user’s name for performing that activity and click OK.
Any time during the process, the user can select the Logout link to securely
log out from the control interface.
Appendix B
Hardware Details
28
Appendix C
This Appendix mentions details about the protocol that the CSS and ESS use
to talk to each other. A one liner description of the protocol is ”Request Reply
protocol over Encrypted TCP/IP Channel”. The following sections explain how
different issues are tackled in the protocol.
29
V Sem Mini Project Report, Revision 1, December 3, 2004 30
The ESS closes the socket immediately after this transfer. The CSS should
close its end too, after it gets the notification.
This Appendix discusses the format for the file that specifies details about the
hardware connected to the ESS. This Configuration File can be located any
where on the system that has ESS installed. Path to the correct file can be set
from the ESS program.
This Configuration File is a tab separated text file. There are two sections
in the file.
The first section stores information about the various “Actions” that can be
performed on the devices. Every record in this section contains four fields, as
follows:
Byte This is the byte word that has to be written on the parallel port so as to
perform that action.
Type This specifies what kind of an input the Action should be provided with.
It could either be 0(for a toggle input) or 1(for numeric input). It is
assumed that with numeric inputs, the request would be repeated specified
number of times to carry out the action.
Description This is a string field which would be displayed to the user. This
should be terse, nonetheless, very descriptive, because the user should be
able to identify this action completely.
Group Actions can be grouped together. All actions of the same group have
this field value the same. This field contains integer values 1,2,. . . ,n. There
might be some actions that can not be grouped. Group number 0 is used
for such actions.
The second section stores information about the various “Groups”. We had
classified actions into groups in the earlier section. There has to be a policy
so that the bytes for those actions can be combined. This section defines the
policy. Every policy is one character out of | & ^ which represent OR, AND and
XOR respectively. These policies are applied as bitwise operations. For example,
if actions A, B, C are in one group with the policy OR, then a byte would be
generated by performing bitwise or of the bytes of the actions A, B and C. The
34
V Sem Mini Project Report, Revision 1, December 3, 2004 35
file should ideally not contain a newline at the end of file, although that would
result in no fatal error.
These two sections need to have a delimiter that is a sentinel to the file. For
this purpose, a line with just ### as the text is used. Table D.1 specifies a
general structure of the file.
The Client for the .Net Remoting Service depends on the type of server running
the Remoting Service.
In order to implement the .Net Remoting Client, we need to use the classes
System.Runtime.Remoting and System.Runtime.Remoting.Channels.
Because the architecture of the CSS supports many clients to one server, use
of Server activated objects is not possible. Client-activated objects are analogous
to common class instances where each caller gets its own copy of the object.
Every client of this system must keep his own copy of the object, and maintain
states (like authentication information) in the same.
The Remoting Component of the CSS exports the following functionality for
the clients:
Authenticate(username,password) Returns true if the user was properly
authenticated.
Get Config() Returns an object containing the configuration of the device.
This object belongs to class ConfigData and details about the same can
be found in the code documentation.
Write Word(byte) Attempts to write the given byte as a state to the device
connected to the ESS. Returns success or failure as a boolean.
Change Password(old, new) Attempts to change the user’s password and
returns a boolean that describes success or failure.
Get LastByte() Returns the byte that was last written to the ESS client.
Logoff() Sets the authentication state to false.
36
Bibliography
37