Sunday, April 20, 2008

Mobile Agent Life Cycle

Mobile Agent Life Cycle

MAs should be able to perform the following operations in order to build a robust system: Creation, Cloning, Dispatching or Migration, Retraction, Activation, Deactivation and finally Disposal [22, 23].

Creation is the first period in the mobile agent life cycle. For example, when a system requests a service to be done by the mobile agent, the system must create a mobile agent instance in the first place before any work can be done. During this creation stage, the mobile agent will be equipped with the desired parameters in order to achieve its goal.

Cloning basically creates a copy of the original mobile agent object. This operation is used when the need for another agent (with the same features and properties to do the same or other job in conjunction with the original one ) arises.

Dispatching or migrating is another main function in the mobile agent life cycle. This function is responsible for moving the agent from one node to another within the network environment by specifying the destination address (e.g. URL) to the agent. By the way, there are two types of migration; Strong migration is which mobile agent can carry itself, its data and its state. While weak migration is which mobile agent can carry only itself and its data.

The retraction function is done where the agent’s source node requires its agent to be returned to the original host or node.

Activation and deactivation are operations done when the mobile agent is required to start or to stop only within certain time of its lifetime. Finally, the dispose operation is done where the agent life comes to the end. Figure 2.5 explains the above mobile agent operations as suggested by an Aglet system:

Wednesday, April 16, 2008

Agent Characteristics of Java

 Platform-independence. Java is designed to operate in heterogeneous networks. To enable a Java application to execute anywhere on the network, the compiler generates architecture-neutral byte code as opposed to non-portable native code. For this code to be executed on a given computer, the Java runtime system needs to be present. There are no platform-dependent aspects of the Java language. Primitive data types are rigorously specified and not dependent on the underlying processor or operating system. Even libraries are platform-independent parts of the system. For example, the window library provides a single interface for the GUI that is independent of the underlying operating system. java allows us to create a mobile agent without knowing the types of computers it is going to run on.

 Secure execution. Java is intended for use on the Internet and intranets. The demand for security has influenced the design in several ways. For example, Java has a pointer model that eliminates the possibility of overwriting memory and corrupting data. Java simply does not allow illegal type casting or any pointer arithmetic. Programs are no longer able to forge access to private data in objects that they do not have access to. This prevents most activities of viruses. Even if someone tampers with the byte code, the Java runtime system ensures that the code will not be able to violate the basic semantics of Java. The security architecture of Java makes it reasonably safe to host an un-trusted agent, because it cannot tamper with the host or access private information.

 Dynamic class loading. This mechanism allows the virtual machine to load and define classes at runtime. It provides a protective name space for each agent, thus allowing agents to execute independently and safely from each other. The class-loading mechanism in extensible and enables classes to be loaded via the network.

 Multithread programming. Agents are by definition autonomous. That is, an agent executes independently of other agents residing within the same place. Allowing each agent to execute in its own lightweight process, is a way of enabling agents to behave autonomously also called a thread of execution. Fortunately, java not only allows multithread programming, but also supports a set of synchronization primitives that are built into the language. These primitives enable interaction between agents.


 Reflection. Java code can discover information about the fields, methods, and constructors of loaded classes, and can use reflected fields, methods, and constructors to operate on their underlying counterparts in objects, all within the security restrictions. Reflection accommodates the need for agents to be smart about them and other agents.


