COT 4600 Operating Systems Spring 2011 Dan C

  • Slides: 14
Download presentation
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours:

COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5: 00 – 6: 00 PM

Lecture 12 – Tuesday, February 22, 2011 n Last time: ¨ Client-server organization Intermediaries;

Lecture 12 – Tuesday, February 22, 2011 n Last time: ¨ Client-server organization Intermediaries; Trusted Intermediaries; Thin clients Issues § Heterogeneity; little-endian and big-endian representation § Timing, response time. ¨ Examples: Event service, X 11; Trusted intermediaries: Email, File Systems, Web Today ¨ ¨ ¨ Peer-to-peer systems Remote Procedure Call Strategies for name resolution Case study: DNS – Domain Name Service Case study: NFS – Network File System Next time n Virtualization Lecture 12 2

Remote procedure call (RPC) n n n Support inter-process communication of remotely located processes

Remote procedure call (RPC) n n n Support inter-process communication of remotely located processes and allows implementation of client-server systems (RFC 1831) Preserve the semantics of a local procedure call. To use an RPC a process may use a special service: PORTMAP or RPCBIND available at port 111. A new RPC service uses the portmapper to register. The portmapper also allows a service lookup. If the process knows the port number of the RPC it may call directly. RPC/TCP and also RPC/UDP Messages must be well-structured; contain the identification of the specific RPC ¨ are addressed to an RPC demon listening at an RPC port. ¨ n A machine independent representation of data external data representation standard (XDR). Lecture 12 3

Lecture 12 4

Lecture 12 4

RPC semantics n At least once the client stub resends a message up to

RPC semantics n At least once the client stub resends a message up to a given number of times until it receives a message from the server; is no guarantee of a response the server may end up executing the a request more than once ¨ suitable for side-effect free operations ¨ n At most once a message is acted upon at most once. If the timeout set for receiving the response expires then an error code is delivered to the client. ¨ The server must keep a history of the time-stamps of all messages. Messages may arrive out of order…. . ¨ Suitable for operations which have side effects ¨ n Exactly once implement the at most once and request an acknowledgment from the server. Lecture 12 5

Domain Name System n Domain Name System (DNS general-purpose name management system Hierarchically structured

Domain Name System n Domain Name System (DNS general-purpose name management system Hierarchically structured ¨ Maps user-friendly host names to IP addresses ¨ n Domain Name Service (DNS) A database editor generates tables of bindings and these bindings and then these tables are distributed to DNS servers ¨ Propagation takes time, hours. ¨ Supports both relative and absolute paths ¨ n DNS architecture a hierarchical distributed database and an associated set of protocols that define: A mechanism for querying and updating the database. ¨ A mechanism for replicating the information in the database among servers. ¨ A schema of the database. ¨ n DNS has a referral architecture somewhat complicated due to need to optimize. Lecture 12 6

DNS Dictionary n n n n Domain name an identification label that defines a

DNS Dictionary n n n n Domain name an identification label that defines a realm of administrative autonomy, authority, or control in the Internet, based on the Domain Name System. The top-level domains (TLDs) are the highest level of domain names of the Internet; they form the DNS root zone. There are 20 generic top-level domains and 248 country code top-level domains Authoritative name server gives original, first-hand, definitive answers; holds either the name record or a referral record for the name Authoritative record first hand information about a host name Naming authority an Internet administrative authority allowed to add authoritative records to a name server Referral record binds a hierarchical region of the DNS name space to another server that could help resolve the name Recursive name service a DNS server takes upon itself to resolve a name rather than provide a referral record. Idempotent action that can be interrupted and restarted from the beginning any number of times and still produce the same result as if the action had run to completion without interruption Lecture 12 7

How DNS works n n A client sends a request to resolve a name

How DNS works n n A client sends a request to resolve a name to a Domain Name server The server examines the collection of the domains it is responsible for If it finds the name record it returns the record ¨ Else it searches a set of referral records ¨ Starts with the most significant component of the requested domain name for the one that matches the most components and ¨ n n If found it returns the name record Else returns “not found” Example on the next slide (left diagram): the system ginger. cs. pedantic. edu tries to resolve the name ginger. Scholarly. edu Important each host must have the address of a domain name server when it is connected to the Internet. This address could be : provided by the ISP (Internet Service Provider) ¨ hardwired into the browser ¨ generated when the system was installed ¨ selected by the user ¨ Lecture 12 8

Lecture 12 9

Lecture 12 9

The Network File System n n n Developed at Sun Microsystems in early to

The Network File System n n n Developed at Sun Microsystems in early to early 1980 s. Application of the client-server paradigm. Objectives: Design a shared file system to support collaborative work ¨ Simplify the management of a set of workstations ¨ n n n Facilitate the backups Uniform, administrative policies Main design goals Compatibility with existing applications NFS should provide the same semantics as a local UNIX file system 2. Ease of deployment NFS implementation should be easily ported to existing systems 3. Broad scope NSF clients should be able to run under a variety of operating systems 4. Efficiency the users of the systems should notice a substantial performance degradation when accessing a remote file system relative to access to a local file system 1. Lecture 12 10

NFS clients and servers n n n Should provide transparent access to remote file

NFS clients and servers n n n Should provide transparent access to remote file systems. It mounts a remote file system in the local name space it perform a function analogous to the MOUNT UNIX call. The remote file system is specified as Host/Path Host the host name of the host where the remote file system is located ¨ Path local path name on the remote host. ¨ n The NFS client sends to the NFS server an RPC with the file Path information and gets back from the server a file handle ¨ n A 32 bit name that uniquely identifies the remote object. The server encodes in the file handle: A file system identifier ¨ An inode number ¨ A generation number ¨ Lecture 12 11

Why file handles and not path names ----------------- Example 1 ------------------------ Program 1 on

Why file handles and not path names ----------------- Example 1 ------------------------ Program 1 on client 1 Program 2 on client 2 CHDIR (‘dir 1’) fd OPEN(“f”, READONLY) RENAME(‘dir 1’, ’dir 2) RENAME(‘dir 3’, ’dir 1’) READ(fd, buf, n) To follow the UNIX specification if both clients would be on the same system client 1 would read from dir 2. f. If the inode number allows the client 1 to follw the same semantics rather than read from dir 1/f ------------------ Example 2 -----------------------fd OPEN(“file 1”, READONLY) UNLINK(“f”) fd OPEN(“f”, CREATE) READ(fd, buf, n) If the NFS server reuses the inode of the old file then the RPC from client 2 will read from the new file created by client 1. The generation number allows the NSF server to distinguish between the old file opened by client 2 and the new one created by client 1. Lecture 12 12

Lecture 12 13

Lecture 12 13

Lecture 12 14

Lecture 12 14