NAME SERVICES ARCHANA ANNAMANENI Name Service The name service is used by client processes to obtain attributes such as the addresses of resources or objects when given their names Name services are often used to hold the addresses and other details of users, computers, network domains, services and remote objects Name services like Directory service, Discovery service, look up services when given some of their attributes Need For Names Names facilitate communication and resource sharing. Name is needed to request a computer system to act upon a specific resource chosen out of many. Processes cannot share particular resources managed by a computer system unless they can name them consistently Descriptive attributes are also another means of identification Names, addresses and other attributes A name is said to be resolved when it is translated into data about the named resource or object, in order to invoke an action upon it. The association between a name and an object is called a binding Names are bound to attributes of the named objects, rather than the implementation of the objects themselves An attribute is the value of a property associated with an object. General Name Service Requirements Name services were originally quite simple. But the interconnection of networks and the increased scale of distributed systems have produced a much larger name-mapping problem. Examples: Grapevine was one of the earliest extensible, multi domain name services. Global Name Service is a descendent of Grapevine with more goals To handle an essentially arbitrary number of names and to serve an arbitrary number of administrative organizations. A long lifetime High Availability Fault isolation Tolerance of mistrust DNS: Heavily relies upon replication and caching of naming data. Domain Name System (DNS) The DNS is a name service design whose principal naming database is used across the Internet (DNS is a Distributed Database). The mechanism of DNS is it maps between high-level machine names and IP addresses. DNS defines: A hierarchical namespace for hosts and IP addresses A host table implemented as a distributed database A “resolver” –library routines query this database Improved routing for email A mechanism for finding services on a network A protocol for exchanging naming information Name Space Name space is the collection of all valid names recognized by a particular service. Flat Namespace: Each name is consisted of a sequence of characters without any further structure Advantage: Names are convenient and short Disadvantage: Cannot generalize to large set of machines for both technical and administrative reasons Hierarchical Namespace The most important advantage is each part of a name is resolved relative to a separate context. So the same name may be used with different meanings in different contexts Hierarchic name spaces are potentially infinite. So they enable a system to grow indefinitely Different contexts can be managed by different people DNS name space has a hierarchic structure. Domain Names A domain name consists of a sequence of sub names separated by a delimiter character, the period. The DNS calls each section label. For example the domain name csc.villanova.edu Contains three labels: csc, villanova, and edu Any suffix of a label in a domain name is also called a domain. Here csc.villanova.edu (the domain name for computer science department at villanova) is lowest level domain The second level domain name is villanova.edu (the domain for Villanova university) Top-level domain is edu (the domain for educational institutions) Domain names are written with the local label first and the top domain last. DNS names are not case sensitive. The Internet DNS name space is partitioned, organizationally and according to geography The top-level organizational domains in use today across the Internet are com - Commercial organizations edu – Universities and other educational institutions gov – US governmental agencies mil - US military organizations net – Major network support centers org - Organizations not mentioned above int - International organizations Every country has its own domains us – United States uk –United kingdom fr – France The DNS name space is a tree of “domains”. Each domain represents a distinct chunk of the namespace and is loosely managed by a single administrative entity. The root of the tree is called “.” or dot, and beneath it are the top level domains DNS servers do not recognize relative names: all names are referred to the global root. In practical implementations, client software keeps a list of domain names that are appended automatically to any single-component name before resolution. For example the name webmail, presented in the domain villanova.edu, probably refers to webmail.villanova.edu Client software will append the default domain villanova.edu and attempts to resolve the name. If this fails then further default domain names may be appended Finally the (absolute) name webmail.villanova.edu is presented to the root for resolution Names with more than one component are normally presented to DNS as absolute names. Aliases One domain name is defined to stand for another. Provides transparency Generally used to specify the names of machines that run a web server or an FTP server e.g. www.dcs.qmw.ac.uk is an alias for copper.dcs.qmw.ac.uk Advantage is if the web server is moved to another computer, all that need to be done is to update the alias in the DNS database Name resolution Resolution is an iterative process where a name is repeatedly presented to naming contexts. Name servers and navigation The process of locating naming data from among more than one name server in order to resolve a name is called navigation The client name resolution software carries out navigation on behalf of the client. It communicates with name servers as necessary to resolve a name. The software is provided as library code and linked into clients, e.g BIND implementation for DNS Another alternative, used with X500, is to provide name resolution in a separate process that is shared by all of the client processes on that computer. Types of navigation Iterative navigation DNS supports the iterative navigation model. Here to resolve a name, a client presents the name to the local name server, which attempts to resolve it. If the local name server has the name, it returns the result immediately. If it does not, it will suggest another server that will be able to help. Resolution proceeds at the new server, with further navigation as necessary until the name is located or is discovered to be unbound. Multicast navigation: Client multicasts the name to be resolved, to the group of name servers. Only the server that holds the named attribute responds to the request Non-recursive and recursive server-controlled navigation Under non-recursive server controlled navigation, the client may choose any name server. This server communicates by multicast or iteratively with its peers, as though it were a client. Under recursive server-controlled navigation, the client contacts a single server. If this server does not know the name, the server contacts its peer , which in turn attempts to resolve it. This procedure continues recursively until the name is resolved. Caching Client name resolution software and servers maintain a cache of the results of previous name resolutions When a client requests a name lookup, the name resolution software consults its cache. If it holds a recent result from a previous lookup for the name, it returns it to the client; otherwise it sets about finding it from a server. That server, in turn, may return data cached from other servers. Advantages Caching is a key to a name service’s performance and assists in maintaining the availability of both the name service and other services despite name server crashes. It enhances the response times by saving communication with name servers Caching can be used to eliminate high-level name servers- the root server Caching is successful because naming data are changed relatively rarely. DNS queries Host name resolution: Applications use the DNS to resolve host names into IP addresses. Mail host location: Electronic mail software uses the DNS to resolve domain names into the IP addresses of mail hosts –computers that will accept mail for those domains. Reverse resolution: A domain name is returned, given an IP address. Host information: DNS stores the machine architecture type and operating system against the domain names of hosts. Well-known services: A list of the services run by a computer (telnet, FTP) and the protocol used to obtain them can be returned. The DNS DATABASE The DNS database is distributed across a logical network of servers. Each server holds part of the naming database –primarily data for the local domain. Most queries concern computers in the local domain and are satisfied by servers within that domain. Each server records the domain names and addresses of other name servers, so that queries pertaining to objects outside the domain can be satisfied A server may hold authoritative data for zero or more zones. System administrators enter the data for a zone into a master file Two types of servers are considered to provide authoritative data for the zone. A primary or master server reads zone data directly from a local master file. Secondary servers download zone data from a primary server. These servers communicate periodically with the primary server to check whether their stored version matches with the primary server. The frequency of the secondary’s check is set by administrator, as a zone parameter, and its value is typically once or twice a day. The above figure shows the arrangement of some of the DNS database. A domain’s DNS database is a set of text files maintained by the system administration on the domain’s master name server. These text files are often called zone files. Zone files contain “resource records” (RR) Resource records Each zone of the DNS hierarchy has a set of resource records associated with it. The basic format of a resource record is [name] [ttl] [class] type data The name field identifies the entity (usually a host or domain) that the record describes The ttl (time to live) field specifies the length of time in seconds that the data item can be cached and still be considered valid The class specifies the network type. The default value for the class is IN. Resource records are divided into four groups: Zone records – identify domains and their name servers Basic records – map names to addresses and route mail Security records – add authentication and signature to zone files Optional records – provide extra information about hosts or domains The content of the data field depend on the record type. The data for a zone starts with a SOA-type record. It contains the zone parameters that specify, for example the version number and how often secondary servers should refresh their copies. Each zone has exactly one SOA record. The zone continues until another SOA is encountered. SOA type records are followed by records of type NS specifying the name servers for the domain and a list of records of type MX giving preferences and domain names of mail hosts. A (address) records provide the mapping from hostnames to IP addresses. An example for SOA record cs.colorado.edu IN SOA ns.colorado.edu admin.cs.colorado.edu( 1999121501 ;serial 21600 ;Refresh 6hours 1800 ;Retry 30 minutes 1209600 ;Expire, 2weeks 432000 ) ;Minimum, 5days An example for NS record The format is Zone [ttl] IN NS hostname cs.colorado.edu IN NS ns.cs.colorado.edu cs.colorado.edu IN NS anchor.cs.colorado.edu cs.colorado.edu IN NS ns.cs.utah.edu A record (address record) The format is hostname [ttl] IN A ipaddr anchor IN A 128.138.243.100 The BIND software BIND, the Berkeley Internet Name Domain system, is an open source software package from ISC that implements the DNS protocol and provides name service on UNIX systems(now on Windows NT) The BIND system has three components: A daemon called named that answers queries Library routines that resolve host queries by contacting the servers of the DNS distributed database Command-line interfaces to DNS: nslookup, dig, and host named: the BIND name server In DNS parlance, a daemon like named (or the machine on which it runs) is called a “name server”, and the client code that contacts it is called a “resolver”. named answers queries about hostnames and IP addresses. If named doesn’t know the answer to a query, it asks other servers and caches their responses. DIRECTORY AND DISCOVERY SERVICES A service that stores collection of bindings between names and attributes and that looks up entries that match attribute-based specifications is called a directory service. Examples Microsoft’s Active Directory Services, X.500 and LDAP Directory services are sometimes called yellow pages services and also called as attribute-based name services Example: For example, a user might ask ‘which computers in this building are Macintoshes running the Mac 8.6 OS?’ ‘Where can I print a high-resolution color image?’ Discovery services A discovery service is a directory service that registers the services provided in a spontaneous networking environment In spontaneous networks, devices are liable to connect without warning and without administrative preparation. The requirement is for the set of clients and services to change dynamically but to be integrated without user intervention. To meet these needs, a discovery service provides an interface for automatically registering and de-registering services, as well as an interface for clients to look up the services that they require from those that are currently available. Recent developments in discovery services include the Jini discovery service Jini Jini is a system that is designed to be used for spontaneous networking. It is entirely java-based – it assumes that JVMs run in all of the computers, allowing them to communicate with one another by means of RMI and to download code as necessary. Jini provides facilities for service discovery, for transactions, for shared data spaces called JavaSpace The lookup service allows Jini services to register the services they offer, and Jini clients to request services that match their requirements. A Jini service, such as printing service, may be registered with one or more lookup services. A Jini service provides, and the lookup services store, an object that provides the service, as well as the attributes of the service. Jini clients query lookup services to find Jini services that match their requirements; if a match is found, they download an object that provides the service from the lookup service. The matching of service offers to clients’ requests can be based on attributes or on Java typing, for example allowing a client to request a color printer for which it has the corresponding Java interface. Bootstrapping Entities that wish to start participating in a distributed a system of JiniTM technology-enabled services and/or devices, known as a djinn, must first obtain references to one or more Jini lookup services. The protocols that govern the acquisition of these references are known as the discovery protocols. Once these references have been obtained, a number of steps must be taken for entities to start communicating usefully with services in a djinn; these steps are described by the join protocol. The Discovery Protocols There are three closely related discovery protocols: one is used to discover one or more lookup services on a local area network (LAN), another is used to announce the presence of a lookup service on a local network, and the last is used to establish communications with a specific lookup service over a wide-area network (WAN). Protocol Roles The multicast discovery protocols work together over time. When an entity is initially started, it uses the multicast request protocol to actively seek out nearby lookup services. After a limited period of time performing active discovery in this way, it ceases using the multicast request protocol and switches over to listening for multicast lookup announcements via the multicast announcement protocol. Protocol Participants Several components take part in the multicast request protocol. Of these, two run on an entity that is performing multicast requests, and two run on the entity that listens for such requests and responds. On the requesting side live the following components: A multicast request client performs multicasts to discover nearby lookup services. A multicast response server listens for responses from those lookup services. These components are paired; they do not occur separately. Any number of pairs of such components may coexist in a single JVM at any given time. The lookup service houses the other two participants: A multicast request server listens for incoming multicast requests. A multicast response client responds to callers, passing each a proxy that allows it to communicate with its lookup service. Figure DJ.2.1: Multicast Request Protocol Participants Jini makes use of leases, when Jini services register with the lookup service they are provided with a lease that guarantees their registration entry for a limited period of time. If a service does not communicate with the lookup service to renew its lease before the lease has expired, then it is assumed to have failed, and the lookup service can delete the entry. An Example for Service discovery in Jini There may be several instances of the lookup service reachable by multicast communication from a given Jini client or service. Every such service instance is configured with one or more group names such as ‘admin’,’finance’ and ‘sales’ When clients and services request a lookup service, they may specify any groups that they are particularly interested in, and only lookup services bound to those same group names will respond. References: Distributed Systems Concepts and Design by Coulouris, Dollimore, and Kindberg UNIX System Administration Hand Book by Nemeth, Snyder, Seebass,and Hein http://www.sun.com/jini/specs/jini1.1html/discovery-spec.html#39235