Although these great advantage, we should be aware of some significant shortcomings.
Note: Some of these shortcomings can be worked around; others are more serious, and have implications for the overall conceptual design and deployment of Java-based mobile agent systems.
 No protection of references. A Java object’s public methods are available to any other object that has a reference to it. Since there is no concept of a protected reference, some objects are allowed access to a larger set of public methods in the Java object’s interface than others. This is important for the agent. There is no way that it directly can monitor and control which other agents are accessing its methods. We have found that a practical and powerful solution to this problem is to insert a proxy object between the caller and the callee to control access. This not only provides protection of references, it also offers a solution to the problem mentioned in the next item and provides location transparency in general.


 No object ownership of references. No one owns the references to a given object in Java. For an agent, this means that we can take its thread of execution away from it, but we cannot explicitly void the agent (object) itself. This is a task for the automated garbage collector. At present, the garbage collector will not reclaim any object until all references to the object have been voided. So if some other agent has a reference to our agent, it will unavoidably open a loophole for that agent to keep our agent alive against our will. All we can do is to repeat the warning against giving away direct references to agents in Java. The upcoming Java Development Kit (JDK) 1.2 provides support for weak reference, which will solve this problem.


 No support for preservation and resumption of the execution state. It is currently impossible in Java to retrieve the full execution state of an object. Information such as the status of the program counter and frame stack is permanently forbidden territory for Java programs. Therefore, for a mobile agent to properly resume a computation on a remote host, it must rely on internal attribute values and external events to direct it. An embedded automaton can keep track of the agent's travels and ensure that computations are properly halted and properly resumed.

More Detail On Mobile Agent: Concept and History

The mobile agent approach is a relatively new paradigm in the distributed systems environment. MAs have been developed as an extension to mobile code approach (e.g. Applet) and could replace the client-server model and its architectures in the near future. Many researchers in this field have extended the mobile-code concept to “mobile object” in which an object (code + data) are moved from one host to another. The mobile agent approach extends this concept further by moving code, data and state (thread) from one host to another as well. MAs run at one location, move with their state to another host, and continue execution at that host. Mobile code and mobile objects are normally moved by an external entity while MAs are usually migrated autonomously.
Before the mobile agent paradigm appeared, many approaches have been proposed and developed for communication between client and server such as, Message Passing (MP), Remote Procedure Call (RPC) and Remote Evaluation (REV). In RPC, the client sends data as parameters to a procedure that resides at the server. The procedure will be executed on the server and the results will be sent back to the client. The REV is a different architecture from RPC. Instead of calling a remote procedure at the sever side, the procedure itself will be sent from the client to the server to be executed and returns the result. Briefly, in RPC the data is transmitted between the client and server in both directions. In REV, code is sent from the client to the server, and the data is returned. In contrast, a mobile agent is a program (encapsulating code, data, and state) sent by a client to a server [19].
However, in a client/server model, a server is a machine that provides some service (or a set of services) and a client (most often another machine) makes requests for those services through a communication channel (e.g. wireless or wired). Communication between the client and the server is usually through message passing. Thus, when a client needs a particular service, it usually sends a request message to the server that contains the needed service as shown in Fig 2.4. A limitation of the client-server model is that the client is limited to the operations provided at the server. If the client needs a service that a particular server does not provide, it must find a server that can satisfy the request by sending out more messages to other servers. This clearly is an inefficient use of network bandwidth. In addition, this kind of communication may increase the networks traffic, waste network bandwidth and causes delays of the reply due to server down time or crashes. Another problem is in the use of the model for disconnected computing. Due to the mobility factor of mobile devices (mobile phones, PDAs, Laptops), sporadic disconnection is frequent in the wireless environment. Mobile agents provide a solution for the dynamic environment of the mobile devices because they do not rely on server operations [20].
The mobile agent appears to tackle significant problems whether in wired or wireless communication such as disconnection operations, increased network traffic and others. Moreover, mobile agents can play a major role in the wireless communication after the failure of the Java RMI(Remote method Invocation) in increasing the performance over slow wireless links [21]. Once the mobile agent has migrated, the connection between client and server will be disconnected. This saves network bandwidth, especially in a wireless environment. When a mobile agent finishes its job at the server, it will then be ready to reconnect to its host or to migrate to another node to perform other duties within the network.

Why use of Mobile Agent in general?
Mobile agents can increase the performance in various areas by achieving the following tasks:
 Reduce the network load: MAs allow users to package and migrate their operations to be carried out locally. This is useful where huge volumes of data are required to be processed; the data will be manipulated locally rather than transferred over the network. In other words, move the computation to the data rather than the data to the computation.
 Overcome network latency: MAs can offer great opportunities to respond to real-time systems where delay is not acceptable due to its mobile and adaptive properties.
 Encapsulates protocols: in distributed systems where many different protocols may be used to communicate among the network nodes, MAs can overcome this problem by moving to remote hosts to establish channels based on proprietary protocols.
 Execute asynchronously and synchronously: in which a mobile computing area where network connection is expensive (small bandwidth). Some tasks require open connection between mobile devices and fixed networks; this might not be economical and practical; this problem can be solved by embedding a mobile task into the mobile agent and dispatch the mobile agent to the destination then disconnect the link between the mobile device and the fixed network.
