39
Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Embed Size (px)

Citation preview

Page 1: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Nguyễn Bảo Toàn 00707189

Bùi Ngọc Sơn 00707179

Name service

Page 2: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

OutlineGeneral conceptsDomain Name System (DNS)

2

Page 3: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

IntroductionIn a distributed system names are used to refer to

a wide variety of resources such as computers, services, remote objects, and files as well as users.

Names facilitate communication and resource sharing.

Names are used for identification as well as for describing attributes.

For many purposes, names are preferable to identifiers because the binding of the named resource to a

physical location is deferred and can be changedbecause they are more meaningful to users

3

Page 4: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Names, Addresses and other attributesAny process that requires access to a specific

resource must possess a name or identifier for it. Ex: URL http:://www.cdk3.net/

The term identifier is sometimes used to refer to names that are interpreted only by programs (remote object reference and NFS file handles are examples)

Names can be pure or non-pure Pure name has to be looked up before it can be

used.A name is said to be resolved when it is

translated into data about the resource or object.

4

Page 5: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Names and BindingThe association between a name and an

object is called binding.Services are written to map between

names and the attributes of objects they refer to.

Example:Domain name Service (DNS) maps domain

names to the attributes of the host computer (IP)

CORBA Naming service maps the name of a remote object onto its remote object reference.

5

Page 6: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Composed naming domains used to access a resource from a URL

file

Web serverSocket

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

*6

Page 7: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Names and servicesMany of the names used in a DS are

specific to some particular service Client uses service name to perform an

operation upone a named object or resource.

Names are also needed to refer to entities in a distributed system that are beyond the scope of any single service.(e.g. users, computers and services)

All these names must be readable.

7

Page 8: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Uniform Resource IdentifierIt used to identify resources on the web

and other internet resources such as electronic mailbox.

URL: Uniform Resource LocatorThis term is reserve for identifiers that are

resource locators, including ‘http’ and ‘mailto’

URN: Uniform Resource NamesURNs are URIs that are used as pure

resource name rather than locator

8

Page 9: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Name Service and the DNSA name service stores a collection of one or

more naming contexts – sets of bindings between textual names and attributes for objects.

Provides a general naming scheme for entities (such as users and services) that are beyond the scope of a single service.

Major operation: resolve a name - to look up attributes from a given name

Other operations required: creating new binding, deleting bindings, listing bound names and adding and deleting contexts.

9

Page 10: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Why is name management separated from other services?1. Unification : it is convenient for resources

managed by different services to use the same naming scheme ( URI)

2. Integration : it is not possible to predict the scope of sharing DS. So, without a common name service, the administrative domain may use entirely different naming conventions.

10

Page 11: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

General Name Service Requirements

Handle arbitrary number of names and to serve arbitrary number of administrative organizations.

A long lifetime High availability Fault isolation Tolerance of mistrust

11

Page 12: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Name services: Design IssuesName spacesName ResolutionThe domain name system

12

Page 13: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Name SpacesA name space is a collection of all valid names

recognized by a particular serviceAllow simple but meaningful names to be usedPotentially infinite number of namesStructured

to allow similar subnames without clashesto group related names

Allow re-structuring of name treesfor some types of change, old programs should

continue to workManagement of trust

13

Page 14: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Hierarchic name spaceNames may have an internal structure that

represents their position in a hierarchic name space.

Hierarchic name space advantages:Each part of a name is resolved relative to a

separate context, and the same name may be used with different meaning in different contexts (directory). E.g. /etc/passwd and /oldetc/passwd have different meanings because the second part is resolved in different contexts.

it is potentially infiniteDifferent context can be managed by different

people.

14

Page 15: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Name Space

15

Page 16: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

AliasesAn alias allows a convenient name to be substituted

for a more complicated one.The DNS allows aliases in which one domain is

defined to stand for another.The reason for having aliases is to provide for

transparency.Aliases are generally used to specify the names of

machines that runs the web server or an FTP server.

Example:www.example.net might be an alias for

www.fred.example.net

16

Page 17: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Aliases (con.)Advantages:Client can refer to the web server by a

generic name that does not refer to a particular machine.

If the web server is moved to another computer, all that needs to be done is to update the alias in the DNS database.

17

Page 18: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Naming domainsA naming domain is a name space for

which there exist a single overall administrative authority for assigning names with it.

Domains in DNS are collections of domain names.

A domain’s name is the common suffix of the domain names within it. For example, net is a domain name that contains cdk4.net

18

Page 19: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Combining and customizing name spacesMerging

In which a part of one name space is conveniently embedded in another.Adding super rootEmbed the mounted file systems

Heterogeneity The DCE allows heterogeneous name spaces

to be embedded with it using junction.Customization

Users sometimes prefer to construct their name spaces independently rather than sharing a single name space

19

Page 20: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Name ResolutionResolution is an iterative process whereby a

name is repeatedly presented to the naming contexts.

The name is first presented to some initial naming context; resolution iterates as long as further context and derived names are output.

Example1: /etc/passwd in which ‘etc’ is presented to context / and ‘passwd’ is presented to context /etc.

