Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science...

32
Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002

Transcript of Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science...

Page 1: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

Lecturer 8:

Name Services

Haibin Zhu, PhD.

Assistant Professor

Department of Computer Science

Nipissing University

© 2002

Page 2: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

2

Contents

9.1 Introduction 9.2 Name services and the DNS 9.3 Directory and Discovery services 9.4 CASE study: Global Name Service 9.5 Case Study: Directory service 9.6 Summary

Page 3: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

3

Learning objectives

To understand the need for naming systems in distributed systems

To be familiar with the design requirements for

distributed name services

To understand the operation of the Internet naming

service - DNS

To be familiar with the role of discovery services in mobile and ubiquitous computer systems

*

Page 4: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

4

Names and Addresses

Pure names are simply uninterpreted bit patterns.

Non-pure names contains information about the object that they name.

An object’s address is a value that identifies the location of the object rather than the object itself.

An attribute is a value of a property associated with an object.

A name is resolved when it is translated into data about the named resource or object.

The association between a name and an object is called a binding.

Page 5: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

5

The role of names and name services

Resources are accessed using identifier or reference– An identifier can be stored in variables and retrieved from tables quickly

– Identifier includes or can be transformed to an address for an object E.g. NFS file handle, Corba remote object reference

– A name is human-readable value (usually a string) that can be resolved to an identifier or address Internet domain name, file pathname, process number E.g ./etc/passwd, http://www.cdk3.net/

For many purposes, names are preferable to identifiers – because the binding of the named resource to a physical location is deferred

and can be changed

– because they are more meaningful to users

Resource names are resolved by name services– to give identifiers and other useful attributes

*

Page 6: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

6

Name service

Name service stores a collection of one or more naming contexts – sets of bindings between textual names and attributes for objects such as users.

Basic requirements of GNS– An essentially arbitrary number of names– A long lifetime– High availability– Fault isolation– Tolerance of mistrust

Page 7: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

7

Name Space

The collection of all valid names recognized by a particular services.

A naming domain is a name space for which there exists a single overall administrative authority for assigning names within it.

Page 8: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

8

Requirements for name spaces

Allow simple but meaningful names to be used

Potentially infinite number of names

Structured – to allow similar subnames without clashes– to group related names

Allow re-structuring of name trees– for some types of change, old programs should continue to work

Management of trust

*

Page 9: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

9

file

Web serverSocket

Composed naming domains used to access a resource from a URL

http://www.cdk3.net:8888/WebExamples/earth.html

URL

Resource ID (IP number, port number, pathname)

138.37.88.61 WebExamples/earth.html8888

DNS lookup

Figure 9.1

(Ethernet) Network address

2:60:8c:2:b0:5a

ARP lookup

*

Page 10: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

10

Names and resources

Currently, different name systems are used for each type of resource:resource name identifiesfile pathname file within a given file systemprocess process id process on a given computerport port number IP port on a given computer

Uniform Resource Identifiers (URI) offer a general solution for any type of resource. There are two main classes:

URL Uniform Resource Locator• typed by the protocol field (http, ftp, nfs, etc.)• part of the name is service-specific• resources cannot be moved between domains

URN Uniform Resource Name• requires a universal resource name lookup service - a DNS-like system

for all resources

*

Page 11: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

11

More on URNsformat: urn:<nameSpace>:<name-within-namespace>examples:a) urn:ISBN:021-61918-0b) urn:dcs.qmul.ac.uk:TR2000-56resolution:a) send a request to nearest ISBN-lookup service - it would return

whatever attributes of a book are required by the requesterb) send a request to the urn lookup service at dcs.qmul.ac.uk

- it would return a url for the relevant document

Page 12: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

12

Name Resolution

Name Resolution– An iterative process whereby a name is repeatedly presented to

naming contexts.

Navigation– A process of locating naming data from among more than one name

server in order to resolve a name.

Page 13: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

13

Iterative navigation

Client 12

3

A client iteratively contacts name servers NS1–NS3 in order to resolve a name

NS2

NS1

NS3

Nameservers

Figure 9.2

Used in:

DNS: Client presents entire name to servers, starting at a local server, NS1. If NS1 has the requested name, it is resolved, else NS1 suggests contacting NS2 (a server for a domain that includes the requested name).

NFS: Client segments pathnames (into 'simple names') and presents them one at a time to a server together with the filehandle of the directory that contains the simple name.

*

Reason for NFS iterative name resolutionThis is because the file service may encounter a symbolic link (i.e. an alias) when resolving a name. A symbolic link must be interpreted in the client’s file system name space because it may point to a file in a directory stored at another server. The client computer must determine which server this is, because only the client knows its mount points. (p.377.)