Note: Building robust distributed systems based on mobile agent technology for the favor of its properties Robust, Fault-Tolerant and the event-based model makes MAs react dynamically to any critical situation within the environment.

Mobile Agents Requirements
Three requirements for building mobile agent: mobile agent code (program), mobile agent platform (execution environment), mobile interfaces or mobile agent creator. Java MAs can be used in areas such as network management, mobile computing, information management, web services, mobile computing, information management, remote software management and so on. Java is a jet fuel for mobile agent. Developers can build powerful distributed applications by using Java due to its independence platform feature.

Sunday, April 13, 2008

Master Thesis Introduction: Mobile Agent

Hi all,

As i promise u that i will publish all my technical knowledge, also i has no problem to publish what i learn in my master thesis, First I will publish introduction to my master then i will publish its problem then my proposed solution.
First I will take you into a tour in several technlogies, i will begin first with mobile agent technology.
But First what is an agent?
It is a program but has the following features:

- Is situated within an execution environment;
- possesses the following mandatory properties:

Reactive : senses changes in the environment and acts in accordance with those changes.
Autonomous: has control over its own actions.
Goal-driven : is pro-active.
Temporally continuous : executes continuously.

- and others like Communicative ¾ can communicate with other agents;
Mobile : can travel from one host to another;
Learning : adapts in accordance with previous experience;
Believable : appears believable to the end-user.

Mobile Agent Can travel from one system to another, means is nt bound to any environment.

So here are seven good reasons to start using mobile agents:


- They reduce the network load. Distributed systems often rely on communication protocols that involve multiple interactions to accomplish a given task. This is especially true when security measures are enabled. The result is a lot of network traffic. Mobile agents allow us to package a conversation and dispatch it to a destination host where the interactions can take place locally. Mobile agents are also useful when it comes to reducing the flow of raw data in the network. When very large volumes of data are stored at remote hosts, these data should be processed in the locality of the data, rather that transferred over the network. The motto is simple: move the computations to the data rather than the data to the computations.

- They overcoming network latency. Critical real-time systems such as robots in manufacturing processes need to respond to changes in their environments in real time. Controlling such systems through a factory network of a substantial size involves significant latencies. For critical real-time systems, such latencies are not acceptable. Mobile agents offer a solution, since they can be dispatched from a central controller to act locally and directly execute the controller's directions.

-
They encapsulate protocols. When data are exchanged in a distributed system, each host owns the code that implements the protocols needed to properly code outgoing data and interpret incoming data, respectively. However, as protocols evolve to accommodate new efficiency or security requirements, it is a cumbersome if not impossible task to upgrade protocol code properly. The result is often that protocols become a legacy problem. Mobile agents, on the other hand, are able to move to remote hosts in order to establish "channels" based on proprietary protocols.

-
They execute asynchronously and autonomously. Often mobile devices have to rely on expensive or fragile network connections. That is, tasks that require a continuously open connection between a mobile device and a fixed network will most likely not be economically or technically feasible. Tasks can be embedded into mobile agents, which can then be dispatched into the network. After being dispatched, the mobile agents become independent of the creating process and can operate asynchronously and autonomously. The mobile device can reconnect at some later time to collect the agent.

-
They adapt dynamically. Mobile agents have the ability to sense their execution
environment and react autonomously to changes. Multiple mobile agents possess the unique ability to distribute themselves among the hosts in the network in such a way as to maintain the optimal configuration for solving a particular problem.

- They are naturally heterogeneous. Network computing is fundamentally
heterogeneous, often from both hardware and software perspectives. As mobile agents are generally computer- and transport-layer-independent, and dependent only on their execution environment, they provide optimal conditions for seamless system integration.

