Client/Server and OS Ajay Kumar Shrivastava. Server program does Waits for client-initiated requests...
-
Upload
rosamond-summers -
Category
Documents
-
view
217 -
download
2
Transcript of Client/Server and OS Ajay Kumar Shrivastava. Server program does Waits for client-initiated requests...
Server program does
• Waits for client-initiated requests• Executes many requests at the same time• Takes care of VIP clients first• Initiates and runs background-task activity• Keeps running• Grows bigger and fatter
Base Services
• Task Preemption• Task Priority• Semaphores• Interprocess Communications (IPC)• Local/Remote Interprocess Communications• Threads• Intertask Protection• Multiuser High-Performance File System• Efficient Memory Management• Dynamically Linked Run-Time Extensions
Extended Services
• Ubiquitous Communications• Network Operating System Extensions• Binary Large Objects (BLOBs)• Global Directories and Network Yellow Pages• Authentication and Authorization Services• System Management• Network Time• Database and Transaction Services• Internet Services• Object-Oriented Services
Non-GUI Clients
• Non-GUI clients that do not need multitasking• Non-GUI clients that need multitasking
GUI Versus OOUIFeature Grapical User Interface (GUI) Object-Oriented User Interface (OOUI)
Application Structure
A graphic application consists of an icon, a primary window with a menu bar, and one or more secondary windows. The focus is on the main task. Ancillary tasks are supported by secondary windows and pop-ups. Users must follow the rigid task structure (and may get trapped in a task). An application represents a task.
A graphic application consists of a collection of cooperating user objects. Everything that you see is an object. Each object is represented by an icon and has at least one view. Objects can be reused in many tasks. The application's boundaries are fuzzy. The user defines what's an application by assembling a collection of objects. These objects may come from one or more programs and are integrated with the desktop objects the system provides (likes printers and shredders). The users can innovate and create their own "Lego-like" object collections.
Icons Icons represent a running application. Icons represent object that may be directly manipulated.
Starting an Application Users start application before selecting an object to work with. Users open the object on the desktop, which causes a
window view of the object to be displayed.
WindowsUsers open a primary window and then specify the objects they want to interact with. The same window can be used to display other objects.
A window is a view of what's inside an object. There is a one-to-one relationship between a window and an object.
Menus Menus provide the primary method for navigating within an application.
Each object has a context menu. You navigate within an application or across applications by directly manipulating objects. The desktop functions as one big menu; icons represent the objects that you can manipulate.
Active Application Visual Icons represent minimized windows of active applications. Icons are augmented with the in-use emphasis to
represent an active object.
GUI Versus OOUIFeature Grapical User Interface (GUI) Object-Oriented User Interface
(OOUI)
Direct Manipulation An application may provide direct manipulation on an ad hoc basis.
Objects are created, communicated with, moved, and manipulated through drag-and-drop manipulation.
Creating New ObjectsObjects are created in an application-specific manner, usually through some form of copy mechanism or using the menu choices: new or open.
A templates folder contains a template for every object type. To create a new instance of an object, drag its template to where you want the new object to reside.
Actions Choose object; then choose action from menu bar.
In addition to choosing actions from menus, a user can drag objects to icons to perform operations; for example, dragging a file to a printer icon.
Containers Text-based list boxes provide the primary form of containment.
In addition to list boxes, OOUIs provide container objects, including folders and notebooks. These in turn can contain other objects. Actions performed on container objects affect all the objects inside them.
Focus Focus is on the main task. Focus is on active objects and tasks.
Who Is In Control? Control alternates between the user and the application.
All the applications behave the same and the user acts as the conductor. Think of the user as the visual programmer of the desktop.
Product Examples Windows 3.X, Motif, and simple Web pages.NextStep/Mac OS X, Mac OS, Windows 98, OS/2 Workplace Shell, and Web pages that take advantage of Java 2 JavaBeans.
What Does a Client Need From an OS?
Requirements From an OS
Non-GUI Client Simple GUI Client OOUI ClientWithout
Multitasking With Multitasking
Request/reply mechanism (preferably with local/remote
transparency)Yes Yes Yes Yes
File transfer mechanism to move picture, text, and
database snapshotsYes Yes Yes Yes
Pre-emptive multitasking No Yes Desirable Yes
Task priorities No Yes Desirable Yes
Inter-process communications No Yes Desirable Yes
Threads for background communications with server and receiving callbacks from
serversNo Yes Yes (unless you like
the hourglass icon) Yes
OS robustness, including intertask protection and
reentrant OS callsNo Yes Desirable Yes
Client/Server Hybrids• Clients are becoming more intelligent• These "New Age" clients must provide a server
lite function• It should still be able to download shippable
places, run Java applets, and receive calls from a server
• A server lite implementation does not need to support concurrent access to shared resources, load balancing, or multithreaded communications
Client OS Trends
• The desktop is becoming more fragmented• The universal client is really a Web browser• There will be a huge demand for super-fat PCs• There will be a huge demand for ultra-thin PCs• Shippable places will become the new desktops• Embedded clients will be everywhere
Server OS Trends
Application vs Mixed Server File/Print Server
Unix 83.00% 17.00%
Windows NT 46.00% 54.00%
OS/2 Warp Server 31.80% 68.20%
NetWare 18.00% 82.00%
What Does Transparency Really Mean?
• Location transparency• Namespace transparency• Logon transparency• Replication transparency• Local/remote access transparency• Distributed time transparency• Failure transparency• Administration transparency
types of synchronization schemes
• Immediate replication causes any update to the master to be immediately shadowed on all replicas
• Skulking causes a periodic propagation (for example, once a day) to all the replicas of all changes made on the master
How Do You Interface to These Directories?
• Directory-specific APIs and class libraries• LDAP and X.500 APIs• Java classes• Distributed object interfaces• Meta-directory services and scripts
Distributed Time Services
• It periodically synchronizes the clocks on every machine in the network
• It introduces an inaccuracy component to compensate for unequal clock drifts that occur between synchronizations
Can We Obtain C2-Level Security on the Intergalactic Net?
• Authentication: Are you who you claim to be?
• Authorization: Are you allowed to use this resource?
• Audit Trails: Where have you been?
Can We Do Better Than C2 on the Intergalatic Net?
• Integrity: Is My In-Transit Data Safe?- Encryption- Cryptographic checksums
• Non-Repudiation: Can You Prove It in Court?-Evidence of message creation - Evidence of message receipt - An action timestamp - The evidence long-term storage facility - The adjudicator
.
The Internet: In Certificates We Trust
• How Do You Like your Keys?- Shared Private Keys- Public Keys
A Certificate Usage Scenario
• Jeri must first obtain a certificate• Jeri applies for a store account• Merchant determines if the certificate is OK• Jeri's certificate is OK• Jeri can now shop, shop, shop
Electronic Payments: The SET Protocol
• Jeri places an order• Merchant asks bank for authorization• The bank asks the credit card issuer for
authorization• The credit card company approves the transaction• The bank says it's OK• The merchant sends Jeri a receipt and ships goods• Jeri receives her monthly credit card bill
Network operating system
• A 'networking operating system ' is an operating system that contains components and programs that allow a computer on a network to serve requests from other computers for data and provide access to other resources such as printer and file systems.
Features
• Add, remove and manage users who wish to use resources on the network.
• Allow users to access to the data on the network. This data commonly resides on the server.
• Allow users to access data found on other network such as the internet.
• Allow users to access hardware connected to the network.• Protect data and services located on the network.• Enables the user to pass documents on the attached
network.
features may include
• basic support for hardware ports• security features such as authentication, authorization, login
restrictions, and access control• name services and directory services• file, print, data storage, backup and replication services• remote access• system management• network administration and auditing tools with graphic
interfaces• clustering capabilities• fault tolerance and high availability
Remote Procedure Call (RPC)
• An essential problem is that RPCs are not procedure calls at all; they are truly process invocations. The invoked program runs across the wire in a different resource domain
Remote Procedure Call
program stub (1)
(8)
LPC Bind req
Recv bindmarshalSend req
Recv result
unmarsh
return
stub procedure
(5)
(6)
execute
return
recv req
unmarsh
LPC
marshal
send result
binder
recv req register or search return
client server
Binding server
(8)
(0)
(1)
(7)(6)
(5)
(4)
(3)
(2)
Distributed Systems 52
Remote Procedure Call: steps
(0) Remote procedures registration;(1) Client procedure calls client stub in normal way;(2) Client stub sends a binding request asking for information;(3) Binding server searches for binding and reply to client stub;(4) Client stub packs a message (marshalling) and send to server stub;(5) Server stub unpacks parameters (unmarshalling), invokes LPC;(6) Server procedure executes and returns results to server stub;(7) Server stub packs results (marshalling) and sends to client stub;(8) Client stub unpacks results and returns to client procedure.
Call-by-value: parameter is a straight value (int, float, …)
Call-by-reference: parameter is a pointer to anything (int, record, array, pointer, …)
The stub is application-specific code, but it is not directly generated by the application writer and therefore appears as a separate layer from the programmer's point of view.
The function of the stub is to provide transparency to the programmer-written application code.
Stubs
1.On the client side: The stub handles the interface between the client's local procedure call and the run-time system, marshaling and unmarshaling data, invoking the RPC run-time protocol, and if requested, carrying out some of the binding steps.
2. On the server side: The stub provides a similar interface between the run-time system and the local manager procedures that are executed by the server.
Issues faces by RPC
• How are the server functions located and started
• How are parameters defined and passed between the client and the server
• How are failures handled• How is security handled by the RPC• How does the client find its server• How is data representation across systems
handled
Messaging And Queuing: The Mom Middleware
• Every DAD needs a MOM• DAD stands for Distributed Application
Development• MOM stands for Message-Oriented
Middleware
Feature MOM: Messaging and Queuing Remote Procedure Call (RPC)
Metaphor Post office-like. Telephone-like.
Client/Server time relationship
Asynchronous. Clients and servers may operate at different times and speeds.
Synchronous. Clients and servers must run concurrently. Servers must keep up with clients.
Client/Server sequencing No fixed sequence.Servers must first come up before clients can talk to them.
Style Queued. Call-Return.
Partner needs to be available No. Yes.
Load-balancing
Single queue can be used to implement FIFO or priority based policy.
Requires a separate TP Monitor.
Transactional support
Yes (some products). Message queue can participate in the commit synchronization.
No. Requires a transactional RPC.
Message filtering Yes. No.
PerformanceSlow. An intermediate hop is required. Fast.
Asynchronous processingYes. Queues and triggers are required.
Limited. Requires threads and tricky code for managing threads.
Dynamic Data Exchange (DDE)
Dynamic Data Exchange or DDE is a Windows feature that allowsWindows applications to communicate with each other. DDE isbased on the messaging system built into Windows. Two Windowsprograms can carry on a DDE "conversation" by posting messages toeach other. These two programs are known as the "server" and the"client". A DDE server is the program that has access to data thatmay be useful to other Windows programs. A DDE client is theprogram that obtains this data from the server.
What is CORBA?
• Common Object Request Broker Architecture• Communication infrastructure for distributed
objects• Allows a heterogeneous, distributed collection
of objects to collaborate transparently
What is CORBA good for?
• Developing distributed applications• Locating remote objects on a network• Sending messages to those objects• Common interface for transactions, security,
etc.– CORBA Services (more later)
Copyright © 1998 Purple Technology, Inc.
Why Distributed Applications?
• Data is distributed– Administrative and ownership reasons– Heterogeneous systems– Shared by multiple applications– Scalability
Copyright © 1998 Purple Technology, Inc.
Why Distributed Applications?
• Computation is distributed– Scalability: multiprocessing– Take computation to data– Heterogeneous architectures
• Users are distributed– Multiple users interacting and communicating via
distributed applications
Distributed Object Systems
• All entities are modeled as objects• Systems support location transparency• Interfaces, not implementations, define
objects• Good distributed object systems are open,
federated systems
What is the OMG?
• Designers of CORBA• Consortium of 700+ companies– Not including Microsoft
• Members:• platform vendors
• database vendors
• software tool developers
• corporate developers
• software application vendors
It’s Just A Spec
• Has never been fully implemented• Probably never will be• Industry moves quickly and spec has to keep
up
Copyright © 1998 Purple Technology, Inc.
CORBA Objects
• Examples– Service– Client– Component– Business object
• CORBA objects approach universal accessibility– Any Language– Any Host on network– Any Platform
what CORBA does on the client side
• The client IDL stubs• The Dynamic Invocation Interface (DII)• The Interface Repository APIs• The ORB Interface
what CORBA elements do on the server
• The Server IDL Stubs (OMG calls them skeletons)
• The Dynamic Skeleton Interface (DSI)• The Object Adapter• The Implementation Repository• The ORB Interface
Copyright © 1998 Purple Technology, Inc.
CORBA Elements
1. ORB2. CORBA Services3. CORBA Facilities4. Application Objects
Copyright © 1998 Purple Technology, Inc.
ORB
• Object Request Broker– “Object Bus”
• Handles all communication among objects• Each host (machine) has its own ORB• ORBs know how to talk to each other• ORB also provides basic services to client
Copyright © 1998 Purple Technology, Inc.
ORB Responsibilities
• Find the object implementation for the request
• Prepare the object implementation to receive the request
• Communicate the data making up the request• Retrieve results of request
Copyright © 1998 Purple Technology, Inc.
Network of ORBs
• There’s an ORB on the server too• ORB receives request
ORB Versus RPC• With an RPC, you call a specific function (the data is
separate). • In contrast, with an ORB, you're calling a method
within a specific object. • ORB method invocations have "scalpel-like" precision.
The call gets to a specific object that controls specific data, and then implements the function in its own class-specific way.
• RPC calls have no specificity—all the functions with the same name get implemented the same way. There's no differentiated service here.
Copyright © 1998 Purple Technology, Inc.
IIOP
• Internet Inter-Orb Protocol• Network or “wire” protocol• Works across TCP/IP (the Internet protocol)
Copyright © 1998 Purple Technology, Inc.
ORB Features
• Method invocations– Static and Dynamic– Remote objects or CORBA services
• High-level language bindings– Use your favorite language; ORB translates
• Self-describing– Provides metadata for all objects and services
Copyright © 1998 Purple Technology, Inc.
ORB Features
• Local or remote– Same API wherever target object lives
• Preserves context– Distributed security and transactions
• Coexistence with legacy code– Just provide a wrapper object
Copyright © 1998 Purple Technology, Inc.
What is an ORB really?
• Not a separate process• Library code that executes in-process• Listens to TCP ports for connections– One port per local object
• Opens TCP sockets to other objects– N ports per remote machine
Copyright © 1998 Purple Technology, Inc.
IDL
• Interface Definition Language• Defines protocol to access objects• Like a contract• Well-specified• Language-independent
Copyright © 1998 Purple Technology, Inc.
IDL Example
module Calc { interface Adder { long add(in long x, in long y); }}
• Defines an object called Adder with a method called add
Copyright © 1997 Alex Chaffee
Stubs and Skeletons
• Stub – lives on client– pretends to be remote object
• Skeleton– lives on server– receives requests from stub– talks to true remote object– delivers response to stub
Copyright © 1997 Alex Chaffee
Stubs and Skeletons (Fig.)
IIOPORB
Client Host Machine
Client Object
ORB
Server Host Machine
Stub
Remote Object
Skeleton
Client vs. Server
• in CORBA, a client is a client relative to a particular object i.e. an object with a reference to a “server” object
• A client may also act as a server– If it has an IDL and stubs and skeletons
• Technically, a CORBA server contains one or more CORBA objects
Copyright © 1998 Purple Technology, Inc.
Different Meanings of “Server”
• Host machine• Program running on host machine• CORBA object running inside program– has IDL, stub, skeleton– Sometimes called a Servant
Stubs and Skeletons -> Platform Independence
– Client code has no knowledge of the implementation of the object or which ORB is used to access the implementation.
Copyright © 1998 Purple Technology, Inc.
CORBA Services
• APIs for low-level, common tasks• Life Cycle Service– creating, copying, moving, removing objects
• Naming Service– Register objects with a name– Look up objects by name
Copyright © 1998 Purple Technology, Inc.
CORBA Services
• Concurrency Control Service– Obtain and release exclusive locks
• Transaction Service– Two-phase commit coordination– Supports nested transactions
• Persistence Service– Storing objects in a variety of databases – RDBMS, OODBMS, file systems
Copyright © 1998 Purple Technology, Inc.
CORBA Services
• Security Service– Authentication, ACLs, encryption, etc.
• Event Service– Uncoupled notifications
Copyright © 1998 Purple Technology, Inc.
CORBA Services
• Relationship• Externalization• Query• Licensing• Properties• Time• Trader• Collection• … and so on…
• See what I mean about it never being implemented?
Copyright © 1998 Purple Technology, Inc.
CORBA Facilities
• Frameworks for specialized applications• Distributed Document Component Facility– OpenDoc
• In progress:– Agents– Business Objects– Internationalization