Distributed Systems CS 15-440 Naming – Part II Lecture 6, Sep 26, 2011 Majd F. Sakr, Vinay Kolar, Mohammad Hammoud Today… Last session: Naming: Flat-Names, Structured-Names Today’s session: Naming: Resolution of Structured Names, Attribute-based Naming Introduction to Synchronization and Clock Synchronization In the next three lectures, we will cover: Synchronization Announcement: Project 1 due on Oct 3rd 2 Recap: Three Classes of Naming Flat naming Structured naming Attribute-based naming 3 Recap: Three Classes of Naming Flat naming Structured naming Attribute-based naming 4 Recap: Name Spaces in Structured Naming Structured names are organized into name spaces Data stored in n1 n0 home n2: “elke” n3: “max” n4: “steen” n1 elke n2 max n3 keys n5 “/keys” steen n4 Leaf node twmrc mbox Directory node Name Spaces may be distributed across multiple computers (e.g., NFS) 5 Recap: Distributed Name Spaces In large Distributed Systems, it is essential to distribute name spaces over multiple name servers Distribute nodes of the naming graph Distribute name space management Distribute name resolution mechanisms 6 Recap: Layers in Distributed Name Spaces Distributed Name Spaces can be divided into three layers Global Layer Administrational Layer Managerial Layer • Consists of high-level directory nodes • Directory nodes are jointly managed by different administrations • Contains mid-level directory nodes • Directory nodes grouped together in such a way that each group is managed by an administration • Contains low-level directory nodes within a single administration • The main issue is to efficiently map directory nodes to local name servers 7 Distributed Name Resolution Distributed Name Resolution is responsible for mapping names to addresses in a system where: Name servers are distributed among participating nodes Each name server has a local name resolver We will study two distributed name resolution algorithms: 1. Iterative Name Resolution 2. Recursive Name Resolution 8 1. Iterative Name Resolution In iterative name resolution, a client iteratively calls various name servers to resolve a name An example: <a,b,c> = structured name in a sequence #<a> = address of node with name “a” Resolving the name “ftp.cs.vu.nl” 9 Iterative Name Resolution Algorithm 1. Client hands over the complete name to root name server 2. Root name server resolves the name as far as it can, and returns the result to the client • The root name server returns the address of the next-level name server (say, NLNS) if address is not completely resolved 3. Client passes the unresolved part of the name to the NLNS 4. NLNS resolves the name as far as it can, and returns the result to the client (and probably its next-level name server) 5. The process continues till the full name is resolved 10 2. Recursive Name Resolution In recursive name resolution, a client calls the root name server to resolve a name The name server may recursively call other name servers for name resolution An example: <a,b,c> = structured name in a sequence #<a> = address of node with name “a” Resolving the name “ftp.cs.vu.nl” 11 Recursive Name Resolution (cont’d) Approach The client provides the name to the root name server If the root name server is not able to resolve the complete name, it passes the unresolved part of the name to the next associated name server The process continues till the name is fully resolved The root name server returns the result to the client Drawback: Recursive name resolution incurs large overhead at name servers (especially, at the high-level name servers) 12 Classes of Naming Flat naming Structured naming Attribute-based naming 13 Attribute-based Naming In many cases, it is convenient to look up entities by means of their attributes Similar to traditional directory services (e.g., yellow pages) e.g., Search an organization for users in a department, Search for printers in a network Attribute-based naming supports looking up for entities by means of their attributes Entities are described using a set of (attribute, value) pairs Name resolution happens through attributes Users search for attributes, and a list of entities that match the attributes are returned 14 Directory Service Directory Services are systems that support naming and name resolution for attribute-based names Many organizations use directory services to locate users, and resources such as files and printers in a network Entity representation in a directory service: Each entity is described using an entry An entry is a set of(attribute, value) pairs All entries are stored in a database called directory Directory service enables searching for entities by specifying attributes The user specifies a query by describing a set of attributes The directory service returns the entities that match the query 15 Directory Service (cont’d) Challenge in Implementing Directory Services: The lookup operations on directory services are extremely expensive They require to match the requested attribute values against the actual attribute values; this needs inspecting all the entities Solution: Implement the basic directory service as a database Organize the database similar to traditional structured naming system for fast look up We will study a well-known directory service Light-weight Directory Access Protocol (LDAP) 16 Light-weight Directory Access Protocol (LDAP) LDAP Directory Service consists of a number of records called “directory entries” Each directory entry is made of (attribute, value) pair LDAP Standard specifies five attributes for each record Directory Information Base (DIB) is a collection of all directory entries Each record in a DIB is unique Each record is represented by a unique name e.g., /C=NL/O=Vrije Universiteit/OU=Comp. Sc. 17 Directory Information Tree in LDAP All the records in the DIB can be organized into a hierarchical tree called Directory Information Tree (DIT) LDAP provides advanced search mechanisms based on attributes by traversing the DIT Example syntax for searching all Main servers in Vrije Universiteit: search("&(C = NL) (O = Vrije Universiteit) (OU = *) (CN = Main server)") 18 Naming in Distributed Systems – Summary Naming and name resolutions enable accessing entities in a Distributed System Three types of naming Flat naming e.g., Home-based approaches, Distributed Hash Table Structured naming Organizes names into name spaces Name spaces can be distributed across multiple computers Attribute-based naming Entities are looked up using their attributes 19 Reference http://en.wikipedia.org/wiki/Directory_service 20