Let's stop here for introduction to mobile agent, we will continue tommorow for more about agent and its implementation..

Thanks alot... and waiting for ur comments

Saturday, April 12, 2008

Single Sign On Authentication

Hi all , One Day i selected to review one paper in oxford journal, it is for a new topic for me called Single Sign On authentication.. I see that it is exciting topic that make me try to publish its concept in my post.

Let's Begin
as the number of internet site account grews, organizing and remembering your idenitiy information become so hard.Is it true?, Also it is n't a logic to make your identiy the same for all sites or service. This is the problem, what is the solution then?
Sso provide us the solution, How?
It allows users to verify their identity on centeral system and gain access to many different resources that trust the centeral system.
A widely used internet SSO system could help people protect their identity secrets by replacing many site-specific logins with a single SSO login.
Thanks a lot

Wednesday, April 9, 2008

what interesting in .docx file?

Hey! Just i see some amazing thing in new microsoft word format.... ।docx is the default file format in the latest version of Microsoft Word in Office 2007. All docs in the new office family is based upon an open, standardized specification called Office Open XML.


One .docx file is actually a collection of many files, stored in an archive or (zip-file).

- Build your own document and save it as .docx format.

- Rename it into .zip

- extract this file into a new folder

- expolre folder there

you will find that all words typed in a document plus its styles are represented in xml files...

Wow.. It will be wonderful to us.How? we are become free to render word documents easily.

Thanks alot and waiting for ur comments

Best Regards

Monday, April 7, 2008

new open blog

Welcome, i open a new blog for my specific technical knowledge in axapta:

Click here

Thanks alot

Tuesday, April 1, 2008

Google Interview

One day i taking @ Google site for their new services and products that make me amazing day by day.....
By luck i found a link for opening jobs there in different location @ world...
I explore these jobs, and i ask my self why i don't try to apply my cv there..may some one feel that it is a useless step, but i feel that make me face with my technical shortage....
So, i decide to apply my CV to opening job in poland, they reply me automatically as they will view my CV and will see my suitable jobs for my qualification.....
after Two days they send me email request me my free time to make the first technical phone interview with google software engineer @UK for 45 minutes, wow, it will be so hard for sure . Iam afraid from their english, because my native language is arabic and my english skills are intermediate specially in listening .
I beging preparing my self in several technical topics like data structure and alogrithms, scripting, especially problem solving (I solve about 15 question with java implementation)
Eng Hassan, Software Engineer @Uk phone me @suitable time, beging introducing my self, first i try as much as i can to get his english statement..
First Question: How to traverse a Tree level By level
Answer: I get an idea of making a loop for n levels and for each iteration get childs of parent ...
It is so classic answer, and by the way it is an AI algorithm called BreadthFirst, solved as a queue implementation..
Second Question: Tell me a searching alogrithm u saw it as a fast?
Answer: I Think about BinarySearch, and tell him its pesudo code,
Third Question: What if we rotate array so that the smallest element not in the firs..
Answer: i dont have answer for it ...... and i will think and send my solutions through emails...
Interview is finished with afraid...
I send hassan my solutions and wait for Google reply.....
after 4 days, they send me email from uk office to prepare to the 2nd interview, and i will be semi happy for passing the first interview.
Software engineering fro US will phone me, wow, iam afraid also from their english..
Question 1: Give me an example for a linked list?
Answer: A list of family
Question 2: what is the difference between array list in java and linked list?
Answer: i know that array list is a dynamic array, so that elements are stored sequentially in memory but with dynamic size, while elements in linked list are stored randomly in memory
Question 3: so when we use linked list in some cases?
Answer: i know that accessing elements in array is faster than linked list, but i dont remember why. i forget, i dont know ...
He think with me, and tell me an example to think with him ..
what if we have an array of elements and try to insert element @the middle?
I answer if we use linked list, it will be easy, it is a normal procedure...
But in array we need to shift all upper elements to insert new element...
So in this case linked list will be better....
By the way i lost alot of the english words in listening that make me confused when speaking, so sorry.
I fail in 2nd interview for my english skills, so i should find a way to improve my english and contact google later...
Thx for my god at any way...