Sistemas Operativos Distribuidos (Parte 2) M. en C. Mario Farias-Elinos 1 Contenido Migración Soporte al Sistema operativo Comunicación entre procesos Servicio de nombres Sistema de archivos 2.2.2 1 Modelo de migración Alternatives for code migration. 2.2.3 Migración en un sistema heterogeneo 3-15 2.2.4 2 Implementación del agente de migración. Arquitectura de Agentes de Tanenbaum 2.2.5 Agentes de un sistema distribuido Propiedad Común para Descripción todos Autonomía Si Capacidad de actuar por ellos mismos Reactivo Si Responds timely to changes in its environment Proactivo Si Iniciar acciones que afecten el ambiente Communicativo Si Pueden intercambiar información con usuarios y/o otros agentes Continuo No Tener un tiempo de vida largo Mobil No Capacidad de migrar de un sitio a otro Adaptivo No Capacidad de aprendizaje Propiedades importantes de un agente. 2.2.6 3 Tecnología de agentes Modelo general de un agente 2.2.7 Capas del sistema Applications, services Middleware OS: kernel, libraries & servers OS1 Processes, threads, communication, ... OS2 Processes, threads, communication, ... Computer & network hardware Computer & network hardware Node 1 Node 2 Platform 2.2.8 4 Funcionalidad del Kernel Process manager Communication manager Thread manager Memory manager Supervisor 2.2.9 Copy-on-write Process A’s address space RA Process B’s address space RB copied from RA RB Kernel A's page table Shared frame B's page table a) Before write b) After write 2.2.10 5 Kernel monolítico VS µkernel S4 ....... S1 S1 Key: Server: S2 S3 S2 S3 S4 ....... ....... Monolithic Kernel Microkernel Kernel code and data: Dynamically loaded server program: 2.2.11 Integración del microkernel Middleware Language support subsystem Language support subsystem OS emulation subsystem .... Microkernel Hardware The microkernel supports middleware via subsystems 2.2.12 6 Activación del Scheduler Process A P added SA preempted Process B Process SA unblocked SA blocked Kernel Virtual processors A. Assignment of virtual processors to processes P idle Kernel P needed B. Events between user-level scheduler & kernel Key: P = processor; SA = scheduler activation 2.2.13 Cliente/Servidor bajo threads Thread 2 makes requests to server Thread 1 generates results Input-output Receipt & queuing T1 Requests N threads Client Server 2.2.14 7 Otras formas de servidores con threads per-connection threads workers I/O I/O remote objects remote objects a. Thread-per-request per-object threads b. Thread-per-connection remote objects c. Thread-per-object 2.2.15 Llamadas serializadas y concurrentes Serialised invocations process args marshal Send Receive unmarshal process results process args marshal Send Concurrent invocations process args marshal Send transmission process args marshal Send Receive unmarshal execute request marshal Send Receive unmarshal process results Receive unmarshal execute request marshal Send Receive unmarshal execute request marshal Send Receive unmarshal process results Receive unmarshal execute request marshal Send time Receive unmarshal process results Client Server Client Server 2.2.16 8 Comunicación entre procesos (a) System call Control transfer via trap instruction Thread Control transfer via privileged instructions User Kernel Protection domain boundary (b) RPC/RMI (within one computer) Thread 1 User 1 Thread 2 Kernel User 2 (c) RPC/RMI (between computers) Network Thread 1 Thread 2 User 1 User 2 Kernel 1 Kernel 2 2.2.17 El sistema X-Window Esquema básico del X-Window 2.2.18 9 Esquema general 3.7 a) b) Client-to-server binding using a daemon as in DCE Client-to-server binding using a superserver as in UNIX 2.2.19 Distribución del espacio de nombes Ejemplo del DNS 2.2.20 10 Ejemplo del servicio DNS URL http://www.cdk3.net:8888/WebExamples/earth.html DNS lookup Resource ID (IP number, port number, pathname) 55.55.55.55 8888 WebExamples/earth.html Web server Network address file 2:60:8c:2:b0:5a Socket 2.2.21 Interactuación con el DNS NS2 2 Client 1 NS1 Name servers 3 NS3 A client iteratively contacts name servers NS1–NS3 in order to resolve a name 2.2.22 11 Búsqueda Recursiva y no recursiva en el DNS NS2 NS2 2 2 1 1 NS1 client client 3 4 4 3 NS1 5 NS3 NS3 Non-recursive server-controlled Recursive server-controlled A name server NS1 communicates with other name servers on behalf of a client 2.2.23 Interactuación entre servidores DNS a.root-servers.net (root) ns1.nic.uk (uk) uk purdue.edu yahoo.com ns.purdue.edu (purdue.edu) co.uk ac.uk ns0.ja.net (ac.uk) * .purdue.edu ic.ac.uk qmw.ac.uk dcs.qmw.ac.uk *.qmw.ac.uk *.dcs.qmw.ac.uk alpha.qmw.ac.uk (qmw.ac.uk) dns0.dcs.qmw.ac.uk (dcs.qmw.ac.uk) *.ic.ac.uk dns0-doc.ic.ac.uk (ic.ac.uk) 2.2.24 12 Servicio de nombres por recurso admin Client Printing service 1. ‘finance’ lookup service? admin Client Lookup service Network 2. Here I am: ..... 4. Use printing service Corporate infoservice admin, finance Printing 3. Request printing Lookup service service finance 2.2.25 Estructura del X.500 2.2.26 13 Ejemplo del uso del X.500 X.500 Service (root) ... France (country)Great Britain (country) Greece (country) ... ... BT Plc (organization)University of Gormenghast (organization) ... ... Computing Service (organizationalUnit) Department of Computer Science (organizationalUnit) Engineering Department (organizationalUnit) ... ... Departmental Staff (organizationalUnit) ely (applicationProcess) Research Students (organizationalUnit) ... ... Alice Flintstone (person)... Pat King (person)James Healey (person)Janet Papworth (person) ... 2.2.27 Esquema del GNS DI: 599(EC) DI: 543 DI: 574 AC DI: 437 DI: 322 UK FR QMW Peter.Smith mailboxes Alpha Beta password Gamma 2.2.28 14 Home-mobil The principle of Mobile IP. 2.2.29 Escalabilidad Creación de subnodos que comparten la información para cubrir toda la red. 2.2.30 15 Sistema de almacenamiento Compartido Persis- Replica/cache Mantenimiento Ejemplo tente distribuidos consistencia Memoria principal 1 RAM Sistema de archivos 1 UFS, FAT, NTFS Sistema de archivos distribuido Sun NFS Web Web server Memoria distribuida compartida Ivy Objetos remotos (RMI/ORB) 1 CORBA Almacenamiento de objetos 1 CORBA Persistent Object Service Almacenamiento de objetos distribuidos PerDiS, Khazana 2.2.31 Arquitectura del servicio de archivos Client computer Application Application program program Server computer Directory service Flat file service Client module 2.2.32 16 Arquitectura del NFS Client computer Server computer Application Application program program UNIX system calls UNIX kernel Virtual file system Local UNIX file system Other file system UNIX kernel Virtual file system Remote NFS client NFS server NFS protocol UNIX file system 2.2.33 Arquitectura del NFS 2.2.34 17 Acceso al sistema de archivos local y remoto Server 1 Client (root) (root) export . . . vmunix Server 2 (root) usr nfs Remote people big jon bob . . . mount Remote students x staff mount users jim ann jane joe 2.2.35 Acceso al sistema de archivos local y remoto 2.2.36 18 Automounting 2.2.37 Andrew File System (AFS) Workstations Servers User Venus program Vice UNIX kernel UNIX kernel User Venus program Network UNIX kernel Vice Venus User program UNIX kernel UNIX kernel 2.2.38 19 Ejemplo del AFS Local Shared / (root) tmp bin . . . cmu vmunix bin Symbolic links 2.2.39 Llamadas del sistema en AFS Workstation User program Venus UNIX file system calls Non-local file operations UNIX kernel UNIX file system Local disk 2.2.40 20 Arquitectura del CFS 2.2.41 Arquitectura del CFS 2.2.42 21 Comunicación del CFS 2.2.43 Uso del servicio de nombres 2.2.44 22 Replicación en CFS 2.2.45 Operación de desconexión 2.2.46 23 Comparativa de xFS Issue NFS Coda Plan 9 xFS Design goals Access transparency High availability Uniformity Serverless system SFS Scalable security Access model Remote Up/Download Remote Log-based Remote Communication RPC RPC Special Active msgs RPC Client process Thin/Fat Fat Thin Fat Medium Server groups No Yes No Yes No Mount granularity Directory File system File system File system Directory Name space Per client Global Per process Global Global File ID scope File server Global Server Global File system Sharing sem. Session Transactional UNIX UNIX N/S Cache consist. write-back write-back write-through write-back write-back Replication Minimal ROWA None Striping None Fault tolerance Reliable comm. Replication and caching Reliable comm. Striping Reliable comm. Recovery Client-based Reintegration N/S Checkpoint & write logs N/S Secure channels Existing mechanisms Needham-Schroeder Needham-Schroeder No pathnames Self-cert. Access control Many operations Directory operations UNIX based UNIX based NFS BASED 2.2.47 24