Example 2: www.dcs.qmw.ac.uk in which the alias is resolved to another domain name such as copper.dcs.qmw.ac.uk which is further resolved to produce IP address.

20

Page 21: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Name Servers and Navigation

Any name service stores a very large database.

Data is partitioned into servers according to its domain.

Partitioning of the data implies that the local name server cannot answer all the enquiries without the help of other name servers.

Process of locating naming data from among more than one name server in order to resolve a name is called navigation. Ex: Iterative Navigation model(DNS)

21

Page 22: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Navigation typesIterative navigationMulticast navigationNon-recursive server-controlled navigationRecursive server-controlled navigation

22

Page 23: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Iterative navigation

23

Client1

2

3

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

NS2

NS1

NS3

Nameservers

Page 24: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Non-recursive and recursive server-controlled navigation

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.

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

*24

Page 25: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

CachingClient name resolution software and

servers maintain a cache of previous name resolutions.

How long a resolver caches a DNS response (i.e. how long a DNS response remains valid) is determined by a value called the time to live.

Server may use data from its own cache or other server cache it is authorized to access.

Caching is key to performance and fault tolerance.

25

Page 26: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

The Domain Name SystemA distributed naming database

Name structure reflects administrative structure of the Internet

Rapidly resolves domain names to IP addressesexploits caching heavilytypical query time ~100 milliseconds

Scales to millions of computerspartitioned databasecaching

Resilient to failure of a serverreplication

26

Page 27: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Parts of a domain nameUsually consists of two or more parts

(technically labels), separated by dots. .The rightmost label conveys the top-level

domain.Each label to the left specifies a

subdivision, or subdomain of the domain above it.

27

Page 28: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

DNS queriesHost name resolution

When a web browser is given a URL containing the domain name www.dcs.qmul.ac.uk , it makes a DNS enquiry and obtains the corresponding IP address.

Mail host locationElectronic mail software uses the DNS to resolve domain names into the IP address of mail hosts

Reverse resolution: return the domain name.Host information: return the machine type and

operating systemWell-known services : return the list of services run

by a computer.

28

Page 29: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

DNS name serversThe Domain Name System consists of a

hierarchical set of DNS serversEach server holds part of the naming databaseEach domain or sub-domain has one or more

authoritative DNS servers that publish information about that domain and the name servers of any domains "beneath" it

The hierarchy of authoritative DNS servers matches the hierarchy of domains.

At the top of the hierarchy stand the root name-servers: the servers to query when looking up (resolving) a top-level domain name

29

Page 30: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

ZonesThe DNS naming data are divided into zones.Each zone contains:

1. Attribute data for names in a domain, less any sub-domains administered by lower-level authorities.

2. The name and addresses of at least two name servers that provide authoritative data for the zone.

3. The names of name servers that hold authoritative data for delegated sub-domains

4. Zone management parameters ( governing the caching & replication of zone data.

30

Page 31: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

DNS servers and zonesA server may hold authoritative data for

zero or more zones.The DNS architecture specifies that each

zone must be replicated authoritatively in at least two servers. (why?)

31

Page 32: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Master filesSystem administrators enter the data for a zone

into a master file, which is the source of authoritative data for the zone.

There are two types of servers:1. Primary or master server which reads zone data

directly from a local master file.2. Secondary servers which download zone data from a

primary server and communicate periodically with the primary server to check whether their stored version matches that held by the primary server.

1. The primary sends the latest version if the secondary’s copy is out of date

2. The value of secondary’s check is one or two a day which is set by administrators as a zone parameters.

32

Page 33: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Basic DNS algorithm for name resolution

Look for the name in the local cacheTry a superior DNS server, which

responds with:another recommended DNS serverthe IP address (which may not be

entirely up to date)

33

Page 34: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

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

*34

Page 35: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

DNS in typical operationa.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

*35

Page 36: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Resource Records

36

Page 37: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000

Figure 9.6DNS zone data records

domain name time to live class type value

1D IN NS dns01D IN NS dns11D IN NS cancer.ucs.ed.ac.uk1D IN MX 1 mail1.qmul.ac.uk1D IN MX 2 mail2.qmul.ac.uk

domain name time to live class type value

www 1D IN CNAME apricot

apricot 1D IN A 138.37.88.248

dcs 1D IN NS dns0.dcsdns0.dcs 1D IN A 138.37.88.249dcs 1D IN NS dns1.dcs

dns1.dcs 1D IN A 138.37.94.248dcs 1D IN NS cancer.ucs.ed.ac.uk

Page 38: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

DNS issuesName tables change infrequently, but when they

do, caching can result in the delivery of stale data.Clients are responsible for detecting this and

recoveringIts design makes changes to the structure of the

name space difficult. For example:merging previously separate domain trees under a

new rootmoving 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.

38

Page 39: Nguyễn Bảo Toàn 00707189 Bùi Ngọc Sơn 00707179 Name service

ReferencesDistributed Systems: Concepts and DesignInternet sources

http://www.cdk3.netwiki

39