tib jini. introduction here we look at only one type(web,object,file). clear separation between...
TRANSCRIPT
TIBJINI
INTRODUCTIONHere we look at only one
type(web,object,file).
Clear separation between computation and coordination exists.
A distributed system is a collection of processes.
INTRODUCTIONEach process is concerned with a specific
computational activity.
which in principle is carried out independently from other activities of other processes.
INTRODUCTION
We are trying to separate computation from coordination.
The coordination part of distributed system handles the communication and cooperation between the processes.
TYPES
INTRODUCTIONReferential coupling generally appears in the
form of explicit referencing in communication.
Sender is in need to know the identifier of receiver.Ex: A process can communicate only if it
knows the name or identifier of the other process.
INTRODUCTIONTemporal coupling means that processes that
are communicating will both have to be up and running.
Sender and Receiver needs to be active and are running.
COORDINATION MODELSTIBJINI
TIBCoordination model: Meeting Oriented Model
Makes use of subject based addressing, leading to what is known as publish/subscribe architecture.
Receiving a message on subject X is possible only if the receiver had subscribed to it.
Publishing a message on subject X means that the message is sent to all subscriber to X.
TIB Architecture
ArchitectureTIB uses multicasting to forward messages
to subscribers.
To cross-large scale networks, it effectively builds an overlay network with proprietary multicast routers.
WAN Architecture
CommunicationEvents : Publish – subscribe systems are
ideally supported by means of events: you are notified when someone publishes a message that is of interest to you.
Listener Events: Local object that registers a call back for a specific subject.
Communication
CommunicationEvent Scheduling: Events for the same
listener event are handled one after the other.
They may also be lost/ignored if listener event is destroyed at the wrong time
Communication
NAMINGNames are important as they form address of
the address of the message.
Filtering facilities ensure that right messages reach right subscribers.
NAMING
NAMING
Transactional MessagingEnsures that the messages sent by a single
process are delivered only if the sender commits.
Store published messages until commit time and only then make them available to subscribers.
Transactional Messaging
Fault Tolerance: MulticastingTIB relies on multicasting for publishing
messages to all subscribers.
This mechanism needs to be extended to wide area networks and requires reliable multicasting.
How?
Fault Tolerance: MulticastingSolution:Pragmatic General Multicast(PGM)A NACK based scheme in which receiver tells
the sender that they are missing something
Fault Tolerance: Multicasting
SECURITYGoal: establish a secure channel between a
publisher and a subscriberReferential decoupling between publisher and
subscriber is lost
Sender publishes encrypted data including its identity
SECURITYEach subscriber sets up a secure channel
with the sender
All subscribers share the same key to decrypt messages
SECURITYDiffie-Helman key exchange + public-key
cryptography
Assume Alice and Bob already:obtained certificates containing each-other
public keyestablished a shared key KA,B using Diffie-
Helman
SECURITYEstablish a secure channel between a specific
publisher and specific subscriber.
TIB-SUMMARY
ArchitectureCommunicationNamingTransactional MessagingFault ToleranceSecurity
JINIGenerative Communication Model.Temporal and Referential uncoupling by
means of javaspaces, a tuple based storage system.
Tuple?A Tuple is typed set of references to objects.
JINITuples are stored in serialized, that is,
marshalled from into javaspace.
To read a tuple, construct a template, with some fields left open.
Match a template against a tuple through a field by field comparision.
JINIwrite(): create an object copy and store it in
JavaSpace
read(): return tuples from JavaSpace that match a template
take(): like read, but removes tuple from JavaSpace
JINI
JINIWrite : A copy of tuple is stored in javaspace.Read : A template is compared to tuple
instances; the first match returns a tuple instance.
Take : A template is compared to tuple instances; the first match returns a tuple instance and removes the matching instance from javaspace.
public class Message implements Entry {public String content;public Message() { }
}
Message msg = new Message();Msg.content = “Hello World”;JavaSpace space = SpaceAccessor.getSpace();Space.write(msg, null, Lease.FOREVER);
Write entry
JavaSpaceEntry
Example: JavaSpace “Hello World” Use pattern matching to get desired objects
from the space“null” value represent wildcardA message object with the “content” field set
to “null” will return any message objectA message object with the content field set to
“Berkeley” will only return a message object with the content set to that value
Message template = new Message(); //Content is nullMessage result = (Message)space.read(
template, null, Long.MAX_VALUE);System.out.println(result.content);
“Hello World”
JavaSpace
Read entry
Entry
Long.MAX_VALUE - timeout parameter
Communication : NotificationsA Process can register itself at an object to
be notified when ever the event happens.
Uses a callback mechanism through listener objects.
A callback is implemented as an RMI.
Layered Architecture of Jini
EventsA client can register with an object that has
events of interest
A client can tell object to pass event to another process
Notification implemented by remote call
Using Events with JavaSpaces
JavaSpace ImplementationReplicate JavaSpace at all machines
Store tuples locally, search everywhere
Partial replication and searchingUse DHTs?
Replicate Everywhere
Search Everywhere
Partial Replication and Searching
Lookup ServiceCan be implemented using JavaSpaces
Each service inserts a tuple describing itselfJavaSpace notifies interested clients when
service becomes available Instead, Jini provides a specialized lookup
serviceA service registers itself using (attribute, value)-
pairsE.g., service parameters, location
Service ItemField Description
ServiceID The identifier of the service associated with this item
Service A (possibly remote) reference to the object implementing the service
AttributeSets A set of tuples describing the service
Tuple Type Attributes
ServiceInfo Name, manufacturer, vendor, version, model, serial number
Location Floor, room, building
Address Street, organization, organizational unit, locality, state or province, postal code, country
Predefined tuples:
TransactionsAim to provide ACID properties
Atomicity: all operations of a transaction take place, or none of them do
Consistency: completion of a transaction must leave the participants in a ``consistent'' state
Isolation: activities of one transaction must not affect any other transactions
Durability: results of a transaction must be persistent
TransactionsJini
Supply the mechanism of two-phase commit protocol
Leave the policy to the participants in a transaction
TransactionsA transaction is represented by a long identifier, obtained from a transaction manager
Each transaction is associated a lease; if lease expires, transaction is aborted
JINI-SUMMARYTransactions
COMPARISION OF TIB & JINI
SOFTWARE AGENTWhy Agent?
To simplify distributed computing.
SOFTWARE AGENTSAGENT?
Agents can be defined to be autonomous problem solving computational entities capable of effective operation in dynamic and open environments.
SOFTWARE AGENTS
SOFTWARE AGENTSwe identify seven types of agents:
Collaborative agents Interface agents Mobile agents Information/Internet agents Reactive agents Hybrid agents Smart Agents
Panoramic Classification
Characteristics of AgentsAutonomous.Adaptive and proactive.Mobile – ability to migrate to a remote
system, perform the tasks and return the results.
Persistent.Goal OrientedCommunicative, Collaborative, Cooperative.Flexible.
Agent Vs ObjectObject
Are defined as computational entities that encapsulate some state, are able to perform actions, or methods on this state, and communicate by message passing. Are computational entities. Encapsulate some internal state. Are able to perform actions, or methods, to change
this state. Communicate by message passing.
Agent Vs ObjectDifferences between agent and object
An object can be thought of as exhibiting autonomy over its state: it has control over it. But an object does not exhibit control over it’s behavior.
Other objects invoke their public method. Agent can only request other agents to perform actions.
“Objects do it for free, agents do it for money.”(implement agents using object-oriented
technology)……Thinking it.Thinking it.
Agent Vs ObjectIn standard object model has nothing
whatsoever to say about how to build systems that integrate reactive, pro-active, social behavior.
Each has their own thread of control. In the standard object model, there is a single thread of control in the system.
(agent is similar with an active object.)Summary,
Agent embody stronger notion of autonomy than object
Agent are capable of flexible behavior Multi-agent system is inherently multi-threaded
AGENT TECHNOLOGYThe computing landscape moves from the
focus on individual stand alone computers to distributed, open and dynamic systems where the real power of computers is used.
Requirements to Build AgentAn agent must have its own unique
identity An agent host must
allow multiple agents to co-exist and execute simultaneously.
allow agents to communicate with each other and the agent host.
be able to negotiate the exchange of agents.
Requirements to Build Agentbe able to freeze an executing agent and transfer
it to another host.be able to thaw an agent transferred from
another and allow it to resume execution. prevent agents from directly interfering with
each other Agents must be able to determine what
other agents are executing in the agent host Agents must be able to send and receive
messages to/from other agents.
Agent Architecture
TerminologyAgentHost: It keeps track of all the agents
executing in the system. It will interact with other AgentHosts to transfer an agent from one system to the other.
Agent: The Agent class defines the agent. An instance of this class exists for each agent executing on a given agent host.
TerminologyAgentInterface: An instance of this class
envelopes an agent and provides access to it via a well-defined interface. It is also the primary conduit for communication between agents. An AgentInterface instance is the only handle an agent gets to the other agents executing on a given host.
AgentIdentity: An instance of this class uniquely identifies an agent. Agents use this information to identify the agents with whom they are interested in collaborating.
AGENT TECHNOLOGYThe characteristics of dynamic and open
environments in which For example
Heterogenous systems must interact,span organisational boundaries, and operate effectively within rapidly changing circumstances and with dramatically increasing quantities of available information, suggests that there exists a need for new computing model.
AGENT TECHNOLOGYIn particular there is a need for autonomy,
i.e., to enable components to respond dynamically to changing circumstances while trying to achieve over arching objectives.
Which results in agent based computing.
AGENT TECHNOLOGYThe two agent languages are:
KQML(Knowledge Query and Manipulation Language)
FIPA (Foundation for Intelligent Physical Agents)
AGENT TECHNOLOGYKQML was developed in the early 1990’s as a
part of US govt. ARPA knowledge sharing project.
FIPA was much standardised by Europe.
Both deal with agent-to-agent communication
AGENT TECHNOLOGYThe power of agent technology depends on
inter-agent communication.Powerful agents need to communicate with
UsersSystem Resources
Benefits of AgentsReduce human work.Handle information overload.Provide automated help to the vast hordes of untrained
users.Provide a new, more powerful methodology to develop
complex software systems.Asynchronous / autonomous task execution.Reduction of network traffic by transferring the agents to
remote places to carry out a task rather than having to remotely monitor the task execution.
Negotiation capabilities.Learning capabilities – Proactive.
Drawbacks of AgentsLack of global standard for agent technology.All existing agent platforms provide basic
capabilities and agents designed on one platform may not be compatible with others.
Security issues such as masquerading, denial of service persists.
Agent ApplicatonsUser Interface Agents
Microsoft Office Assistant.Business process Agents
Data-driven workflow management.Information Management Agents
Email filtering agents.Web browsing assistantNotification agents.Resource Discovery agents.
Agent PlatformsTelescript (General Magic).Aglets Workbench (IBM).Concordia (Mitsubishi).JADE (Java Agent Development Framework,
Sun Microsystems).Grasshopper (IKV++).Odyssey (General Magic).Voyager (Object Space).
MOBILE AGENTSoftware programMoves from machine to machine under its
own control….Suspend execution at any point in time,
transport itself to a new machine and resume execution
Once created, a mobile agent autonomously decides which locations to visit and what instructions to perform
Continuous interaction with the agent’s originating source is not required
MOBILE AGENTMobile Code – transfers codeMobile Object – transfers code + dataMobile Process – transfers
code + data + thread stateMobile Agent – transfers
code + data + thread + authority of its owner
RPC Vs Mobile Agents
• Remote Procedure Calls (RPC)– One computer calls procedures on another– Messages: Requests and Responses– Procedure is “remote” – i.e. it is local to the
machine that performs it– Client and Server agree in advance on the
protocol for communication– Continuous on-going interaction and
communication between the client and server
CLIENT SERVERnetwork
RPC Vs Mobile Agents • Mobile Agents
– Instead of calling a procedure, supply the procedure as well
– Messages: Mobile Agent ( procedure + data + state)
– “Sending” computer may have begun the procedure and the receiving computer will continue the procedure
– On-going interaction, but NO on-going communication
CLIENT
SERVER
network
Mobile
AgentService
Applets, Servlets and Mobile Agents
• Applet – Downloaded from server to client
• Servlet – Uploaded from client to server
• Mobile Agents – Detached from client, can have multiple hops
MOBILE AGENTSMobile agents are computational software
processes capable of roaming wide area networks (WANs) such as the WWW.
interacting with foreign hosts gathering information on behalf of its owner coming “back home” having performed the
duties set by its user
MOBILE AGENTSThese duties may range from a flight
reservation to managing a telecommunications network
NOTE:mobility is neither a necessary nor sufficient
condition for agenthood
MOBILE AGENTSMobile agents are agents because they are
autonomous and they cooperate, albeit differently to collaborative agents
MOBILE AGENTSFor example they may cooperate or communicate by one
agent making the location of some of its internal objects and methods known to other agents.
By doing this, an agent exchanges data or information with other agents without necessarily giving all its information away.
MOBILE AGENTSThe key hypothesis underlying mobile agents
is that agents need not be stationary; indeed, the idea is that there are significant benefits to be accrued, in certain applications, by eschewing static agents in favour of their mobile counterparts
MOBILE AGENTSThese benefits are largely non-functional, i.e.
we could do without mobile agents, and only have static ones but the costs of such a move are high
MOBILE AGENTSFor example, consider the scenario borrowed from Wayner
(1995b) where the user is required to write a program that would allow her home computer make a flight reservation for her by accessing several airline reservation databases. She lists all her preferences: non-smoking, departure between 7 and 9.30 am from Baltimore, arrival at Austin before noon, no more than one connection, and no changes at Chicago OíHare. A static single-agent program would need to request for all flights leaving between these times from all the databases, which may total more than 200 and take up many kilobytes. It would also require a list of all the connections and proceed to narrow down the search. Each of these actions involves sifting through plenty of extraneous information which could/would clog up the network. Besides, she is probably paying for this network time
MOBILE AGENTSConsider the alternative. She encapsulates, object-
oriented style, her entire program within an agent which consumes probably less than 2K which roams the network of airline reservation systems, arrive safely and queries these databases locally, and returns ultimately to her home computer, with a schedule which she may confirm or refute. This alternative obviates the high communications costs of shifting, possibly, kilobytes of information to her local computer - which presumably she cannot cope with. Hence, mobile agents provide a number of practical, though non-functional, advantages which escape their static counterparts. So their motivation include the following anticipated benefit.
How Mobile Agents Work: A Brief Telescript View Telescript is an interpreted object-oriented
and remote programming language which allows for the development of distributed applications
How Mobile Agents Work:The interpreter and runtime development
environment for the Telescript language is called the Telescript engine and a given host can support simultaneously multiple Telescript engines
How Mobile Agents Work:
How Mobile Agents Work:It shows just one of these Telescript engines
integrated onto an operating system via a programming interface called the Telescript application programmer interface (API
How Mobile Agents Work:Telescript applications consist of Telescript
agents operating within a ëworldí or cyberspace of places, engines, clouds and regions. All of these are objects
How Mobile Agents Work:For example, a place is an instance of some
class within the engine whose definition inherits operations which can be called on that place
How Mobile Agents Work:The top class in Telescriptís object hierarchy
is the process
How Mobile Agents Work:A Telescript engine is itself a multitasking
interpreter which can run multiple processes and switches preemptively between them. Hence, the engine can host multiple agents that share data/information between themselves
How Mobile Agents Work:Telescript makes use of these three language
concepts: places, agents and "go". Go" is the primitive which allows for inter-
process communication A "go" requires a destination space and the
host engine packages up the agent along with all its data, stack and instruction pointer and ships it off to its destination place which may be across a vast WAN
How Mobile Agents Work:At its destination, the other Telescript-
enabled engine unpacks it, checks its authentication, and it is then free to execute at its new place. When it finishes, it returns to its original host having performed the task required by its owner. Non-cooperation occurs when a place refuses to accept an incoming agent process
Advantages of the Mobile Agent Paradigm
• reduce bandwidth consumption and network loads
• allow dynamic deployment of application components to arbitrary network sites
• encapsulate protocols• execute asynchronously and autonomously• can adapt by moving• run on heterogeneous platforms • most distributed applications fit naturally into the
mobile agent model• intuitively suitable for mobile users and
disconnected operations• Mobile agents combine the strengths of
techniques such as RPC, java applets etc. into a single, convenient framework