Presentation on theme: "Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing."— Presentation transcript:
Rasool Jalili, OS2, Sem Naming Chapter 4
Rasool Jalili, OS2, Sem Advertisment!! Please inform the students to subscribe to the mailing list by sending an to containing the line: subscribe Regards, --Shahriari
Rasool Jalili, OS2, Sem Naming Role of naming: share resources, uniquely identify entities, refer to locations, … Resolution of names: naming system Often the naming system is distributed across multiple machines. In this chapter: –Organization and implementation of human-friendly names –Using names to locate mobile entities: mobile telephony. –Removed and unreferenced objects and names.
Rasool Jalili, OS2, Sem Naming-2 Subject of name: resources such as hosts, files,.. –Processes, users, mailboxes, messages, connections,.. To operate on an entity, we need an access point. The name of an access point is called “address” Location independency. Identifier: refers to at most one entity and each entity is referred to by at most one identifier, and never reused. Name space
Rasool Jalili, OS2, Sem Name Spaces (1) A general naming graph with a single root node.
Rasool Jalili, OS2, Sem Name Spaces (2) The general organization of the UNIX file system implementation on a logical disk of contiguous disk blocks.
Rasool Jalili, OS2, Sem Name Resolution The process of looking up a name: Name Resolution Depends on if we know the start point, e.g. first inode. Closure Mechanism: knowing how and where to start name resolution. Environment variable (“HOME”) helps. Aliases Hard Link Symbolic link (shortcut)
Rasool Jalili, OS2, Sem Linking and Mounting (1) The concept of a symbolic link explained in a naming graph.
Rasool Jalili, OS2, Sem Linking and Mounting (2) Mounting remote name spaces through a specific process protocol.
Rasool Jalili, OS2, Sem Linking and Mounting (3) Mounting is one way to merge different name spaces Organization of the DEC Global Name Service: Adding a new root, so existing names should be changed! So names should have their initiating point; no:/home/steen/keys
Rasool Jalili, OS2, Sem Implementation of a Name Space Name space is the heart of a naming service. In LANs, it is feasible to implement a naming service through a single name server. In large-scale distributed systems, we need to distribute the implementation of a name space over multiple name servers. It is normally implemented hierarchically.
Rasool Jalili, OS2, Sem Name Space Distribution (1) An example partitioning of the DNS name space, including Internet-accessible files, into three layers.
Rasool Jalili, OS2, Sem Name Space Distribution (2) A comparison between name servers for implementing nodes from a large-scale name space partitioned into a global layer, as an administrational layer, and a managerial layer. ItemGlobalAdministrationalManagerial Geographical scale of networkWorldwideOrganizationDepartment Total number of nodesFewManyVast numbers Responsiveness to lookupsSecondsMillisecondsImmediate Update propagationLazyImmediate Number of replicasManyNone or fewNone Is client-side caching applied?Yes Sometimes
Rasool Jalili, OS2, Sem Implementation of Name Resolution (1) The principle of iterative name resolution. In each step, the address of the name server for the remaining part is given.
Rasool Jalili, OS2, Sem Implementation of Name Resolution (2) The principle of recursive name resolution. Caching is more efficient here compared to the iterative.
Rasool Jalili, OS2, Sem Implementation of Name Resolution (3) Recursive name resolution of. Name servers cache intermediate results for subsequent lookups. Server for node Should resolve Looks up Passes to child Receives and caches Returns to requester cs # -- # vu # # # # ni # # # # # # root # # # # # # # #
Rasool Jalili, OS2, Sem Implementation of Name Resolution (4) The comparison between recursive and iterative name resolution with respect to communication costs.
Rasool Jalili, OS2, Sem Example: DNS One of the largest name service. Organization is a rooted tree hierarchy. Label has a max of 63 alphanumeric chars; Path is restricted to 256 chars. Representation of the path name, root: as “ cabinet.ce.sharif.ir.” The rightmost “.” is normally ommited. Incoming edge has the same name as the node A subtree is called a domain.; a path name to its root is called a domain name.
Rasool Jalili, OS2, Sem The DNS Name Space The most important types of resource records forming the contents of nodes in the DNS name space. Type of record Associat ed entity Description SOA (Start of Authority) Zone Holds information on the represented zone A ( Address )Host Contains an IP address of the host this node represents MX ( Mail Exchange )Domain Refers to a mail server to handle mail addressed to this node SRV ( Server )Domain Refers to a server handling a specific service NS ( Name Service )Zone Refers to a name server that implements the represented zone CNAME ( alias )Node Symbolic link with the primary name of the represented node PTRHost Contains the canonical name of a host with its IP address (for reverse mapping) HINFOHost Holds information on the host this node represents TXTAny kind Contains any entity-specific information considered useful
Rasool Jalili, OS2, Sem DNS Implementation (1) An excerpt from the DNS database for the zone cs.vu.nl.
Rasool Jalili, OS2, Sem DNS Implementation (2) Part of the description for the vu.nl domain which contains the cs.vu.nl domain. NameRecord typeRecord value cs.vu.nlNISsolo.cs.vu.nl A
Rasool Jalili, OS2, Sem X.500 DNS is similar to a white page book. A different approach is directory service which resolves the problem using description of properties, instead of a full name: similar to yellow pages. An X.500 directory consists a number of records, as directory entries, similar to resource records. Each record as a collection of (attr, val). The collection of all entries is called a Dir. Info. Based (DIB). Each naming attribute is called a Relative Distinguished Name (RDN) Directory Information Tree (DIT) forms the naming graph
Rasool Jalili, OS2, Sem The X.500 Name Space (1) A simple example of a X.500 directory entry using X.500 naming conventions. AttributeAbbr.Value CountryCNL LocalityLAmsterdam OrganizationLVrije Universiteit OrganizationalUnitOUMath. & Comp. Sc. CommonNameCNMain server Mail_Servers , , FTP_Server WWW_Server
Rasool Jalili, OS2, Sem The X.500 Name Space (2) Part of the directory information tree.
Rasool Jalili, OS2, Sem The X.500 Name Space (3) Two directory entries having Host_Name as RDN. AttributeValueAttributeValue CountryNLCountryNL LocalityAmsterdamLocalityAmsterdam OrganizationVrije UniversiteitOrganizationVrije Universiteit OrganizationalUnitMath. & Comp. Sc.OrganizationalUnit Math. & Comp. Sc. CommonNameMain serverCommonNameMain server Host_NameStarHost_Namezephyr Host_Address Host_Address
Rasool Jalili, OS2, Sem Locating Mobile Entities Traditional naming systems are not so well suited for mobile entities. 3 types of names were discussed: –Human-friendly names –Identifiers –Addresses In all naming systems it is needed to have a mapping from names to addresses. 3 layers in DNS: Caching ad change in each layer. It is better to restrict updates to a single name server.
Rasool Jalili, OS2, Sem Naming vs Locating (1) Assume ftp.cs.vu.nl is moved to ftp.cs.unisa.edu.au.ftp.cs.vu.nlftp.cs.unisa.edu.au Two ways to cope with: –-Record the address of the new machine for ftp.cs.vu.nl.ftp.cs.vu.nl –Record the name of the new machine in DNS and create a symbolic link. However, if the machine moves frequently! Each time an entity moves, a new operation is needed. It is expected that our names are not changed. traditional naming services are not good for mobile entities.
Rasool Jalili, OS2, Sem Naming versus Locating Entities a)Direct, single level mapping between names and addresses. b)T-level mapping using identities. Identifiers never change, and never to refer to a different entity.
Rasool Jalili, OS2, Sem Forwarding Pointers (1) The principle of forwarding pointers using (proxy, skeleton) pairs.
Rasool Jalili, OS2, Sem Forwarding Pointers (2) Redirecting a forwarding pointer, by storing a shortcut in a proxy.
Rasool Jalili, OS2, Sem Home-based Approaches Bcasting and forwarding has the problem of scalability. An alternative approach is based on the comcept of home location. Home location is where an entity was created. It is used as a fall-back mechanism for location service based on forwarding pointer.
Rasool Jalili, OS2, Sem Home-Based Approaches The principle of Mobile IP.
Rasool Jalili, OS2, Sem Home-based Approaches It is assumed the home location is fixed. However, when a mobile is moved forever!! 0917 in moved for years to Tehran! Two-tiered home-based approach can be extended into multiple layers. Globe location services as a base for hierarchical location services. General mechanism: A network is partitioned into a collection of domains ( similar to the organization of DNS) The lowest level domain is called a leaf domain, corresponding to a LAN or a cell
Rasool Jalili, OS2, Sem Hierarchical Approaches (1) Hierarchical organization of a location service into domains, each having an associated directory node.
Rasool Jalili, OS2, Sem Hierarchical Approaches Location Record at different layers –At the leaf, the address only. –At the upper levels, each entity has a location record pointing to the lower level node toward the entity. If an entity has multiple addresses, the smallest sub-domain containing both domains have multiple entries.
Rasool Jalili, OS2, Sem Hierarchical Approaches (2) An example of storing information of an entity having two addresses in different leaf domains.
Rasool Jalili, OS2, Sem Hierarchical Approaches (3) Looking up a location in a hierarchically organized location service.
Rasool Jalili, OS2, Sem Hierarchical Approaches (4) a)An insert request is forwarded to the first node that knows about entity E. b)A chain of forwarding pointers to the leaf node is created.
Rasool Jalili, OS2, Sem Pointer Caches (1) Caching a reference to a directory node of the lowest-level domain in which an entity will reside most of the time.
Rasool Jalili, OS2, Sem Pointer Caching Moving between two super domains like provinces! What is the best node for caching. Cache invalidation
Rasool Jalili, OS2, Sem Pointer Caches (2) A cache entry that needs to be invalidated because it returns a nonlocal address, while such an address is available.
Rasool Jalili, OS2, Sem Scalability Issues The root node should have a location record for all entities and process requests for each entity!! –Storage: 1,000,000,000 entries of 1k yields 1000GB. –Processing time and being bottleneck! A solution is to partition the root node and major nodes. –Where to put the subnodes (of the root). Close to each other (in a parallel computer) Spread the subnodes across the network.
Rasool Jalili, OS2, Sem Scalability Issues The scalability issues related to uniformly placing subnodes of a partitioned root node across the network covered by a location service.
Rasool Jalili, OS2, Sem Removing Unreferenced Entities Naming and location services provide a global referencing service for entities. As long as an entity is referred, it can be accessed and used. As soon as an entity can no longer be accessed, it should be removed. Alternatives –Manual. Impossible in large DSs. There is no info of existence of a reference to an entity. –Should take care, as in future the reference may be used! –Distributed garbage collectors.
Rasool Jalili, OS2, Sem The Problem of Unreferenced Objects An example of a graph representing objects containing references to each other.
Rasool Jalili, OS2, Sem Garbage Collection The model of referencing a remote object is through (proxy, skeleton) The process of garbage collection is transparent An object itself may have references to remote objects. An object for which no remote reference exists should be removed. Solutions: Reference counting –Each time a reference is created, a reference counter is incremented. Removal of the reference decrementing the counter. –Unreliable connection results in inconsistency!
Rasool Jalili, OS2, Sem Reference Counting (1) The problem of maintaining a proper reference count in the presence of unreliable communication.
Rasool Jalili, OS2, Sem Reference Counting (2) a)Copying a reference to another process and incrementing the counter too late b)A solution.
Rasool Jalili, OS2, Sem Advanced Reference counting Race condition in increment and decrement operations A solution is to do just decrement. When an object is created, the total weight is stored in its associated skeleton. When a new remote reference is created, half of the partial weight is assigned to the new proxy. Duplication of a remote reference (passing it from P1 to P2), half of the weight is assigned to P2 proxy. Destroy of a reference yields sending a decrement message to the object.
Rasool Jalili, OS2, Sem Advanced Referencing Counting (1) a)The initial assignment of weights in weighted reference counting b)Weight assignment when creating a new reference.
Rasool Jalili, OS2, Sem Advanced Referencing Counting (2) c)Weight assignment when copying a reference.
Rasool Jalili, OS2, Sem Advanced Referencing Counting (3) Creating an indirection when the partial weight of a reference has reached 1.
Rasool Jalili, OS2, Sem Advanced Reference Counting The problem is tracking the chains! An Alternative approach is generation reference counting. Assuming each remote ref. is constructed as ( proxy, skeleton ) pair, and the only skeleton s is located in the same address as the object. Each proxy stores a counter of its being copied, plus a generation number. When a new ref (p, s) is created, the gen # of p is reset, its initial copy# is also set to 0. When a remote ref (p,s) to another process is done, the copy# is incremented, the gen# of the copy (p’) is also incremented. Another approach is reference listing in which the skeleton maintains the list of proxies have a ref to it.
Rasool Jalili, OS2, Sem Advanced Referencing Counting (4) Creating and copying a remote reference in generation reference counting.
Rasool Jalili, OS2, Sem Identifying Unreachable Entities Mark and sweep collectors, achieve in two phases, mark and sweep, starting from some root entities. To cope with the scalability problem in tracing based GC, processes can be hierarchically organized into groups. GC is done locally into within groups through a combination of mark-and-sweep and reference counting. Groups are needed just for scalability. The skeleton maintains the reference counter.
Rasool Jalili, OS2, Sem In group Garbage Collection 1- Initial marking 2- Intra-process propagation of marks from skeleton to proxies 3- Intra-process propagation of marks from proxies to skeletons 4- Stabilization by repetition of the prev steps 5- Garbage collection A skeleton can be marked as soft or hard. A proxy can be marked as none, soft, or hard. Hard marked skeleton means reachability from a proxy outside the group or from a root object inside the group. Hard marked proxy means reachability from an object in the root set. A soft proxy is reachable from a soft skeleton such proxies potentially lie in a non-reachable cycle. A proxy is marked none, if neither reachable from a skeleton, nor an object in the root set.
Rasool Jalili, OS2, Sem Tracing in Groups (1) Initial marking of skeletons.
Rasool Jalili, OS2, Sem Tracing in Groups (2) After local propagation in each process.
Rasool Jalili, OS2, Sem Tracing in Groups (3) Final marking.