Docstoc

Naming

Document Sample
Naming Powered By Docstoc
					                Name Service (DNS)

       Outline
              Terminology
              Domain Naming System




Spring 2006                   CS 332   1
              Why A Name Service?
• Fundamental property of name: identify object
• Fundamental property of an address: locate object
• Using name service allows us to decouple these two
  different functions (though often times naming
  conventions can help with location, and vice versa)
     – Name can help locate objects, define membership in a group,
       specify a role, etc.
• Differences (related to Internet):
     – Names more user friendly than IP addresses
     – Names can have variable length

Spring 2006                      CS 332                              2
                Name Properties

•   Location transparent or location-dependent
•   Flat or hierarchical
•   Global versus local
•   Absolute versus relative




Spring 2006              CS 332                  3
                     Terminology
• Name space: defines set of possible names
     – Flat: names not divisible into components
     – Hierarchical (e.g. Unix file names, Internet domain names)
• Naming system maintains a collection of bindings of
  names to values
     – Value can be anything we want naming system to return
       when presented with a name
• Resolution mechanism: a procedure that, when
  invoked with a name, returns the corresponding value
• Name server: specific implementation of a resolution
  mechanism that can be queried via a network

Spring 2006                  CS 332                          4
              In The Beginning…
• Network Information Center (NIC) maintained a
  flat table of name-to-address bindings (called
  hosts.txt)
• To add host to Internet, email NIC with new
  name/address pair, which NIC manually added to
  table
• Modified table was mailed to every site every few
  days; sysadmins installed hosts.txt on every
  host
Spring 2006             CS 332                        5
         Domain Name System (DNS)
• Went online in mid 1980s
• Hierarchical name space
     – Names processed from right to left (though humans read
       them from left to right) with periods as field separators
     – Ex. cleopatra.richmond.edu




Spring 2006                   CS 332                          6
         Domain Name System (DNS)
• Distributed database of domain name bindings
     – Each site (university department, campus, company, etc.)
       maintains its own part of database, along with a server
     – Mapping is not necessarily host name to address
• Apps presented with host names query DNS to find
  address
     – Accessed through a resolver, which in Unix is primarily
       reached via gethostbyname() and gethostbyaddress()
     – resolver opens UDP connection to pass name service
       packets (IP address of server(s) in /etc/resolve.conf)
     – resolver is not part of TCP implementation (or kernel)
Spring 2006                  CS 332                          7
                                Example
                                           User                 1
                       2
                       cs.princeton.edu       user @ cs.princeton.edu

              Name                      Mail
              server                  program

                       192.12.69.5               192.12.69.5    4
                       3
                                           TCP

                                                 192.12.69.5    5

                                            IP




Spring 2006                               CS 332                        8
                        DNS Implementation
• Partition hierarchy into zones
                             edu           com           gov           mil          org       net   uk   fr


                      princeton … mit   cisco … yahoo nasa … nsf   arpa … navy   acm … ieee


               cs      ee   physics


          ux01 ux04


• Zones correspond to administrative authority (NIC
  gets top)
    – Each zone implemented by two or more name servers
          • Primary: get its info from disk files
          • Secondary: get their info from the primary (called a zone-transfer)
 Spring 2006                                       CS 332                                                     9
              DNS Implementation (cont.)
• DNS is really a hierarchy of name servers, rather
  than hierarchy of domains
• Servers respond either with info
  requested or with IP address of                    Root
                                                  name server

  another name server
• All primary servers must             Princeton
                                      name server
                                                     …          Cisco
                                                              name server

  know IP addresses of
                               CS         …        EE
  all root servers         name server         name server


Spring 2006                       CS 332                                    10
                     Resource Records
• Each name server maintains a collection of resource records
              (Name, Value, Type, Class, TTL)
• Name/Value: not necessarily host names to IP addresses
• Type: tells how value should be interpreted
     – A: Value is an IP address (gives the name-to-address mapping)
     – NS: Value gives domain name for host running name server that knows
       how to resolve names within specified domain.
     – CNAME: Value gives canonical name for a particular host; used to
       define aliases (e.g. indirection for web server).
     – MX: Value gives domain name for host running mail server that accepts
       messages for specified domain.
• Class: allow other entities to define types (Internet class is IN)
• TTL: how long the resource record is valid (when TTL expires,
  this record must be removed from cache)
Spring 2006                      CS 332                              11
                Root Server
 (princeton.edu, cit.princeton.edu, NS, IN)
 (cit.princeton.edu, 128.196.128.233, A, IN)

 (cisco.com, thumper.cisco.com, NS, IN)
 (thumper.ciscoe.com, 128.96.32.20, A, IN)

 …




Spring 2006            CS 332                  12
              Princeton Server
(cs.princeton.edu, optima.cs.princeton.edu, NS, IN)
(optima.cs.princeton.edu, 192.12.69.5, A, IN)
(ee.princeton.edu, helios.ee.princeton.edu, NS, IN)
(helios.ee.princeton.edu, 128.196.28.166, A, IN)
(jupiter.physics.princeton.edu, 128.196.4.1, A, IN)
(saturn.physics.princeton.edu, 128.196.4.2, A, IN)
(mars.physics.princeton.edu, 128.196.4.3, A, IN)
(venus.physics.princeton.edu, 128.196.4.4, A, IN)




Spring 2006             CS 332                   13
                    CS Server
(cs.princeton.edu, optima.cs.princeton.edu, MX, IN)
(cheltenham.cs.princeton.edu, 192.12.69.60, A, IN)
(che.cs.princeton.edu, cheltenham.cs.princeton.edu,
  CNAME, IN)
(optima.cs.princeton.edu, 192.12.69.5, A, IN)
(www.cs.princeton.edu, optima.cs.princeton.edu,
  CNAME, IN)
(baskerville.cs.princeton.edu, 192.12.69.35, A, IN)
(bas.cs.princeton.edu, baskerville.cs.princeton.edu,
  CNAME, IN)



  Spring 2006            CS 332                    14
              Name Resolution
• Client sends request to a root server for
  cleopatra.mathcs.richmond.edu
• Root server returns the best info it has, which
  includes all information relating to richmond.edu
  (which should contain the name and address of a
  richmond.edu name server)
• Client queries richmond.edu name server, which
  returns name and address of
  mathcs.richmond.edu name server
• Client queries mathcs.richmond.edu name
  server and gets IP address of
  cleopatra.mathcs.richmond.edu
Spring 2006           CS 332                   15
              How It Really Works
• Client queries local name server, and name server
  goes through resolution process on client’s behalf
     – Hosts must be configured with address of local name
       server
     – Only local name server needs to know addresses of root
       server(s)
     – Local server sees all DNS responses, and can thus
       cache these (removing record when TTL expires)
• Partial names (e.g. cleopatra): client program
  is configured with local domain and appends this
  to incomplete names before query
Spring 2006                  CS 332                        16
                                        Example
                                                                                            Root
                                                                                2
                                                                                            name
                                                                                            server

                                                                                        3



                                                                                4
                       1
                       cicada.cs.princeton.edu   Local       cicada.cs.princeton.edu Princeton
              Client                             name                                   name
                           192.12.69.60          server   cs.princeton.edu, 192.12.69.5 server
                           8                                                        5




                                                                                    6

                                                                                             CS
                                                                                            name
                                                                            7               server




Spring 2006                                      CS 332                                              17

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:1
posted:1/9/2012
language:
pages:17
jianghongl jianghongl http://
About