Page 14: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

14

Non-recursive and recursive server-controlled navigation

A name server NS1 communicates with other name servers on behalf of a client

Recursiveserver-controlled

1

23

5

4

client

NS2

NS1

NS3

12

34client

NS2

NS1

NS3

Non-recursiveserver-controlled

Figure 9.3

DNS offers recursive navigation as an option, but iterative is the standard technique. Recursive navigation must be used in domains that limit client access to their DNS information for security reasons.

*

Page 15: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

15

DNS - The Internet Domain Name System

A distributed naming database

Name structure reflects administrative structure of the Internet

Rapidly resolves domain names to IP addresses– exploits caching heavily

– typical query time ~100 milliseconds

Scales to millions of computers– partitioned database

– caching

Resilient to failure of a server– replication

*

Basic DNS algorithm for name resolution (domain name -> IP number)• Look for the name in the local cache• Try a superior DNS server, which responds with:

– another recommended DNS server

– the IP address (which may not be entirely up to date)

Page 16: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

16

DNS Data

DNS naming data are divided into zones.

A zone contains:– Attribute data for names in a domain– The names and addresses– The names of name servers– Zone management parameters

http://hotwired.lycos.com/webmonkey/geektalk/97/03/index4a.html?tw=backend

Page 17: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

17

DNS name servers

Note: Name server names are in italics, and the corresponding domains are in parentheses.Arrows denote name server entries

a.root-servers.net(root)

ns0.ja.net(ac.uk)

dns0.dcs.qmw.ac.uk(dcs.qmw.ac.uk)

alpha.qmw.ac.uk(qmw.ac.uk)

dns0-doc.ic.ac.uk(ic.ac.uk)

ns.purdue.edu(purdue.edu)

ukpurdue.edu

ic.ac.uk

qmw.ac.uk...

dcs.qmw.ac.uk*.qmw.ac.uk

*.ic.ac.uk*.dcs.qmw.ac.uk

* .purdue.edu

ns1.nic.uk(uk)

ac.uk...

co.uk

yahoo.com ....

Figure 9.4

authoritative path to lookup:

jeans-pc.dcs.qmw.ac.uk

*

Page 18: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

18

DNS in typical operation

a.root-servers.net(root)

ns0.ja.net(ac.uk)

dns0.dcs.qmw.ac.uk(dcs.qmw.ac.uk)

alpha.qmw.ac.uk(qmw.ac.uk)

dns0-doc.ic.ac.uk(ic.ac.uk)

ns.purdue.edu(purdue.edu)

ukpurdue.edu

ic.ac.uk

qmw.ac.uk...

dcs.qmw.ac.uk*.qmw.ac.uk

*.ic.ac.uk*.dcs.qmw.ac.uk

* .purdue.edu

ns1.nic.uk(uk)

ac.uk...

co.uk

yahoo.com ....

client.ic.ac.uk

IP: alpha.qmw.ac.uk

2

3IP:dns0.dcs.qmw.ac.uk

jeans-pc.dcs.qmw.ac.uk ?

IP:ns0.ja.net

1

IP:jeans-pc.dcs.qmw.ac.uk

4

Without caching

*

Page 19: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

19

DNS server functions and configuration

Main function is to resolve domain names for computers, i.e. to get their IP addresses– caches the results of previous searches until they pass their 'time to live'

Other functions:– get mail host for a domain – reverse resolution - get domain name from IP address– Host information - type of hardware and OS– Well-known services - a list of well-known services offered by a host– Other attributes can be included (optional)

*

Page 20: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

20

DNS resource records

Record type Meaning Main contentsA A computer address IP numberNS An authoritative name server Domain name for serverCNAME The canonical name for an alias Domain name for aliasSOA Marks the start of data for a zone Parameters governing the zoneWKS A well-known service description List of service names and protocolsPTR Domain name pointer (reverse

lookups)Domain name

HINFO Host information Machine architecture and operatingsystem

MX Mail exchange List of <preference, host> pairsTXT Text string Arbitrary text

Figure 9.5

*

Page 21: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

21

DNS issues

Name tables change infrequently, but when they do, caching can result in the delivery of stale data.– Clients are responsible for detecting this and recovering

Its design makes changes to the structure of the name space difficult. For example:– merging previously separate domain trees under a new root

– moving subtrees to a different part of the structure (e.g. if Scotland became a separate country, its domains should all be moved to a new country-level domain.

See Section 9.4 on GNS, a research system that solves the above issues.

*

Page 22: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

22

Directory and discovery services

Directory service:- 'yellow pages' for the resources in a network

– Retrieves the set of names that satisfy a given description – e.g. X.500, LDAP, MS Active Directory Services

(DNS holds some descriptive data, but:

• the data is very incomplete

• DNS isn't organised to search it)

Discovery service:- a directory service that also:– is automatically updated as the network configuration changes– meets the needs of clients in spontaneous networks (Section 2.2.3)– discovers services required by a client (who may be mobile) within the current scope, for

example, to find the most suitable printing service for image files after arriving at a hotel.– Examples of discovery services: Jini discovery service, the 'service location protocol',

the 'simple service discovery protocol' (part of UPnP), the 'secure discovery service'.

*

Page 23: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

24

Printing service

serviceLookup

serviceLookup

Printing service

admin

admin

admin, finance

finance

Client

Mobile client

Corporate infoservice

Network

Service discovery in Jini

2. Here I am: .....4. Use printing

service

1. ‘finance’ lookup service?

Figure 9.6

Jini services register their interfaces and descriptions with the Jini lookup services in their scope

Clients find the Jini lookup services in their scope by IP multicast

Jini lookup service searches by attribute or by interface type– The designers of Jini argue convincingly that this the only reliable way to do discovery

*

3. Requestprinting &receive proxy

Page 24: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

25

GNS (Global Name Service) case study

An early research project (1985) that developed solutions for the problems of:– large name spaces – restructuring the name space

<directory name, value name>

Page 25: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

26

Figure 9.7GNS directory tree and value tree for user Peter.Smith

UK FR

AC

QMWDI: 322

Peter.Smith

passwordmailboxes

DI: 599 (EC)

DI: 574DI: 543

DI: 437

Alpha GammaBeta

Page 26: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

27

Figure 9.8Merging trees under a new root

EC

UK FR

DI: 599

DI: 574DI: 543

NORTH AMERICA

US

DI: 642

DI: 457DI: 732

#599 = #633/EC#642 = #633/NORTH AMERICA

Well-known directories:

CANADA

DI: 633 (WORLD)

Page 27: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

28

Figure 9.9Restructuring the directory

EC

UK FR

DI: 599

DI: 574DI: 543

NORTH AMERICA

US

DI: 642

DI: 457DI: 732

#599 = #633/EC#642 = #633/NORTH AMERICA

Well-known directories:

CANADA

DI: 633 (WORLD)

#633/EC/US

US

Page 28: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

29

X.500 and LDAP

A hierarchically-structured standard directory service designed for world-wide use

Accommodates resource descriptions in a standard form and their retrieval for any resource (online or offline)

Never fully deployed, but the standard forms the basis for LDAP, the Lightweight Directory Access Protocol, which is widely used

DIT(Directory Information Tree) and DIB (Directory Information Base)

Page 29: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

30

Figure 9.10X.500 service architecture

DSA

DSA

DSA

DSA

DSADSADUA

DUA

DUA

Directory User Agent Directory Service Agent

Page 30: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

31

Figure 9.11Part of the X.500 Directory Information Tree

... France (country) Great Britain (country) Greece (country)...

BT Plc (organization) University of Gormenghast (organization)... ...

Department of Computer Science (organizationalUnit)

Computing Service (organizationalUnit)

Engineering Department (organizationalUnit)

...

...

X.500 Service (root)

Departmental Staff (organizationalUnit)

Research Students (organizationalUnit)

ely (applicationProcess)...

...

Alice Flintstone (person) Pat King (person) James Healey (person) ...... Janet Papworth (person)...

Page 31: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

32

Figure 9.12An X.500 DIB (Directory Information Base) Entry

infoAlice Flintstone, Departmental Staff, Department of Computer Science,

University of Gormenghast, GB

commonName Alice.L.Flintstone Alice.Flintstone Alice Flintstone A. Flintstone

surname

Flintstone

telephoneNumber +44 986 33 4604

uid

alf

mail

[email protected]

[email protected]

roomNumber

Z42

userClass

Research Fellow

Page 32: Lecturer 8: Name Services Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.

33

Summary

Name services:– defer the binding of resource names to addresses (and other attributes)

– Names are resolved to give addresses and other attributes

– Goals : Scalability (size of database, access traffic (hits/second), update traffic) Reliability Trust management (authority of servers)

– Issues exploitation of replication and caching to achieve scalability without compromising the

distribution of updates navigation methods

Directory and discovery services:– 'yellow pages' retrieval by attributes

– dynamic resource registration and discovery

*